

activateMenu = function(nav) {
	var navroot = document.getElementById(nav);
	var lis=navroot.getElementsByTagName("LI");  
	for (i=0; i<lis.length; i++) {
		if(lis[i].lastChild.tagName=="UL"){
			lis[i].onmouseover=function() {	
				this.lastChild.style.display="block";
				this.style.color='#fff';
				this.style.background='#4CA090';
			}
			lis[i].onmouseout=function() {                       
				this.lastChild.style.display="none";
				this.style.color='#017960';
				this.style.background='#fff'
			}
		}
		else{
			lis[i].onmouseover=function() {	
				this.style.color='#fff';
				this.style.background='#C3E2D2';
			}
			lis[i].onmouseout=function() {                       
				this.style.color='#017960';
				this.style.background='#fff'
			}
		}
	}
}


window.onload= function(){
//activateMenu('nav'); 
}

function openwindow(strURL, width, height){
  var windowObj = window.open(strURL, "new", "location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0,titlebar=0,height=" + height +",width=" + width );
  windowObj.focus();
}

function cmswindow(strUrl, blnFull){
  var height = 360;
  var width = 360;
  if (!blnFull)
  {
    var windowObj = window.open(strUrl, "inv", "location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0,titlebar=0,height=" + height +",width=" + width );
    //windowObj.moveTo( (screen.width - width) / 2, (screen.height - height) / 2 );
    windowObj.focus();
  }
  else{
    var windowObj = window.open(strUrl, "inv", "location=1,menubar=1,resizable=1,scrollbars=1,status=1,toolbar=1,titlebar=1");
    windowObj.focus();
  }
}

function swap(imageID, newImageSrc){
  imageID.src = newImageSrc;
}

function setClass(strName, strClass){
  var objElement = document.getElementById(strName);
  if (objElement){
    objElement.className = strClass;
  }
  else{
    alert('item not found: '+ strName);
  }
}


function layerShow(LayerName, vis){
  var layerObj = document.getElementById(LayerName);
  if (layerObj && layerObj.style){
    layerObj.style.visibility = (vis ? "visible" : "hidden");
  }
}



