var width;
var height;

function popup(url)
{
	popup(url, null, null);
}

function popup(url, width, height)
{
	popup(url, width, height, null);
}

function popup(url, width, height, toolbar)
{
	popup(url, width, height, toolbar, null);
}
function popup(url, width, height, toolbar, resizable)
{
	popup(url, width, height, toolbar, resizable, null);
}
function popup(url, width, height, toolbar, resizable, scrollbar)
{
    resizable = 'yes';
    var xMax = 1024, yMax=768;
	if (document.all || document.layers)
	{
        var xMax = screen.availWidth, yMax = screen.availHeight;
    }

	var xPopup=600;
	var yPopup=800;
	var toolbarVar=1;
	var resizableVar=1;
	var scrollbarVar=1;

	if(width != null && width <= xMax) xPopup = width;
	if(height != null && height <= yMax) yPopup = height;
	if(toolbar != null) toolbarVar = toolbar;
	if(resizable != null) resizableVar = resizable;
	if(scrollbar != null) scrollbarVar = scrollbar;

    var xOffset = (xMax - xPopup) / 2, yOffset = (yMax - yPopup) / 2;

	var popup;
    popup = window.open(url,'popup','width='+xPopup+',height='+yPopup+',toolbar='+toolbarVar+',scrollBars='+scrollbarVar+',status=no,resizable='+resizableVar+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset);
    if (!popup.opener)
         popup.opener = self;
    if (popup.focus) popup.focus();
}


function popupCover(url, width, height)
{
	popupWidth = (width) ? width : 760;
	popupHeight = (height) ? height : null;

	popup(url, popupWidth, popupHeight, 0, 0);
}

function popupLearnmore(url)
{
	popup(url, 660, 780);
}

function popupReqs(url)
{
	popup(url, 640, 760, 0, 0);
}

function popupTermsPromo(url)
{
	openWindow(url, 450, 200, 0, 0);
}

function popupPolicy(url)
{
	openWindow(url, 600, 600, 0, 0);
}

function popupFlashtour(url)
{
	openWindow(url, 895, 600, 0, 0);
}




function openWindow(url)
{
	openWindow(url, null, null);
}
function openWindow(url, width, height)
{
	openWindow(url, width, height, null);
}
function openWindow(url, width, height, toolbar)
{
	openWindow(url, width, height, toolbar, null);
}
function openWindow(url, width, height, toolbar, resizable)
{
	openWindow(url, width, height, toolbar, resizable, null);
}
function openWindow(url, width, height, toolbar, resizable, scrollbar)
{
    resizable = 'yes';
    var xMax = 1024, yMax=768;
	if (document.all || document.layers)
	{
        var xMax = screen.availWidth, yMax = screen.availHeight;
    }

	var xPopup=600;
	var yPopup=800;
	var toolbarVar=1;
	var resizableVar=1;


	if(width != null && width <= xMax) xPopup = width;
	if(height != null && height <= yMax) yPopup = height;
	if(toolbar != null) toolbarVar = toolbar;
	if(resizable != null) resizableVar = resizable;

	var xOffset = (xMax - xPopup) / 2, yOffset = (yMax - yPopup) / 2;

	var win;
	win = window.open(url,'window','width='+xPopup+',height='+yPopup+',toolbar='+toolbarVar+',location,directories,status,scrollbars,menubar,resizable='+resizableVar+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'')
	if (!win.opener)
         win.opener = self;
    win.focus();
}


function checkCountry(theVal)
{
	document.updateform.cmd.value='none';
	var validateZip = document.updateform.validateZip.value;

	if ((theVal == 'US' || theVal == 'CA' || theVal == 'XXC')
        && (validateZip == 'false' || validateZip != theVal))
	{
		document.updateform.cmd.value='change';
		document.updateform.validateZip.value=theVal;
		document.updateform.submit();
	} else if((theVal != 'US' && theVal != 'XXC') && (	validateZip=='US' ||
														validateZip=='XXC'))
	{
		document.updateform.cmd.value='change';
		document.updateform.validateZip.value='false';
		document.updateform.contacts_state.value='';
		document.updateform.submit();
	}
}

function chase()
{
//var xx = screen.width / 2;
var xx=785;
//var yy = screen.height / 5;
var yy=480;
var newWindow = window.open('http://creditcardsatchase.com/portal/site/marketing/index.jsp?pgTitle=pg_creditcardhome',null, 'left=0,top=0,screenX=0,screenY=0,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+xx+',height='+yy);
newWindow.blur();
}




// JavaScript to interpolate random background images into a page.

 var ic = 2;     // Number of alternative background images

 var bgimg = new Array(ic);  // Array to hold filenames

        

bgimg[0] = "http://imgs.zinio.com/images/search_bkg_1.jpg";

bgimg[1] = "http://imgs.zinio.com/images/search_bkg_2.jpg";

<!---bgimg[2] = "http://imgs.zinio.com/images/search_bkg_3.jpg";--->

 

 

function pickRandom(range) {

if (Math.random)

return Math.round(Math.random() * (range-1));

else {

var now = new Date();

return (now.getTime() / 1000) % range;

}

}

var choice = pickRandom(ic);

document.write('<style type="text/css">');

document.write('.searchBkg {background-image:url('+bgimg[choice]+');}');

document.write('</style>');



function text_button() {

    document.ageVerificationForm.submit();

}

