function LanguageChange(oElm)
{
	//cboLanguageMenu

var sUrl	= document.forms.frmLanguage.action;

sUrl = replaceAll( sUrl, sDESiteServer , "" );
sUrl = replaceAll( sUrl, sUKSiteServer , "" );
sUrl = replaceAll( sUrl, sUSSiteServer , "" );
sUrl = replaceAll( sUrl, "http://" , "" );
sUrl = replaceAll( sUrl, "https://" , "" );

	var sToSite	= oElm.options[ oElm.selectedIndex ].value;
	if ( sToSite == 'de' )
		document.forms.frmLanguage.action	= sDESiteServer + sUrl ;
	
	else if ( sToSite == 'uk' )
		document.forms.frmLanguage.action	= sUKSiteServer + sUrl ;
		
	else 
		document.forms.frmLanguage.action	= sUSSiteServer + sUrl ;

		
	//document.forms.frmLanguage
	window.location = document.forms.frmLanguage.action;
	//document.forms.frmLanguage.submit();
}

function URLDecode(sText)
{
   // Replace + with ' '
   // Replace %xx with equivalent character
   // Put [ERROR] in output if %xx is invalid.
   var HEXCHARS = "0123456789ABCDEFabcdef"; 
   var encoded = sText;
   var plaintext = "";
   var i = 0;
   
   encoded	= encoded.replace("%92", "'");
   
   while (i < encoded.length) 
   {
       var ch = encoded.charAt(i);
       
	   if (ch == "+") 
	   {
	       plaintext += " ";
		   i++;
	   }
	   else if (ch == "%") 
	   {
			if (i < (encoded.length-2) && HEXCHARS.indexOf(encoded.charAt(i+1)) != -1 && HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) 
			{
				plaintext += unescape( encoded.substr(i,3) );
				i += 3;
			}
			else 
			{
				i++;
			}
		}
		else
		{
		   plaintext += ch;
		   i++;
		}
		
	}

	return plaintext;
}
function primary_mouse(oElm, iMode)
{	


	var oFlyout	= oElm.getAttribute( 'flyout_menu' );
	if ( oElm.parentNode.parentNode.parentNode.flyoutMenu	 != null ){
		if( oElm.parentNode.parentNode.parentNode.flyoutMenu.getAttribute( 'id' ) != oFlyout )
		//if ( oElm.parentNode.parentNode.parentNode.flyoutMenu.parentMenu.id != oElm.id )
			hideNestedMenus( oElm.parentNode.parentNode.parentNode.flyoutMenu );
	}
		
	if ( iMode == 1 ){
		if( oFlyout != null ){			
				var oFlyout				= document.getElementById( oFlyout );
				var oCoord 				= getAnchorPosition( oElm );
				x1						= oCoord.x;
				y1						= oCoord.y;
				
				oFlyout.style.left			= x1 + oElm.offsetWidth + 1;
				oFlyout.style.top			= y1 ;
				
				//alert( oFlyout.style.left );

				//if ( isFireFox() )
				//	oFlyout.style.top			= "133";
					
				oFlyout.style.display		= "block";
				
				oFlyout.parentMenu			= oElm;
				oFlyout.onmouseout			= dropdown_out;//function() { hideIfOut( this );};
				oElm.parentNode.parentNode.parentNode.flyoutMenu	= oFlyout;
				//oElm.onmouseout				= "";
				
				
				//oFlyout.onmouseout			= dropdown_out;
						
		}
	}else{
		if( oElm.getAttribute( 'flyout_menu' ) != null ){
			//document.getElementById( oElm.getAttribute( 'flyout_menu' ) ).style.display = 'none';
		}	
	}
	
	oElm.className	= iMode == 1 ? 'main_primary_drop_item_active' : 'main_primary_drop_item'; 
	oElm.style.cursor='hand'; 
}

