// get window height
function getWindowHeight(thisWindow) {
  if(myBrowser == "NN" || myBrowser == "DOM") {
    return(thisWindow.innerHeight);
  } else if(myBrowser == "IE") {
    return(thisWindow.document.body.clientHeight);
  }
}

// get window width
function getWindowWidth(thisWindow) {
  if(myBrowser == "NN" || myBrowser == "DOM") {
    return(thisWindow.innerWidth);
  } else if(myBrowser == "IE") {
    return(thisWindow.document.body.clientWidth);
  }
}

// get window horizontal center
function getCenter(thisWindow) {
  return(Math.floor(getWindowWidth(thisWindow)/2));
}


// browser sniffer
var myBrowser = null;
if(document.all) {
  myBrowser = "IE";
} else if(document.layers) {
  myBrowser = "NN";
} else if(document.getElementById) {
  myBrowser = "DOM";
}


document.popLoaded = false;
document.preLoaded = false;  
var vert_nav_xOffset = -360;
var vert_nav_yOffset = 0;

//pop up Flash

var javascript_version = 1.0;




var newwin;

function launchwin(winurl,winname,winfeatures)
{
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	newwin = window.open(winurl,winname,winfeatures);
	if(javascript_version > 1.0)
	{
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 		setTimeout('newwin.focus();',250);
	}
}
//pop up Flash Control:launchwinflacontrol

var javascript_version = 1.0;

var newwinfla;

function launchwinfla(winurl,winname,winfeatures)
{
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	newwinfla = window.open(winurl,winname,winfeatures);
	if(javascript_version > 1.0)
	{
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 		setTimeout('newwinfla.focus();',250);
	}
}


//pop up win
var win;
function openwin(winwidth,winheight,URL)
{
	win = window.open(URL,'','width='+ winwidth +',height=' + winheight + ',top='+((screen.height/2)-(winheight/2))+',left='+((screen.width/2)-(winwidth/2))+',toolbar=no,scrollbars=no,resizable=no,menubar=no,status=no,directories=no,location=no'); void(0);
}

//non pop up
var newwin;
function launchwinnon(winurl,winheight,winwidth)
{
	newwin = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
}

//non pop up control with popup two pop ups...
var newwincontrol;
function launchwinnoncontrol(winurl,winheight,winwidth,winY,winX)
{
	if (newwin)
		if (newwin.closed == false)
			newwin.close();
			

	if((myBrowser == "NN")||(myBrowser == "DOM")) {
		newwincontrol = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',screenY=' + winY + ',screenX=' + winX + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
	} else if(myBrowser == "IE") {
		newwincontrol = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',top=' + winY + ',left=' + winX + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
	}
}

// convert all characters to lowercase
var agt=navigator.userAgent.toLowerCase(); 
var is_mac = (agt.indexOf("mac")!=-1);


//non pop up control
var newwincontrol;

function launchwinnoncontrol(winurl,winheight,winwidth,winY,winX)
{
if((myBrowser == "NN")||(myBrowser == "DOM")) {
		newwincontrol = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',screenY=' + winY + ',screenX=' + winX + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
} else if(myBrowser == "IE") {
		newwincontrol = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',top=' + winY + ',left=' + winX + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
	}
}

//non pop up control
var nonnewwincontrol;

function launchwinonecontrol(winurl,winheight,winwidth,winY,winX)
{
if((myBrowser == "NN")||(myBrowser == "DOM")) {
	nonnewwincontrol = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',screenY=' + winY + ',screenX=' + winX + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
	} else if(myBrowser == "IE") {
		nonnewwincontrol = window.open(winurl,'','toolbar=no,height=' + winheight + ',width=' + winwidth + ',top=' + winY + ',left=' + winX + ',directories=no,status=no,scrollbars=no,resize=yes,menubar=no');
}
}

