
/***********************************************
* Drop Down/ Overlapping Content-  Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.visibility='hidden';
subobj.style.display=(subobj.style.display!="block")? "block" : "none";
/* var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
*/

windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;       
subobj.style.left = (windowWidth/2 - subobj.scrollWidth/2) +'px';
subobj.style.top = (windowHeight/2 - subobj.scrollHeight/2) +'px';
subobj.style.visibility='visible';
return false;
}
else
return true;
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}

function center() {
var widget=document.getElementById("subcontent2")
if( !widget || (iecheck((document.compatMode=='BackCompat')?true:false)) ) return;
windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;       
widget.style.left = (windowWidth/2 - widget.scrollWidth/2) +'px';
widget.style.top = (windowHeight/2 - widget.scrollHeight/2) +'px';
}


