
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
	obj.visibility=v; }
}

function ExtendLayer() { //v3.0
	obj = document.getElementById('mainmenu01');
	obj = obj.style;
	obj.height=250;
}

function positionLayer(layerID, imageName) { 

	// positions layer 'layerID' at the same coordinates as image 'imageName' 
	var xPos, yPos, myElement, myLayer; 
	if(document.layers) { // NN4.x 
	xPos = document.images[imageName].x; 
	yPos = document.images[imageName].y; 
	} else if(document.all) { // IE4/IE5 
	xPos = getXPos(document.images[imageName]); 
	yPos = getYPos(document.images[imageName]); 

	myLayer = document.all[layerID]; 
	} else { // ass-u-me W3 DOM 
	myElement = document.getElementById(imageName); 
	xPos = myElement.offsetLeft; 
	yPos = myElement.offsetTop; 

	myLayer = document.getElementById(layerID); 
	} 

	// position 
	if(document.layers) { 
	document.layers[layerID].moveTo(xPos, yPos); 
	} else { // ass-u-me DHTML-capable browser 
	myLayer.style.left = xPos + "px"; 
	myLayer.style.top = yPos + "px"; 
	} 

}

	
function CheckMouseOver(layerID){
	var xPos, yPos, myElement, myLayer; 
	myLayer = document.all[layerID]; 
	
	
}


function getXPos(thisObject) { 
	return((thisObject.offsetParent) ? (thisObject.offsetLeft + getXPos(thisObject.offsetParent)) : thisObject.offsetLeft); 
} 


function getYPos(thisObject) { 
	return((thisObject.offsetParent) ? (thisObject.offsetTop + getYPos(thisObject.offsetParent)) : thisObject.offsetTop); 

}

/* Hide Layer Example */
function hideLayer (layer, evt) { 
	if (document.layers) 
		layer.visibility = 'hide'; 
	else if (layer.contains && evt.toElement) { 
		if (!layer.contains(evt.toElement)) 
		{
		layer.style.visibility = 'hidden';
		MM_showHideLayers('mainmenu01OVERBackGround','','hide');
		MM_showHideLayers('mainmenu02OVERBackGround','','hide');
		MM_showHideLayers('mainmenu03OVERBackGround','','hide');
		MM_showHideLayers('mainmenu04OVERBackGround','','hide');
		MM_showHideLayers('mainmenu05OVERBackGround','','hide');
		}
	} 
	else if (layer.parentNode && evt.relatedTarget) { 
		if (!containsDOM(layer, evt.relatedTarget)) 
		{
		layer.style.visibility = 'hidden';
		MM_showHideLayers('mainmenu01OVERBackGround','','hide');
		MM_showHideLayers('mainmenu02OVERBackGround','','hide');
		MM_showHideLayers('mainmenu03OVERBackGround','','hide');
		MM_showHideLayers('mainmenu04OVERBackGround','','hide');
		MM_showHideLayers('mainmenu05OVERBackGround','','hide');
		} 
	} 
	
	
} 


function HideBackGround (layer1, layer2)
{	
	var topLayer, bottomLayer;
	
	topLayer = document.getElementById(layer1);
	bottomLayer = document.getElementById(layer2);
	bottomLayer.style.visibility == 'hidden';
	if (document.layers) 
	{
		if (topLayer.visibility == 'hide') 
		{ 
			bottomLayer.visibility == 'hide'; 
		}
	}	
	else 
	{
		if(topLayer.style.visibility == 'hidden')
		{
			bottomLayer.style.visibility == 'hidden';
		}
	}
	
	document.getElementById('mainmenu01OVERBackGround').style.visibility == 'hidden';
}

function containsDOM (container, containee) { 
	while (containee) { 
		if (container == containee) 
		return true; 
		containee = containee.parentNode; 
	} 
	return false; 

} 

