/*************Image preloading changes Start*************************/
if (document.images)
	{	
		
		
		image_url = new Array();
		var Portfolio;
		if( Portfolio == "GM" || Portfolio == "EF" || Portfolio == "FX"){	
			// Added en_US_ for fixing 404 Feb 2009 Release Start
			image_url[0] = "/ecare/images/nav_view_acct_hov_en_US_" + Portfolio + ".gif";
			image_url[1] = "/ecare/images/nav_stmnt_ctr_hov_en_US_" + Portfolio + ".gif";
			image_url[2] = "/ecare/images/nav_paymnt_ctr_hov_en_US_" + Portfolio + ".gif";
			image_url[3] = "/ecare/images/nav_cust_serv_hov_en_US_" + Portfolio + ".gif";
			image_url[4] = "/ecare/images/nav_mng_prof_hov_en_US_" + Portfolio + ".gif";
			// Added en_US_ for fixing 404 Feb 2009 Release End
			image_url[5] = "/ecare/images/nav_view_acct_on_en_US_" + Portfolio + ".gif";
			image_url[6] = "/ecare/images/nav_stmnt_ctr_on_en_US_" + Portfolio + ".gif";
			image_url[7] = "/ecare/images/nav_paymnt_ctr_on_en_US_" + Portfolio + ".gif";
			image_url[8] = "/ecare/images/nav_cust_serv_on_en_US_" + Portfolio + ".gif";
			image_url[9] = "/ecare/images/nav_mng_prof_on_en_US_" + Portfolio + ".gif";
			image_url[10] = "/ecare/images/nav_view_acct_off_en_US_" + Portfolio + ".gif";
			image_url[11] = "/ecare/images/nav_stmnt_ctr_off_en_US_" + Portfolio + ".gif";
			image_url[12] = "/ecare/images/nav_paymnt_ctr_off_en_US_" + Portfolio + ".gif";
			image_url[13] = "/ecare/images/nav_cust_serv_off_en_US_" + Portfolio + ".gif";
			image_url[14] = "/ecare/images/nav_mng_prof_off_en_US_" + Portfolio + ".gif";
			image_url[15] = "/ecare/images/arrow_nav_right.gif";
		}else
		{
		
			image_url[0] = "/ecare/images/tab_left_" + Portfolio + ".gif";
			image_url[1] = "/ecare/images/tab_right_" + Portfolio + ".gif";
			image_url[2] = "/ecare/images/tab_left_hover_" + Portfolio + ".gif";
			image_url[3] = "/ecare/images/tab_right_hover_" + Portfolio + ".gif";
			image_url[4] = "/ecare/images/arrow_nav_right.gif";
			
	
		}
		var i = 0;
		for(i=0; i<image_url.length; i++) {
			preload_image_object = new Image();
			preload_image_object.src = image_url[i];
		}	
}

/*************Image preloading changes ends*************************/

