//code get the x and y of an object
var oCoor = {
	//get the x-coor by calculating the offsetLeft of it's parents.
	getLeft: function(o) {
		var left = 0;
	    while(eval(o)) {
	    	left += o.offsetLeft;
	        o = o.offsetParent;
	    }
	        return left;
	},
	//get the y-coor by calculating the offsetTop of it's parents.
	getTop: function(o) {
		var top = 0;
	    while(eval(o)) {
	    	top += o.offsetTop;
	         o = o.offsetParent;
	    }
        return top;
	}
}


//=======================================================
     //detect browser settings for showing and hiding DIVs
     isNS4 = (document.layers) ? true : false;
     isIE4 = (document.all && !document.getElementById) ? true : false;
     isIE5 = (document.all && document.getElementById) ? true : false;
     isNS6 = (!document.all && document.getElementById) ? true : false;
//=======================================================



function SwitchDiv(strDivName,bolVisible){
 //identify the element based on browser type
 if (isNS4) {
   objElement = document.layers[strDivName];
 } else if (isIE4) {
   objElement = document.all[strDivName].style;
 } else if (isIE5 || isNS6) {
   objElement = document.getElementById(strDivName).style;
 }

 if(isNS4){
     if(!bolVisible) {
       objElement.visibility ="hidden"
     } else {
       objElement.visibility ="visible"
     }
 }else if(isIE4 || isIE5 || isNS6){
     if(!bolVisible) {
       objElement.visibility = "hidden";
     } else {
       objElement.visibility = "visible";
     }
 }

 return objElement;
}

