function on_mouse_over_special_menu(index)
{
	document.getElementById("smtitle"+index).style.color='#273649';
	document.getElementById("smspacer1"+index).className='gltab';
	document.getElementById("smspacer3"+index).className='grtab';
	document.getElementById("smspacer2"+index).className='gctab';
}
function on_mouse_out_special_menu(index)
{
	if(index!=nCurrentSpecialMenu)
	{
		document.getElementById("smtitle"+index).style.color='#626f77';
		document.getElementById("smspacer1"+index).className='wltab';
		document.getElementById("smspacer3"+index).className='wrtab';
		document.getElementById("smspacer2"+index).className='wctab';
	}
}
function special_menu_action(index)
{
	var prev=nCurrentSpecialMenu;
	on_mouse_over_special_menu(index);
	nCurrentSpecialMenu=index;
	on_mouse_out_special_menu(prev);
	document.getElementById('content'+prev).style.display='none';
	document.getElementById('content'+index).style.display='';
}


function sp_mouseovermnu(object)
{
	object.style.textDecoration='none';
	object.childNodes[0].className="spmlnksm_sel";
	object.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].className="spmlnk_sel";
}
function sp_mouseoutmnu(object)
{
	object.childNodes[0].className="spmlnksm";
	object.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].className="spmlnk";
}

var currentMenu=-1;
function onmouseoverspmenu(index, hasChildren)
{
	if(currentMenu>-1)
		onmouseoutspmenu_delayed(currentMenu);
	
	currentMenu=index;

	spmenuoverstate[index]=1;
	if(navigator.appName=="Opera")
		for(var x=0;x<spmenuoverstate.length;x++)
			if(x>index)
				document.getElementById('spmenutit'+x).style.display='none';
			else
				document.getElementById('spmenutit'+x).style.display='';
		
	document.getElementById('spmenutitle'+index).className='spmlnkhdr_sel';
	
	if(hasChildren)
		document.getElementById('spmenu'+index).style.display='';
}

var spmouseout_intervalID=-1;
function onmouseoutspmenu(index)
{
	spmenuoverstate[index]=0;
	spmouseout_intervalID=setInterval("onmouseoutspmenu_delayed("+index+");",500);
}
function onmouseoutspmenu_delayed(index)
{
	clearInterval(spmouseout_intervalID);
	if(spmenuoverstate[index]==0)
	{
		document.getElementById('spmenu'+index).style.display='none';
		document.getElementById('spmenutitle'+index).className='spmlnkhdr';
	}
}

function menu_mouse_over(index)
{
	if(selectedMenu==index)
		return;
		
	if(menuButtonStates[index]==1)
		menu_mouse_down(index);
	else
		document.getElementById('menu'+index+'_container').style.top=-41;
	
	menuButtonStates_over[index]=1;
}
function menu_mouse_out(index)
{
	if(selectedMenu==index)
		return;
	
	menuButtonStates_over[index]=0;
	document.getElementById('menu'+index+'_container').style.top=0;
}
function menu_mouse_down(index)
{
	if(selectedMenu==index)
		return;
		
	menuButtonStates[index]=1;
	document.getElementById('menu'+index+'_container').style.top=-82;
}
function menu_mouse_up(index)
{
	try
	{
		menuButtonStates[index]=0;
		if(menuButtonStates_over[index]==1 && !navigator.appName=="Microsoft Internet Explorer")
			menu_mouse_over(index);
		else if(menuButtonStates_over[index]==1 && navigator.appName=="Microsoft Internet Explorer")
			menu_mouse_out(index);
	}
	catch(e)
	{
	
	}
}
function menu_select_tab(index)
{
	try
	{
		selectedMenu=index;
		var t=0;
		for(t=0;t<5;t++)
			document.getElementById('menu'+t+'_container').style.top=0;
		if(selectedMenu>=0)
			document.getElementById('menu'+index+'_container').style.top=-82;
	}
	catch(e)
	{
		
	}
}

function hp_mouseovermnu(object, selectedObj)
{
	try
	{
		object.style.textDecoration='none';
		object.childNodes[0].className="hp_lnk_sel";
		object.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].className="hp_lnk_txt_sel";
	}
	catch(e)
	{
	
	}
}
function hp_mouseoutmnu(object, selectedObj)
{
	try
	{
		if(selectedObj==object)
			return;
		object.childNodes[0].className="hp_lnk";
		object.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].className="hp_lnk_txt";
	}
	catch(e)
	{
		
	}
}
function hp_mousedownmnu(object, selectedObj)
{
	if(selectedObj==object)
		return false;
	if(navigator.appName=="Microsoft Internet Explorer")
		location.href=object.href;
	return true;
}

function hp2_set_current(object)
{
	object.childNodes[0].className="hp_lnk_sel2";
}

function hp2_mouseovermnu(object, selectedObj)
{
	try
	{
		if(selectedObj==object)
		{
			object.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.color="#ffffff";
			return false;
		}
		object.style.textDecoration='none';
		//object.childNodes[0].className="hp_lnk_sel2";
		//object.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].className="hp_lnk_txt_sel2";
		//object.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.color="#0099FF";
		object.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.textDecoration="underline";
	}
	catch(e)
	{
	
	}
}
function hp2_mouseoutmnu(object, selectedObj)
{
	try
	{
		if(selectedObj==object)
			return;
		//object.childNodes[0].className="hp_lnk2";
		//object.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.color="#0099FF";
		object.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.textDecoration="";
	}
	catch(e)
	{
		
	}
}

function onblur_textfield(object, strEmptyText)
{
	//document.getElementById('input_border').style.borderColor='#E6E6E6';
	if(object.value=='' || object.value==strEmptyText)
	{
		//object.style.fontStyle='italic';
		object.style.color='#797C80';
		object.value=strEmptyText;
	}
	else
	{
		//object.style.fontStyle='normal';
		object.style.color='#56594B';
	}
}

function onfocus_textfield(object, strEmptyText)
{
	document.getElementById('input_border').style.borderColor='#00b5ff';
	if(object.value==strEmptyText)
		object.value='';
	//object.style.fontStyle='normal';
	object.style.color='#797C80';
}

function switch_id(index, obj)
{
	//if(typeof ClickTaleExec=='function')
		//ClickTaleExec('switch_id('+index+', document.getElementById("wsecgg'+index+'"))');
	
	if(document.getElementById('id_desc_long_'+index).style.display=='none')
	{
		document.getElementById('id_desc_long_'+index).style.display='';
		document.getElementById('id_desc_short_'+index).style.display='none';
		obj.innerHTML=COLLAPSE;
	}
	else
	{
		document.getElementById('id_desc_short_'+index).style.display='';
		document.getElementById('id_desc_long_'+index).style.display='none';
		obj.innerHTML=EXPAND;
	}
}

function MM_openBrWindow(theURL,winName,features) 
{
	window.open(theURL,winName,features);
}

//added 14.04.2010
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			   string: navigator.userAgent,
			   subString: "iPhone",
			   identity: "iPhone/iPod"
	    },
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();