/*************May 08 chnages Start*************************/	  
/*************May 08 chnages Start*************************/	  
 function veridAutoTabFLP(veridFlow, securityFlag)
	{
		if(securityFlag=="false" && veridFlow=="true"){		   
			document.getElementById("ForgotLoginIdPwdConfirmForm").primaryQuestionId.focus();
		}else{
			document.getElementById("ForgotLoginIdPwdConfirmForm").cmd_ForgotLoginIdPwdEnd.focus();
		}
	} 
  
  function veridAutoTabEnrollment(fieldname)
	{
		if(!isOnlineActivation && !document.getElementById("enroll").rd[0].checked){
			document.getElementById("enroll").initialname.focus();
		}else{
			
			eval('document.getElementById(\"enroll\").focus()');
		}
	}

  function updateIdentificationfileld(cardTypeName){
	if(cardTypeName=='Y')
	{
		document.getElementById("spc").style.display= 'block';
		document.getElementById("enroll").rd1.disabled=true;
		document.getElementById("enroll").rd2.disabled=true;
		document.getElementById("enroll").dateExpiryMonth.disabled=true;
		document.getElementById("enroll").DateExpiryYear.disabled=true;
		document.getElementById("enroll").signaturePanelCode.disabled=true;
		document.getElementById("enroll").initialname.disabled=true;
		document.getElementById("enroll").initialname.style.backgroundColor='#ececec';
		document.getElementById("enroll").signaturePanelCode.style.backgroundColor='#ececec';
	}
	else if(cardTypeName=='N')
	{
		document.getElementById("spc").style.display= 'none';
		document.getElementById("enroll").rd1.disabled=false;
		document.getElementById("enroll").rd2.disabled=false;
		document.getElementById("enroll").dateExpiryMonth.disabled=false;
		document.getElementById("enroll").DateExpiryYear.disabled=false;
		document.getElementById("enroll").signaturePanelCode.disabled=false;
		document.getElementById("enroll").initialname.disabled=false;
	}
	else if(cardTypeName=='null')
	{
		if(document.getElementById("enroll").rd1.checked)								
		{
			document.getElementById("spc").style.display= 'none';
			document.getElementById("enroll").dateExpiryMonth.disabled=false;
			document.getElementById("enroll").DateExpiryYear.disabled=false;
			document.getElementById("enroll").signaturePanelCode.disabled=false;
			document.getElementById("enroll").initialname.disabled=true;
		}
		else if(document.getElementById("enroll").rd2.checked)
		{
			document.getElementById("spc").style.display= 'block';
			document.getElementById("enroll").dateExpiryMonth.disabled=true;
			document.getElementById("enroll").DateExpiryYear.disabled=true;
			document.getElementById("enroll").signaturePanelCode.disabled=true;
			document.getElementById("enroll").initialname.disabled=false;
		}
	}			
}	
	
	function showhide()
	{
		if(!isOnlineActivation && document.getElementById("enroll").rd[0].checked)
		{
			document.getElementById("enroll").rd[0].disabled=false;
			document.getElementById("enroll").rd[1].disabled=false;
			document.getElementById("enroll").dateExpiryMonth.disabled=false;
			document.getElementById("enroll").DateExpiryYear.disabled=false;
			document.getElementById("enroll").signaturePanelCode.disabled=false;
			document.getElementById("enroll").initialname.disabled=true;
			document.getElementById("enroll").initialname.style.backgroundColor='#ececec';
			document.getElementById("enroll").signaturePanelCode.style.backgroundColor='#ffffff';
			document.getElementById("spc").style.display= 'none';
		}else if(!isOnlineActivation  && document.getElementById("enroll").rd[1].checked  )
		{
			document.getElementById("enroll").rd[0].disabled=false;
			document.getElementById("enroll").rd[1].disabled=false;
			document.getElementById("enroll").dateExpiryMonth.disabled=true;
			document.getElementById("enroll").DateExpiryYear.disabled=true;
			document.getElementById("enroll").signaturePanelCode.disabled=true;
			document.getElementById("enroll").initialname.disabled=false;
			document.getElementById("enroll").initialname.style.backgroundColor='#ffffff';
			document.getElementById("enroll").signaturePanelCode.style.backgroundColor='#ececec';
			document.getElementById("spc").style.display= 'block';
		}

	}
/*************May 08 chnages Start*************************/	  
function onMouseOut()
	{
		self.status="";
		return true;
	}
	
function winOpen(targetAddress)
	{
			window.open(targetAddress);
	}
function onMouseOver()
	{
		self.status="BalanceTransfer";
		return true;
	}
function OpenNewWin(page) {
   		 OpenWin = this.open(page, "SafekeeperWnd", "toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes,width=700,height=400");
	}
	
function openWhatisThis(url) 
	{
	var linkWin = false
	if (linkWin && !linkWin.closed)
    {
    	linkWin.close();
    }

    linkWin = window.open(url,'','width=340,height=240,scrollbars=no,toolbar=no, resizable=yes');

	if (!linkWin.opener) linkWin.opener = self;
	}	
	
	function openNewWindow(target)
	{
		window.open(target);
	}	
	
		function openTC(urlTC)
	{
		window.open('/ecare/lmsenrolltc' + '?&pageURL=' + urlTC, 'Terms_And_Conditions', 'width=700,height=400,toolbar=no,resizable,location=no,scrollbars');
	}
	
function closeIt() {
   self.close()
    }	
    
function emailUs(){
		
		if (loggedIn)
		{
			var link = "/ecare/customerservice/submitquestion1"  ;
		}
		else
		{
			  var link = "/ecare/contactus/emailus1";
		}
		document.getElementById("EmailUs").action = link;
		document.getElementById("EmailUs").submit();
		}	
		
