function openoffscreen(sURL) {
	window.name = "main";
	var newwindow = null;
	var s_width = screen.availWidth;
	var s_height = screen.availHeight;
	var p_width = 1;
	var c_height = 1;

	var x_position = 10000;
	var y_position = 0;

	newwindow=window.open(sURL,'popupnav','scrollbars=0,toolbar=0,directories=0,menubar=0,resizable=1,status=0,width=' + p_width + ',height='+ c_height +',left='+ x_position + ',top='+ y_position);
	newwindow.resizeTo(0,0);
	newwindow.blur();
	newwindow.moveTo(0,-10000);
	window.focus();
}

function openit(sURL) {
	window.name = "main";
	var newwindow = null;
	var s_width = screen.availWidth;
	var s_height = screen.availHeight;
	var p_width = Math.round(s_width * .8);

	if (s_height < 600) {var c_height = (s_height)} else {var c_height = (s_height - 150)}
	
	var x_position = ((s_width - p_width - 10) * .5);
	var y_position = ((s_height - c_height - 30) * .5);

	newwindow=window.open(sURL,'popupnav','scrollbars=0,toolbar=0,directories=0,menubar=0,resizable=1,status=0,width=' + p_width + ',height='+ c_height +',left='+ x_position + ',top='+ y_position);
	newwindow.resizeTo(p_width,c_height);
	newwindow.moveTo(x_position,y_position);
}

function openitx(sURL) {
	window.name = "main";
	var mainWin1 = null;
	var s_width = screen.availWidth;
	var s_height = screen.availHeight;
	var p_width = Math.round(s_width * .8);

	if (s_height < 600) {var c_height = (s_height)} else {var c_height = (s_height - 150)}
	
	var x_position = ((s_width - p_width - 10) * .5);
	var y_position = ((s_height - c_height - 30) * .5);

	mainWin1=window.open(sURL,'mainWin1','scrollbars=yes,location=yes,toolbar=yes,directories=yes,menubar=yes,resizable=no,status=yes,width=' + p_width + ',height='+ c_height +',left='+ x_position + ',top='+ y_position);
	//mainWin1.resizeTo(p_width,c_height);
	//mainWin1.moveTo(x_position,y_position);
}

function openit_a(sURL) {
	window.name = "main";
	var newwindow = null;
	var s_width = screen.availWidth;
	var s_height = screen.availHeight;
	var p_width = 640;
	var c_height = 480;
	var x_position = ((s_width - p_width - 10) * .5);
	var y_position = ((s_height - c_height - 30) * .5);

	newwindow=window.open(sURL,'popupnav','scrollbars=1,toolbar=0,directories=0,menubar=0,resizable=1,status=0,width=640,height=480,left='+ x_position + ',top='+ y_position);
	newwindow.resizeTo(p_width,c_height);
	newwindow.moveTo(x_position,y_position);
}

function openit_b(sURL) {
	window.name = "main";
	var newwindow = null;
	var s_width = screen.availWidth;
	var s_height = screen.availHeight;
	var p_width = Math.round(s_width * .9);

	if (s_height < 600) {var c_height = (s_height)} else {var c_height = (s_height - 150)}
	
	var x_position = ((s_width - p_width - 10) * .5);
	var y_position = ((s_height - c_height - 30) * .5);
	
	newwindow=window.open(sURL,'popupnav','scrollbars=1,toolbar=0,directories=0,menubar=0,resizable=1,status=0,width=630,height=400,left='+ x_position + ',top='+ y_position);
	newwindow.resizeTo(p_width,c_height);
	newwindow.moveTo(x_position,y_position);
}

function openit_c(sURL) {
	window.name = "main";
	var newwindow = null;
	var s_width = screen.availWidth;
	var s_height = screen.availHeight;
	var p_width = 400;
	var c_height = 300;
	var x_position = ((s_width - p_width - 10) * .5);
	var y_position = ((s_height - c_height - 30) * .5);

	newwindow=window.open(sURL,'popupnav','scrollbars=1,toolbar=0,directories=0,menubar=0,resizable=1,status=0,width=400,height=300,left='+ x_position + ',top='+ y_position);
	newwindow.resizeTo(p_width,c_height);
	newwindow.moveTo(x_position,y_position);
}

function openit_d(sURL) {
	window.name = "main";
	var newwindow = null;
	var s_width = screen.availWidth;
	var s_height = screen.availHeight;
	var p_width = 800;
	var c_height = 600;
	var x_position = ((s_width - p_width - 10) * .5);
	var y_position = ((s_height - c_height - 30) * .5);
	
	newwindow=window.open(sURL,'popupnav','scrollbars=1,toolbar=0,directories=0,menubar=0,resizable=1,status=0,width=800,height=600,left='+ x_position + ',top='+ y_position);
	newwindow.resizeTo(p_width,c_height);
	newwindow.moveTo(x_position,y_position);
}

function openit_size(sURL,xwidth,yheight) {
	window.name = "main";
	var newwindow = null;
	var s_width = screen.availWidth;
	var s_height = screen.availHeight;
	var p_width = xwidth;
	var c_height = yheight;
	var x_position = ((s_width - p_width - 10) * .5);
	var y_position = ((s_height - c_height - 30) * .5);

	newwindow=window.open(sURL,'popupnav','scrollbars=1,toolbar=0,directories=0,menubar=0,resizable=1,status=0,width=' + xwidth + ',height=' + yheight + ',left='+ x_position + ',top='+ y_position);
	newwindow.resizeTo(p_width,c_height);
	newwindow.moveTo(x_position,y_position);
	

}

