
var hide  = true;

function show(obj){
	var x = new getObj('myfolders');
	x.style.visibility = 'visible';
	setLyr(obj,'myfolders');
}

function hidelyr(){
	var x = new getObj('myfolders');
	x.style.visibility = 'hidden';
	popuplyr.location="blank.html";
}

function setLyr(obj,lyr){
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	if (lyr == 'myfolders') newY += 20;
	var x = new getObj(lyr);
	x.style.top = newY + 'px';
	x.style.left = newX + 'px';
}

function findPosX(obj){
	var curleft = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj){
	var curtop = 0;
	var printstring = '';
	if (obj.offsetParent){
		while (obj.offsetParent){
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function setIframeHeight(ifr,pageHeight){
	var x = new getObj(ifr);
	x.style.height = (pageHeight)+"px";
}


function getObj(name){
 if (document.getElementById){
	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all){
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers){
	   if (document.layers[name]){
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   }
	   else{
	    this.obj = document.layers.testP.layers[name];
	    this.style = document.layers.testP.layers[name];
	   }
 	}
}

function writeIt(text,id){
  if (document.getElementById){
          x = document.getElementById(id);
          x.innerHTML = text;
  }
  else if (document.all){
          x = document.all[id];
          x.innerHTML = text;
  }
  else if (document.layers){
          x = document.layers[id];
          text2 = '<P CLASS="testclass">' + text + '</P>';
          x.document.open();
          x.document.write(text2);
          x.document.close();
  }
}

function getWindowWidth(){
	if (document.getElementById){
		if (window.innerWidth)
			return window.innerWidth;
  		if (document.documentElement&&document.documentElement.clientWidth)
   			return document.documentElement.clientWidth;
  		if (document.body&&document.body.clientWidth)
		   return document.body.clientWidth;
	 }
}

function reloadPage(){
	//document.location.href="index.php";
}

function showMenu(m){
	ypSlideOutMenu.showMenu(m);
	var x= new getObj("c_"+m);
	x.display="none";
}

function showMenu2(m){
	ypSlideOutMenu.showMenu(m);
	document[m].src="images/"+m+".gif";

}

function hideMenu2(m){
	ypSlideOutMenu.hideMenu(m);
	document[m].src="images/"+m+"_inact.gif";
}

var base= "images/"
var nrm = new Array();
var omo = new Array();
var stuff = new Array('menu1','menu2','menu3','menu4','logo');

if (document.images){
	for (i=0;i<stuff.length;i++){
		nrm[i] = new Image;
		nrm[i].src = base + stuff[i] + "_inact.gif"
		omo[i] = new Image;
		omo[i].src = base + stuff[i] + ".gif";
	}
}

function over(no){
	if (document.images){
		document.images[stuff[no]].src = omo[no].src
	}
}

function out(no){
	if (document.images){
		document.images[stuff[no]].src = nrm[no].src
	}
}
function overhome(no){
	out(0);
	out(1);
	out(2);
	out(3);
	over(no);
}

function outhome(no){
	over(0);
	over(1);
	over(2);
	over(3);
}