function launchWhatsThis(url){
                window.open(url, "reader", "width=360,height=220,scrollbars=yes");
          }	
          
          
function openSampleEmail(){
			openWin=window.open('','win1','toolbar=no,location=no,scrollbars=yes,resizable=1,width=600,height=465,screenX=200,screenY=225,top=200,left=200');
			openWin.document.open();
			openWin.document.write( '<html>'+
                                    '<head></head>'+
                                    '<body><table width="100%">'+
                                    	'<tr><th align="right"><span style="font-size:.9em"><a href="javascript:window.close()">Close This Window</a></span>'+
                                    	'</th></tr>'+
                                    	'<tr><th><img alt="" src="/ecare/images/cc_ReferFriend_Email.gif">'+
                                    	'</th></tr>'+
                                    	'</table>'+
                                    '</body>'+
                                    '</html>');
            openWin.document.close();
	}
	
	function viewImage(image)
 	{
    	if (image != '')
    	{
			openWin=window.open('','win1','toolbar=no,location=no,scrollbars=yes,resizable=no,width=415,height=465,screenX=200,screenY=225,top=200,left=200');
			openWin.document.open();
			openWin.document.write( '<html>'+
                                    '<head></head>'+
                                    '<body><img alt="" src="' + image + '">'+
                                    '</body>'+
                                    '</html>');
            openWin.document.close();
     	}
   	}	
   	
   	    function viewWirelessImage(image,title)
    {
		if (image != '')
		{
			openWin=window.open('','','toolbar=no,location=no,scrollbars=no,resizable=no,width=135,height=135,screenX=200,screenY=225,top=200,left=200');
	   		openWin.document.open();
  			openWin.document.write( '<html>'+
                                    '<head></head>'+
                                    '<title>'+title+'</title>'+
                                    '<body>'+
                                    '<IMG SRC="' + image + '">'+
                                    '</body>'+
                                    '</html>');
            openWin.document.close();
     	}
   	}
   	function closeWindow()
	{
		if (openWin != null)
		{
		    openWin.close()
  		}
  	}
   	function actionClick(action)
	{   
		document.getElementById("batchform").currentpage.value = document.getElementById("batchform").currentpageField.value;
		document.getElementById("batchform").directionFlag.value = action;	
	 	document.getElementById("batchform").action='/ecare/accountservices/referafriendpagination';
	 	document.getElementById("batchform").method='post';
	 	appendBrandToForms();			
		document.getElementById("batchform").submit();
	}     
	
	function changeAccount(index, page)
	{
	
		var acountNums = document.getElementById("frmCustomerInformation").selectAcctList.options;
		var selectedAccNum = acountNums[acountNums.selectedIndex].value;
		var brandStr = brandArray[selectedAccNum];
		var localeStr = localeArray[selectedAccNum];
		brand = brandStr;
		locale = localeStr;
				
		shortAccountNumber = document.getElementById("frmCustomerInformation").selectAcctList.options[index].text;
		document.getElementById("frmCustomerInformation").action=page;
		appendBrandToForms();
		document.getElementById("frmCustomerInformation").submit();
	}	
		   
	   
function btOfferPopUp(URL)
	{
		var destUrl=URL;
		var openWin=window.open(destUrl, 'QuitBalanceTransfer', 'toolbar=no,location=no,scrollbars=no,resizable=no,width=300,height=100,screenX=200,screenY=200,top=200,left=300');
		openWin.focus();
	}	
	
	function setDefaultSelected()
			{
				if (typeof(document.StandardOnlinePayment)!="undefined")
				{
					document.getElementById("StandardOnlinePayment").selectOnlinePayment.options[0].selected=true;
				}
				if (typeof(document.getElementById("MakeAPayment"))!="undefined")
				{
					document.getElementById("MakeAPayment").selectAPayment.options[0].selected=true;
				}
			}
			
			function checkEnableStatus(objSelected, objButton)
			{
				if(objSelected.selectedIndex == 0)
				{
					objButton.disabled = true;
				}
				else
				{
					objButton.disabled = false;
					objButton.focus()
				}
			}
			
function choiceRadio()
{
	document.getElementById("RedemptionForm3").method="post";
	document.getElementById("RedemptionForm3").action="<%=CCSUrlConstants.REDEMPTION_CHOICE_URL%>";
	document.getElementById("RedemptionForm3").submit();
}

