var dotmagwindow;
this.window.name = "main"

function customPopup(width,height,scrollbars,resizeable,url)
	{
	help=window.open(url, "Detail", "width=" + width + ",height="+ height +",top=50,left=50,scrollbars="+ scrollbars +",resizable="+ resizeable +"");
	if (help.opener == null) help.opener = window;
	help.focus();
	}

function popup(url)
	{
	help=window.open(url, "Detail", "width=500,height=400,scrollbars=yes,resizable=yes");
	if (help.opener == null) help.opener = window;
	help.focus();
	}
	function popup2(url)
	{
	help=window.open(url, "Detail", "width=400,height=470,scrollbars=yes,resizable=yes");
	if (help.opener == null) help.opener = window;
	help.focus();
	}
	
	function flashpop(url)
	{
	help=window.open(url, "Detail", "width=711,height=500,top=50,left=50,scrollbars=no,resizable=no");
	}
	
	function navpop(url)
	{
	nav=window.open(url, "Navigator", "width=640,height=510,scrollbars=yes,resizable=yes");
	if (nav.opener == null) nav.opener = window;
	nav.focus();
	}

function fullscreenpopup(url) {

	if (typeof(dotmagwindow) != "undefined" && !dotmagwindow.closed) {
		dotmagwindow.location=url;
		dotmagwindow.focus();
	}

  var w = screen.availWidth-10;
  var h = screen.availHeight-20;
  var features = "width="+w+",height="+h+",";
  features += "left=0,top=0,screenX=0,screenY=0";

  dotmagwindow=window.open(url, "", features);
}



function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
 }


function menuopen(menudiv, header) {
//menudiv.style.posLeft=findPosX(header);
//menudiv.style.posTop=findPosY(header)+14;
menudiv.style.display='block';
//document.getElementById('menukill').style.width=document.body.clientWidth;
document.getElementById('menukill').style.display='block';
document.getElementById('menukillabove').style.display='block';
}


function menuclose(menudiv) {
menudiv.style.display='none';
document.getElementById('menukill').style.display='none';
document.getElementById('menukillabove').style.display='none';
}
function menukiller() {
document.getElementById('menu1').style.display='none';
document.getElementById('menu2').style.display='none';
document.getElementById('menu3').style.display='none';
document.getElementById('menu4').style.display='none';
document.getElementById('menu5').style.display='none';
document.getElementById('menu6').style.display='none';
document.getElementById('menu7').style.display='none';
document.getElementById('menu8').style.display='none';
document.getElementById('menukill').style.display='none';
document.getElementById('menukillabove').style.display='none';
}



sfHover = function() {    
	var sfEls = document.getElementsByTagName("input");     
	for (var i=0; i<sfEls.length; i++) {       
		if ( sfEls[i].getAttribute('className') == "ghtxt" ) {  
			if ( sfEls[i].getAttribute('type') == "text" ) {  
				sfEls[i].focused=false;
				sfEls[i].alerted=false;
				sfEls[i].onmouseover=function() {      
					if (this.alerted==false) {     
						this.className="ghtxt_hover";    
						this.focused=false;   
					}  
				}         
				sfEls[i].onmouseout=function() {  
					if (this.alerted==false && this.focused==false) {  
				    this.className="ghtxt";    
					}
				}     
				sfEls[i].onfocus=function() {   
					if (this.alerted==false) {   
						this.focused=true;          
						this.className="ghtxt_active";   
					}     
				}         
				
				// doing it this way lets you maintain the old onblur function
				sfEls[i].onblur = (function (old) {
	   			 return function () {
	        		if (typeof old == 'function')    old();
	        			// Run new code here...
						if (this.alerted==false) {
						this.className="ghtxt";        
						this.focused=false;
						}
	    			};
				})(sfEls[i].onblur);
			}
		}
	} 
	var sfEls = document.getElementsByTagName("textarea");     
	for (var i=0; i<sfEls.length; i++) {       
		if ( sfEls[i].getAttribute('className') == "ghtxt" ) {  
			sfEls[i].focused=false;
			sfEls[i].alerted=false;
			sfEls[i].onmouseover=function() {      
				if (this.alerted==false) {     
					this.className="ghtxt_hover";    
					this.focused=false;   
				}  
			}         
			sfEls[i].onmouseout=function() {  
				if (this.alerted==false && this.focused==false) {  
			    this.className="ghtxt";    
				}
			}     
			sfEls[i].onfocus=function() {   
				if (this.alerted==false) {   
					this.focused=true;          
					this.className="ghtxt_active";   
				}     
			}         
			
			// doing it this way lets you maintain the old onblur function
			sfEls[i].onblur = (function (old) {
	  			 return function () {
	       		if (typeof old == 'function')    old();
	       			// Run new code here...
					if (this.alerted==false) {
						this.className="ghtxt";        
						this.focused=false;
					}
	   			};
			})(sfEls[i].onblur);
		}
	} 
	
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			
		}
	}
	var sfEls = document.getElementById("nav2").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
} 

if (window.attachEvent) window.attachEvent("onload", sfHover); 

