

// remove flickering
try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {
}


// menu layer onoff script
function viewlayer(va,onoff) {
	var obj=document.getElementById(va);
	if(onoff=="on") obj.style.display="block";
	else if (onoff=="in") obj.style.display="inline";
	else obj.style.display="none";
}
/*
function viewMenu(filename,num){
			
					
			if (document.location.href.indexOf(filename))
			{
				
				var tempImg = document.getElementById("MenuItem"+num);
				var tempSrc;
				if (document.getElementById("MenuItem"+num).getAttribute("src").indexOf("navtop-home.gif"))
				{
					tempSrc = tempImg.getAttribute("src").replace(".gif","_on.gif");
					tempImg.setAttribute("src",tempSrc);
					
					return false;
					}
			}
			
		}
*/

function viewMenu(){
			
			var num;
			
			if (document.location.href.indexOf('/benefits/') !=-1 ) num = 2;
			else if (document.location.href.indexOf('/platform/') !=-1 ) num = 3;
			else if (document.location.href.indexOf('/showcase/') != -1 ) num = 4;
			else if (document.location.href.indexOf('/contact/') != -1) num = 5;
			else num = 1;
			
			var tempImg = document.getElementById("MenuItem"+num);
			var tempSrc;
			
				if ( tempImg.getAttribute("src").indexOf("_on.gif") != -1) return false;
				
				if ( tempImg.getAttribute("src").indexOf("_over.gif") == -1)
				{
					tempSrc = tempImg.getAttribute("src").replace(".gif","_on.gif");
				
					tempImg.setAttribute("src",tempSrc);
				return false;
				}
				if ( tempImg.getAttribute("src").indexOf("_on.gif") != -1) return false;
				/*{
					tempSrc = tempImg.getAttribute("src").replace(".gif","_on.gif");
				
					tempImg.setAttribute("src",tempSrc);
				return false;
				}
				*/
			
}

function getCurrentUrlId()
{
	var num;
	
	if (document.location.href.indexOf('/benefits/') !=-1 ) num = 2;
	else if (document.location.href.indexOf('/platform/') !=-1 ) num = 3;
	else if (document.location.href.indexOf('/showcase/') != -1 ) num = 4;
	else if (document.location.href.indexOf('/contact/') != -1) num = 5;
	else num = 1;
return num;
}

function hightlightItem()
{
	
	if (document.location.href.indexOf('/platform/') !=-1 )
	{
	
			
			if (document.location.href.indexOf('/dtx-toolbar-technology') !=-1 )
			{
				elt = "technology";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
				
			}
			else if (document.location.href.indexOf('/toolbar-apps') !=-1 )
			{
				elt = "widget";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
				
			}
			else if (document.location.href.indexOf('/sdk') !=-1 )
			{
				elt = "sdk";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
				
			}
			else if (document.location.href.indexOf('/monetization') !=-1 )
			{
				elt = "monetization";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
				
			}
			else if (document.location.href.indexOf('/analytics') !=-1 )
			{
				elt = "analytics";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
				
			}
			else if (document.location.href.indexOf('/custom-toolbar-development') !=-1 )
			{
				elt = "custom";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
			
			}
			else if (document.location.href.indexOf('/developers') !=-1 )
			{
				elt = "developer";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
			
			}
			else
			{
				elt = "platform";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
				
			}
			
	return false;		
	}	
	else if (document.location.href.indexOf('/benefits/') !=-1)
	{
			
			if (document.location.href.indexOf('/create-toolbar-apps') !=-1 )
			{
				elt = "index";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
				
			}
			else if (document.location.href.indexOf('/toolbar-advantage') !=-1 )
			{
				elt = "advantage";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
			}			
			else if (document.location.href.indexOf('/revenue-generation') !=-1 )
			{
				elt = "revenue";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;			
			}			
			else if (document.location.href.indexOf('/custom-toolbar-development') !=-1 )
			{
				elt = "customdev";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;			
			}
			else
			{
				elt = "index";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
				
			}
		return false;	
		}
		else if (document.location.href.indexOf('/company/') !=-1)
		{
			if (document.location.href.indexOf('/index') !=-1 )
			{
				elt = "companyabout";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
				
			}
			if (document.location.href.indexOf('/news') !=-1 )
			{
				elt = "companynews";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
				
			}
			if (document.location.href.indexOf('/become-a-partner') !=-1 )
			{
				elt = "companypartner";
				document.getElementById(elt+'_left').style.fontWeight = "bold";
				document.getElementById(elt+'_menu').style.fontWeight = "bold";
				return false;
			
			}
			return false;
		}
		else{
			return false;
		}
}	

