/* 
	File Name: 			popup.js
	Author: 			Domenic Polsoni - FabulousSavings.com
	Date Created:  		2007/03/15
	Modified History:	2008/05/29 (ML)
*/

function openWindow(u)
{
	var url = u;

	var screenW = -1;
	var screenH = -1;

	//check for the properties existence before trying to access it
	if ((screen) && (screen.width) && (screen.height)) {
		screenW = (screen.width / 2) - 356;
		screenH = (screen.height / 2) - 300;
	}
	//make sure the window will not be placed off screen on very small resolutions
	if (screenW < 0){
		screenW = 0;
	}
	if (screenH < 0){
		screenH = 0;
	}
	if (window.open) {
		winRef = window.open(url,"popup","height=600,width=732,scrollbars=yes,menubar=no,titlebar=yes,screenX="+screenW+",screenY="+screenH+",top="+screenH+",left="+screenW+"");
		if (window.focus){
			winRef.focus(); //in cases where the window has been openned but moved to the background
		}
	}
}

function writePrivacyLink(){
	if ((document) && (document.write) && (window) && (window.close)){
		document.write("<a href=\"Javascript: openWindow('../privacy/index.html');\">Privacy Policy</a>");
	}
}