function checkSelectedOffers()
{
	var frmOffer = document.getElementById("lmsenrollment");
	var frmSelectedOffer = frmOffer.rdo_lmsOfferGrp;
	var offerLen = frmSelectedOffer.length;
	for(i = 0; i < offerLen; i++)
	{
		if(frmSelectedOffer[i].checked)
		{
			document.getElementById("lmsenrollment").action = (frmSelectedOffer[i].value == "No_Thanks") ? "/ecare/manageyouraccount" : "/ecare/lmsenrollend";
			//document.getElementById("lmsenrollment").action=frmOffer.LMSEnrollmentEnd.name;
			appendBrandToForms();   
	        document.getElementById("lmsenrollment").submit();
			
		}
	}
}


function navigateTC()
{
	var frmOffer = document.getElementById("lmsenrollment");
	var frmSelectedOffer = frmOffer.rdo_lmsOfferGrp;
	var offerLen = frmSelectedOffer.length;
	for(i = 0; i < offerLen; i++)
	{
		if(frmSelectedOffer[i].checked)
		{
			urlTC = frmSelectedOffer[i].value;
			if(urlTC != "No_Thanks")
			{

				urlTC = urlTC.substring(0,5);
				window.open('/ecare/lmsenrolltc' + '?&pageURL=' + urlTC, 'Terms_And_Conditions', 'width=500,height=300,toolbar=no,resizable,location=no,scrollbars');
			}
		}

	}
}


function doRedirect()
			{
				document.getElementById("AccountOverviewRedirect").submit();
			}
			
function MM_openBrWindow(theURL,winName,features) 
			{ //v2.0
              window.open(theURL,winName,features);
            }
         
function getHttpsBaseUrl(command)
            {
          		window.location.href = command;
			}			

	function openTCSegment(schemeID,segID)
	{
		window.open('/ecare/lmsenrolltc?&pageURL=' + schemeID + '&segURL=' + segID, 'Terms_And_Conditions', 'width=700,height=400,toolbar=no,resizable,location=no,scrollbars');
	}

	
	
	function openFAQ(urlFAQ)
	{
		window.open('/ecare/lms_rewards_faq?&pageURL=' + urlFAQ, 'Rewards_Questions', 'width=700,height=400,toolbar=no,resizable,location=no,scrollbars');
	}
  

   function openFAQSegment(schemeID,segID)
	{
		window.open('/ecare/lms_rewards_faq?&pageURL=' + schemeID +'&segURL=' + segID, 'Rewards_Questions', 'width=700,height=400,toolbar=no,resizable,location=no,scrollbars');
	}

    
    function showErrorWin(url)
	{
	var errorlinkWin;
		if (errorlinkWin && !errorlinkWin.closed)
		{
			errorlinkWin.close();
		}
		errorlinkWin=window.open(url,'currentStatus','width=340,height=240,scrollbars=no,toolbar=no ');
		if (!errorlinkWin.opener) 
		{
			errorlinkWin.opener = self;
		}
    }

	function openPopUp(url) {
		
		window.open(url,'','width=700,height=400,toolbar=1, menubar=1, resizable=1,location=yes,status=yes');
		
	}	

	function onHRefClick()
            {
	            var objFrame = document.getElementById("cframe");
	            objFrame.src = "<%=pdfStmtURL %>";
	            return false;
            }	  
	function openWindow(theURL, winName, features)
	{
	  window.open(theURL,winName,features);
	}     	

	function MM_openBrWindow(theURL,winName,features) 
		{ //v2.0
	              window.open(theURL,winName,features);
        }

/*************FEB 08 chnages***********************************************************************************************************/	  
var formSubmitted = false;
function submitAction(actionUrl, formName){

	actionUrl='"'+actionUrl+'"';
	if(!formSubmitted){
		eval('document.getElementById(\"' + formName + '\").action =' + actionUrl);
	    appendBrandToForms();
		eval('document.getElementById(\"' + formName + '\").submit()');
		formSubmitted=true;
		}
}

