// A blank HTML file /includes/blank.htm should be included for the frames option to function properly
/* usage:-
<a href="page.htm" onclick="popItUp(this,'Page Title','no',500,500);return false;" target="_blank">
	this, - URL
	'Page Title', - page title for frames version
	'no', - show menu bars etc. (yes/no)
	500,500, - width and height
	true, - use framed version (true/false)
	false, - use cache buster (true/false with ASP) 
	true - Pages are printable (true/false - from same domain only)
*/
//global vars
var myWin1=null;
var myWin2=null;

function popItUp(file_url,file_title,menu_bar,xwide,yhigh)
{
  if(file_title == "Interest Rate Calculator")
  {

	  myWin1=window.open(file_url,'myWin1','toolbar='+menu_bar+',location='+menu_bar+',directories='+menu_bar+',status='+menu_bar+',menubar='+menu_bar+',scrollbars='+menu_bar+',resizable='+menu_bar+',copyhistory=no,width='+xwide+',height='+yhigh);
	   
	  setTimeout('myWin1.focus();myWin1.resizeTo('+xwide+','+yhigh+');',250);
	  //myWin1.focus();
	  return myWin1
	}
  if(file_title == "Savings Selector")
  {

	  myWin2=window.open(file_url,'myWin2','toolbar='+menu_bar+',location='+menu_bar+',directories='+menu_bar+',status='+menu_bar+',menubar='+menu_bar+',scrollbars='+menu_bar+',resizable='+menu_bar+',copyhistory=no,width='+xwide+',height='+yhigh);
	  
	  setTimeout('myWin2.focus();myWin2.resizeTo('+xwide+','+yhigh+'); ',250);
	  //myWin2.focus();
	  return myWin2
	}
}

function resize()
{
//window.moveTo(200,250)
window.moveTo(100,150)
window.resizeTo(900,675)
//window.resizeTo(850,740)
}

function returnSelector()
{
window.moveTo(450,250)
window.resizeTo(366,346)
}

function remote2(url){
window.opener.location=url;
window.opener.focus();
}


//popup for eSaver


var eSaverPage = false;

function setCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function getCookie(name) {
	var nameTemp = name + "=";
	var cArray = document.cookie.split(';');
	for(var i=0;i < cArray.length;i++) {
		var c = cArray[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameTemp) == 0) return c.substring(nameTemp.length,c.length);
	}
	return null;
}

function killCookie(name) {
	setCookie(name,"",-1);
}

function myPopup() {
   if(eSaverPage==true && !getCookie('popUpCookie')) {
   //setCookie('popUpCookie','true',0)
   mywindow = window.open ("/questionnaire.aspx","mywindow","location=0,status=0,scrollbars=0,width=510,height=595");
   mywindow.moveTo(0,0);}
}
