document.write('<script type="text/javascript" src="Javascript/browserDetection.js"></script>');

function popUp(URL) {
	var index = URL.indexOf('?');
	var fileName;
	if (index > 0) {
		fileName = Left(URL, index);
	} else {
		fileName = URL;
	}
	
	var width, height;
	if (fileName == 'eazyxray.cfm') {
		width = 825;
		height = 635;
	} else if (fileName == 'eazytyper.cfm') {
		width = 625;
		height = 230;
	} else if (fileName == 'interac_printable.cfm') {
		width = 680;
		height = 350;
	} else if (fileName == 'products_benefits.cfm#eazylibrary') {
		width = 750;
		height = 505;
	} else if (fileName == 'wordCount.cfm') {
		width = 560;
		height = 690;
	} else if (fileName == 'demo.cfm') {
		popUpDemo(URL);
		return;
	} else {
		width = 100;
		height = 100;
		alert ("unknown URL for javascript\popup.js " + fileName);
	}

	day = new Date(); id = day.getTime(); 
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,statusbar=0,menubar=0,resizable=0,width=" + width + ",height=" + height + ",left = 137,top = 144');");
}

function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}

function popUpDemo(theURL) {
	var windowprops;
	if (navigator.appName == "Microsoft Internet Explorer" && screen.height < 800){ // better be ie6 at least
		windowprops = "fullscreen=yes";
	} else {
		var height = 680;
		
		BrowserDetect.init();
		if (BrowserDetect.browser == "Chrome") {
			height = (screen.height == 800) ? 701 : 684;
		}
		windowprops = "menubar=no,statusbar=no,locationbar=no,toolbar=no,width=1277,height=" + height;
	}

	var scrollbars = (screen.height < 800) ? "yes":"no";
	windowprops = windowprops + ",scrollbars=" + scrollbars;
	window.open(theURL, '', windowprops);
}	