function submitVerdAction(actionUrl, formName){
	actionUrl='"'+actionUrl+'"';
	if(!formSubmitted){
		eval('document.getElementById(\"' + formName + '\").action =' + actionUrl);
		appendBrandToVerdForms();
		eval('document.getElementById(\"' + formName + '\").submit()');
		formSubmitted=true;
		}
}
function cancelAction(actionUrl, formName){

	actionUrl='"'+actionUrl+'"';
	if(!formSubmitted){
		eval('document.getElementById(\"' + formName + '\").action =' + actionUrl);
		appendBrandToForms();
		eval('document.getElementById(\"' + formName + '\").submit()');
		formSubmitted=true;
	}
}	     	

function invokeUpdatePI(actionUrl, formName) {  
		eval('document.getElementById(\"' + formName + '\").action =\"' + actionUrl + '\"');
		appendBrandToForms();
		eval('document.getElementById(\"' + formName + '\").submit()');
	}
	
function dosubmit(urlString){
	window.open(urlString);
	self.close();
}


function setCheckNum(checkNum,actionUrl, formName)
{	var formSubmit = false;
	if(!formSubmit){
	eval('document.getElementById(\"'  + formName + '\").FieldCN.value =' + checkNum);
	eval('document.getElementById(\"' + formName + '\").action =' + actionUrl);
	appendBrandToForms();
	eval('document.getElementById(\"' + formName + '\").submit()');
	formSubmit = true;
	}
}
function submitenter(myfield, e, actionUrl, formName) {

	var keycode;
	if (window.event){
	 keycode = window.event.keyCode;
	}
	else{
		if (e){
			keycode = e.which;
		}
		else{
			return true;
		}
	}
	if (keycode == 13) {
		   submitAction(actionUrl, formName);
		   return false;
	}
	else {
	   return true;
	}
}


function submitOnEnter(actionUrl, formName, event) {
	var keycode;
	if (window.event){
		keycode = window.event.keyCode;
	}
	else{
		if (event){
			keycode = event.which;
		}
		else{
			return true;
		}
	}
	if (keycode == 13) {
		return submitAction(actionUrl, formName);
    }
	else {
		return true;
    }
}

function onCancelASPEnrollment(catalystUrl){
  input_box=window.confirm("Are you sure you want to cancel this request?");
    if(input_box){ 
     var img=new Image; 
     img.src=catalystUrl; 
     document.getElementById("AcctSecure").action = '/ecare/viewaccount';  
     appendBrandToForms();	 
     document.getElementById("AcctSecure").submit();
    }
}

function onSubmitASPForm(catalystUrl) {
    var img=new Image; 
    img.src=catalystUrl; 
    document.getElementById("AcctSecure").action='/ecare/aspenrollconfirm';	
	appendBrandToForms();	   
	document.getElementById("AcctSecure").submit();
    }  	
 
 function showExpandedASPForm(catalystUrl){
  document.getElementById('showhid').style.display='block'; 
  document.getElementById('enrollnowBtn').style.display='none';
  var img=new Image; 
  img.src=catalystUrl; 
 }

 function cancelForm()
 {	 
    document.getElementById("formPicker").action = '/ecare/billing_dispute1';  
	appendBrandToForms();	 
    document.getElementById("formPicker").submit();
 }

/* Added for security fix */

var pib= pib;
var keepAlive = keepAlive;
/* pib check is removed, March 10 onwards eCare page
will be parent window when PIB user click on creditcard
link present on PIB account overview page */

if (top != self)	{
top.location=self.location;
}
function pibLogOff(){
	if (top != self)
   {
    top.location=self.location;
   }
   document.getElementsByTagName("body")[0].style.overflow = "scroll";
}
function offerheight(){
// Don't delete this method, it will result in JS errors, on pages where offers are loaded
	/*
	var offercnt=document.getElementById("offercnt").clientHeight;
	var offerimg=document.getElementById("offerimg").clientHeight;
	if(offercnt > offerimg)
	{
		document.getElementById("offercnt").style.height= offercnt;
	}
	else if(offerimg > offercnt)
	{
		document.getElementById("offercnt").style.height= offerimg;
	}*/
	
}

/* Start Nov'08 Changes : Contact Info SPR :UPI*/
 function updatePersonalInfoSubmit(actionUrl, formName)
{
	validatePhoneField("homePh");
	validatePhoneField("workPh");
	validatePhoneField("cellPh");
	validatePhoneField("wireLess");
	
	submitAction(actionUrl, formName);
}