function openit_max(sURL) {
	window.name = "main";
	var newwindow2 = null;
	var s_width = screen.availWidth - 10;
	var s_height = screen.availHeight - 30;

	newwindow2=window.open(sURL,'popupnav','scrollbars=1,toolbar=0,directories=0,menubar=0,resizable=1,status=0,width='+ s_width +',height='+ s_height +',left=0,top=0');
	newwindow2.resizeTo(s_width,s_height);
	newwindow2.moveTo(0,0);
}

function openit_fullscreen(sURL) {
	window.name = "main";
	var newwindow3 = null;
	var s_width = screen.availWidth;
	var s_height = screen.availHeight;
	newwindow3=window.open(sURL,'popupnav3','scrollbars=yes,location=yes,toolbar=yes,directories=yes,menubar=yes,resizable=yes,status=yes,width='+ s_width +',height='+ s_height +',left=0,top=0');
	newwindow3.resizeTo(s_width,s_height);
	newwindow3.moveTo(0,0);
}

function openit_fullscreenx(sURL) {
	window.name = "main";
	var mainWin = null;
	var s_width = screen.availWidth;
	var s_height = screen.availHeight;
	mainWin=window.open(sURL,'mainWin','scrollbars=yes,location=yes,toolbar=yes,directories=yes,menubar=yes,resizable=yes,status=yes,width='+ s_width +',height='+ s_height +',left=0,top=0');
	mainWin.resizeTo(s_width,s_height);
	mainWin.moveTo(0,0);
}

var AgntUsr = navigator.userAgent.toLowerCase();
var appVer  = navigator.appVersion.toLowerCase();
var DomYes  = (document.getElementById)?1:0;				// DOM
var NavYes  = (AgntUsr.indexOf('mozilla')!=-1&&AgntUsr.indexOf('compatible')==-1)?1:0;	// Netscape
var ExpYes  = (AgntUsr.indexOf('msie')!=-1)?1:0;				// IExplorer
var Opr5    = (AgntUsr.indexOf('opera 5')!=-1||AgntUsr.indexOf('opera/5')!=-1)?1:0;	// Opera 5
var DomNav  = (DomYes&&NavYes)?1:0;					// Netscape 6 up
var DomExp  = (DomYes&&ExpYes)?1:0;					// IExplorer 5 up
var Nav4    = (NavYes&&!DomYes&&document.layers)?1:0;			// Netscape 4
var Exp4    = (ExpYes&&!DomYes&&document.all)?1:0;				// IExplorer 4

var is_mac = (AgntUsr.indexOf("mac")!=-1) ? 1 : 0;
var iePos  = appVer.indexOf('msie');
if (iePos !=-1) {
   is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
   is_major = parseInt(is_minor);
} else if (NavYes) {
   is_major = parseInt(navigator.appVersion.substr(0,2));
}

var is_ie    = (iePos!=-1);
var is_ie3   = (is_ie && (is_major < 4));
var is_ie4   = (is_ie && is_major == 4);
var is_ie4up = (is_ie && is_minor >= 4);
var is_ie5   = (is_ie && is_major == 5);
var is_ie5up = (is_ie && is_minor >= 5);
var is_ie6   = (is_ie && is_major == 6);
var is_ie6up = (is_ie && is_major >= 6);
var is_aol   = (AgntUsr.indexOf("aol") != -1);

// Help Popup Code

var helpStartbarH = 0;
var helpStartbarW = 0;
var mac_heightoffset = 0;

if (is_aol) {
	var aolToolbar = 150;
} else {
	var aolToolbar = 0;
}

if (DomNav) {
	var chromeH = 43;
	var chromeW = 8;
} else {
	if (!is_aol) {
		var chromeH = 50;
		var chromeW = 10;
	} else {
		var chromeH = 170;
		var chromeW = 30;
	}
}

sWidth = screen.availWidth;
sHeight = screen.availHeight;

sWorkWidth = parseInt(sWidth * .85);
sWorkHeight = parseInt(sHeight * .85);

sWorkPosX = parseInt((sWidth - sWorkWidth) / 2);
sWorkPosY = parseInt((sHeight - sWorkHeight) / 2);

var windowWidth = (sWorkWidth * .78);
var windowWidth2 = (windowWidth - chromeW);
var windowHelpWidth = sWorkWidth - windowWidth;
var windowHelpHeight = sWorkHeight - chromeH - 1;

var help_h = windowHelpHeight;
var help_l = sWorkPosX + windowWidth;
var help_t = sWorkPosY;
var help_w = windowHelpWidth - chromeW;
var windowHelpPopup,windowHelpPopup2;

function loadHelpWindow1(myURL) {
var windowVars = "scrollbars=yes,toolbar=yes,status=yes,menubar=no,width=" + windowWidth2 + ",height="+help_h+",left="+sWorkPosX+",top="+sWorkPosY+",resizable=no";
windowHelpPopup = window.open(myURL, 'windowHelpPopup', windowVars);
}

function loadHelpWindow2(myURL2) {
var windowVars2 = "toolbar=yes,status=yes,menubar=no,width="+help_w+",height="+help_h+",left="+help_l+",top="+help_t+",resizable=no";
windowHelpPopup2 = window.open(myURL2, 'windowHelpPopup2', windowVars2);
}

function goHelp1(URL) {
loadHelpWindow1(URL);
}

function goHelp2(URL2) {
loadHelpWindow2(URL2);
}
