$(document).ready(function(){
		$("a").filter(".popup").click(function(){
			this.blur();
			popWin(this.href);
			return false;
		});
});

function popWin(url) {
	var w = 380;
	var h = 390;
	var centerW = (window.screen.width - w) / 2; 
	var centerH = (window.screen.height - h) / 2;
	var newWindow = window.open(url, 'Fandango', 'resizable=0,scrollbars=no,width=' + w + ',height=' + h + ',left=' + centerW + ',top=' + centerH);
	if (newWindow != null)
	{
		newWindow.focus();
	}
}

function defaultPopup(url, windowName) {
	var w = 990;
	var h = 560;
	var centerW = (window.screen.width - w) / 2; 
	var centerH = (window.screen.height - h) / 2;
	
	if (windowName == null)
	{
		windowName = 'Fandango';
	}
	
	var newWindow = window.open(url, windowName, 'resizable=yes,scrollbars=yes,width=' + w + ',height=' + h + ',left=' + centerW + ',top=' + centerH);
	if (newWindow != null)
	{
		newWindow.focus();
	}
}

function customPopup(url, windowName, width, height) {    
	var centerW = (window.screen.width - width) / 2; 
	var centerH = (window.screen.height - height) / 2;
	
	if (windowName == null)
	{
		windowName = 'Fandango';
	}
	
	var newWindow = window.open(url, windowName, 'resizable=yes,scrollbars=yes,width=' + width + ',height=' + height + ',left=' + centerW + ',top=' + centerH);
	if (newWindow != null)
	{
		newWindow.focus();
	}
}

function largePopup(url) {
    defaultPopup(url, 'PurchaseFooterPopup');
}

function faqPopup(url) {
	var w = 800;
	var h = 500;
	var centerW = (window.screen.width - w) / 2; 
	var centerH = (window.screen.height - h) / 2;
	var newWindow = window.open(url, 'Fandangofaq', 'resizable=0,scrollbars=yes,width=' + w + ',height=' + h + ',left=' + centerW + ',top=' + centerH);
	if (newWindow != null)
	{
		newWindow.focus();
	}
}