function validatePhoneField(phone_id)
{

var phoneValue;
if(((document.getElementById(phone_id) !=null) && (document.getElementById(phone_id).value)!= null)){
	phoneValue = document.getElementById(phone_id).value;
	var chars=phoneValue.split("");
	var allowedPhoneValue = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	document.getElementById(phone_id).value = "";

for (i = 0; i < chars.length; i++) 
     {  
        if (allowedPhoneValue.indexOf(chars[i])!= -1)         
           {
             document.getElementById(phone_id).value += chars[i];
            }
    }           
	     return document.getElementById(phone_id).value;
  }
}

/* Stop Nov'08 Changes : Contact Info SPR :UPI*/
function promptCreateCookie(){
	var cookieName = prompt("Cookie Creation: Name of cookie", "WEBTRENDS_CATLST_ID");
	if(cookieName!=undefined){
		var cookieValue = prompt("Cookie Creation: Value of cookie", "63.95.36.13-122245351.123456");
		if(cookieValue!=undefined){
			document.cookie = cookieName+'='+cookieValue+'; expires=Wed, 26 Sep 2018 20:47:11 UTC; path=/';
		}
	}
}

function eraseWTCookie(name){
  var cookie = document.cookie;
  var index1 = cookie.indexOf(name);


var sliced_cookie = cookie.slice(index1);
var index2=sliced_cookie.indexOf(";");

if(index2 != -1)
{
	sliced_cookie = sliced_cookie.substring(0,index2-1)
}

var cookieValue = sliced_cookie.substring(sliced_cookie.indexOf("=")+1);



	if(cookieValue != null){
	var index3 = cookieValue.indexOf("-");

		if( index3!= -1){

			var OLD_WEBCATALYST_LENGTH = 20;
			var len = cookieValue.substr(index3+1).length;
			
			if(len <= OLD_WEBCATALYST_LENGTH)
			{
			
			var date = new Date();
			var days = -1;
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
			
			document.cookie = name+"="+cookieValue+expires+"; path=/";
			
			}
	
		}
	}

}

//Nov 08- Release Web catalyst Id changes, new method added - starts
function CheckWebCatalystID_Cookies(value)
   {	
		/* 
		var CATALYST_COOKIE_AGE_DAYS = 720;
		cookie_name="WEBTRENDS_CATLST_ID";
		eraseWTCookie(cookie_name);
		var c_value = "";
		if (document.cookie.length>0)
		{
		  c_start=document.cookie.indexOf(cookie_name + "=");
		  if(c_start!=-1)
	 	  { 
	 	    c_start=c_start + cookie_name.length+1 ;
		    c_end=document.cookie.indexOf(";",c_start);
		    if(c_end==-1) c_end=document.cookie.length
		    c_value=unescape(document.cookie.substring(c_start,c_end));
		  } 
	 	}
		if (c_value==null || c_value=="")
	  	{
	  		var exdate=new Date();exdate.setDate(exdate.getDate()+CATALYST_COOKIE_AGE_DAYS);
	  		document.cookie=cookie_name + "=" + value + ";path=/" + ((CATALYST_COOKIE_AGE_DAYS==null) ? "" : ";expires="+exdate.toGMTString());
	  	}
		*/
	}
