/*********************************************************************************************************/
//CCSCREATOR
activateMenu = function(nav) {

/* currentStyle restricts the Javascript to IE only */
	if (document.all &&
 document.getElementById(nav).currentStyle) {  
        var navroot = document.getElementById(nav);
        
        /* Get all the list items within the menu */

        var lis=navroot.getElementsByTagName("LI");  
        for (i=0; i<lis.length; i++) {
        
           /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
            
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {	
                
                   /* display the inner menu */
                   this.lastChild.style.display="block";
                }
                lis[i].onmouseout=function() {   
                   this.lastChild.style.display="none";
                }
            }
        }
    }
}

window.onload= function(){
    /* pass the function the id of the top level UL */
    /* remove one, when only using one menu */
    activateMenu('navigation'); 
//    activateMenu('vertnav'); 
}


/*********************************************************************************************************/
// Menu Dropdowns

initNav = function() {
		var navRoot = document.getElementById("navigation");
		if (navRoot)
		{
		var lis = navRoot.getElementsByTagName("li");
		for (var i=0; i<lis.length; i++)
		{
			var drops = lis[i].getElementsByTagName("ul");
			if (drops.length)
			{
				lis[i].onmouseover = function()
				{
					this.className += " hover";
				}
				lis[i].onmouseout = function()
				{
					this.className = this.className.replace("hover", "");
				}
			}
		}
		}
		var navRoot = document.getElementById("language");
		if (navRoot != null)  /*for vmworld pages*/
		{
		var lis = navRoot.getElementsByTagName("li");
		for (var i=0; i<lis.length; i++)
		{
			var drops = lis[i].getElementsByTagName("ul");
			if (drops.length)
			{
				lis[i].onmouseover = function()
				{
					this.className += " hover";
				}
				lis[i].onmouseout = function()
				{
					this.className = this.className.replace("hover", "");
				}
			}
		}
		}
}

if (window.addEventListener){
	window.addEventListener("load", initNav, false);
}
else if (window.attachEvent){
	window.attachEvent("onload", initNav);
}

/////////////////////////////////////////////
// Dynamic Tabs controller used in VI3 pages
//

function showLayer(lyr) {
//   makeHistory(lyr);
   document.getElementById(currentLayer).className = 'hide';
   document.getElementById(lyr).className = 'show';
   currentLayer = lyr;
//   showTab(lyr.replace("tab","t_"));
}

function showTab(lyr) {
   document.getElementById(currentTab).className = 'taboff';
   document.getElementById(lyr).className = 'tabon';
   currentTab = lyr;
}

/*********************************************************************************************************/
// MENU by javascriptkit
/*------------------------------*/

var menu_li; //list in
var menu_lo; //list out
var menu_tt; //test timer
function menu_create(sd,v,l){ 
	if(!l){l=1;
		sd=document.getElementById("menu"+sd);
		sd.onmouseover=function(e){ x6(e);	return false;};
		document.onmouseover=x2;
		sd.parentNode.style.zoom=1;
		if(navigator.userAgent.indexOf("afari")+1) sd.style.position="relative";
	}
	var lsp;
	var sp=sd.childNodes;
	for(var i=0;i<sp.length;i++){
		var b=sp[i];
		if(b.tagName=="A"){
			lsp=b;
			b.onmouseover=x0;
			if(l==1&&v) b.style.styleFloat="none";
		}
		if(sp[i].tagName=="SPAN"){
			sp[i].style.zIndex=l;
			x5("menuparent",lsp,1);
			lsp.cdiv=b;
			b.idiv=lsp;
			new menu_create(b,null,l+1);
		}
	}
};

function menu_a(a){
	if(a.className.indexOf("menumc")+1) return 1;
};

function x0(e){
	if(menu_tt) clearTimeout(menu_tt);
	var a=this;
	var go=true;
	while((a=a.parentNode)&&!menu_a(a)){
		if(a==menu_li) go=false;
	}
	if(menu_li&&go){
		a=this;
		if((!a.cdiv)||(a.cdiv&&a.cdiv!=menu_li))
			x1(menu_li);
			a=menu_li;
			while((a=a.parentNode)&&!menu_a(a)){
				if(a!=this.parentNode) 
					x1(a);
				else break;
		}
	}
	var b=this;
		if(b.cdiv){
			var aw=b.offsetWidth;
			var ah=b.offsetHeight;
			var ax=b.offsetLeft;
			var ay=b.offsetTop; 
			if(menu_a(b.parentNode)&&b.style.styleFloat!="none") aw=0;
			else ah=0;
			b.cdiv.style.left=(ax+aw)+"px";
			b.cdiv.style.top=(ay+ah)+"px";
			x5("menuactive",this,1);
			b.cdiv.style.display="inline";
			menu_li=b.cdiv;
		}
		else menu_li=b.parentNode;
		x6(e);
	return false;
};

function x1(a){
	a.style.display="none";
	x5("menuactive",a.idiv);
}

// timeout 
function x2(e){
	if(menu_li) menu_tt=setTimeout("x3()",300);
};

function x3(){
	var a;
	if(a=menu_li) { do{x1(a); }
	while((a=a.parentNode)&&!menu_a(a))}menu_li=null;
};

function x4(a,b){
	return String.fromCharCode(a.charCodeAt(0)-1-(b-(parseInt(b/4)*4)));
};

function x5(name,obj,add){var a=obj.className;
	if(add){
		if(a.indexOf(name)==-1) obj.className+=(a?' ':'')+name;
	}
	else {
		obj.className=a.replace(" "+name,"");
		obj.className=obj.className.replace(name,"");
	}
};

function x6(e){
	if(!e) e=event;
	e.cancelBubble=true;
	if(e.stopPropagation) e.stopPropagation();
}