// ********** Скрипт по динамическому отображению  кнопок ************
if (document.images) 
{
	logoon = new Image;	logoon.src = "images/template/logo2.jpg";
	logooff = new Image;	logooff.src = "images/template/logo.jpg";
}
function active(imagesName) 
{
	if (document.images) 
	{
		var imagesOn = eval(imagesName + "on.src");
		document [imagesName].src = imagesOn; 
	}
}
function passive(imagesName) 
{
	if (document.images) 
	{
		var imagesOff = eval(imagesName + "off.src");
		document [imagesName].src = imagesOff; 
	}
}

/**
 * Tabs code.
 *
 * @param tabVarName: name of the form variable that holds the id of the selected tab.
 */
function selectTab(tabGroupId, tabGroupSize, selectedTabId, enabledStyle, disabledStyle, errorStyle, tabKeyName, tabKeyValue) {
	// first unselect all tab in the tag groups.
	for (i=0;i<tabGroupSize;i++) {
		element = document.getElementById("tabs" + tabGroupId + "head" + i);
		if (element.classNameErrorStdLayout) {
			element.className = errorStyle;
			element.style.color = "";
			document.getElementById("tabs" + tabGroupId + "tab" + i).style.display = "none";		
		} else if (element.className == enabledStyle) {
			element.className = disabledStyle;
			element.style.color = "";
			document.getElementById("tabs" + tabGroupId + "tab" + i).style.display = "none";
		} else if (element.className == errorStyle) {
			document.getElementById("tabs" + tabGroupId + "tab" + i).style.display = "none";
		}
	}
	if (document.getElementById("tabs" + tabGroupId + "head" + selectedTabId).className==errorStyle) {
		document.getElementById("tabs" + tabGroupId + "head" + selectedTabId).classNameErrorStdLayout = new Object();
	}
	document.getElementById("tabs" + tabGroupId + "head" + selectedTabId).className = enabledStyle;
	document.getElementById("tabs" + tabGroupId + "head" + selectedTabId).style.cursor = "default";
	document.getElementById("tabs" + tabGroupId + "tab" + selectedTabId).style.display = "";
	
	// update a cookie holding the name of the selected tab.
	if (tabKeyName!=null) {
		setTabCookie(tabKeyName, tabKeyValue);
	}
}
function onTabHeaderOver(tabGroupId, selectedTabId, enabledStyle) {
	element = document.getElementById("tabs" + tabGroupId + "head" + selectedTabId);
	if (element.className == enabledStyle) {
		element.style.cursor = "default";
	} else {
		element.style.cursor = "hand";
	}
}