//Nov 08- Release Web catalyst Id changes, new method added - ends
/*Feb'09 Paperless Core Review Comment Fix*/
function submitFunction()
{
	
var radioVal="";
    for(var i=0; i < document.getElementById("forcedStatementInterstitial").ForcedStmtradioSelect.length; i++){
	if(document.getElementById("forcedStatementInterstitial").ForcedStmtradioSelect[i].checked)
		{radioVal=document.getElementById("forcedStatementInterstitial").ForcedStmtradioSelect[i].value;
		 break;
		}
	}
	
	//Changed for prod fix july'08
	var radioEmail="";
    	for(var i=0; i < document.getElementById("forcedStatementInterstitial").ForcedStmtverifyEmail.length; i++)
    	{
    	if(document.getElementById("forcedStatementInterstitial").ForcedStmtverifyEmail[i].checked)
			{
				radioEmail=document.getElementById("forcedStatementInterstitial").ForcedStmtverifyEmail[i].value;
			 	break;
			}
		}
		
	if(radioVal=="selPaperless" && radioEmail=="verifyEmailN") 
	{
	  document.getElementById("forcedStatementInterstitial").action='/ecare/choosePaperlessFormForcedStatementEmailChange?'+'&locale='+locale+'&brand='+brand+'&StmtOption=selPaperless';
	  //document.forcedStatementInterstitial.action="/ecare/choosePaperlessFormForcedStatement";
     	
      document.getElementById("forcedStatementInterstitial").submit();
      formSubmitted=true;
      return true;
	}
	else if (radioVal=="selPaperless" && radioEmail=="verifyEmailY")
	{
	  document.getElementById("forcedStatementInterstitial").action='/ecare/choosePaperlessFormForcedStatement?'+'&locale='+locale+'&brand='+brand+'&StmtOption=selPaperless';
	  //document.forcedStatementInterstitial.action="/ecare/choosePaperlessFormForcedStatement";
      
      document.getElementById("forcedStatementInterstitial").submit();
      formSubmitted=true;
      return true;
	}
	else if (radioVal=="selPostal")
	{
	  document.getElementById("forcedStatementInterstitial").action='/ecare/choosePaperFormForcedStatement?'+'&locale='+locale+'&brand='+brand+'&StmtOption=selPostal';
      document.getElementById("forcedStatementInterstitial").submit();
      formSubmitted=true;
      return true;
	}	
	else
	{
		document.getElementById("forcedStatementInterstitial").action='/ecare/choosePaperlessFormForcedStatement?'+'&locale='+locale+'&brand='+brand+'&StmtOption=selPaperless';
		document.getElementById("forcedStatementInterstitial").submit();
	    formSubmitted=true;
    	return true;
	}
 	
}


function selectChkBox()
{        
  var mailDeliveryVal = document.getElementById("selMailOptionId").value;
  var correctEmailVal = document.getElementById("chooseCorrectEmailId").value;
  var noSelectValue = document.getElementById("noSelectId").value;
 
  //Paperless Core: feb'09 release Start
   
      if(noSelectValue == "Y" && radioSelectVal=="")
     {
       document.getElementById("forcedStatementInterstitial").ForcedStmtradioSelect[0].checked=false;
       document.getElementById("USMailDelivery").style.display="none";
     } 
   else{
      document.getElementById("forcedStatementInterstitial").ForcedStmtradioSelect[0].checked=true;
      //document.getElementById("USMailDelivery").style.display="none";
   }
     
  
  //Paperless Core: feb'09 release End
    
  if(mailDeliveryVal=="selPaperless" && correctEmailVal=="verifyEmailN")
  {
    disclosureDiv = document.getElementById("VerifyEmailAddress");
    disclosureDiv.style.display = ""; 
    document.getElementById("forcedStatementInterstitial").ForcedStmtverifyEmail[1].checked=true;
  }  
   else if(mailDeliveryVal=="selPaperless" && correctEmailVal=="verifyEmailY")
	{
	  document.getElementById("forcedStatementInterstitial").ForcedStmtverifyEmail[0].checked=true;
	}
  

  
  var chkval = document.getElementById("selectedChk").value;
 
  if(chkval=="Y")
    {   
    document.getElementById("forcedStatementInterstitial").termsCheck.checked=true;
    }
    
}
/*Feb'09 Paperless Core Review Comment Fix*/

//Non-D : Cookie Looping back Issue Starts
function checkCookiesEnbaled()
{
	//IE6->Tools->Internet Options->Privacy->Advanced->Override automatic cookie handling
	//First-party Cookies->Block ; Third-party Cookies->Block ; Always allow session cookies->uncheck

	//check disabled cookies, but enabled session cookies
	var exdate=new Date();
	exdate.setMinutes(exdate.getMinutes()+1);
	document.cookie = "sce=sce; expires="+exdate.toGMTString()+"; path=/";
	var pos1 = document.cookie.indexOf( "sce=" );
	
	//check disabled session cookies
    document.cookie = "dsc=dsc;"+"; path=/";
	var pos = document.cookie.indexOf( "dsc=" );
	
	//alert(pos + "," + pos1 + "," + document.cookie);
    
	if( pos == -1  || pos1 == -1 )
    {
		document.location.href="/ecare/cookies_disabled?&locale="+locale+"&brand="+brand+"";		
    }
}
//Non-D : Cookie Looping back Issue End

// Added for Paper Less core SPR for FEB 0'9 Release start

