/*
  http://www.mattersolutions.com
*/


function preloadImages() { 
	var args = preloadImages.arguments; 
	document.imageArray = new Array(args.length); 

	for(var i=0; i<args.length; i++)
  	{
    	document.imageArray[i] = new Image;
    	document.imageArray[i].src = args[i];
  	}
}

function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}

function hideAll() {
   var isShow = 0;
   var noHide = 1;
   //
   switchImage('Image1','/images/nav/consult_off.gif')
   switchImage('Image2','/images/nav/solutions_off.gif')
   switchImage('Image4','/images/nav/software_off.gif')
   switchImage('Image7','/images/nav/staff_off.gif')
   //
   showHide('consult', isShow, noHide);
   showHide('solutions', isShow, noHide);
   showHide('software', isShow, noHide);
   showHide('staff', isShow, noHide);
}

function showHide(divID, isShow, noHide)
{
  //if(!noHide) hideAll();
  divStyle = (document.getElementById) ? document.getElementById(divID).style : (document.all) ? document.all[divID].style : document.layers[divID];
  divStyle.visibility = (isShow) ? 'visible' : 'hidden';
  divStyle.display = (isShow) ? 'block' : 'none';
} 

function getWidth(myDiv,rw)
{
	var sw = Math.floor(document.body.offsetWidth / 2);
	var tw = 355;
	var np = sw - tw + rw;
	var fp = eval(np) + "px";
	//document.getElementById("property_div").style.left = fp;
	
	divStyle = (document.getElementById) ? document.getElementById(myDiv).style : (document.all) ? document.all[myDiv].style : document.layers[myDiv];
	divStyle.left = fp;
}

function doResize(){
getWidth('submenu',142);
showHide('submenu',0);
}

function closesubnav(event){
  if ((event.clientY <100)||(event.clientY > 260)){
		doResize();
    }
}
