				
var ns4=(document.layers)? true:false;
var ie4=(document.all)? true:false;
var ns6=(document.getElementById && !document.all)? true:false;

function changeBg(layerName,swapColor) {
 if (ns4) { document.layers[layerName].bgColor = swapColor; }
 if (ie4) { document.all[layerName].style.backgroundColor = swapColor; }
 if (ns6) { document.getElementById(layerName).style.backgroundColor = swapColor; }
}

function showSquare2(x){
	if (ns4) { document.layers[x].visibility = 'show'; }
	if (ie4) { document.all[x].style.visibility = 'visible'; }
	if (ns6) { document.getElementById(x).style.visibility = 'visible'; }
}

function hideSquare2(x){
	if (ns4) { document.layers[x].visibility = 'hide'; }
	if (ie4) { document.all[x].style.visibility = 'hidden'; }
	if (ns6) { document.getElementById(x).style.visibility = 'hidden'; }
}

function selectIndex(x,i){
	if (ns4) { document.layers[x].selectedIndex   = i; }
	if (ie4) { document.all[x].selectedIndex   = i; }
	if (ns6) { document.getElementById(x).selectedIndex   = i; }
}


var handle_PUW = null;
function CenterWindow(url, w, h) 
{  
   /*
   if (document.all)var xMax = screen.width, yMax = screen.height;
    else
    {
        if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight;
        else var xMax = 640, yMax=480;
    }
   if (w>xMax) w = xMax * .9;
   if (h>yMax) h = yMax * .9;
   var l = (xMax - w)/2, t = (yMax-h)/2;
   handle_PUH = window.open('',"Partner",'left=1000,top=1000,width=2,height=2')
   if (!handle_PUH.closed) handle_PUH.close();   
   handle_PUH = window.open(url,"Partner",'screenX='+l+',left='+l+',screenY='+t+',top='+t+',toolbar=1,location=0,directories=0,status=1, menubar=0,scrollbars=2,resizable=1,fullscreen=0,width='+w+',height='+h);
   
   /*
   if (handle_PUW && handle_PUW.open && !handle_PUW.closed) handle_PUW.close(); 
   handle_PUW = window.open(url,'PartnerW','screenX=0,left=0,screenY=0,top=0,toolbar=1,location=0,directories=0,status=1, menubar=0,scrollbars=1,resizable=1,fullscreen=0,width='+w+',height='+h);
   */

   if (handle_PUW && handle_PUW.open && !handle_PUW.closed) handle_PUW.close(); 
   handle_PUW = window.open(url,'PopupWindow','screenX=0,left=0,screenY=0,top=0,toolbar=1,location=0,directories=0,status=1, menubar=0,scrollbars=1,resizable=1,fullscreen=0,width='+w+',height='+h);
  
}

var handle_PUH = null;
function CenterHelp(url, w, h) 
{
   /*
   if (document.all)var xMax = screen.width, yMax = screen.height;
    else
    {
        if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight;
        else var xMax = 640, yMax=540;
    }
   if (w>xMax) w = xMax * .9;
   if (h>yMax) h = yMax * .9;
   var l = (xMax - w)/2, t = (yMax-h)/2;
   handle_PUH = window.open(url,"Partner",'left=1000,top=1000,width=2,height=2')
   if (!handle_PUH.closed) handle_PUH.close();   
   //handle_PUH = window.open(url,"Partner",'screenX='+l+',left='+l+',screenY='+t+',top='+t+',toolbar=0,location=0,directories=0,status=0, menubar=0,scrollbars=2,resizable=1,fullscreen=0,width='+w+',height='+h);
   handle_PUH = window.open(url,'Partner','screenX=0,left=0,screenY=0,top=0,toolbar=0,location=0,directories=0,status=0, menubar=0,scrollbars=1,resizable=1,fullscreen=0,width='+w+',height='+h);

   /*
   if (handle_PUH && handle_PUH.open && !handle_PUH.closed) handle_PUH.close(); 
   handle_PUH = window.open(url,'Partner','screenX=0,left=0,screenY=0,top=0,toolbar=0,location=0,directories=0,status=0, menubar=0,scrollbars=1,resizable=1,fullscreen=0,width='+w+',height='+h);
   //handle_PUH.moveTo(0,0);
   //handle_PUH.resizeTo(w,h);
   handle_PUH.focus();
   */
   
   if (handle_PUH && handle_PUH.open && !handle_PUH.closed) handle_PUH.close(); 
   handle_PUH = window.open(url,'PopupView','screenX=0,left=0,screenY=0,top=0,toolbar=0,location=0,directories=0,status=0, menubar=0,scrollbars=1,resizable=1,fullscreen=0,width='+w+',height='+h);
   //handle_PUH.moveTo(0,0);
   //handle_PUH.resizeTo(w,h);
   handle_PUH.focus();
   
}