function paperlessAlertEmail()
{
var bookmarkEmailAddress="";
if(Portfolio){
	if(Portfolio == "OB"){bookmarkEmailAddress ="orchardbank@ebusiness.orchardbank.com";}
	if(Portfolio == "HS"){bookmarkEmailAddress ="hsbc@email.hsbcusa.com";}
	if(Portfolio == "HB"){bookmarkEmailAddress ="householdbank@ebusiness.householdaccount.com";}
	if(Portfolio == "EM"){bookmarkEmailAddress ="householdcard@ebusiness.householdaccount.com";}
	if(Portfolio == "GM"){bookmarkEmailAddress ="gmcardservices@email.gmcard.com";}
	if(Portfolio == "EF"){bookmarkEmailAddress ="gmcardservices@email.gmcard.com";}
	if(Portfolio == "FX"){bookmarkEmailAddress ="gmcardservices@email.gmcard.com";}
	if(Portfolio == "UN"){bookmarkEmailAddress = "householdcard@ebusiness.householdaccount.com";}
	if(Portfolio == "UP"){bookmarkEmailAddress ="unionplus@ebusiness.unionpluscard.com";}
	if(Portfolio == "PS"){bookmarkEmailAddress = "alerts@email.partnercardservices.com";}
	if(Portfolio == "SH"){bookmarkEmailAddress ="alerts@email.partnercardservices.com";}
	if(Portfolio == "CB"){bookmarkEmailAddress ="alerts@email.partnercardservices.com";}
	if(Portfolio == "RZ"){bookmarkEmailAddress = "alerts@email.partnercardservices.com";}
	if(Portfolio == "NM"){bookmarkEmailAddress ="alerts@email.partnercardservices.com";}
	if(Portfolio == "SA"){bookmarkEmailAddress ="alerts@email.partnercardservices.com";}
	if(Portfolio == "SS"){bookmarkEmailAddress ="alerts@email.partnercardservices.com";}
	if(Portfolio == "TM"){bookmarkEmailAddress ="teamstercard@ebusiness.teamstercard.com";}
	if(Portfolio == "FT"){bookmarkEmailAddress ="alerts@ebusiness.partnercardservices.com";}
	return bookmarkEmailAddress;
}
}
	
function closePibSsoWindow()
{

	top.window.close();

}

function scrollIE()
{
	document.body.scroll="auto";
}

if(navigator.appName=="Netscape")
{
	netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
	window.scrollbars.visible = true;
}
// PIB keep Alive URL changes start

function pib_quick_append(u){

var s=document.createElement('script'); s.setAttribute('type','text/javascript');
s.setAttribute('src',u);
s.setAttribute('charset','UTF-8'); 
if(typeof(window.attachEvent)!='undefined')
document.body.appendChild(s);
else  document.getElementsByTagName('head').item(0).appendChild(s); }

function pibClick(){
	try{if(keepAlive != 'null'){pib_quick_append(keepAlive,0);}
	}catch(e){}
	}

// PIB keep Alive URL changes end

//added for onkeypress for ada march'10 rel
function onKeypress(obj, e)
	{
		if(e.keycode == 13)
		{
			obj.onclick();
		}

	}

function showHelperTxt(input_field)
	{
	    document.getElementById(input_field+'MSG').style.display = 'block';	
    }
function hideHelperTxt(input_field)
	{
    	document.getElementById(input_field+'MSG').style.display='none';
     }


function setErrorFieldFocus(fieldErrorFieldName)
{
	if(document.getElementsByName(fieldErrorFieldName).item(0) != null) 
	{ 
		var id = document.getElementsByName(fieldErrorFieldName).item(0).id; 
		if(document.getElementById(id).readOnly != true)
		{
			document.getElementById(id).focus(); 
		}
	}
}

function submitInterstitial(actionUrl, formName){
	actionUrl='"'+actionUrl+'"';
	if(!formSubmitted){
		eval('document.getElementById(\"' + formName + '\").action =' + actionUrl);
		eval('document.getElementById(\"' + formName + '\").submit()');
		formSubmitted=true;
		}
}

function replaceDest(){
var url = window.document.URL.toString();
var destURL = (url.lastIndexOf("ReferAFriend")!= -1 )|| (url.lastIndexOf("BalanceTransferOffer")!= -1 );
if (destURL==true)
{
document.getElementById("login").dest.value = "";
}
}
