function OpenTheWindow(theURL,winName,features) {
   if (features == "") {
      windowName = window.open(theURL,winName);
   }
   else {
      windowName = window.open(theURL,winName,features);
   }
   if (((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) >= 4)) ||
       ((navigator.appName == 'Microsoft Internet Explorer') && (parseInt(navigator.appVersion) >= 5 || (parseInt(navigator.appVersion) == 4) && ((navigator.userAgent.toLowerCase()).indexOf("msie 5.0")!=-1) ))) {
      if (window.focus) {
         windowName.focus();
      }
   }
}

function verifyCompatibleBrowser(){ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ie5p=(document.all && this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
bw=new verifyCompatibleBrowser();

function SWidth()
{
	w= (screen) ? screen.width : 0;
	return w;
}
function SHeight()
{
	h= (screen) ? screen.height : 0;
	return h;
}
function ClientWidth()
{
	w=(bw.ie4 || bw.ie5p || bw.ie5) ? document.body.clientWidth : (bw.ns5 || bw.ns4) ? innerWidth : 0;
	return w;
}
function ClientHeight()
{
	h=(bw.ie4 || bw.ie5p || bw.ie5) ? document.body.clientHeight : (bw.ns5 || bw.ns4) ? innerHeight : 0;
	return h;
}

function windowOpener(fileName, w, h, l, t){
	msgWindow=window.open(fileName,"winName","width="+w+",height="+h+",left="+l+",top="+t+",toolbar=0,directories=0,menubar=0,resizable=0,location=0,scrollbars=1,copyhistory=0");
}

function windowNSOpener(fileName, w, h, l, t){
	msgWindow=window.open(fileName,"winName","width="+w+",height="+h+",left="+l+",top="+t+",toolbar=0,directories=0,menubar=0,resizable=0,location=0,scrollbars=1,copyhistory=0");
}

// open popup window with scrollbar centered on desktop
function windowCOpener(fileName, w, h){
	l=(SWidth()-w);	l=(l<0) ? 0 : parseInt(l/2);
	t=(SHeight()-h); t=(t<0) ? 0 : parseInt(t/2);
	windowOpener(fileName, w, h, l, t);
}
// open popup window with no scrollbar centered on desktop
function windowNSCOpener(fileName, w, h){
	l=(SWidth()-w);	l=(l<0) ? 0 : parseInt(l/2);
	t=(SHeight()-h); t=(t<0) ? 0 : parseInt(t/2);
	windowNSOpener(fileName, w, h, l, t);
}
// open popup window with scrollbar centered on browser window
function windowBCOpener(fileName, w, h){
	l=(ClientWidth()-w);	l=(l<0) ? 0 : parseInt(l/2);
	t=(ClientHeight()-h); t=(t<0) ? 0 : parseInt(t/2);
	windowOpener(fileName, w, h, l, t);
}