//functions to launch a fullscreen page or fullscreen popup

	//check page size
	if (self.screen) {     
		width = screen.width
		height = screen.height
	}
	else if (self.java) {   
	 var javakit = java.awt.Toolkit.getDefaultToolkit();
	 var scrsize = javakit.getScreenSize();       
	 width = scrsize.width; 
	 height = scrsize.height; 
	}
	else {
	width = height = '' 
	}
			
	function daddyBrowserCheck() {
		var appName = navigator.appName;
		var userAgent = navigator.userAgent;
		var appVersion = navigator.appVersion;
		var platform = navigator.platform;
		
		this.isIE = (appName.indexOf("Microsoft Internet Explorer") != -1 || userAgent.indexOf("MSIE") != -1) ? true : false;
		this.isMoz = (appName.indexOf("Mozilla") != -1 ) ? true : false;
		this.isNS = (appName.indexOf("Netscape") != -1) ? true : false;
		this.isWin = (platform.indexOf("Win") != -1) ? true : false;
		this.isMac = (platform.indexOf("Mac") != -1) ? true : false;
		this.isUnix = (platform.indexOf("Unix") != -1) ? true : false;
		this.majorVersion = (this.isIE && appVersion.indexOf("MSIE") != -1) ? parseFloat(appVersion.substring(appVersion.indexOf("MSIE") + 4,appVersion.length)) : this.version = parseFloat(appVersion);
		this.minorVersion = (this.isIE && appVersion.indexOf("MSIE") != -1) ? parseInt(appVersion.substring(appVersion.indexOf("MSIE") + 4,appVersion.length)) : this.version = parseInt(appVersion);

	}
	
	//check browser
	browser = new daddyBrowserCheck()
		
	function popup(popupLink){
	
		var width, height;
		width = (parent.width) -10;
		height = (parent.height) - 8;
		
		// according to OS decide page size 
		if (browser.isMac != true) {
			if ((document.getElementById && !document.all) || ((navigator.appName=="Netscape" && theVersion<5) ? 1:0)) {
				height +=40;
			} else {
				width += 10;
				height += 6;
			}
		} else {
			if(document.getElementById && !document.all) {
				width +=4;
				height +=2;
			}
		}
		
		//launch pop up
		daddyWin = window.open(popupLink,"Daddy","left=0,top=0,width=" + width + ",height=" + height + ",fullscreen=no");

		if (daddyWin && (browser.isMac != true) && daddyWin.moveTo && daddyWin.resizeTo) {
			daddyWin.moveTo(0,0);
			daddyWin.resizeTo(width,height);
			daddyWin.focus();
		}
	}
	
	function fullscreen(popupLink){
		if(browser.isIE && browser.isWin){
			//launch fullscreen
			newWindow = window.open(popupLink,'levelfullscreen','fullscreen=yes,width=1024,height=768,top=0,left=0,location=0,scrollbars=auto,status=,toolbar=0,menubar=0');	
			//location.href=main.htm
		} else {
			if(browser.isMac){
				location.href=popupLink
			}else{	
				//if not win or IE launch popup
				popup(popupLink)
			}
		}
	}