function CalcSavings() {
    var WinSettings = "center:yes;resizable:yes;dialogHeight:435px;dialogWidth:575px"
    var WinOpenSettings = "height=435px, width=575px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcSavings.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/savings.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/savings.html", 0, WinOpenSettings);
    }
}
	
function CalcCollegeSavings() {
    var WinSettings = "center:yes;resizable:yes;dialogHeight:440px;dialogWidth:575px"
    var WinOpenSettings = "height=440px, width=575px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CollegeSaving.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtcollegesavings.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtcollegesavings.html", 0, WinOpenSettings);
    }
}
	
	function CalcRetirement() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:460px;dialogWidth:585px"
    var WinOpenSettings = "height=460px, width=585px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("RetirePlan.aspx", 0, WinSettings);
   	 var WindowArgs = window.showModalDialog("../calculators/qcbtretireplan.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtretireplan.html", 0, WinOpenSettings);
	
    }
    
}
	
	function CalcRothVsTrad() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:450px;dialogWidth:570px"
    var WinOpenSettings = "height=450px, width=570px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcRothVsReg.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtrothvsreg.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtrothvsreg.html", 0, WinOpenSettings);

    }
    
}

	function CalcTradtoRoth() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:450px;dialogWidth:570px"
    var WinOpenSettings = "height=450px, width=570px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcRothTrans.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtrothtrans.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtrothtrans.html", 0, WinOpenSettings);

    }
    
}
	
	function CalcHomeBudget() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:460px;dialogWidth:575px"
    var WinOpenSettings = "height=460px, width=575px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcHomeBudget.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbthomebudget.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbthomebudget.html", 0, WinOpenSettings);

    }
    
}
	
	function CalcCheckBook() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:460px;dialogWidth:575px"
    var WinOpenSettings = "height=460px, width=575px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcCheckbook.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtcheckbook.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtcheckbook.html", 0, WinOpenSettings);

    }
    
}
	function CalcPayOff() 
{
    var WinSettings = "center:yes;resizable:yes;dialogHeight:450px;dialogWidth:570px"
    var WinOpenSettings = "height=450px, width=570px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcPayOff.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtpayoff.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtpayoff.html", 0, WinOpenSettings);

    }
    
}
	
	function CalcAmortizing() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:400px;dialogWidth:570px"
    var WinOpenSettings = "height=400px, width=570px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcAmortising.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtamortizing.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtamortizing.html", 0, WinOpenSettings);

    }
    
}
	function CalcAutoVsHome() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:465px;dialogWidth:570px"
    var WinOpenSettings = "height=465px, width=570px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcAutoVsHome.aspx", 0, WinSettings);
   	var WindowArgs = window.showModalDialog("../calculators/qcbtautovshome.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtautovshome.html", 0, WinOpenSettings);

    }
    
}
	function CalcConsolidate() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:470px;dialogWidth:575px"
    var WinOpenSettings = "height=470px, width=575px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcConsolidate.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtconsolidate.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtconsolidate.html", 0, WinOpenSettings);

    }
    
}
	
	function CalcBuyVsLease() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:470px;dialogWidth:570px"
    var WinOpenSettings = "height=470px, width=570px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcBuyVsLease.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtbuyvslease.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtbuyvslease.html", 0, WinOpenSettings);

    }
    
}
	
	function CalcPaymentOptions() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:435px;dialogWidth:570px"
    var WinOpenSettings = "height=435px, width=570px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcPaymentoptions.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtpaymentoptions.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtpaymentoptions.html", 0, WinOpenSettings);

    }
    
}
	
	function CalcCreditLine() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:460px;dialogWidth:550px"
    var WinOpenSettings = "height=460px, width=550px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcCreditLine.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtcreditline.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtcreditline.html", 0, WinOpenSettings);

    }
    
}
	
	function CalcMortgageQualifier() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:580px;dialogWidth:566px"
    var WinOpenSettings = "height=580px, width=566px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcMortgageQualifier.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtmortgagequalifier.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtmortgagequalifier.html", 0, WinOpenSettings);
	
    }
    
}
	function CalcRentVsBuy() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:580px;dialogWidth:566px"
    var WinOpenSettings = "height=580px, width=566px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcRentVsBuy.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtrentvsbuy.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtrentvsbuy.html", 0, WinOpenSettings);
	
    }
    
}
	function Calc15Vs30() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:440px;dialogWidth:566px"
    var WinOpenSettings = "height=440px, width=566px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("Calc15Vs30Mortgage.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbt15vs30mortgage.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbt15vs30mortgage.html", 0, WinOpenSettings);
	
    }
    
}

	function CalcPayOffMortgage() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:500px;dialogWidth:567px"
    var WinOpenSettings = "height=500px, width=567px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcPayOffMortgage.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtpayoffmortgage.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtpayoffmortgage.html", 0, WinOpenSettings);
	
    }
    
}
	function CalcRefinanceBreakEven() 
{
    
    var WinSettings = "center:yes;resizable:yes;dialogHeight:580px;dialogWidth:567px"
    var WinOpenSettings = "height=580px, width=567px, resizable=yes"
    //ALTER BELOW LINE - supply correct URL for Child Form
    if (window.showModalDialog) {
    	//var WindowArgs = window.showModalDialog("CalcRefinanceBreakEven.aspx", 0, WinSettings);
    	var WindowArgs = window.showModalDialog("../calculators/qcbtrefinancebreakeven.html", 0, WinSettings);
    } else {
	var WindowArgs = window.open("../calculators/qcbtrefinancebreakeven.html", 0, WinOpenSettings);
	
    }
    
}
	
	function popupLeavingSite(url) {
		window.open('popup.aspx?url='+ url,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=484,height=321,left=50,top=50');
	}


	function continueToExternalWindow(url){
        window.opener.location.href=url;
		window.close();
	}
	
	function popupECashMFAHandler()
	{
		var objDDL = document.Form1.ddlLogin;
		switch(objDDL.options[objDDL.selectedIndex].text)
	{
		case "Personal eCash":
			window.location = objDDL.options[objDDL.selectedIndex].value;
			window.open("popupECashMFA.aspx","eCashPopup","width=1024,height=680,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable,left=0,top=0");
			break;
		case "Business eCash":
			window.location = objDDL.options[objDDL.selectedIndex].value;
			window.open("popupECashBusMFA.aspx","eCashPopup","width=1024,height=680,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable,left=0,top=0");
			break;
		default:
			if (objDDL.options[objDDL.selectedIndex].value != "")
			{
				window.location = objDDL.options[objDDL.selectedIndex].value;
			}
			break;
	}
	return false;
}  

function Redirect()
{
	var d = new Date();
	if (d.getMonth()+1 == 5 && d.getDate() == 4 &&  d.getYear() == 2008 &&  d.getHours() > 1 && d.getHours() < 7)
	{
		window.location = "https://www.crbt.com/personalsolutions/ecashmaint.aspx?section=02&sub=01"
		//alert(d.getMonth()+1 + "/" + d.getDate() + "/" + d.getYear());
	}else
	{
		window.location = "https://ec71.arl-tsg.com/crbt-rtl/"
		//alert(d.getMonth()+1 + "/" + d.getDate() + "/" + d.getYear() + " " +  d.getHours() );
	}

}

function RedirectBiz()
{
	var d = new Date();
	if (d.getMonth()+1 == 5 && d.getDate() == 4 &&  d.getYear() == 2008 &&  d.getHours() > 1 && d.getHours() < 7)
	{
		window.location = "https://www.crbt.com/personalsolutions/ecashmaint.aspx?section=02&sub=01"
		//alert(d.getMonth()+1 + "/" + d.getDate() + "/" + d.getYear());
	}else
	{
		window.location = "https://ec71.arl-tsg.com/crbt-comm/"
		//alert(d.getMonth()+1 + "/" + d.getDate() + "/" + d.getYear() + " " +  d.getHours() );
	}

}