function popupWindow(URL,setWidth,setHeight) {

	var winl   = (screen.width-setWidth)/2;
	var wint   = (screen.height-setHeight)/2;
	newWindow  = window.open(URL, "NewWin", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+setWidth+',height='+setHeight+',top='+wint+',left='+winl);			

	setTimeout('checkpopup(newWindow)',1500);  // Wait a second or so and see if the window is still around -- DML

}//End popupWindow

// Checks to see if our popup window is still present.  If not, its likely due to a popup blocker and we
// need to let the person know.  It could also be due to them quickly closing the window, but no likely
function checkpopup(mywin) {

	try {
		if (mywin.opener)  {
			mywin.focus() ;	// Make sure they see this bad boy in case it was already open
		}

	} catch (error) {

		alert("Display of requested webpage aborted -- probably due to a webpage popup blocker.\n" +
		      "Please disable the blocker and try again.") ;
	}
}


function whichBrowser(){
	var intBrowser = "";
	var nVer = navigator.appVersion;
	var nAgt = navigator.userAgent;
	
	var fullVersion = parseFloat(nVer);
	var majorVersion = parseInt(nVer);
	
	// In Internet Explorer, the true version is after "MSIE" 
	
	if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
		 fullVersion = parseFloat(nAgt.substring(verOffset+5,nAgt.length));
		 majorVersion = parseInt(''+fullVersion);
	}//End if
	
	// In Opera, the true version is after "Opera"
	
	if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
		 fullVersion = parseFloat(nAgt.substring(verOffset+6,nAgt.length));
		 majorVersion = parseInt(''+fullVersion);
	}//End if
	
	if ( majorVersion >= 5){
		
		if (navigator.appName.indexOf("Netscape") != -1){
			intBrowser = 1;
		}else if (navigator.appName.indexOf("Microsoft") != -1){
			intBrowser = 2;
		}//End if
		
	}else{
		intBrowser = 3;
	}//End if
	
	return intBrowser;

}//End whichBrowser()

function defineBackground(){
	 
	 var intBrowser = 0;
	 var htmlHeight = 0;
	 var windowHeight = 0;
	
	 var frame = document.getElementById("main-background");
	 
    intBrowser = whichBrowser();

	if(intBrowser < 3){
		
		htmlHeight = document.body.clientHeight;
		windowHeight = window.screen.height;  
		
		if(htmlHeight < windowHeight){
			document.body.style.height = windowHeight + "px"; frame.style.height = windowHeight + "px"; 
		}else{
			document.body.style.height = htmlHeight + "px"; frame.style.height = htmlHeight + "px"; 
		}
		
		if ( htmlHeight < windowHeight ){ 
			document.body.style.height = windowHeight + "px"; frame.style.height = windowHeight + "px"; 
		}else{ 
			document.body.style.height = htmlHeight + "px"; frame.style.height = htmlHeight + "px"; 
		} 		
	
	}//End if

}//End defineBackground()	

function noLicenseMsg(){
	alert("We're sorry - all of today's licenses have already been granted. Check back tomarrow - free licenses are replenished daily at 12:00 AM ET.");	
}