//LAUNCH FULLSCREEN WINDOW

function popFullWindow(theURL,winName) {
		var browserName=navigator.appName;
		var operatingSystem=navigator.platform;
		var version = parseFloat(navigator.appVersion);

		// Netscape check version 4.0+ on Win
		if (browserName.indexOf("Netscape")!=-1 && version>=4.0 && operatingSystem.indexOf("Mac")!=-1)
		 {
		 window.open(theURL,winName,'titlebar=no,top=0,left=0,scrollbars=yes,width=' + window.screen.availWidth+',height='+window.screen.availWidth+',screenX=0,screenY=0,top=0,left=0')
		 }

		// MSIE Mac check
		else if (browserName.indexOf("Microsoft Internet Explorer")!=-1 && operatingSystem.indexOf("Mac")!=-1)
		 {
		 window.open(theURL,winName,'titlebar=no,top=0,left=0,scrollbars=yes,width=' + window.screen.availWidth+',height='+window.screen.availWidth+',screenX=0,screenY=0,top=0,left=0')
		 }

		// Netscape Mac check
		else if (browserName.indexOf("Netscape")!=-1 && operatingSystem.indexOf("Mac")!=-1)
		 {
		 window.open(theURL,winName,'width='+screen.width+',height='+screen.height+',top=0,left=0,scrollbars=yes');
		 }

		// MSIE Windows
		else if (browserName.indexOf("Microsoft Internet Explorer")!=-1 && operatingSystem.indexOf("Win")!=-1)
		 {
		 //window.open(theURL,winName,'fullscreen=1,top=0,left=0');
		 var win = window.open(theURL,winName,'titlebar=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,top=0,left=0,width=' + window.screen.availWidth+',height='+window.screen.availHeight+',screenX=0,screenY=0,top=0,left=0')
			 win.resizeTo(screen.width, screen.height);
			 //win.moveTo(1, 1);
			 //win.moveTo(0, 0);
			 //win.resizeTo(screen.width, screen.height);
		 }

		// Netscape Windows
		else if (browserName.indexOf("Netscape")!=-1 && operatingSystem.indexOf("Win")!=-1)
		 {
		 window.open(theURL,winName,'width='+screen.width+',height='+screen.height+',top=0,left=0,scrollbars=yes');
		 }

		else
		 {
		 window.open(theURL,winName);
		 }

	}



// CENTER WINDOW

function openBrWindow(theURL,winName,features) 
{
    var flength = features.length;
    var wlocate = features.indexOf('width=');
    var hlocate = features.indexOf(',height=');
    
    var w = features.substring(wlocate+6, hlocate);
    var h = features.substring(hlocate+8, flength);
    
   //confirm("width="+w+",height="+h);
    
    var winl = (screen.width - w)/2;
    var wint = (screen.height - h)/2;
    
    //confirm("top="+wint+",left="+winl);
    
    features += ",top="+wint;
    features += ",left="+winl;
    
    window.open(theURL,winName,features);

}

// LAUNCH FULLSCREEN WINDOW REZ SPECIFIED

if(typeof(Screen) == "undefined") Screen = {};

Screen.getWidth = function(){
	return window.screen ? window.screen.availWidth : 0;
};
Screen.getHeight = function(){
	return window.screen ? window.screen.availHeight : 0;
};

if(typeof(Window) == "undefined") Window = {};

Window.open = function(url,name,width,height,xpos,ypos,chrome,scroll,fullscreen){
	var x, y, w, h, moveX=0, moveY=0, features="";
	chrome = chrome ? "yes" : "no";
	scroll = scroll ? "yes" : "no";
	features += "toolbar="+chrome;
	features += ",menubar="+chrome;
	features += ",location="+chrome;
	features += ",status="+chrome;
	features += ",scrollbars="+scroll;
	features += ",resizable="+scroll;
	if(width) features += ",width="+width;
	if(height) features += ",height="+height;
	if(fullscreen) features += ",fullscreen=yes";
	if(xpos){
		w = Screen.getWidth();
		width = parseInt(width);
		switch(xpos){
			case "left": x = 0; break;
			case "center": x = Math.round((w-width)/2); break;
			case "right": x = w-width; break;
			default: x = xpos;
		}
		features += ",screenX="+x+",left="+x;
		var moveX = x;
	}
	if(ypos){
		h = Screen.getHeight();
		height = parseInt(height);
		switch(ypos){
			case "top": y = 0; break;
			case "middle": y = Math.round((h-height)/2); break;
			case "bottom": y = h-height; break;
			default: y = ypos;
		}
		features += ",screenY="+y+",top="+y;
		var moveY = y;
	}
	Window.windowReference = window.open(url,name,features);
};
Window.openFullWindow = function(url,name,width,height){
	this.open(url,name,width,height,"center","middle",false);
};
Window.openCenterScroll = function(url,name,width,height){
	this.open(url,name,width,height,"center","middle",false);
};



