/* ---------------------------------------- Common ---------------------------------------- */
function getbyid( sId )
{
	return document.getElementById( sId );
}

function scr( p_sURL )
{
	window.open( p_sURL, '_blank', 'channelmode=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, top=0, left=0, width=' + (screen.availWidth-16) + ', height=' + (screen.availHeight-32));
}

function set_cookie()
{
  var sLiveHelpCookie = "LiveHelpCookie";
  try{
    document.cookie =  sLiveHelpCookie + "=-1;path=/" ;
  }
  catch(e){}
}

function goToOnlineHelp()
{	
	if( history.length > 1 )
	{
		history.go(-1);
		return false;
	}
}
/* ---------------------------------------- end of Common ---------------------------------------- */





/* ---------------------------------------- Menu ---------------------------------------- */
function hideSubs()
{
	oChild = getbyid("submenus").firstChild;
	while ( oChild != getbyid("submenus").lastChild )
	{
		if(oChild.nodeType == 1)
		{
			oChild.style.display = "none";
		}
		oChild = oChild.nextSibling;
	}
	oChild = getbyid("submenus").lastChild;
	if(oChild.nodeType == 1)
		getbyid("submenus").lastChild.style.display = "none";
}



function homeRollOver()
{
	//getbyid("tl").style.background = "url(../i/menu_top_left_hover.gif)";
	getbyid("tl").className = "a_hover";
	getbyid("ctl00_homelink").className = "a_hover";
	hideSubs();
}

function homeRollOut()
{
	//getbyid("tl").style.background = "url(../i/menu_top_left.gif)";
	getbyid("tl").className = "";
	getbyid("ctl00_homelink").className = "";
}



function productsRollOver()
{
	hideSubs();
	getbyid("products_sub").style.display = "";
}

function partnersRollOver()
{
	hideSubs();
	getbyid("partners_sub").style.display = "";
}

function aboutRollOver()
{
	hideSubs();
	getbyid("about_sub").style.display = "";
}

function newsRollOver()
{
	hideSubs();
	getbyid("news_sub").style.display = "";
}



function showSubItems( p_sSubsId, p_oParent )
{
	hideSubs();
	oSubs = getbyid( p_sSubsId );
	iParentX = 0;
	oTopRow = document.getElementsByClassName("topRow")[0]
	oBeforeParent = oTopRow.firstChild;
	while( oBeforeParent != oTopRow.lastChild )
	{
		if( oBeforeParent.firstChild )
		{
			if( oBeforeParent.firstChild.id == p_oParent.id )
				break;
			iParentX += oBeforeParent.offsetWidth;
		}
		oBeforeParent = oBeforeParent.nextSibling;
	}
	oSubs.style.display = "";
	oSubs.style.marginLeft = Math.round( Math.max( (iParentX + p_oParent.offsetWidth/2 - oSubs.offsetWidth/2 - document.getElementsByClassName("bl")[0].offsetWidth), 0 ) )  +  "px";
}
/* ---------------------------------------- end of Menu ---------------------------------------- */

