/*
 +-------------------------------------------------------------------+
 |                   Common JavaScript functions                     |
 |                                                                   |
 +-------------------------------------------------------------------+
*/
function CheckBrowserType() {
    if (navigator.appName == "Netscape") {
    }
    document.forms[0].submit();
}
function changeBGC(cell, color) {
    cell.bgColor = color;
}
/* Branch Location display for direct product starts here*/
function showLocations(val) {
    retrieveURLBranchLocations("ajaxXMLServiceActionBranchLocation.do?method=branches&service=AjaxDetails&bankID=" + escape(val) + "");	
	//window.open("showBranchLocations.do?method=branches&rbID=" + val,"null", "height=370,width=260,top=220,location=no,toolbar=no,titlebar=no,scrollbars=1,resizable=yes, directories=no,menubar=no");
}
function retrieveURLBranchLocations(url) {
		var divCity = document.getElementById("cityAddres");
		var cityHtml = "";	
		divCity.innerHTML = cityHtml;
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChangeBranchLocation;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            isIE = true;
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChangeBranchLocation;
                req.send();
            }
        }
    }
}
function processStateChangeBranchLocation() {
	divID = document.getElementById("location");
	divID.innerHTML = "<img src='images/wait.gif' align='absmiddle'><strong>Please Wait....</strong>";
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
            generateIncludeDocBranchLocations(req.responseXML);
        }
    }
}
function generateIncludeDocBranchLocations(xml) {
    var html = "<table width='100%' border='0' cellspacing='0' cellpadding='0' class='arial-black-12'>";
    html += "<tr valign='top' align='left'>";
    html += "<td height='22'>";
    html += "<table width='100%'>";
    html += "<tr bgcolor='#F2F2F2'><td align='right'><a href='#' onclick='hideCashPickUpBranchLocationsDiv(cashPickUpBranchLocations)' class='arial-black-12-mOver'><strong>Close</strong></a></td></tr>";
    html += "</table><tr valign='top'>";
    html += "<td valign='top'>";
    html += "<table>";
    var spaceCount = 0;
    try {
        if (xml) {
            var title = xml.getElementsByTagName("title");
            var val = title[0].firstChild.nodeValue;
            var criteria = xml.getElementsByTagName("Criteria");
            var criteriaValue = criteria[0].firstChild.nodeValue;                     
            html += "<tr>";
            html += "<td class='arial-black-12'><strong>";
            html += "<a name ='loc'>Distribution Points in ";
            html += val;
            html += "</a></strong></td>";
            html += "</tr>";
            var cities = xml.documentElement.getElementsByTagName("city");
            for (var j = 0; j < cities.length; j++) {     							 
                        //code = country.childNodes.item(j).getAttribute("code");
                city = cities[j].firstChild.firstChild.nodeValue;
                count = cities[j].lastChild.firstChild.nodeValue;
                html += "<tr>";                                       
                html += "<tr>";
                html += "<td class='arial-blue-12'>";
                //If there are no Cities, States, Departments, Municipalities,
				//Provinces, or Counties in the RB cash pick up address list then the user should
				//NOT be allowed to click on the RB name. For that passed a value as a node Criteria
				//and checked the value for "BankName"				
                if (criteriaValue == "BankName"){
                html += city;
                }else{
                html += "<a href='#adrs1' class='arial-blue-12-mOver' onclick=\"showCityAddress('" + city + "','"+criteriaValue+"')\">";
                html += city;
                html += "(" + count + ")";
                html += "</a>";
                }
                html += "</td>";
                html += "</tr>";
            }
        }
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "</table><a name='adrs1'></a>";
    }
    catch (e) {
        alert(e);
    }
    if (val != "NotAvailable") {
        divTag = document.getElementById("location");    
       //var newDiv = document.createElement('div');
        divTag.innerHTML = html;
       	//divTag.appendChild(newDiv);
    } else {
        divTag = document.getElementById("location");
        var html = "<table width='100%' border='0' cellspacing='0' cellpadding='0' class='arial-black-12'>";
        html += "<tr valign='top' align='left'>";
        html += "<td height='22'>";
        html += "<table width='100%'>";
        html += "<tr bgcolor='#F2F2F2'><td align='right'><a href='#' onclick='hideCashPickUpBranchLocationsDiv(cashPickUpBranchLocations)' class='arial-black-12-mOver'><strong>Close</strong></a></td></tr>";
        html += "</table><tr valign='top'>";
        html += "<td valign='top'><strong>Locations Not Available</strong>";
        html += "<table>";
        divTag.innerHTML = html;
    }
}
function showCityAddress(city,criteria) {
    retrieveURLCityAddress("ajaxXMLServiceActionCityAddress.do?method=cityAddress&service=AjaxDetails&city=" + city + "&criteria="+escape(criteria)+"");
}
function retrieveURLCityAddress(url) {
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChangeCityAddress;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            isIE = true;
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChangeCityAddress;
                req.send();
            }
        }
    }
}
function processStateChangeCityAddress() {
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
            generateIncludeDocCityAddress(req.responseXML);
        }
    }
}
function generateIncludeDocCityAddress(xml) {
    var html = "<table width='100%' border='0' cellspacing='0' cellpadding='0' class='arial-black-12'>";
    html += "<tr valign='top'><td height='27'></td></tr>";
    html += "<tr valign='top'>";
    html += "<td valign='top'>";
    html += "<table>";
    var spaceCount = 0;
    try {
        if (xml) {
            var title = xml.getElementsByTagName("title");
            var val = title[0].firstChild.nodeValue;
            html += "<tr>";
            html += "<td class='arial-black-12'><strong>";
            html += "Locations in ";
            html += val;
            html += "</strong></td>";
            html += "</tr>";
            html += "<tr>";
            html += "<td>";
            html += "<a name='adrs1'><hr>";
            html += " </a></td>";
            html += "</tr>";
            var cityAddress = xml.documentElement.getElementsByTagName("address");
            for (var j = 0; j < cityAddress.length; j++) {
                        //code = country.childNodes.item(j).getAttribute("code");
                addressOne = cityAddress[j].firstChild.firstChild.nodeValue;
                addressTwo = cityAddress[j].childNodes.item(1).firstChild.nodeValue;
                city = cityAddress[j].childNodes.item(2).firstChild.nodeValue;
                zip = cityAddress[j].childNodes.item(3).firstChild.nodeValue;
                locationCode = cityAddress[j].childNodes.item(4).firstChild.nodeValue;
                         
                       
                                              
                        // alert("code-->"+code);
                html += "<tr>";
                html += "<td class='arial-blue-12'>";
                html += addressOne;
                html += "</td>";
                html += "</tr>";
                html += "<tr>";
                html += "<td class='arial-blue-12'>";
                html += addressTwo + " , " + city;
                html += "</td>";
                html += "</tr>";
                html += "<tr>";
                html += "<td class='arial-blue-12'>";
                html += zip;
                html += "</td>";
                html += "</tr>";
                html += "<tr>";
                html += "<tr>";
                html += "<td class='arial-blue-12'>";
                html += "Location Code: " + locationCode;
                html += "</td>";
                html += "</tr>";
                html += "<tr>";
                html += "<tr>";
                html += "<td>";
                html += "<hr>";
                html += "</td>";
                html += "</tr>";
            }
        }
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
    }
    catch (e) {
        alert(e);
    }
    divTag = document.getElementById("cityAddres");                           
 				//var newDiv = document.createElement('div');
    divTag.innerHTML = html;
      //	divTag.appendChild(newDiv);
}
/* Branch Location display for direct product ends here*/
function updateDate(dd) {
    var today = new Date(dd);
    if ((today.getMonth() + 1) < 10) {
        var strToday = "0" + (today.getMonth() + 1);
    } else {
        var strToday = (today.getMonth() + 1);
    }
    strToday = strToday + "/";
    if (today.getDate() < 10) {
        strToday = strToday + "0" + today.getDate();
    } else {
        strToday = strToday + today.getDate();
    }
    strToday = strToday + "/";
    strToday = strToday + today.getFullYear();
    document.forms[0].paymentSchedule.value = strToday;
}
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_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 showCal() {
    var cal19 = new CalendarPopup();
    cal19.showYearNavigation();
    cal19.showYearNavigationInput();
}
function loadDynamicPart(val) {
    retrieveURL("ajaxXMLServiceAction.do?method=paymentInfo&prodTyp=1&service=PaymentDetails&paymentMethodID=" + val);
}
function loadDynamicPartForDirect(val,func) {
	if(val != "1"){ 
    retrieveURLForDirect("ajaxXMLServiceAction.do?method=paymentInfo&prodTyp=2&service=PaymentDetails&paymentMethodID=" + val+"&purpose="+func);
    }else{    
    retrieveURLForDirect("ajaxXMLServiceAction.do?method=paymentInfo&prodTyp=2&service=PaymentDetails&paymentMethodID=" + val+"&purpose="+func);
    //divTag = document.getElementById("currDelivery");
    //divTag.innerHTML = "";
    }
    }
function loadDeliveryOpts(val) {	
    if (document.forms[0].cnt.value == 0) {
        paymentMethodID = document.forms[0].pmtmethod.value;
    } else {
        for (i = 0; i <= document.forms[0].cnt.value; i++) {
            if (document.forms[0].pmtmethod[i].checked) {
                paymentMethodID = document.forms[0].pmtmethod[i].value;
            }
        }
    }
    loadCurrencyDeliveryXML("ajaxXMLServiceAction.do?method=currDevryOpts&prodTyp=1&bankID=" + val + "&paymentMethodID=" + paymentMethodID);
}
function loadDeliveryOptsForDirect(val) {	
    if (document.forms[0].cnt.value == 0) {
        paymentMethodID = document.forms[0].pmtmethod.value;
    } else {
        for (i = 0; i <= document.forms[0].cnt.value; i++) {
            if (document.forms[0].pmtmethod[i].checked) {
                paymentMethodID = document.forms[0].pmtmethod[i].value;
            }
        }
    }   
    if (val != "0"){
    divTag = document.getElementById("currDelivery");
    divTag.innerHTML = "";
    loadCurrencyDeliveryXML("ajaxXMLServiceAction.do?method=currDevryOpts&prodTyp=2&bankID=" + val + "&paymentMethodID=" + paymentMethodID);
    }else{
    divTag = document.getElementById("currDelivery");
    divTag.innerHTML = "";
    }
}
function loadDynamicParts(val) {
    retrieveURLforServiceAccount("ajaxXMLServiceAction.do?method=paymentInfo&service=PaymentDetails&prodTyp=1&paymentMethodID=" + val);
}

function checkSession() {
var pathName = window.location.pathname;
var desPath = pathName.substring((pathName.indexOf("/")+1),pathName.length);
var path = desPath.substring(0,(desPath.indexOf("/")+1));
var finalPath;
if(path == "PayLynxs/"){
finalPath = path+"validateSession.do";
}else{
finalPath = "validateSession.do";
}
var url = window.location.protocol + "//" + window.location.hostname + ":" + window.location.port + "/" + finalPath;
validateSession(url);
}

function loadOnInitialization() {
    if (document.forms[0].cnt.value == 0) {
        if (document.forms[0].pmtmethod.checked) {
            document.forms[0].pmtmethod.checked = false;
        }
    } else {
        for (i = 0; i <= document.forms[0].cnt.value; i++) {
            if (document.forms[0].pmtmethod[i].checked) {
                loadDynamicPart(document.forms[0].pmtmethod[i].value);
            }
        }
    }
}
function initAjaxContols() {
    if (document.forms[0].cnt.value == 0) {
        if (document.forms[0].pmtmethod.checked) {
            paymentMethodID = document.forms[0].pmtmethod.value;
        }
    } else {
        for (i = 0; i <= document.forms[0].cnt.value; i++) {
            if (document.forms[0].pmtmethod[i].checked) {
                paymentMethodID = document.forms[0].pmtmethod[i].value;
            }
        }
    }
    loadDynamicParts(paymentMethodID);
}
function initOnLoad() {
	var paymentMethodID = 0; 
    if (document.forms[0].cnt.value == 0) {
        if (document.forms[0].pmtmethod.checked) {
            document.forms[0].pmtmethod.checked = true;
            loadDynamicPartForDirect(document.forms[0].pmtmethod.value,"FOREDIT");             
        }        
    } else {
        for (i = 0; i <= document.forms[0].cnt.value; i++) {         
            if (document.forms[0].pmtmethod[i].checked) {
            	paymentMethodID = document.forms[0].pmtmethod[i].value;            	
                loadDynamicPartForDirect(document.forms[0].pmtmethod[i].value,"FOREDIT");                             	
            }
        }
        
    }     
}
function initAddOnLoad() {
    if (document.forms[0].cnt.value == 0) {
        if (document.forms[0].pmtmethod.checked) {
            document.forms[0].pmtmethod.checked = false;
        }
    } else {
        for (i = 0; i <= document.forms[0].cnt.value; i++) {
            if (document.forms[0].pmtmethod[i].checked) {
                //loadDynamicPartForDirect(document.forms[0].pmtmethod[i].value);
                document.forms[0].pmtmethod.checked = false;
            }
        }
    }
}
var req;
var which;
function validateSession(url) {
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = redirectPage;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = redirectPage;
                req.send();
            }
        }
    }
}
function retrieveURL(url) {
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChange;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChange;
                req.send();
            }
        }
    }
}
function retrieveURLforServiceAccount(url) {
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChangeForDirect;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChangeForDirect;
                req.send();
            }
        }
    }
}
function retrieveURLForDirect(url) {
	divTag = document.getElementById("pmt");
	divTag.innerHTML = "<img src='images/wait.gif' align='absmiddle'><strong>Please Wait....</strong>";
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChangeForDirect;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChangeForDirect;
                req.send();
            }
        }
    }
}
function loadCurrencyDeliveryXML(url) {
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processCDXML;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processCDXML;
                req.send();
            }
        }
    }
}
function redirectPage() {
 //alert("RESP = "+ req.responseText);
    if (req.readyState == 4) { // one
        if (req.status == 200) { //two
          //  alert("RESPText = "+req.responseText);
        //	alert("RESP = "+req.responseText.indexOf("BranchSessionExpired"));
            if (req.responseText.indexOf("BranchSessionExpired") > 0) {
                // alert("SessionExpired = "+req.responseText);
                var pathName = window.location.pathname;
				var desPath = pathName.substring((pathName.indexOf("/")+1),pathName.length);
				var path = desPath.substring(0,(desPath.indexOf("/")+1));
				var finalPath;
				if(path == "PayLynxs/"){
				finalPath = path+"Logincommon.do?method=sessionTimeOut";
				}else{
				finalPath = "Logincommon.do?method=sessionTimeOut";
				}
	            window.parent.location = window.location.protocol + "//" + window.location.hostname + ":" + window.location.port +"/"+ finalPath;
             } else if (req.responseText.indexOf("shutdownmessage") > 0) {
              
                //  var message ="shutdownmessage" + req.responseText;
                    var message = req.responseText;
             //  alert("message recieved is"+message);
                    if (message != 0) {
                        servermessage(message);
                    }
                    }
             if (req.responseText.indexOf("RBDirectExpiredSession") > 0) {
                      //  alert("RBDirectExpiredSession");
            //alert("forward to SessionTimeOutHome.jsp"); 
            			var pathName = window.location.pathname;
						var desPath = pathName.substring((pathName.indexOf("/")+1),pathName.length);
						var path = desPath.substring(0,(desPath.indexOf("/")+1));
						var finalPath;
						if(path == "PayLynxs/"){
						finalPath = path+"rb/direct/SessionTimeOutHome.do?method=sessionTimeOutHome";
						}else{
						finalPath = "rb/direct/SessionTimeOutHome.do?method=sessionTimeOutHome";
						}
                        window.parent.location = window.location.protocol + "//" + window.location.hostname + ":" + window.location.port +"/"+ finalPath;
               // alert("Session Expired Please Login Again");
                 } else if (req.responseText.indexOf("AdminSessionExpired") > 0) {
		              //  alert("insideAdminSessionExpired");
		                var pathName = window.location.pathname;
						var desPath = pathName.substring((pathName.indexOf("/")+1),pathName.length);
						var path = desPath.substring(0,(desPath.indexOf("/")+1));
						var finalPath;
						if(path == "PayLynxs/"){
						finalPath = path+"Logincommon.do?method=sessionTimeOut&selectproduct=adminProduct";
						}else{
						finalPath = "Logincommon.do?method=sessionTimeOut&selectproduct=adminProduct";
						}
			            window.parent.location = window.location.protocol + "//" + window.location.hostname + ":" + window.location.port +"/"+ finalPath;    
		       }else{
		               }
                     //  }
                    
               // }
          //  }
        } //two
    } // one
}
function processCDXML() {
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
            //alert(req.responseText);
            generateCurrencyOptDoc(req.responseXML);
        }
    }
}
function processStateChange() {
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
					//alert(req.responseText);
            generateIncludeDoc(req.responseXML);
        }
    }
}
function processStateChangeForDirect() {
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
            //alert(req.responseText);
            generateIncludeDocForDirect(req.responseXML);
        }
    }
}
function generateCurrencyOptDoc(xml) {
    if (xml.documentElement) {
        var countryNameAttribute = xml.documentElement.getElementsByTagName("CountryName");
        var countryName;
        if (countryNameAttribute.length > 0){
        	countryName = countryNameAttribute[0].firstChild.nodeValue;
        }        
        var deliveryTypeAttribute = xml.documentElement.getElementsByTagName("DeliveryType");
        if (deliveryTypeAttribute.length > 0){
        deliveryType = deliveryTypeAttribute[0].firstChild.nodeValue;
        var currencyNameAttribute = xml.documentElement.getElementsByTagName("CurrencyName");
        currencyName = currencyNameAttribute[0].firstChild.nodeValue;
        var paymentMethodAttribute = xml.documentElement.getElementsByTagName("PaymentMethod");
        PaymentMethodName = paymentMethodAttribute[0].firstChild.nodeValue;
        if(PaymentMethodName == 'Check'){
           if(countryName == 'India'){
           		PaymentMethodName ='Cheque';
           }
        }
        var currTypeAttribute = xml.documentElement.getElementsByTagName("SelectedType");
        currType = currTypeAttribute[0].firstChild.nodeValue;    
    var html = "<table width='100%'>";
    html += "<tr>";
    html += "<td colspan='3' class='arial-black-12' background='images/dotted_horiz1.gif'>";
    html += "&nbsp;";
    html += "</td>";
    html += "</tr>";
    html += "<tr>";
    html += "<td width='100%' class='arial-black-12' colspan='2'><input type='hidden' name='deliveryType' value='" + deliveryType + "'>";
    html += "Currency Delivery Options :";
    html += "</td>";
    html += "</tr>";
  //  alert("Delivery Type ="+deliveryType);
    //alert("Currency Name ="+currencyName);
   // alert("Payment Method="+PaymentMethodName);
   // alert("SelectedType ="+currType);
    if (deliveryType == 3) {
        if (currType == 1) {
            selectModeUSD = "checked";
            selectModeLoc = "";
        } else {
            if (currType == 2) {
                selectModeLoc = "checked";
                selectModeUSD = "";
            } else {
                selectModeLoc = "";
                selectModeUSD = "";
            }
        }
        html += "<tr><td width='5%' class='arial-black-12'></td><td class='arial-black-12' colspan='2'><table width='100%' border='0' cellspacing='0' cellpadding='0'>";
        html += "<tr><td align='left' width='40%' class='arial-black-12'><input name='dynamicProps(currencyType)' type='radio' value='1' " + selectModeUSD + " />";
        html += " U.S. Dollar (USD $) </td> </tr>";
        html += "<tr><td class='arial-black-12' width='60%' align='left'><input name='dynamicProps(currencyType)' type='radio' value='2' " + selectModeLoc + " /> " + currencyName + "</td>";
        html += "</tr></table></td></tr>";
    } else {
        html += "<tr>";
        html += "<td width='5%' class='arial-black-12'>";
        html += "&nbsp;";
        html += "</td>";
        html += "<td width='95%' class='arial-black-12'>";
        html += PaymentMethodName + " may only be made in " + currencyName + "<input type='hidden' name='dynamicProps(currencyType)' value='1'>";
        html += "</td>";
        html += "</tr>";
    }
    html += "<tr>";
    html += "<td width='5%' class='arial-black-12' >";
    html += "&nbsp;";
    html += "</td>";
    html += "<td width='95%' class='arial-black-12' >";
    html += "<a href='javascript:showViewBankDetailsDIV(viewBankDetails);' class='arial-blue-12-mOver' onClick=\"showViewBankDetailsDIV(viewBankDetails);\">View Fees & Exchange Rates</a>";
    html += "</td>";
    html += "</tr>";
    html += "</table>";
    divTag = document.getElementById("currDelivery");
    divTag.innerHTML = html;
    }else{
    divTag = document.getElementById("currDelivery");
    divTag.innerHTML = "";
    }  
    } 
}
/*
	The structure of the XML file has defined as follows:
	---------------------------------------------------------------------------------------
	<controls>
		<section>
			<title>	</title>
				<control>
					<type> </type>
					<name> </name>
					<value>
						<option value="key">
						  option
						</option>
					 </value>
					<selectedvalue> </selectedvalue>
				</control>
		</section>
	</controls>
	-----------------------------------------------------------------------------------------
*/
function generateIncludeDocForDirect(xml) {     
	var paymentMethodID = 0;	
       if (document.forms[0].cnt.value == 0) {
        paymentMethodID = document.forms[0].pmtmethod.value;
    	} else {
        for (i = 0; i <= document.forms[0].cnt.value; i++) {
            if (document.forms[0].pmtmethod[i].checked) {
                paymentMethodID = document.forms[0].pmtmethod[i].value;
            }
        }
    	} 
    var branchCodePresent = false;  
    var selectedVal = null;
    var html = "<table width='100%' border='0' cellspacing='1' cellpadding='1' class='arial-black-12'>";
    html += "<tr>";
    html += "<td colspan='3' background='images/dotted_horiz1.gif'>";
    html += "&nbsp;";
    html += "</td>";
    html += "</tr>";
    html += "<tr>";
    html += "<td colspan='3' class='arial-black-12'>";
    html += "Provide additional payment information :";
    html += "</td>";
    html += "</tr>";
    html += "<tr>";
    html += "<td colspan='3' height='12' class='arial-black-12'>";
    html += "</td>";
    html += "</tr>";
	    // parse the XML
    try {
        if (xml.documentElement) {
            var sections = xml.documentElement.getElementsByTagName("section");
            var secLength = sections.length;
            for (var i = 0; i < secLength; i++) {
                var sect = sections[i];
                var label = sections[i].firstChild.firstChild.nodeValue;
                var control = sections[i].lastChild;
                //control type
                var type = control.childNodes.item(0).firstChild.nodeValue;
                //control name
                var name = control.childNodes.item(1).firstChild.nodeValue;
                if (type == 0) {
                    html += "<tr>";
                    html += "<td colspan='3'>";
                    html += "<table width='100%' border='0' cellspacing='1' cellpadding='1' class='border-black-all'>";
                    html += "      <tr>        <td class='arial-red-12'>This Payment method is not available for transaction.";
                    html += "</td>      </tr>    </table>";
                    html += "</td>";
                    html += "</tr>";
                    break;
                } else {
                //type == 5 means selection control
                }
                if (type == 7) {                        
                         var val = control.childNodes.item(2).firstChild.nodeValue;
                        if (val == "BLANK") {
                            val = "";
                        } 
                        if (name == "dynamicProps(routingNumber)") {                  
                            if (val == "") {
                        	//alert("Value empty found"); 
                                var controlHtml = "<input name='routingNumberHidden' type='hidden' id='routingNumberHidden'>";
                            } else {
                                var controlHtml = "<input name='routingNumberHidden' id='routingNumberHidden' type='hidden'  value='" + val + "' >";
                            }  
                            }else if (name == "dynamicProps(bankBrchCode)"){
                            branchCodePresent = true;
                            if (val == "") {
                        	//alert("Value empty found"); 
                                var controlHtml = "<input name='bankBrchCodeHidden' type='hidden' id='bankBrchCodeHidden'>";
                            } else {
                                var controlHtml = "<input name='bankBrchCodeHidden' id='bankBrchCodeHidden' type='hidden'  value='" + val + "' >";
                            }  
                            }               
                   }
                if (type == 5) {                
                    var optionlist = control.childNodes.item(2);
                    var selectedValue = control.childNodes.item(3).firstChild.nodeValue;
                    //alert('selectedValue at first=' + selectedValue);
                    var opt = "";
                    for (var j = 0; j < optionlist.childNodes.length; j++) {
                        val = optionlist.childNodes.item(j).getAttribute("value");
                        txt = optionlist.childNodes.item(j).firstChild.nodeValue;
                        //if value is comma seperated take the second one
                       if (name == "dynamicProps(citizenID)"){
                        	valToComp = val;
                       }else{
                        values = val.split(",");
                        arrLen = values.length;
                        valToComp = values[arrLen - 1];
                        }
                        // alert(' value =' + val);
                         //This logic is for edit mode.  Selected value will be null for add mode
                         //This will be true only while edit
                        if (selectedValue == valToComp) {
                            opt = opt + "<option value='" + val + "' selected>" + txt + "</option>";

                             //alert('bankName=' + dynamicProps(bankName));
                             //alert('companyName=' + dynamicProps(companyName));
                            if (name == "dynamicProps(bankName)" || name == "dynamicProps(companyName)") {
                                selectedTxt = txt;
                                selectedVal = val;
                               // alert('Selected Value =' + selectedVal);
                               // alert(' value =' + val);
                            }
                        } else {
                            opt = opt + "<option value='" + val + "'>" + txt + "</option>";
                            //This section for adding a new beneficiary
                            //selectedVal is for passing this selected value for
                            //loading currency delivery option, as direct product has only one
                            //RB this is enough.
                            if (name == "dynamicProps(bankName)" || name == "dynamicProps(companyName)") {
                                selectedVal = val;
                            }
                        }
                         //alert('Value =' + val);
                    }
                    var controlHtml = "<select name='" + name + "'  id='" + name + "'";
                    if (name == "dynamicProps(bankName)") {
                        controlHtml = controlHtml + " onChange='loadAdvcdBeneInfFields(this.value);' ";
                    }else if (name == "dynamicProps(bankBranchState)" || name == "dynamicProps(bankBranchProvince)"){
                    	controlHtml = controlHtml + " onChange='createBranches(this.value);' ";
                    }else if(name == "dynamicProps(bankBrchName)") {
                    	controlHtml = controlHtml + " onChange='showBranchCode(this.value);'  ";
                    }else if (name == "dynamicProps(citizenID)"){
                    	controlHtml = controlHtml + "   onblur='closeIt(this);' onChange='openIt(this);'";
                    }
                    controlHtml = controlHtml + "' class='textfield-new-listProfile-ajaxfield'>" + opt + "</select>";
                    controlHtml += "<input type='hidden' name='bankNameBox' value='" + txt + "' />";
                } else {                
                	//type == 1 means input type text field
                    if (type == 1) {                   
                        var val = control.childNodes.item(2).firstChild.nodeValue;
                        if (val == "BLANK") {
                            val = "";
                        }      
                        //alert("Value=#"+val+"#");
						// -----------------------------------------------------------------
                        //For Masking account Number
                        if (name == "dynamicProps(accountNumber)") {
                        	val = val.trim();
                            if (val.length >= 4) {
                                val = val.trim();
                            } else {
                                if (val != " ") {
                                    if (val.length != 0) {
                                        val = "***********" + val;
                                    }
                                } else {
                                    val = "";
                                }
                            }
                            if (val == "") {
                        	//alert("Value empty found"); 
                        	if (paymentMethodID == "5"){
                                var controlHtml = "<input name='" + name + "' type='text' class='textfield-new' size='14' maxlength='17'>";
                            }else{
                            	 var controlHtml = "<input name='" + name + "' type='text' class='textfield-new' size='14' maxlength='35'>";
                            }
                            } else {
                            	if (paymentMethodID == "5"){
                                var controlHtml = "<input name='" + name + "' id='" + name + "' type='text' class='textfield-new' size='14' maxlength='17' value='" + val + "' >";
                                }else{
                                var controlHtml = "<input name='" + name + "' id='" + name + "' type='text' class='textfield-new' size='14' maxlength='35' value='" + val + "' >";
                                }
                            }
                        } else {
                        	if (paymentMethodID == "5"){
                            var controlHtml = "<input name='" + name + "' id='" + name + "' type='text' class='textfield-new' size='14' maxlength='17' value='" + val + "'>";
                            }
                            else{
                            var controlHtml = "<input name='" + name + "' id='" + name + "' type='text' class='textfield-new' size='14' maxlength='35' value='" + val + "'>";
                            }                            
                        }                      
                    	//-----------------------------------------------------------------------
                        //var controlHtml = "<input name='" + name + "' type='text' class='textfield-new' size='16' maxlength='35' value='" + val + "'>";
                        //html +="<div style="background-color:#FFCC33"><table> <tr><td>Account Number:</td><td> "+ controlHtml+"</td></tr></table></div>";
                    } else {
                    
                    	//type == 6 means input type hidden
                        if (type == 6) {
                            var val = control.childNodes.item(2).firstChild.nodeValue;
                            var controlHtml = "<input name='" + name + "' id='" + name + "' type='hidden' value='" + val + "'>";
                            html += controlHtml;
                            //alert("Val in LoadDelivery Opt = "+ val);
                            loadDeliveryOptsForDirect(val);
                        } else {
                        
                        	//type == 2 means radio buttons
                            if (type == 2) {
                                var optionlist = control.childNodes.item(2);
                                var selectedValue = control.childNodes.item(3).firstChild.nodeValue;
                                for (var j = 0; j < optionlist.childNodes.length; j++) {        
                                	//val means value of the option butten when it selected                       
                                    val = optionlist.childNodes.item(j).getAttribute("value");                                    
                                    txt = optionlist.childNodes.item(j).firstChild.nodeValue;
                                    values = val.split(",");
                        			arrLen = values.length;
                       				valToComp = values[arrLen - 1];
                                    if (selectedValue == valToComp) {
                                    	//alert(selectedValue);
                                        var controlHtml = "<input name='" + name + "' id='" + name + "' type='radio' value='" + val+"'";
                                        if (name == "dynamicProps(bankName)") {
                                            controlHtml = controlHtml + " onClick='loadAdvcdBeneInfFields(this.value);'" ;
                                        }
                                        controlHtml = controlHtml + "' checked />";
                                    } else {
                                        var controlHtml = "<input name='" + name + "' id='" + name + "' type='radio' value='" + val+"'";
                                        if (name == "dynamicProps(bankName)") {
                                            controlHtml = controlHtml + " onClick='loadAdvcdBeneInfFields(this.value);'";
                                        }
                                        controlHtml = controlHtml + "' />";
                                    }
                                    html += "<tr>";
                                    html += "<td colspan='3' class='arial-black-12'>";
                                    html += "<table width='100%'>";
                                    html += "<tr>";
                                    html += "<td align='right' class='arial-black-12' width='25'>";
                                    html += controlHtml;
                                    html += "</td>";
                                    if (name == "dynamicProps(bankName)") {
                                        html += "<td class='arial-black-12'>";
                                    } else {
                                        html += "<td class='arial-black-12'>";
                                    }
                                    html += txt;
                                    if (name == "dynamicProps(bankName)") {
                                        var testVal = "showLocations("+val+");showCashPickUpBranchLocationsDiv(cashPickUpBranchLocations);";
                                        html += "<td>";
                                        html += " <a href='#loc' class='arial-blue-12-mOver' onclick=\" showLocations('"+val+"');showCashPickUpBranchLocationsDiv(cashPickUpBranchLocations);\">View Locations</a>";
                                        html += "</td>";
                                    }
                                    html += "</td>";
                                    html += "</tr>";
                                    html += "</table>";
                                    html += "</td>";
                                    html += "</tr>";
                                }
                                html += "<tr>";
                                html += "<td colspan='3' id='currencyOpt'>";
                            
                            //	Add javascript to include the Currency selection option
                                html += "&nbsp;";
                                html += "</td>";
                                html += "</tr>";
                                
                            }
                        }
                    }
                }
                if (type == 1) {
                    html += "<tr>";
                    html += "<td width='45%' height='26'>";
                    html += label;
                    html += "</td>";
                    html += "<td width='55%' height='26'>";
                    html=html+"<div style='overflow:auto;'></div>";
					html=html+"<div style='overflow:auto;z-index:9999'>" 
                    html += controlHtml;
                    html += "</div>";
                    html += "</td>";
                    html += "</tr>";
                }else if (type == 7) {                	
                    html += "<tr>";
                    html += "<td width='45%' height='26'>";
                    html += label;
                    html += "</td>";
                    html += "<td width='55%' id='bankBranchCodeVal' height='26'>";                                       
                    html += val;
                    html += "</td>";
                    html += "</tr>";                    
                }else if (type != 2 && type != 6 && type != 7 && type != 1) {
                    html += "<tr>";
                    html += "<td width='45%' height='26'>";
                    html += label;
                    html += "</td>";
                    html += "<td width='55%' height='26'>";                   
                    html += controlHtml;                   
                    html += "</td>";
                    html += "</tr>";
                }
            }
        }
        
        var paymentMethodID = 0; 
    if (document.forms[0].cnt.value == 0) {
        if (document.forms[0].pmtmethod.checked) {
            paymentMethodID = document.forms[0].pmtmethod.value;
        }        
    } else {
        for (i = 0; i <= document.forms[0].cnt.value; i++) {         
            if (document.forms[0].pmtmethod[i].checked) {
            	paymentMethodID = document.forms[0].pmtmethod[i].value;          	
                       	
            }
        }
        
    }  
        if (paymentMethodID == "4"){
        html = html+"<tr><td colspan='3' background='images/dotted_horiz1.gif' height='20'></td></tr>";
        html += "<tr>";
        html += "<td colspan='3'>";
        html += "<table width='100%' border='0' cellspacing='1' cellpadding='1' class='border-black-all'>";
        html += "      <tr>        <td class='arial-black-12'>The beneficiary can pick up money at any of <br />";
        html += "          the locations of the organization you select. </td>      </tr>    </table>";
        html += "</td>";
        html += "</tr>";
        }       
        html += "<tr>";
        html += "<td width='100%' colspan='3' id='currDelivery'>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
        divTag = document.getElementById("pmt");
        divTag.innerHTML = html;              
    }
    catch (e) {
   //     alert(e);
    }
	changeComboboxSizeToElementsDirect();	 

	//The if-else section is not make any sense. But this
	//may probably has to be fixed. The else part is required
	//to add check payment currency delivery options and if part for
	//other payments.
    if (selectedVal != null) {
    //alert("LAST = "+selectedVal);
        loadDeliveryOptsForDirect(selectedVal);
    } else {
	  //alert("Selected value is null");
        loadDeliveryOptsForDirect(selectedVal);
    }
    
    if (branchCodePresent == true){
     for(ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){
			if (document.forms[0].elements[ctrl].name == "dynamicProps(bankBrchName)"){
				showBranchCode(document.forms[0].elements[ctrl].value);
			}
		}  
	}
	for(ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){
			if (document.forms[0].elements[ctrl].name == "dynamicProps(bankName)" 
				&& document.forms[0].elements[ctrl].value == "0"){
				setSelectBoxDisabled();  
			}
		}  
	
	for(ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){
			if ((document.forms[0].elements[ctrl].name == "dynamicProps(bankBranchState)"  
				|| document.forms[0].elements[ctrl].name ==
						 "dynamicProps(bankBranchProvince)") && 
				document.forms[0].elements[ctrl].type=="select-one" 			
				&& document.forms[0].elements[ctrl].value == "0"){
				setSelectBoxDisabledBranch();  
			}
		}   	  
}


/** 
		Function used to set the width of combo box corresponding to the 
		elements in the combobox, while it is loading
	**/
	
	function changeComboboxSizeToElementsDirect(){
		for(ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){					
		if (document.forms[0].elements[ctrl].name == "dynamicProps(bankName)" && 
						document.forms[0].elements[ctrl].type=="select-one"){					
					    openIt(document.forms[0].elements[ctrl]);				      
			}
			}  
		}

//Function used for removing leading and trailing spaces.
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };
		
//Function used for disabling Bank branch state, Bank branch province and 
//bank branch name Bene ficiary pages
		function setSelectBoxDisabled(){				
			for(ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){					
				if ((document.forms[0].elements[ctrl].name == 
					"dynamicProps(bankBranchState)" || document.forms[0].elements[ctrl].name ==
						 "dynamicProps(bankBranchProvince)") && 
						 document.forms[0].elements[ctrl].type=="select-one"){
					if(document.forms[0].elements[ctrl].value == "0"){	 
					document.forms[0].elements[ctrl].disabled=true;
					}
				}
				if (document.forms[0].elements[ctrl].name == 
				"dynamicProps(bankBrchName)" && document.forms[0].elements[ctrl].type=="select-one"){
					if(document.forms[0].elements[ctrl].value == "0"){
					document.forms[0].elements[ctrl].disabled=true;
					}
				}				
			}			
		}
		
		function setSelectBoxDisabledBranch(){				
			for(ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){									
				if (document.forms[0].elements[ctrl].name == 
				"dynamicProps(bankBrchName)" && document.forms[0].elements[ctrl].type=="select-one"){
					if(document.forms[0].elements[ctrl].value == "0"){
					document.forms[0].elements[ctrl].disabled=true;
					}
				}				
			}			
		}
// End of loadDynamicPartForDirect ---------------------------------------
function generateIncludeDoc(xml) {
    var paymentMethodID = 0;	
       if (document.forms[0].cnt.value == 0) {
        paymentMethodID = document.forms[0].pmtmethod.value;
    	} else {
        for (i = 0; i <= document.forms[0].cnt.value; i++) {
            if (document.forms[0].pmtmethod[i].checked) {
                paymentMethodID = document.forms[0].pmtmethod[i].value;
            }
        }
    	} 
    var selectedVal = null;
    var html = "<table width='350' border='0' cellspacing='2' cellpadding='2' class='arial-black-12'>";
    html += "<tr>";
    html += "<td colspan='3' background='images/dotted_horiz1.gif'>";
    html += "&nbsp;";
    html += "</td>";
    html += "</tr>";
    html += "<tr>";
    html += "<td colspan='3' class='arial-black-12'>";
    html += "Provide additional payment information :";
    html += "</td>";
    html += "</tr>";
    html += "<tr>";
    html += "<td colspan='3' height='12' class='arial-black-12'>";
    html += "</td>";
    html += "</tr>";
	    // parse the XML
    try {
        if (xml.documentElement) {
            var sections = xml.documentElement.getElementsByTagName("section");
            var secLength = sections.length;
            for (var i = 0; i < secLength; i++) {
                var sect = sections[i];
                var label = sections[i].firstChild.firstChild.nodeValue;
                var control = sections[i].lastChild;
                //control type
                var type = control.childNodes.item(0).firstChild.nodeValue;
                //control name
                var name = control.childNodes.item(1).firstChild.nodeValue;
                if (type == 0) {
                    html += "<tr>";
                    html += "<td colspan='3'>";
                    html += "<table width='100%' border='0' cellspacing='1' cellpadding='1' class='border-black-all'>";
                    html += "      <tr>        <td class='arial-red-12'>This Payment method is not available for transaction.";
                    html += "</td>      </tr>    </table>";
                    html += "</td>";
                    html += "</tr>";
                    break;
                } else {
                //type == 5 means selection control
                }
                if (type == 5) {
                    var optionlist = control.childNodes.item(2);
                    var selectedValue = control.childNodes.item(3).firstChild.nodeValue;
                    //alert('selectedValue at first=' + selectedValue);
                    var opt = "";
                    for (var j = 0; j < optionlist.childNodes.length; j++) {
                        val = optionlist.childNodes.item(j).getAttribute("value");
                        txt = optionlist.childNodes.item(j).firstChild.nodeValue;
                        //if value is comma seperated take the second one
                        values = val.split(",");
                        arrLen = values.length;
                        valToComp = values[arrLen - 1];
                        // alert(' value =' + val);
                         //This logic is for edit mode.  Selected value will be null for add mode
                         //This will be true only while edit
                        if (selectedValue == valToComp) {
                            opt = opt + "<option value='" + val + "' selected>" + txt + "</option>";

                             //alert('bankName=' + dynamicProps(bankName));
                             //alert('companyName=' + dynamicProps(companyName));
                            if (name == "dynamicProps(bankName)" || name == "dynamicProps(companyName)") {
                                selectedTxt = txt;
                                selectedVal = val;
                               // alert('Selected Value =' + selectedVal);
                               // alert(' value =' + val);
                            }
                        } else {
                            opt = opt + "<option value='" + val + "'>" + txt + "</option>";
                            //This section for adding a new beneficiary
                            //selectedVal is for passing this selected value for
                            //loading currency delivery option, as direct product has only one
                            //RB this is enough.
                            if (name == "dynamicProps(bankName)" || name == "dynamicProps(companyName)") {
                                selectedVal = val;
                            }
                        }
                         //alert('Value =' + val);
                    }
                    var controlHtml = "<select name='" + name + "'id='" + name;
                    if (name == "' dynamicProps(bankName)" || name == "dynamicProps(companyName)") {
                        controlHtml = controlHtml + " onChange='loadDeliveryOptsForDirect(this.value);";
                    }
                    controlHtml = controlHtml + "' class='textfield-new-listProfile-ajaxfield' onChange='loadDeliveryOptsForDirect(this.value);'>" + opt + "</select>";
                    controlHtml += "<input type='hidden' name='bankNameBox' value='" + txt + "' />";
                } else {
                
                	//type == 1 means input type text field
                    if (type == 1) {
                        var val = control.childNodes.item(2).firstChild.nodeValue;
                        if (val == "BLANK") {
                            val = "";
                        }      
                        //alert("Value=#"+val+"#");
						// -----------------------------------------------------------------
                        //For Masking account Number
                        if (name == "dynamicProps(accountNumber)") {
                            if (val.length >= 4) {
                                val = "***********" + val.substring(val.length - 4);
                            } else {
                                if (val != " ") {
                                    if (val.length != 0) {
                                        val = "***********" + val;
                                    }
                                } else {
                                    val = "";
                                }
                            }
                            if (val == "") {
                        	//alert("Value empty found"); 
                        	if(paymentMethodID == "5"){
                                var controlHtml = "<input name='" + name + "' type='text' class='textfield-new' size='16' maxlength='35'>";
                            }
                            else{
                            	var controlHtml = "<input name='" + name + "' type='text' class='textfield-new' size='16' maxlength='17'>";
                            }
                            } else {
                            	if(paymentMethodID == "5"){
                                var controlHtml = "<input name='" + name + "' id='" + name + "' type='text' class='textfield-new' size='16' maxlength='17' value='" + val + "' >";
                                }
                                else{
                                var controlHtml = "<input name='" + name + "' id='" + name + "' type='text' class='textfield-new' size='16' maxlength='35' value='" + val + "' >";
                                }
                            }
                        } else {
                        	if(paymentMethodID == "5"){
                            var controlHtml = "<input name='" + name + "' id='" + name + "' type='text' class='textfield-new' size='16' maxlength='17' value='" + val + "'>";
                            }
                            else{
                             var controlHtml = "<input name='" + name + "' id='" + name + "' type='text' class='textfield-new' size='16' maxlength='35' value='" + val + "'>";
                            }
                        }                      
                    	//-----------------------------------------------------------------------
                        //var controlHtml = "<input name='" + name + "' type='text' class='textfield-new' size='16' maxlength='35' value='" + val + "'>";
                        //html +="<div style="background-color:#FFCC33"><table> <tr><td>Account Number:</td><td> "+ controlHtml+"</td></tr></table></div>";
                    } else {
                    
                    	//type == 6 means input type hidden
                        if (type == 6) {
                            var val = control.childNodes.item(2).firstChild.nodeValue;
                            var controlHtml = "<input name='" + name + "' id='" + name + "' type='hidden' value='" + val + "'>";
                            html += controlHtml;
                            //alert("Val in LoadDelivery Opt = "+ val);
                            loadDeliveryOptsForDirect(val);
                        } else {
                        
                        	//type == 2 means radio buttons
                            if (type == 2) {
                                var optionlist = control.childNodes.item(2);
                                var selectedValue = control.childNodes.item(3).firstChild.nodeValue;
                                for (var j = 0; j < optionlist.childNodes.length; j++) {        
                                	//val means value of the option butten when it selected                       
                                    val = optionlist.childNodes.item(j).getAttribute("value");
                                    loadDeliveryOptsForDirect(val);
                                    txt = optionlist.childNodes.item(j).firstChild.nodeValue;
                                    if (selectedValue == val) {
                                        var controlHtml = "<input name='" + name + "' id='" + name + "' type='radio' value='" + val;
                                        if (name == "dynamicProps(bankName)") {
                                            controlHtml = controlHtml + "' onClick='loadDeliveryOptsForDirect(this.value);";
                                        }
                                        controlHtml = controlHtml + "' checked />";
                                    } else {
                                        var controlHtml = "<input name='" + name + "' id='" + name + "' type='radio' value='" + val;
                                        if (name == "dynamicProps(bankName)") {
                                            controlHtml = controlHtml + "' onClick='loadDeliveryOptsForDirect(this.value);";
                                        }
                                        controlHtml = controlHtml + "' />";
                                    }
                                    html += "<tr>";
                                    html += "<td colspan='3' class='arial-black-12'>";
                                    html += "<table width='100%'>";
                                    html += "<tr>";
                                    html += "<td align='left' class='arial-black-12'>";
                                    html += controlHtml;
                                    html += "</td>";
                                    if (name == "dynamicProps(bankName)") {
                                        html += "<td class='arial-black-12'>";
                                    } else {
                                        html += "<td class='arial-black-12'>";
                                    }
                                    html += txt;
                                    if (name == "dynamicProps(bankName)") {
                                        var testVal = "showLocations("+val+");showCashPickUpBranchLocationsDiv(cashPickUpBranchLocations);";
                                        html += "<td>";
                                        html += " <a href='#loc' class='arial-blue-12-mOver' onclick=\"showLocations('"+val+"');showCashPickUpBranchLocationsDiv(cashPickUpBranchLocations); \">View Locations</a>";
                                        html += "</td>";
                                    }
                                    html += "</td>";
                                    html += "</tr>";
                                    html += "</table>";
                                    html += "</td>";
                                    html += "</tr>";
                                }
                                html += "<tr>";
                                html += "<td colspan='3' id='currencyOpt'>";
                            
                            //	Add javascript to include the Currency selection option
                                html += "&nbsp;";
                                html += "</td>";
                                html += "</tr>";
                                html += "<tr>";
                                html += "<td colspan='3'>";
                                html += "<table width='100%' border='0' cellspacing='1' cellpadding='1' class='border-black-all'>";
                                html += "      <tr>        <td class='arial-black-12'>The beneficiary can pick up money at any of <br />";
                                html += "          the locations of the organization you select. </td>      </tr>    </table>";
                                html += "</td>";
                                html += "</tr>";
                            }
                        }
                    }
                }
                if (type != 2 && type != 6) {
                    html += "<tr>";
                    html += "<td width='45%'>";
                    html += label;
                    html += "</td>";
                    html += "<td width='55%'>";
                    html += controlHtml;
                    html += "</td>";
                    html += "</tr>";
                }
            }
        }                               
        html += "<tr>";
        html += "<td width='100%' colspan='3' id='currDelivery'>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
        divTag = document.getElementById("pmt");
        divTag.innerHTML = html;
    }
    catch (e) {
   //     alert(e);
    }


	//The if-else section is not make any sense. But this
	//may probably has to be fixed. The else part is required
	//to add check payment currency delivery options and if part for
	//other payments.
    if (selectedVal != null) {
    //alert("LAST = "+selectedVal);
        //loadDeliveryOptsForDirect(selectedVal);
    } else {
	  //alert("Selected value is null");
        //loadDeliveryOptsForDirect(selectedVal);
    }
}
function shifting(org, dest) {
    var flag = 0;
    for (i = 0; i < org.length; i++) {
        if (org.options[i].selected) {
            flag = 1;
            dest.options[dest.length] = new Option(org.options[i].text, org.options[i].value);
        }
    }
    var cnt = 0;
    for (i = 0; i < org.length; i++) {
        if (org.options[i].selected) {
            flag = 1;
            org.remove(i);
            i = i - 1;
        }
    }
    if (flag == 0) {
        alert("Select a country from the list");
    }
}
function moveLeftToRight() {
    shifting(document.forms[0].selectCountries, document.forms[0].selectedCountries);
}
function moveRightToLeft() {
    shifting(document.forms[0].selectedCountries, document.forms[0].selectCountries);
}
function selectCountries(dest, selectedList) {
    for (i = 0; i < selectedList.length; i++) {
        selectedList.options[i].selected = true;
    }
}
function selectAll(dest) {
    for (i = 0; i < dest.length; i++) {
        dest.options[i].selected = true;
    }
}
function selectAllList(fields, dest) {
    if (fields.checked == true) {
        for (i = 0; i < dest.length; i++) {
            dest.options[i].selected = true;
        }
    } else {
        for (i = 0; i < dest.length; i++) {
            dest.options[i].selected = false;
        }
    }
}
function check_length(dest, length) {
    if (dest.value.length >= length) {
        dest.value = dest.value.substring(0, length);
    }
}
function submitAllLists() {
    selectAll(document.forms[0].userEntriesState);
    selectAll(document.forms[0].userEntriesCity);
    selectAll(document.forms[0].userEntriesCounty);
    selectAll(document.forms[0].userEntriesProvince);
    selectAll(document.forms[0].userEntriesDept);
    selectAll(document.forms[0].userEntriesMuncipality);
}



// 'Checkbox selection' function for ReleasePayment.jsp 
var payreleasecheckflag = "false";
function payreleasecheck(field) {
    if (payreleasecheckflag == "false") {
        for (i = 0; i < field.length; i++) {
            field[i].checked = true;
        }
        payreleasecheckflag = "true";
        return "Uncheck all";
    } else {
        for (i = 0; i < field.length; i++) {
            field[i].checked = false;
        }
        payreleasecheckflag = "false";
        return "Check all";
    }
}

//For Div in Address.jsp of country
function show(divID) {		
    divID.style.visibility = "visible";
}

function hide(divID) {
    divID.style.visibility = "hidden";
}

//For Div to dynamically open in coordinates of the screen.
function showDiv(divID) {	
	var y = window.document.body.scrollTop;
	divID.style.top = y + 250;
	divID.style.left = 500;
    divID.style.visibility = "visible";
}

//For Div to dynamically open in coordinates of the screen.
function showDivTermsAndCond(divID) {	
	var y = window.document.body.scrollTop;
	divID.style.top = y + 50;
	divID.style.left = 100;
    divID.style.visibility = "visible";
}

function showMandatory() {
  //alert(firstName.value);
    id = document.getElementById("middleName");
//  if((!document.forms[0].selection[id].checked)){
//  document.forms[0].mandatory[id].checked=false
}
function move(fbox, tbox,divID) {	
	var re =/[^a-zA-Za-zàÀèÈéÉïÏîÎôÔêÊçÇñáéóíÑÍÓÜÑüúü¿««\u0104\u0106\u0118\u0141\u0143\u00D3\u015A\u0179\u017B\u0105\u0107\u0119\u0142\u0144\u00F3\u015B\u017A\u017C\s.-]/;    
    if (fbox.value != "" && fbox.value.charAt(0) != ' ' &&
    			 fbox.value.charAt(fbox.value.length -1) != ' '){  	
    if (!re.test(fbox.value)){ 
    	divID.style.visibility = "hidden";  	    	  
        var no = new Option();
        no.value = fbox.value;
        no.text = fbox.value;
        tbox.options[tbox.options.length] = no;
        fbox.value = "";   
    } else {   		
	  	var html = "<li>Enter only <strong>alphabetic characters</strong>.</li>";
    	var ni = divID;
    	ni.innerHTML = html;       
        divID.style.visibility = "visible";
    }  	  
    }else {   		
	  	var html = "<li>Enter only <strong>alphabetic characters</strong>.</li>";
    	var ni = divID;
    	ni.innerHTML = html;       
        divID.style.visibility = "visible";
    }  	  
}
function remove(box) {
    for (var i = 0; i < box.options.length; i++) {
        if (box.options[i].selected && box.options[i] != "") {
            box.remove(i);            
        }
    }
   // BumpUp(box);
}
function BumpUp(abox) {
    for (var i = 0; i < abox.options.length; i++) {
        if (abox.options[i].value == "") {
            for (var j = i; j < abox.options.length - 1; j++) {
                abox.options[j].value = abox.options[j + 1].value;
                abox.options[j].text = abox.options[j + 1].text;
            }
            var ln = i;
            break;
        }
    }
    if (ln < abox.options.length) {
        abox.options.length -= 1;
        BumpUp(abox);
    }
}
function saveClick(tbox, hiddenText) {
    var xVal = "";
    for (var i = 0; i < tbox.options.length; i++) {
        xVal = xVal + tbox.options[i].value + ":";
    }
    // document.forms[0].hiddenCity.value=xVal;
    hiddenText.value = xVal;
}
function removeAllOptions(selectbox) {
    var i;
    for (i = selectbox.options.length - 1; i >= 0; i--) {
    //selectbox.options.remove(i);
        selectbox.remove(i);
    }
}
function setToList(fbox, tbox) {
    var i = 0;
    if (fbox.value != "") {
        var no = new Option();
        var textVal = new Array();
        var orgStr = fbox.value.substring(0, fbox.value.length - 1);
        textVal = fbox.value.substring(0, fbox.value.length - 1).split(":");
        for (var count = 0; count < textVal.length; count++) {
            no = new Option();
            no.value = textVal[count];
            no.text = textVal[count];
            var len = tbox.options.length;
            tbox.options[len] = no;
        }       
        //fbox.value = "";
    }
}


function cancelAll(selectbox, divID, hiddenValue) {
    removeAllOptions(selectbox);
    var a = new Array();
    a = hiddenValue.value.split(":");
    hide(divID);   
    setToList(hiddenValue, selectbox);
    //for (var k = 0; k < a.length; k++) {
       // tbox.options[k].value = a[k];
       //  tbox.options[k].text = a[k];
        
       /* try {
            tbox.add(a[k], null); // standards compliant
        }
        catch (ex) {        	
            tbox.add(a[k]); // IE only
        }*/
    //}
}
function setReadOnly() {
    document.forms[0].ftpAddress.value = "";
    document.forms[0].uploadDirectory.value = "";
    document.forms[0].downloadDirectory.value = "";
    document.forms[0].userID.value = "";
    document.forms[0].password.value = "";
    document.forms[0].ftpAddress.readOnly = true;
    document.forms[0].uploadDirectory.readOnly = true;
    document.forms[0].downloadDirectory.readOnly = true;
    document.forms[0].userID.readOnly = true;
    document.forms[0].password.readOnly = true;
}
function removeReadOnly() {
    document.forms[0].ftpAddress.readOnly = false;
    document.forms[0].uploadDirectory.readOnly = false;
    document.forms[0].downloadDirectory.readOnly = false;
    document.forms[0].userID.readOnly = false;
    document.forms[0].password.readOnly = false;
}
function removeReadonlyFlatFileSelection() {
    if (document.forms[0].pmtApprovalMethod[1].checked) {
        removeReadOnly();
    }
}
function jumpToNext(org, dest, e, len) {
    if (e.which) {  // if there is syntax support for the property 'which' (NN)
        keycode = e.which;  // e.which is stored in variable
    } else {
        keycode = e.keyCode;  // otherwise for IE, var keycode stores e.keyCode syntax
    }
    if (keycode != 8 && org.value.length == len) {
        dest.focus();
    }
}
function jumpToPrev(org, dest, e) {
    if (e.which) {  // if there is syntax support for the property 'which' (NN)
        keycode = e.which;  // e.which is stored in variable
    } else {
        keycode = e.keyCode;  // otherwise for IE, var keycode stores e.keyCode syntax
    }
    if (keycode == 8 && org.value.length == 0) {
        dest.focus();
        dest.selstart = dest.value.length;
        dest.select();
    }
}
function lockState(selection, ctrl) {
    if (selection) {
        ctrl.checked = false;
    } else {
        ctrl.checked = true;
    }
}
function generateBeneficiaryReport(id) {
    var address = "downloadBeneficiaryReport.do?method=downloadBeneficiaryReport&rbSelect=" + id;
    window.open(address);
}
function generateRemitterReport(id) {
    var address = "downloadRemitterReport.do?method=downloadRemitterReport&rbSelect=" + id;
    window.open(address);
}
function clearError(errors) {
    errors.style.visibility = "hidden";
    return true;
}
function generateBeneficiaryReport(id) {
    var address = "downloadBeneficiaryReport.do?method=downloadBeneficiaryReport&rbSelect=" + id;
    window.open(address);
}
function generateRemitterReport(id) {
    var address = "downloadRemitterReport.do?method=downloadRemitterReport&rbSelect=" + id;
    window.open(address);
}
var mins = 3;
var decrement = 1;
function startClock() {
    mins = mins - decrement;
    setTimeout("startClock()", (60 * 1000));
    if (mins == 0) {
        checkSession();
        mins = 3;
    }
}
function changeInnerHTML(ctrl1, ctrl2) {
    if (ctrl2.options.length == 0) {
        ctrl1.innerHTML = "Create List";
    }
    if (ctrl2.options.length > 0) {
        ctrl1.innerHTML = "Edit List";
    }
}
function disableIt(obj) {
    obj.disabled = !(obj.disabled);
    var z = (obj.disabled) ? "disabled" : "enabled";
}
function setEnable() {
    if (document.forms[0].optionFieldSelection.checked) {
        document.forms[0].optionalfield.disabled = false;
    }
     if (document.forms[0].optionFieldSelection1.checked) {
        document.forms[0].optionalfield1.disabled = false;
    }
}
function setEnableAll() {
    if (document.forms[0].optionFieldSelection.checked) {
        document.forms[0].optionalfield.disabled = false;
    }
    if (document.forms[0].optionFieldSelection1.checked) {
        document.forms[0].optionalfield1.disabled = false;
    }
    if (document.forms[0].optionFieldSelection2.checked) {
        document.forms[0].optionalfield2.disabled = false;
    }
}
function populateYear(inForm) {
    var temp = 0;
    var today = new Date();
    var years = today.getFullYear();
    for (var i = years - 18; i >= 1875; i--) {
	//inForm.year.options[i] = new Option(y,y);
        inForm.year.options[inForm.year.length] = new Option(i, i);
    }
}
function populateDates(formObj) {
    for (var count = 1; count <= 31; count++) {
        formObj.date.options[formObj.date.length] = new Option(count, count);
    }
}
function populateMonths(formObj) {
    var monthList = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
    for (var count = 0; count < monthList.length; count++) {
        formObj.month.options[formObj.month.length] = new Option(monthList[count], count + 1);
    }
}
function populateDateFields(formObj) {
    populateDates(formObj);
    populateMonths(formObj);
    populateYear(formObj);
}

//This method is for disabling the comboboxes in System admin Activity Reporting
//JSP's
//type =1 represents RB
//type=2 represents SB
//type=3 represents All
function showComboBox(frm, type) {
    if (type == 1) {
        frm.rbSelect.disabled = false;
        frm.sbSelect.disabled = true;
    } else {
        if (type == 2) {
            frm.sbSelect.disabled = false;
            frm.rbSelect.disabled = true;
        } else {
            if (type == 3) {
                frm.sbSelect.disabled = true;
                frm.rbSelect.disabled = true;
            }
        }
    }
}
function showComboBoxForRevenueReports(frm, type) {
    if (type == 1) {
        frm.rbSelect.disabled = false;
        frm.sbSelect.disabled = true;
    } else {
        if (type == 2) {
            frm.sbSelectOfCountry.disabled = false;
            frm.rbSelect.disabled = true;
        } else {
            if (type == 3) {
                frm.sbSelect.disabled = true;
                frm.rbSelect.disabled = true;
            }
        }
    }
}
function showComboBoxRevenueReportsDateRange(frm, type) {
    if (type == 1) {
        frm.date.disabled = false;
        frm.month.disabled = false;
        frm.year.disabled = false;
        frm.dateMonth.disabled = true;
        frm.dateYear.disabled = true;
        frm.yearYear.disabled = true;
    } else {
        if (type == 2) {
            frm.dateMonth.disabled = false;
            frm.dateYear.disabled = false;
            frm.date.disabled = true;
            frm.month.disabled = true;
            frm.year.disabled = true;
            frm.yearYear.disabled = true;
        } else {
            if (type == 3) {
                frm.yearYear.disabled = false;
                frm.date.disabled = true;
                frm.month.disabled = true;
                frm.year.disabled = true;
                frm.dateMonth.disabled = true;
                frm.dateYear.disabled = true;
            }
        }
    }
}



//This method is for disabling the comboboxes in System admin Activity Reporting - Revenue Reports
//JSP's
function showComboBoxRevenueReports(frm, type) {
    if (type == 1) {
        var len = document.forms[0].searchByBankTypeOfAggregate.length;
        for (var i = 0; i < len; i++) {
            document.forms[0].searchByBankTypeOfAggregate[i].disabled = "";
        }
        frm.criteriaSelectOfCountry.disabled = true;
        frm.sbSelectOfCountry.disabled = true;
        var len = document.forms[0].searchByBankTypeOfCountry.length;
        for (var i = 0; i < len; i++) {
            document.forms[0].searchByBankTypeOfCountry[i].disabled = "true";
        }
    } else {
        var len = document.forms[0].searchByBankTypeOfCountry.length;
        for (var i = 0; i < len; i++) {
            document.forms[0].searchByBankTypeOfCountry[i].disabled = "";
        }
        frm.sbSelectOfAggregate.disabled = true;
        frm.criteriaSelectOfCountry.disabled = false;
        frm.sbSelectOfCountry.disabled = true;
        var len = document.forms[0].searchByBankTypeOfAggregate.length;
        for (var i = 0; i < len; i++) {
            document.forms[0].searchByBankTypeOfAggregate[i].disabled = "true";
        }
        if (type == 2) {
            frm.rbSelectOfAggregate.disabled = true;
            frm.sbSelectOfAggregate.disabled = true;
            frm.sbSelectOfCountry.disabled = true;
            frm.criteriaSelectOfCountry.disabled = false;
        }
    }
}
function changeRadio() {
    if (document.forms[0].criteria[0].checked == true) {
        document.forms[0].criteria[0].checked = false;
    }
    if (document.forms[0].criteria[1].checked == true) {
        document.forms[0].criteria[1].checked = false;
    }
    if (document.forms[0].searchByBankTypeOfAggregate[0].checked == true) {
        document.forms[0].searchByBankTypeOfAggregate[0].checked = false;
    }
    if (document.forms[0].searchByBankTypeOfAggregate[0].checked == false) {
        document.forms[0].sbSelectOfAggregate.disabled = true;
    }
    if (document.forms[0].searchByBankTypeOfAggregate[1].checked == true) {
        document.forms[0].searchByBankTypeOfAggregate[1].checked = false;
    }
    if (document.forms[0].searchByBankTypeOfAggregate[1].checked == false) {
        document.forms[0].rbSelectOfAggregate.disabled = true;
    }
    if (document.forms[0].searchByBankTypeOfAggregate[2].checked == true) {
        document.forms[0].searchByBankTypeOfAggregate[2].checked = false;
    }
    if (document.forms[0].searchByBankTypeOfAggregate[3].checked == true) {
        document.forms[0].searchByBankTypeOfAggregate[3].checked = false;
    }
    if (document.forms[0].searchByBankTypeOfAggregate[4].checked == true) {
        document.forms[0].searchByBankTypeOfAggregate[4].checked = false;
    }
    if (document.forms[0].searchByBankTypeOfCountry[0].checked == true) {
        document.forms[0].searchByBankTypeOfCountry[0].checked = false;
    }
    if (document.forms[0].searchByBankTypeOfCountry[0].checked == false) {
        document.forms[0].sbSelectOfCountry.disabled = true;
    }
    if (document.forms[0].searchByBankTypeOfCountry[1].checked == true) {
        document.forms[0].searchByBankTypeOfCountry[1].checked = false;
    }
    if (document.forms[0].searchByBankTypeOfCountry[2].checked == true) {
        document.forms[0].searchByBankTypeOfCountry[2].checked = false;
    }
   //document.forms[0].searchByBankTypeOfAggregate.value="";
}
function showInnerComboBoxRevenueReports(frm, type) {
    if (type == 1) {
        frm.rbSelectOfAggregate.disabled = true;
        frm.sbSelectOfAggregate.disabled = false;
    } else {
        if (type == 2) {
        	//alert("hiii***!!!");
            frm.sbSelectOfAggregate.disabled = true;
            frm.rbSelectOfAggregate.disabled = false;
            //changeRadio();
        } else {
            if (type == 3) {
                frm.sbSelect.disabled = true;
                frm.rbSelect.disabled = true;
            }
        }
    }
}
//Function for Date Range
function changeDateTypeRadio() {
    if (document.forms[0].dateType[0].checked == true) {
        document.forms[0].dateType[0].checked = false;
    }
    if (document.forms[0].dateType[0].checked == false) {
        document.forms[0].date.disabled = true;
        document.forms[0].month.disabled = true;
        document.forms[0].year.disabled = true;
    }
    if (document.forms[0].dateType[1].checked == true) {
        document.forms[0].dateType[1].checked = false;
    }
    if (document.forms[0].dateType[1].checked == false) {
        document.forms[0].dateMonth.disabled = true;
        document.forms[0].dateYear.disabled = true;
    }
    if (document.forms[0].dateType[2].checked == true) {
        document.forms[0].dateType[2].checked = false;
    }
    if (document.forms[0].dateType[2].checked == false) {
        document.forms[0].yearYear.disabled = true;
    }
}
function showCalendar(calender) {
    calender.style.visibility = "visible";
}
function hideCalendar(divID) {
    divID.style.visibility = "hidden";
}
function checkComboBox() {
    for (var i = 0; i < document.forms[0].bankType.length; i++) {
        if (document.forms[0].bankType[i].checked) {
            showComboBox(document.forms[0], i + 1);
        }
    }
}
function checkComboBoxTwo() {
    for (var i = 0; i < document.forms[0].searchByBankType.length; i++) {
        if (document.forms[0].searchByBankType[i].checked) {
            showComboBox(document.forms[0], i + 1);
        }
    }
}
function confirmSubmit() {
    if (document.forms[0].deletemyaccount.checked) {
        var agree = confirm("Are you sure you want to delete this account from the system? \n By deleting the account any scheduled payments will be automatically canceled.");
        if (agree) {
            document.forms[0].action = "showChangedProfile.do";
            document.forms[0].submit();
        }
    } else {
        document.forms[0].action = "showChangedProfile.do";
        document.forms[0].submit();
    }
}
function confirmDirectSubmit() {
    if (document.forms[0].deletemyaccount.checked) {
        var agree = confirm("Are you sure you want to permanently delete your account?");
        if (agree) {
            document.forms[0].action = "showChangedProfile.do";
            document.forms[0].submit();
        }
    } else {
		   // document.forms[0].deletemyaccount.checked="false";
        document.forms[0].action = "showChangedProfile.do";
        document.forms[0].submit();
    }
}

function deleteTxnAlert() {
	 var agree = confirm("Are you sure you want to permanently delete this transaction?  If this is a recurring payment you will be canceling all future payments.");
       if (agree) {
        document.forms[0].action = "showDeleteTrans.do?method=showDeleteTrans";
        document.forms[0].submit();
        disableButton(buttonsrvactraDelete);
    }
}
function confirmDeleteTxn() {
    var agree = confirm("Are you sure you want to permanently delete this transaction?");
    if (agree) {
        document.forms[0].action = "showDeleteTransaction.do?method=showDeleteTransaction&transactionID=<bean:write name='pendingTransactionList' property='transactionID'/>";
        document.forms[0].submit();
    }
}
function confirmDirectDeleteTxn(transactionID) {
    var agree = confirm("Are you sure you want to permanently delete this transaction? If this is a recurring payment you will be canceling all future payments.");
    if (agree) {
        document.forms[0].action = "showDeleteTrans.do?method=showDeleteTrans&transactionID=" + transactionID;
        document.forms[0].submit();
    }
}
function showCriteriaCalendar(value) {
 
    if (value == "Date") {
        calendar.style.visibility = "visible";
        noCalendar.style.visibility = "hidden";
    } else {
    	noCalendar.style.visibility = "visible";
        calendar.style.visibility = "hidden";         
    }
}
function fileHide() {
    document.forms[0].ftpaddress.value = "";
    document.forms[0].directory.value = "";
    document.forms[0].userid.value = "";
    document.forms[0].password.value = "";
    document.forms[0].ftpaddress.disabled = true;
    document.forms[0].directory.disabled = true;
    document.forms[0].userid.disabled = true;
    document.forms[0].password.disabled = true;
}

/* Function to generate bank origination code for SB*/
function getCountryCodeElement(countryID) {
    if (document.forms[0].bankName.value.length == 0) {
        alert("Bank Name cannot be null");
        document.forms[0].bankName.focus();
        document.forms[0].country.value = "0";
    } else {
        if (countryID == 0) {
            document.forms[0].bankOriginationCode.value = "";
        } else {
            var bankName = document.forms[0].bankName.value;
            retrieveURLOriginationCode("ajaxXMLServiceAction.do?method=originationCode&service=AjaxDetails&countryID=" + escape(countryID) + "&bankName=" + escape(bankName) + "");
        }
    }
}
function getCountryCodeElementBankSB(frm) {
    if (frm.bankName.value.length != 0 && frm.country.value != "0") {
        var bankName = frm.bankName.value;
        var countryID = frm.country.value;
        retrieveURLOriginationCode("ajaxXMLServiceAction.do?method=originationCode&service=AjaxDetails&countryID=" + escape(countryID) + "&bankName=" + escape(bankName) + "");
    }
}
function retrieveURLOriginationCode(url) {
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChangeOriginationCode;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            isIE = true;
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChangeOriginationCode;
                req.send(null);
            }
        }
    }
}
function processStateChangeOriginationCode() {
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
            generateIncludeDocOriginationCode(req.responseXML);
        }
    }
}
function generateIncludeDocOriginationCode(xml) {
    try {
        if (xml) {
            var country = xml.getElementsByTagName("code");
            var val = country[0].firstChild.nodeValue;
            if (!val == "") {
                document.forms[0].bankOriginationCode.value = val.toUpperCase();
            } else {
                document.forms[0].bankOriginationCode.value = "";
            }
        }
    }
    catch (e) {
        alert(e);
    }
}
/* Function to generate bank origination code for RB*/
function getCountryCodeElementRB(countryID) {
    if (document.forms[0].receivingBankName.value.length == 0) {
        alert("Bank Name cannot be null");
        document.forms[0].receivingBankName.focus();
        document.forms[0].country.value = "0";
    } else {
        if (countryID == 0) {
            document.forms[0].orginCode.value = "";
        } else {
            var bankName = document.forms[0].receivingBankName.value;
            retrieveURLOriginationCodeRB("ajaxXMLServiceAction.do?method=originationCode&service=AjaxDetails&countryID=" + escape(countryID) + "&bankName=" + escape(bankName) + "");
        }
    }
}
function getCountryCodeElementBankRB(frm) {
    if (frm.receivingBankName.value.length != 0 && frm.country.value != "0") {
        var bankName = frm.receivingBankName.value;
        var countryID = frm.country.value;
        retrieveURLOriginationCodeRB("ajaxXMLServiceAction.do?method=originationCode&service=AjaxDetails&countryID=" + escape(countryID) + "&bankName=" + escape(bankName) + "");
    }
}
function retrieveURLOriginationCodeRB(url) {
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChangeOriginationCodeRB;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChangeOriginationCodeRB;
                req.send();
            }
        }
    }
}
function processStateChangeOriginationCodeRB() {
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
					//alert(req.responseText);
            generateIncludeDocOriginationCodeRB(req.responseXML);
        }
    }
}
function generateIncludeDocOriginationCodeRB(xml) {
    try {
        if (xml) {
            var country = xml.getElementsByTagName("code");
            var val = country[0].firstChild.nodeValue;
            if (!val == "") {
                document.forms[0].orginCode.value = val.toUpperCase();
            } else {
                document.forms[0].orginCode.value = "";
            }
        }
    }
    catch (e) {
        alert(e);
    }
}
function checkEmailValidation(email, contactName) {
    var value = new Array();
    value = email.split(",");
    var bValid = true;
    var arrayLen = value.length;
		 //alert(value.length);
    var lastCharacter = email.charAt(email.length - 1);
    if (lastCharacter == ",") {
        arrayLen = arrayLen - 1;
    }
    if (arrayLen > 5) {
        alert("Enter only five email address");
    } else {
        for (var i = 0; i < arrayLen; i++) {
            emailString = value[i].replace("\n", "");
            if (!checkEmail(emailString.trim())) {
                bValid = false;
            }
        }
    }
    if (bValid == false) {
        alert(contactName + " email is invalid");
    }
}
function trimAll(sString) {
    while (sString.substring(0, 1) == " ") {
        sString = sString.substring(1, sString.length);
    }
    while (sString.substring(sString.length - 1, sString.length) == " ") {
        sString = sString.substring(0, sString.length - 1);
    }
    return sString;
}
function checkEmail(emailStr) {
    if (emailStr.length == 0) {
        return true;
    }
    var emailPat = /^(.+)@(.+)$/;
    var specialChars = "\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
    var validChars = "[^\\s" + specialChars + "]";
    var quotedUser = "(\"[^\"]*\")";
    var ipDomainPat = /^(\d{1,3})[.](\d{1,3})[.](\d{1,3})[.](\d{1,3})$/;
    var atom = validChars + "+";
    var word = "(" + atom + "|" + quotedUser + ")";
    var userPat = new RegExp("^" + word + "(\\." + word + ")*$");
    var domainPat = new RegExp("^" + atom + "(\\." + atom + ")*$");
    var matchArray = emailStr.match(emailPat);
    if (matchArray == null) {
        return false;
    }
    var user = matchArray[1];
    var domain = matchArray[2];
    if (user.match(userPat) == null) {
        return false;
    }
    var IPArray = domain.match(ipDomainPat);
    if (IPArray != null) {
        for (var i = 1; i <= 4; i++) {
            if (IPArray[i] > 255) {
                return false;
            }
        }
        return true;
    }
    var domainArray = domain.match(domainPat);
    if (domainArray == null) {
        return false;
    }
    var atomPat = new RegExp(atom, "g");
    var domArr = domain.match(atomPat);
    var len = domArr.length;
    if ((domArr[domArr.length - 1].length < 2) || (domArr[domArr.length - 1].length > 3)) {
        return false;
    }
    if (len < 2) {
        return false;
    }
    return true;
}
String.prototype.trim = function () {
    return this.replace(/^\s*|\s*$/g, "");
};
function displayNumber(num) {
    if (num == "clr") {
        document.forms[0].keyPadQuestion.value = "";
    } else {
        if (num == "del") {
            oldStr = document.forms[0].keyPadQuestion.value;
            newStr = oldStr.substring(0, oldStr.length - 1);
            document.forms[0].keyPadQuestion.value = newStr;
        } else {
            document.forms[0].keyPadQuestion.value = document.forms[0].keyPadQuestion.value + num;
        }
    }
}
function resetForm() {
    document.forms[0].reset();
}
function clearText() {

	if (document.forms[0].paymentSchedule != undefined) {
    document.forms[0].paymentSchedule.value = "";
    }
}
function selectRecurringOption() {
	if(document.forms[0].RecurringOption != undefined) {
	document.forms[0].RecurringOption.checked = true;
	}
}

function clearTextRecurring() {
	document.forms[0].paymentRecurringFrom.value = "";
    document.forms[0].paymentRecurringTo.value = "";
    document.forms[0].monthly.checked = false;
    document.forms[0].twiceMonthly.checked = false;
}
function clearTextSelectDate() {
    document.forms[0].fromDate.value = "";
    document.forms[0].toDate.value = "";
}
function clearTextFromToDate() {
    document.forms[0].date.value = "";
}

function setRecurringMonthlyOptions(frm){
	clearText();selectRecurringOption();showCalenderSendRecurring(frm);
	frm.monthly.checked = true;
	frm.twiceFirst.value = "";
	frm.twiceFirst.enabled = false;
	frm.twiceSecond.value = "";
	frm.twiceSecond.enabled = false;
}

function setRecurringTwiceMonthlyOptions(frm){
	clearText();selectRecurringOption();showCalenderSendRecurring(frm);
	frm.twiceMonthly.checked = true;
	frm.firstDateMonthly.value= "";
	frm.firstDateMonthly.enabled = false;
}

// FX Calculator
function getFXMappedCountries(countryID) {
//alert("hi");
    retrieveURLOriginationCodeFX("ajaxXMLServiceAction.do?method=fXMappedCountries&service=AjaxDetails&countryID=" + escape(countryID));
}
function retrieveURLOriginationCodeFX(url) {
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChangeOriginationCodeFX;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChangeOriginationCodeFX;
                req.send();
            }
        }
    }
}
function processStateChangeOriginationCodeFX() {
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
					//alert(req.responseText);
            generateIncludeDocOriginationCodeFX(req.responseXML);
        }
    }
}
function generateIncludeDocOriginationCodeFX(xml) {
    var spaceCount = 0;
    try {
        if (xml) {
            var country = xml.documentElement.getElementsByTagName("country");
      // alert(country.length);
            document.forms[0].toCountry.options.length = 0;
            for (var j = 0; j < country.length; j++) {
                        //code = country.childNodes.item(j).getAttribute("code");
                code = country[j].firstChild.firstChild.nodeValue;
                name = country[j].lastChild.firstChild.nodeValue;
                         //alert("code-->"+code);
                         //alert("name-->"+name);
                         //document.forms[0].toCountry.options[code].value=name;
                document.forms[0].toCountry.options[j] = new Option(name, code);
            }
        }
    }
    catch (e) {
        alert(e);
    }
}

function showvalue() {
 //alert("hi");
    document.getElementById("viewFXResult").innerHTML = "";
    var html = "<table width='300' border='0' bgcolor='#FFFFFF'>";
    html += "<tr> <td class='arial-black-12' align='center' colspan=2>";
    html += "Foreign Exchange & Fee Calculator </td></tr>";
    html += "<tr><td class='arial-black-12' align='right' width='50%'>Amount:</td><td class='arial-black-12' align='left'>" + document.forms[0].amount.value + "</td></tr>";
    html += "<tr><td class='arial-black-12' align='right'>From:</td><td class='arial-black-12' align='left'>";
    switch (document.forms[0].fromCountry.value) {
      case "1":
        html += "USA";
        break;
      case "2":
        html += "European Union";
        break;
      case "3":
        html += "United Kingdom";
        break;
      case "4":
        html += "Switzerland";
        break;
      case "5":
        html += "Japan";
        break;
    }
    html += "</td></tr>";
    html += "<tr><td class='arial-black-12' align='right'>To:</td><td class='arial-black-12' align='left'>";
    try {
        if (xml) {
            //alert(xml.documentElement);
            var country = xml.documentElement.getElementsByTagName("code");
            //alert(country.length);
            for (var j = 0; j < country.length; j++) {
                        //code = country.childNodes.item(j).getAttribute("code");
                code = country[j].firstChild.firstChild.nodeValue;
                if (code == document.forms[0].toCountry.value) {
                    html += country[j].lastChild.firstChild.nodeValue;
                }
            }
        }
    }
    catch (e) {
        alert(e);
    }
  
  //document.forms[0].toCountry.value
    html += "</td></tr>";
    html += "<tr><td class='arial-black-12' align='right'>Method:</td><td class='arial-black-12' align='left'>" + document.forms[0].toCountry.value + "</td></tr>";
    html += "<tr><td class='arial-black-12' align='center' colspan=2>";
    html += "<a href='#' onclick='hideViewFXResultDiv(viewFXResult)'><img src='images/cancel.gif' name='Image8' width='84' height='34'></a>";
    html += "</td></tr></table>";
    document.getElementById("viewFXResult").innerHTML = html;
}

// FX Calculator for SB branch
function getFXMappedCountriesSB(countryID) {
    retrieveURLOriginationCodeFXSB("ajaxXMLServiceAction.do?method=fXMappedCountries&service=AjaxDetails&countryID=" + escape(countryID));
}
function retrieveURLOriginationCodeFXSB(url) {
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChangeOriginationCodeFXSB;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChangeOriginationCodeFXSB;
                req.send();
            }
        }
    }
}
function processStateChangeOriginationCodeFXSB() {
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
					//alert(req.responseText);
            generateIncludeDocOriginationCodeFXSB(req.responseXML);
        }
    }
}
function generateIncludeDocOriginationCodeFXSB(xml) {
    var spaceCount = 0;
    try {
        if (xml) {
            var country = xml.documentElement.getElementsByTagName("country");
            //alert(country.length);
            document.forms[0].toCountry.options.length = 0;
            for (var j = 0; j < country.length; j++) {
                        //code = country.childNodes.item(j).getAttribute("code");
                code = country[j].firstChild.firstChild.nodeValue;
                name = country[j].lastChild.firstChild.nodeValue;
                document.forms[0].toCountry.options[j] = new Option(name, code);
            }
        }
    }
    catch (e) {
        alert(e);
    }
}
function fXRateSubmit() {
			//alert("i am in");
    document.forms[0].action = "showFXRate.do?method=showFXRate";
    document.forms[0].submit();
}
function checkData() {
    flag = 1;
    var html = "";
    var ni = document.getElementById("divCalcError1");
    var olddiv = document.getElementById("divCalcError");
    if (olddiv != null) {
        ni.removeChild(olddiv);
    }
    var newdiv = document.createElement("div");
    newdiv.innerHTML = "";
    newdiv.setAttribute("id", "divCalcError");
    if (isNaN(document.forms[0].amount.value) || (document.forms[0].amount.value.length == 0) || (document.forms[0].amount.value.indexOf(" ") >= 0)) {
        html += "<li>Enter the valid <strong> amount </strong>.</li>";
        flag = 0;
    }
     var parsedAmount = Number(document.forms[0].amount.value);
    if(parsedAmount == 0){
    	html += "<li><strong>Amount </strong> must be greater than 0. </li>";
        flag = 0;
    }
    if (document.forms[0].fromCountry.value == "0") {
        html += "<li>Select a Source <strong> Country </strong>.</li>";
        show(divCalcError1);
        flag = 0;
    }
    if (document.forms[0].paymentMethod.value == "0") {
        html += "<li>Select a <strong> Payment Method </strong>.</li>";
        show(divCalcError1);
        flag = 0;
    }
    if (flag == 0) {
        viewBranchDetails.style.visibility = "visible";
        newdiv.innerHTML = html;
        ni.appendChild(newdiv);
        show(divCalcError1);
    } else {
        if (flag == 1) {
            hideViewFXResultDiv(viewBranchDetails);
            hide(divCalcError1);
        javascript:
            document.forms[0].submit();
        }
    }
}
/*function checkDataFxCalculator() {
    flag = 1;
    var html = "";
    var ni = document.getElementById("divCalcError1");
    var olddiv = document.getElementById("divCalcError");
   if (olddiv != null) {
       ni.removeChild(olddiv);
    }
    var newdiv = document.createElement("div");
    newdiv.innerHTML = "";
    newdiv.setAttribute("id", "divCalcError");
    if (isNaN(document.forms[0].amount.value) || (document.forms[0].amount.value.length == 0) || (document.forms[0].amount.value.indexOf(" ") >= 0)) {
        document.forms[0].amount.value="";
        html += "<li>Enter a valid <strong> amount </strong></li>";
        flag = 0;
    }
     var parsedAmount = Number(document.forms[0].amount.value);
    if(parsedAmount == 0){
    document.forms[0].amount.value="";
    	html += "<li><strong>Amount </strong> must be greater than 0. </li>";
        flag = 0;
    }
    if (document.forms[0].fromCountry.value == "0") {
        html += "<li>Select a Source <strong> Country </strong>.</li>";
        show(divCalcError1);
        flag = 0;
    }
    if (document.forms[0].paymentMethod.value == "0") {
        html += "<li>Select a <strong> Payment Method </strong>.</li>";
        show(divCalcError1);
        flag = 0;
    }
    if (flag == 0) {
        viewBranchDetails.style.visibility = "visible";
        newdiv.innerHTML = html;
        ni.appendChild(newdiv);
        show(divCalcError1);
    } else {
        if (flag == 1) {
            hideViewFXResultDiv(viewBranchDetails);
            hide(divCalcError1);
            var amount = document.forms[0].amount.value;
            var paymentMethod = document.forms[0].paymentMethod.value;            
            retrieveURLFXCalculator("http://indusind.staging.paylynxs.com/rb/direct/ajaxXMLServiceActionFXCalculator.do?method=fxCalculator&service=AjaxDetails&amount=" + escape(amount) + "&paymentMethod=" + escape(paymentMethod) + "");
            showViewFXResultDiv(viewFXResult);
        }
    }
}
function retrieveURLFXCalculator(url) {
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChangeFXCalculator;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChangeFXCalculator;
                req.send();
            }
        }
    }
}
function processStateChangeFXCalculator() {
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
            generateIncludeDocFXCalculator(req.responseXML);
        }
    }
}
function generateIncludeDocFXCalculator(xml) {
    try {
        if (xml) {
        	
            var fxRateMap = xml.documentElement.getElementsByTagName("FxRate");
            var fromCountry = fxRateMap[0].firstChild.firstChild.nodeValue;
            var toCountry = fxRateMap[0].childNodes.item(1).firstChild.nodeValue;
            var amount = fxRateMap[0].childNodes.item(2).firstChild.nodeValue;
            var exchangeRate = fxRateMap[0].childNodes.item(3).firstChild.nodeValue;
            var transactionFee = fxRateMap[0].childNodes.item(4).firstChild.nodeValue;
            var toCurrency = fxRateMap[0].childNodes.item(5).firstChild.nodeValue;
            var toCurrencySymbol = fxRateMap[0].childNodes.item(6).firstChild.nodeValue;
            var totalAmount = fxRateMap[0].childNodes.item(7).firstChild.nodeValue;
            var html = "<table bgcolor='#FFFFFF' width='300'>";
            html += "<tr><td colspan='2' align='center' class='arial-black-12'>";
            html += "<strong>Foreign Exchange & Fee Calculator</strong>";
            html += "</td></tr><tr><td></td></tr>";
            html += "<tr><td class='arial-black-12'>From:</td><td class='arial-black-12'>";
            html += fromCountry;
            html += "</td></tr>";
            html += "<tr><td class='arial-black-12'>To:</td><td class='arial-black-12'>";
            html += toCountry;
            html += "</td></tr>";
            html += "<tr><td class='arial-black-12'>Amount:</td>";
            html += "<td class='arial-black-12'>";
            html += "$ " + amount;
            html += "</td></tr>";
            html += "<tr><td class='arial-black-12'>Exchange Rate *:</td>";
            html += "<td class='arial-black-12'>$ 1.00 = ";
            html += toCurrency +" "+ exchangeRate;
            html += "</td></tr>";
            html += "<tr><td class='arial-black-12'>Transaction Fee:</td>";
            html += "<td class='arial-black-12'>";
            html += "$ " + transactionFee;
            html += "</td></tr>";
            html += "<tr><td class='arial-black-12'>Estimated Amount:</td>";
            html += "<td class='arial-black-12'>";
            if(toCurrency == "$"){
             html += toCurrency + " " +totalAmount +"</td></tr>";
            }
            else{
            html += totalAmount + " " +toCurrencySymbol +"</td></tr>";
            }
            html += "<tr><td class='arial-black-12' align='center' colspan='2'>";
            html+="<input type='button' value='Close' Class='button1' onclick='hideViewFXResultDiv(viewFXResult);clearValue();' border='0' alt='' tabindex=8' onmouseover='mouseOverFunct(this)' onmouseout='mouseOutFunct(this)' >"
			html += "</td></tr><tr><td align='center' colspan='2'>";
            html += "<font style='font-family: MS Sans Serif; font-size:8pt'  color='black'>";
            html += "* Exchange rates are indicative only.Actual rates will be applied when the payment is processed on or after the availability date shown on your receipt.</td>";
            html += "</tr></table>";
             divTag = document.getElementById("viewFXResult");
             divTag.innerHTML = html;
            showViewFXResultDiv(document.getElementById("viewFXResult"));
        }
    }
    catch (e) {
        alert(e);
    }
}*/
function mouseOverFunct(btn)
{
btn.className="button2";
}
function mouseOutFunct(btn)
{
btn.className="button1";
}
function clearValue() {
	document.forms[0].amount.value = "";
    document.forms[0].fromCountry.value = "0";
    document.forms[0].paymentMethod.value = "0";
    document.forms[0].paymentMethod.value = "0";
}






//
function storeBeneContent() {
    var arrayObject = new Array();
    for (i = 0; i < document.forms[0].elements.length; i++) {
        arrayObject[i] = document.forms[0].elements[i].value;
    }
    document.forms[0].firstName.value = "dfgdfgdfg";
		//for(i=0;i<arrayObject.length;i++){
		//document.forms[0].elements[i].value = arrayObject[i];
		//alert(document.forms[0].elements[i].value);
		//}
}
function closedivCalcError001() {
    var d = document.getElementById("divCalcError1");
    var olddiv = document.getElementById("divCalcError");
    if (olddiv != null) {
        d.removeChild(olddiv);
    }
    hideViewFXResultDiv(viewBankDetails);
    hide(divCalcError1);
    var oHelperIframe = document.getElementById("HELPER_IFRAME_ID");
	oHelperIframe.style.visibility = 'hidden';
}
function setAccountNumber(value) {
    var accntField = document.getElementById("accountNumber");
    alert(value);
    accntField.value = value;
}
function focusOnSubmit() {
    document.getElementById("submitLink").focus();
}
function checkEvents(e) {
    if (e.keyCode == 13) {
        focusOnSubmit();
    }
}
function clearAllFXValues() {
//alert("hi");
    hideViewFXResultDiv(viewFXResult);
    document.forms[0].action = "clearAllValues.do?method=clearAllFXValues";
    document.forms[0].submit();
}

// FX calculator in service Exixting Account
function checkFXData() {
    flag = 1;
    if (document.forms[0].amount.value == "") {
        alert("enter the Amount!");
        flag = 0;
    }
    if (isNaN(document.forms[0].amount.value)) {
        alert("Please enter a valid amount!");
        flag = 0;
    }
    if (document.forms[0].fromCountry.value == "0") {
        alert("Select the From Country!");
        flag = 0;
    }
    if (document.forms[0].paymentMethod.value == "0") {
        alert("Select a Payment Method !");
        flag = 0;
    }
    if (flag == 1) {
        hideViewFXResultDiv(viewBranchDetails);
        document.forms[0].action = "calcFXRate.do?method=calculateFXRate";
    javascript:
        document.forms[0].submit();
        show(viewServiceFXCalcResult);
    }
}
function clearAllServiceFXValues() {
//alert("hi");
    hide(viewServiceFXCalcResult);
    document.forms[0].action = "clearAllValues.do?method=clearAllFXValues";
    document.forms[0].submit();
}
function showloginAuthentication() {
//hide(viewServiceFXCalcResult);
    document.forms[0].action = "gotoAccountAunthentication.do?method=loginAuthentication";
    document.forms[0].submit();
}
function displayTellAFriend() {
//alert(window.parentWindow.location.href);
//alert(parent.location.href);
//alert(window.parent.location.href);
//alert(window.parent.location);
    document.rbDirectHomeForm.rbSiteUrl.value = parent.location.href;
//alert("URL ="+document.rbDirectHomeForm.rbSiteUrl.value);
    document.rbDirectHomeForm.action = "mrktls/displayTellAFriend.do?method=showTellYourFriend&rbSiteUrl=" + document.rbDirectHomeForm.rbSiteUrl.value;
    document.rbDirectHomeForm.submit();
}
/*
	Function for clearing additional payment contrl elements 
*/
function clearPaymentContrls(form) {
	//alert("Leg ="+form.length);
    for (var i = 0; i < form.length; i++) {
		
		//alert(" element id =" + i +" name="+ form[i].name+" " + form[i].value);
        if (form[i].name == "dynamicProps(accountNumber)") {
            setTimeout("clearPaymentContrl()", 1000);
            form[i].value = "";
        }
    }
}
function focusOnUserName() {
//alert("inside the username highlight");
//document.form[3].userName.value="";
    document.getElementById("userName").focus();
}
function displayForgotUserName() {
//alert(window.parentWindow.location.href);
//alert(parent.location);
//alert(parent.location);
//alert(parent.location);
//alert(parent.location);
//alert("URL ="+document.rbDirectHomeForm.rbSiteUrl.value);
    document.forms[0].action = "showResetPasswordComplete.do?method=forgotPassword&rbSiteUrl=" + parent.location.href;
    document.forms[0].submit();
}
function confirmationBlockOrHold(confirmString) {
    var flag = 0;
    for (count = 0; count < document.forms[0].suspiciousparty.length; count++) {
        if (document.forms[0].suspiciousparty[count].checked == true) {
            flag = 1;
            var confirmation;
            if (confirmString == "Block") {
                confirmation = confirm("You are about to permanenlty block this transaction. Once it is blocked it cannot be released. Are you sure you want to proceed?");
            } else {
                if (confirmString == "Hold") {
                    confirmation = confirm("You are about to put this transaction on hold. This will result in stopping this transaction from being released to the beneficiary. You can release this transaction at a later date. Are you sure you want to proceed?");
                }
            }
        }
    }
    if (flag == 0) {
        alert("Select a suspicious party");
    }
    if (confirmation == true) {
        document.forms[0].submit();
    }
}

function confirmationRelease() {
    var flag = 0;
    var obj = document.forms[0];
    var len = document.forms[0].length;
    for (count = 0; count < len; count++) {
        if (obj[count].checked == true) {
            flag = 1;
        }
    }
    if (flag == 0) {
        alert("Select atleast one ");
    }
    else if (flag == 1)
    {
    	var confirmation;
    	confirmation = confirm("You are about to unlock the selected accounts.The Remitter will be able to access their account again and enter new transactions.Are you sure you want to proceed?");
    }
    if (confirmation == true) {
        document.forms[0].submit();
    }
}
function confirmationFreeze() {
    var confirmString = confirm("You are about to freeze this account. The remitter will no longer be able to access their account. All payments will be placed on hold and all scheduled payments will be canceled. Are you sure you want to proceed?");
    if (confirmString == true) {
    	document.forms[0].action="showFrozenAccountComplete.do";
        document.forms[0].submit();
    }
}
function rateApprove() {
    var flag = 0;
    var obj = document.forms[0];
    var len = document.forms[0].length;
    var checkBoxCount = 0;
    for (count = 0; count < len; count++) {
    	if(obj[count].type == "checkbox"){
    		checkBoxCount++;
    	}
        if (obj[count].checked == true) {
            flag++;
        }
    }
    if (checkBoxCount > flag && flag != 0) {
        var confirmString = confirm("You did not select all of the new rates. Only the rates you selected will be updated. Do you want to continue");
        if (confirmString == true) {
            document.forms[0].submit();
        } else {
            if (confirmString == false) {
            }
        }
    } else {
        document.forms[0].submit();
    }
}
function rateApproveConfirm(isRateAvlble) {
	if(isRateAvlble == 1){
	 var rateAvlbe = confirm("An FX rate is already available in the time slot. Once you submit the rates they will be immediately published to all user sending money to your bank. Are you sure you want to publish the new rates?");
	 if(rateAvlbe == true){
	 	document.forms[0].submit();
	 }
	}
	else{
		var confirmString = confirm("Once you submit the rates they will be immediately published to all user sending money to your bank. Are you sure you want to publish the new rates?");
	    if (confirmString == true) {
	        document.forms[0].submit();
	    }
	}
}
function rateUpdateConfirm(isRateAvlble){

	if(isRateAvlble == 1){
		var rateAvailable = confirm("An FX rate is already defined in the time slot. Are you sure you want to continue?");
		if(rateAvailable == true){
			document.forms[0].action ="showNewFXRatesComplete.do?method=viewNewRatesComplete";
			document.forms[0].submit();
		}
	}
	else{
		document.forms[0].action ="showNewFXRatesComplete.do?method=viewNewRatesComplete";
		document.forms[0].submit();
	}
}
function chgStatusReason(divID) {
    if (document.forms[0].accountSuspicion == "other") {
        divID.visibility = "visible";
    } else {
        divID.visibility = "hidden";
    }
}
/* Functions for checking the factor trust status */
function checkfactorStatuscall() {
    document.forms[0].action = "pleaseWait.do?method=validationResult";
    document.forms[0].submit();
}
/*
var factorMins = 0;
var factorDecrement = 0;
function checkFactorStatus() {

     //alert("inside checkFactorStauts"+factorMins);

    // alert("inside checkFactorStauts"+factorMins);

	 factorMins = factorMins - factorDecrement;
	// alert("inside checkFactorStauts"+factorMins);
	// setTimeout('checkFactorStatus()', 4000);	
	 //alert("After called inside checkFactorStauts"+factorMins);
	  if (factorMins == 0) {  
		url =  window.location.protocol + "//" + window.location.hostname 
		+ ":" + window.location.port 
		+ "/PayLynxs/rb/direct/srvac/pleaseWait.do?method=validationResult";
		
        sendRequestToURL(url);
        factorMins = 2;
    }
}

var factReq;
function sendRequestToURL(url) {
    if (window.XMLHttpRequest) { // Non-IE browsers
        factReq = new XMLHttpRequest();
        try {
            factReq.open("GET", url, true);
            factReq.onreadystatechange = redirectPage;
        }
        catch (e) {
            alert(e);
        }
        factReq.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            factReq = new ActiveXObject("Microsoft.XMLHTTP");
            if (factReq) {
                factReq.open("GET", url, true);
                factReq.onreadystatechange = redirectPage;
                factReq.send();
            }
        }
    }
}*/
function toclear() {
    for (count = 0; count < document.forms[0].elements.length; count++) {
        document.forms[0].elements[count].checked = false;
    }
}
//please wait using div tag
function gowait() {
    document.getElementById("main").style.visibility = "hidden";
    document.getElementById("wait").style.visibility = "visible";
    document.getElementById("menu").style.visibility = "hidden";
    document.forms[0].submit();
    window.setTimeout("showProgress()", 500);
 // document.forms[0].action="pleaseWait.do?method=validationResult";
}
function showProgress() {
    var wg = document.getElementById("wait.gif");
    wg.src = wg.src;
 // document.forms[0].action="pleaseWait.do?method=validationResult";
   //document.forms[0].submit();
}





// revenue Reports (getting the sb list from the country id)
function getRevenueReportSBList(countryID) {
    retrieveURLOriginationCodeFX("ajaxXMLServiceAction.do?method=sbList&service=AjaxDetails&countryID=" + escape(countryID));
}
function retrieveURLOriginationCodeFX(url) {
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChangeOriginationCodeFX;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChangeOriginationCodeFX;
                req.send();
            }
        }
    }
}
function processStateChangeOriginationCodeFX() {
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
					//alert(req.responseText);
            generateIncludeDocOriginationCodeFX(req.responseXML);
        }
    }
}
function generateIncludeDocOriginationCodeFX(xml) {
    var spaceCount = 0;
    try {
        if (xml) {
            var country = xml.documentElement.getElementsByTagName("country");
      // alert(country.length);
            document.forms[0].sbSelectOfCountry.options.length = 0;
            for (var j = 0; j < country.length; j++) {
                        //code = country.childNodes.item(j).getAttribute("code");
                code = country[j].firstChild.firstChild.nodeValue;
                name = country[j].lastChild.firstChild.nodeValue;
                         //alert("code-->"+code);
                         //alert("name-->"+name);
                         //document.forms[0].toCountry.options[code].value=name;
                document.forms[0].sbSelectOfCountry.options[j] = new Option(name, code);
            }
        }
    }
    catch (e) {
        alert(e);
    }
}
function getRadioDisabled() {
    alert(e);
}
//for server down message
function servermessage(message) {
    var html;
    html = "<table width='100%'>";
    html += "<tr>";
    html += "<td colspan='3' class='arial-black-12' >";
    html += "&nbsp;";
    html += "</td>";
    html += "</tr>";
    html += "<tr>";
    html += "<td width='100%' class='arial-red-12' color='red' colspan='2'>" + message;
    html += "</td>";
    html += "</tr>";
    html += "<tr>";
    html += "<td align='center' colspan=2  >";
    html += "<a href='#' onClick='hide(downmsg)'onMouseOut='MM_swapImgRestore()' onMouseOver='MM_swapImage('Image3','','images/closed_over.gif',1)'><img src='images/closed.gif' name='Image3' width='84' height='34' border='0' alt=''></a>";
    html += "</td>";
    html += "</tr>";
    html += "</table>";
    divTag = document.getElementById("downmsg");
    divTag.style.visibility = "visible";
    divTag.innerHTML = html;
}

function disclaimers1()
{
 	var termsOfUse=document.forms[0].termsOfUse.value;
 	var html;
 	html=termsOfUse;
	divTag = document.getElementById("terms");
	divTag.style.visibility = "visible";
	divTag.innerHTML = html;
}

function disclaimersdelete()
{
 	var termsOfUse1=document.forms[0].deleteAccount.value;
 	var html;
 	html=termsOfUse1;
	divTag = document.getElementById("terms123");
	divTag.style.visibility = "visible";
	divTag.innerHTML = html;
}
function disclaimersManage()
{
 	var trndisclaimer = document.forms[0].trnRcpDisclmr.value;
 	//deletedisclaimer += " <p> <a href='#end'> <img src='images/cancel.gif' border='0' alt='' onclick='hide(trnRcptDiv)'> </a> ";
	//deletedisclaimer += "<img src='images/print.gif' 'alt='' border='0' height='34' width='84' onclick='Javascript:if(window.print) window.print();' /> </p>";
	divTag = document.getElementById("trnRcptDiv");
	divTag.style.visibility = "visible";
	divTag.innerHTML = trndisclaimer;
}
function disclaimersDeleteManage()
{
	var deletedisclaimer = document.forms[0].delAccDisclmr.value;
 	divTag = document.getElementById("delAccDiv");
	divTag.style.visibility = "visible";
	divTag.innerHTML = deletedisclaimer;
}
function disclaimersSbDeleteManage()
{
 	var sbdeletedisclaimer = document.forms[0].sbdelAccDisclmr.value;
 	divTag = document.getElementById("sbdelAccDiv");
	divTag.style.visibility = "visible";
	divTag.innerHTML = sbdeletedisclaimer;
}
function disclaimersp()
{
 	var privacypolicy=document.forms[0].privacyPolicy.value;
 	var html;
 	html=privacypolicy;
	divTag = document.getElementById("terms1234");
	divTag.style.visibility = "visible";
	divTag.innerHTML = html;
}


function disclaimers(termsOfUse)
{
	var html;
	html=termsOfUse;
	divTag = document.getElementById("terms");
	divTag.style.visibility = "visible";
	divTag.innerHTML = html;
}


function showDeliveryOption(paymentMethodId) {
    retrieveURLDeliveryOption("ajaxXMLServiceActionDeliveryOption.do?method=deliveryOption&service=AjaxDetails&paymentID=" + escape(paymentMethodId) + "");
}
function retrieveURLDeliveryOption(url) {
	if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChangeDeliveryOption;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            isIE = true;
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChangeDeliveryOption;
                req.send();
            }
        }
    }
}
function processStateChangeDeliveryOption() {
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
            generateIncludeDocDeliveryOption(req.responseXML);
        }
    }
}
function generateIncludeDocDeliveryOption(xml) {
    var html = "<table border='0' cellspacing='0' cellpadding='0' class='arial-black-12' width='100%'>";
    html += "<tr valign='top' align='left'>";
    html += "<td height='22'>";
    html += "<table width='100%'>";
    html += "<tr bgcolor='#F2F2F2'><td align='right'><a href='#' onclick='hide(deliveryOptions)' class='arial-black-12-mOver'><strong>Close</strong></a></td></tr>";
    html += "</table><tr valign='top'>";
    html += "<td valign='top'>";
    html += "<table>";
    var spaceCount = 0;
    try {
        if (xml) {
            var title = xml.getElementsByTagName("title");
            var val = title[0].firstChild.nodeValue;
            var company = xml.documentElement.getElementsByTagName("company");
            html += "<tr>";
            html += "<td class='arial-blue-12'><strong><U>";
            html += val;
            html += "</strong></U></td>";
            html += "</tr>";
            for (var j = 0; j < company.length; j++) {
                        //code = country.childNodes.item(j).getAttribute("code");
                companyName = company[j].firstChild.firstChild.nodeValue;
                        // alert("code-->"+code);
                html += "<tr>";
                html += "<td class='arial-blue-12'>";
                html += companyName;
                html += "</td>";
                html += "</tr>";
            }
        }
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
    }
    catch (e) {
        alert(e);
    }
    if (val != "NotAvailable") {
        divTag = document.getElementById("deliveryOptions");   
        divTag.innerHTML = html;       
    } else {
        divTag = document.getElementById("deliveryOptions");
        var html = "<table width='100%' border='0' cellspacing='0' cellpadding='0' class='arial-black-12'>";
        html += "<tr valign='top' align='left'>";
        html += "<td height='22'>";
        html += "<table width='100%'>";
        html += "<tr bgcolor='#F2F2F2'><td align='right'><a href='#' onclick='hide(deliveryOptions)' class='arial-black-12-mOver'><strong>Close</strong></a></td></tr>";
        html += "</table><tr valign='top'>";
        html += "<td valign='top'><strong>Locations Not Available</strong>";
        html += "<table>";
        divTag.innerHTML = html;
    }
}
function showDeliveryOptionList(paymentMethodId) {
	divTag = document.getElementById("deliveryOptions"); 
 	divTag.innerHTML = "<img src='images/wait.gif' align='absmiddle'><strong>Please Wait....</strong>";
    retrieveURLDeliveryOptionList("ajaxXMLServiceActionDeliveryOptionList.do?method=deliveryOptionDirect&service=AjaxDetails&paymentID=" + escape(paymentMethodId) + "");
}
function retrieveURLDeliveryOptionList(url) { 	
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChangeDeliveryOptionList;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            isIE = true;
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChangeDeliveryOptionList;
                req.send();
            }
        }
    }
}
function processStateChangeDeliveryOptionList() {
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
            generateIncludeDocDeliveryOptionList(req.responseXML);
        }
    }
}
function generateIncludeDocDeliveryOptionList(xml) {
    var html = "<table width='100%' border='0' cellspacing='0' cellpadding='0' class='arial-black-12'>";
    html += "<tr valign='top' align='left'>";
    html += "<td height='22'>";
    html += "<table width='100%'>";
    html += "<tr bgcolor='#F2F2F2'><td align='right'><a href='#' onclick='hide(deliveryOptions)' class='arial-black-12-mOver'><strong>Close</strong></a></td></tr>";
    html += "</table><tr valign='top'>";
    html += "<td valign='top'>";
    html += "<table>";
    var spaceCount = 0;
    try {
        if (xml) {
            var title = xml.getElementsByTagName("title");
            var val = title[0].firstChild.nodeValue;
            var company = xml.documentElement.getElementsByTagName("company");
            html += "<tr>";
            html += "<td class='arial-black-12'><strong>";
            html += val;
            html += "</strong></td>";
            html += "</tr>";
            for (var j = 0; j < company.length; j++) {
                        //code = country.childNodes.item(j).getAttribute("code");
                companyName = company[j].firstChild.firstChild.nodeValue;
                        // alert("code-->"+code);
                html += "<tr>";
                html += "<td class='arial-black-12'>";
                html += companyName;
                html += "</td>";
                html += "</tr>";
            }
        }
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
    }
    catch (e) {
        alert(e);
    }
    if (val != "NotAvailable") {
        divTag = document.getElementById("deliveryOptions");        
 				//var newDiv = document.createElement('div');
        divTag.innerHTML = html;
       	//divTag.appendChild(newDiv);
    } else {
        divTag = document.getElementById("deliveryOptions");
        var html = "<table width='100%' border='0' cellspacing='0' cellpadding='0' class='arial-black-12'>";
        html += "<tr valign='top' align='left'>";
        html += "<td height='22'>";
        html += "<table width='100%'>";
        html += "<tr bgcolor='#F2F2F2'><td align='right'><a href='#' onclick='hide(deliveryOptions)' class='arial-black-12-mOver'><strong>Close</strong></a></td></tr>";
        html += "</table><tr valign='top'>";
        html += "<td valign='top'><strong>Locations Not Available</strong>";
        html += "<table>";
        divTag.innerHTML = html;
    }
}





//to submit on press enter
function submitIfEnter(e) {
    if (e.keyCode == 13) {
    	showloginAuthentication();
    }
}
function showCalen(number) {
    var el, i = 0;
    while (el = document.getElementById("d" + (i++))) {
        el.style.display = "none";
    }
    document.getElementById("d" + number).style.display = "block";
}
function hideCalen(number) {
    document.getElementById("d" + number).style.display = "none";
}
function showCalend(a, b) {
    document.getElementById("d" + a).style.display = "block";
    document.getElementById("d" + b).style.display = "block";
}
function hideCalend(a, b) {
    document.getElementById("d" + a).style.display = "none";
    document.getElementById("d" + b).style.display = "none";
}
function showCalende(a, b) {
    document.getElementById("d" + a).style.display = "block";
    document.getElementById("d" + b).style.display = "none";
}
function showCalenderDuplicate(frm, type) {
    if (type == 1) {
        frm.startDate.disabled = false;
        frm.endDate.disabled = false;
    }
}
function hideCalenderDuplicate(frm) {
    frm.startDate.disabled = true;
    frm.endDate.disabled = true;
}
function showCalenderHistory(frm, type) {
    if (type == 1) {
        frm.fromDate.disabled = false;
        frm.toDate.disabled = false;
    }
}
function hideCalenderHistory(frm) {
    frm.fromDate.disabled = true;
    frm.toDate.disabled = true;
}
function showCalenderInDailyReportSelectDate(frm) {
	frm.date.disabled = false;
}
function showCalenderInDailyReportFromToDate(frm) {
	frm.fromDate.disabled = false;
    frm.toDate.disabled = false;
}
function showCalenderSend(frm, type) {
    if (type == 1) {
      if(frm.paymentSchedule != undefined){
        frm.paymentSchedule.disabled = false;
      }
      hideCalenderSendRecurring(frm);
    }
}

function showCalenderSendRecurring(frm) {
      frm.paymentRecurringFrom.disabled = false;
      frm.paymentRecurringTo.disabled = false;
      frm.monthly.disabled = false;
      frm.twiceMonthly.disabled = false;
}

function hideCalenderSendRecurring(frm) {

	if (frm.paymentRecurringFrom != undefined) {
    frm.paymentRecurringFrom.value = "";
    frm.paymentRecurringTo.value = "";
    frm.paymentRecurringFrom.disabled = true;
    frm.paymentRecurringTo.disabled = true;
    frm.twiceFirst.value = "";
	frm.twiceFirst.enabled = false;
	frm.twiceSecond.value = "";
	frm.twiceSecond.enabled = false;
	frm.firstDateMonthly.value= "";
	frm.firstDateMonthly.enabled = false;
	frm.monthly.checked = false;
	frm.twiceMonthly.checked = false;
	}
}

function hideCalenderSend(frm) {
	if (frm.paymentSchedule != undefined) {
    frm.paymentSchedule.disabled = true;
    }
}
function hideCalenderInDailyReportSelectDate(frm) {
	    frm.fromDate.disabled = true;
	    frm.toDate.disabled = true;
}

function hideCalenderInDailyReportFromToDate(frm) {
		frm.date.disabled = true;
}

function sendOnLoad()
{
   if(document.forms[0].scheduleOption[1].checked && document.forms[0].paymentSchedule != undefined)  {    
       document.forms[0].paymentSchedule.disabled = false;
  }
}

function cntrlResizeOnLoad(cntrlnm){
cntrlnm.style.width='auto';
}

function hideDailyReportDates(){
	if(document.forms[0].dailyReportOption[0].checked==false 
			&& document.forms[0].dailyReportOption[1].checked==false ){
		document.forms[0].fromDate.disabled = true;
		document.forms[0].toDate.disabled = true;
		document.forms[0].date.disabled = true;
	}
	else if(document.forms[0].dailyReportOption[0].checked==true){
		document.forms[0].fromDate.disabled = true;
		document.forms[0].toDate.disabled = true;
		document.forms[0].date.disabled = false;
	}
	else if(document.forms[0].dailyReportOption[1].checked==true){
		document.forms[0].fromDate.disabled = false;
		document.forms[0].toDate.disabled = false;
		document.forms[0].date.disabled = true;
	}
}
function sendOnLoadtrHis()
{
   if(document.forms[0].timeFrame[2].checked)  {    
       document.forms[0].fromDate.disabled = false;
       document.forms[0].toDate.disabled = false;
}
}
  
function hideNrcptMsgBox(divID) {
    divID.style.visibility = "hidden";
}

function showNrcptMsgBox(divID) { 
    divID.style.visibility = "visible";
}

function enableTextFields(frm){		
	if (frm.accountNumberSelection.checked == true){
		frm.newNameAccntNum.disabled = false;
		frm.minimumLength.disabled = false;
		frm.maximumLength.disabled = false;
	}	
	if (frm.accountNumberSelection.checked == false){
		frm.newNameAccntNum.disabled = true;
		frm.minimumLength.disabled = true;
		frm.maximumLength.disabled = true;
	}
	enableTextFieldsChecking(frm);
	
}

function enableTextFieldsChecking(frm){		
	
	if (frm.routingNumberSelection.checked == true){
		frm.newNameRoutNum.disabled = false;
	}
	if (frm.routingNumberSelection.checked == false){
		frm.newNameRoutNum.disabled = true;
	}
	
	if (frm.bankBranchNameSelection.checked == true){
		frm.newNameBankBrchName.disabled = false;
	}
	if (frm.bankBranchNameSelection.checked == false){
		frm.newNameBankBrchName.disabled = true;
	}
	if (frm.bankBranchCodeSelection.checked == true){
		frm.newNameBankBrchCode.disabled = false;
	}
	if (frm.bankBranchCodeSelection.checked == false){
		frm.newNameBankBrchCode.disabled = true;
	}
	if (frm.bankBranchCitySelection.checked == true){
		frm.newNameBankBrchCity.disabled = false;
	}
	if (frm.bankBranchCitySelection.checked == false){
		frm.newNameBankBrchCity.disabled = true;
	}
	additionalFeePresent = false;
	for (i=0;i<frm.length;i++){
	if (frm.elements[i].name == "addlnFee"){
	additionalFeePresent = true;
	break;
	}	
	}
	if (additionalFeePresent == true){
	addtionalFeeChecking(frm);
	}
	
}

function accountNumberSelectionChecking(frm){
if (frm.accountNumberSelection.checked == true){
		frm.newNameAccntNum.disabled = false;		
	}	
	if (frm.accountNumberSelection.checked == false){
		frm.newNameAccntNum.disabled = true;		
	}
}

function typeofCardPrePaid(frm){
if (frm.typeOfCardSelection.checked == true){
		frm.typeOfCard.disabled = false;		
	}	
	if (frm.typeOfCardSelection.checked == false){
		frm.typeOfCard.disabled = true;		
	}
}

function addtionalFeeChecking(frm){
	if (frm.addlnFee.checked == true){
		frm.addlnFeeValue.disabled = false;
		frm.addlnFeeBillToCust.disabled = false;
	}
	if (frm.addlnFee.checked == false){
		frm.addlnFeeValue.disabled = true;
		frm.addlnFeeBillToCust.disabled = true;
	}
	
	if (frm.addlnFeeUSDDelivery.checked == true){
		frm.addlnFeeUSDDeliveryValue.disabled = false;
		frm.addlnFeeUSDDeliveryBillToCust.disabled = false;
	}
	if (frm.addlnFeeUSDDelivery.checked == false){
		frm.addlnFeeUSDDeliveryValue.disabled = true;
		frm.addlnFeeUSDDeliveryBillToCust.disabled = true;
	}
}

function addtionalFeeCheckingCourierChecking(frm){
	additionalFeeCourierPresent = false;
	for (i=0;i<frm.length;i++){
	if (frm.elements[i].name == "addlnFeeCourierDelivery"){
	additionalFeeCourierPresent = true;
	break;
	}	
	}
	if (additionalFeeCourierPresent == true){
	if (frm.addlnFeeCourierDelivery.checked == true){
		frm.addlnFeeCourierDeliveryValue.disabled = false;
		frm.addlnFeeCourierDeliveryBillToCust.disabled = false;
	}
	if (frm.addlnFeeCourierDelivery.checked == false){
		frm.addlnFeeCourierDeliveryValue.disabled = true;
		frm.addlnFeeCourierDeliveryBillToCust.disabled = true;
	}
	}
}

function courierServiceSelectionCheck(frm){	
	citizenResidencyIDChecking(frm);
	courierServiceCheckingAll(frm);	
	secretWordCheckingAll(frm);
	bankBrchNameChecking(frm);
	bankBrchCodeChecking(frm);
}

function secretWordCheckingAll(frm){
	if (frm.secretWordSelection.checked == true){
		frm.secretWordName.disabled = false;
	}
	if (frm.secretWordSelection.checked == false){
		frm.secretWordName.disabled = true;
	}
}

function courierServiceCheckingAll(frm){
	if (frm.courierServiceSelection.checked == true){
		frm.courierService.disabled = false;
	}
	if (frm.courierServiceSelection.checked == false){
		frm.courierService.disabled = true;
	}
}

function citizenResidencyIDChecking(frm){
	if (frm.citizenResidencyIDSelection.checked == true){
		frm.citizenResidencyID.disabled = false;
	}
	if (frm.citizenResidencyIDSelection.checked == false){
		frm.citizenResidencyID.disabled = true;
	}
}

function bankBrchNameChecking(frm){
	if (frm.bankBranchNameSelection.checked == true){
		frm.newNameBankBrchName.disabled = false;
	}
	if (frm.bankBranchNameSelection.checked == false){
		frm.newNameBankBrchName.disabled = true;
	}
}

function bankBrchCodeChecking(frm){
	if (frm.bankBranchCodeSelection.checked == true){
		frm.newNameBankBrchCode.disabled = false;
	}
	if (frm.bankBranchCodeSelection.checked == false){
		frm.newNameBankBrchCode.disabled = true;
	}
}

function companyIDNumIDChecking(frm){
	if (frm.companyIdNumberSelection.checked == true){
		frm.companyIdNumber.disabled = false;
	}
	if (frm.companyIdNumberSelection.checked == false){
		frm.companyIdNumber.disabled = true;
	}
}

function enableBankBranchStateTextField(frm){
	if (frm.bankBranchStateSelection.checked == true){
		frm.newNameBankBrchState.disabled = false;
	}
	if (frm.bankBranchStateSelection.checked == false){
		frm.newNameBankBrchState.disabled = true;
	}
}

function enableBankBranchProvinceTextField(frm){
	if (frm.bankBranchProvinceSelection.checked == true){
		frm.newNameBankBrchProvince.disabled = false;
	}
	if (frm.bankBranchProvinceSelection.checked == false){
		frm.newNameBankBrchProvince.disabled = true;
	}
}

function advdBeneUserInterfaceSelectionForEdit(frm){
	for(var i=0;i<frm.advdBeneUserInterface.length;i++){
	if (frm.advdBeneUserInterface[i].checked &&
			frm.advdBeneUserInterface[i].value == "50"){			
		routingNunmberAdvcdBeneSelectionEdit(frm);
		break;
	}else if (frm.advdBeneUserInterface[i].checked && 
					frm.advdBeneUserInterface[i].value == "51"){
		bankBranchNameAdvcdBeneSelectionEdit(frm);
		break;
	}else if (frm.advdBeneUserInterface[i].checked && 
					frm.advdBeneUserInterface[i].value == "52"){
		bankProvinceAdvcdBeneSelectionEdit(frm);		
		break;
	}else if (frm.advdBeneUserInterface[i].checked && 
					frm.advdBeneUserInterface[i].value == "53"){
		bankNameProvinceAdvcdBeneSelectionEdit(frm);		
		break;
	}else if (frm.advdBeneUserInterface[i].checked && 
					frm.advdBeneUserInterface[i].value == "0"){
		notApplicableAdvcdBeneSelection(frm);
		break;
	}
	}
}

function routingNunmberAdvcdBeneSelectionEdit(frm){
		routAdvcdBeneficiarySelection(frm,"true");
		citizenResidenceIDSelectionForEdit(frm)
		accntNumberSelectionForEdit(frm);
		bankBrchNameSelectionForEdit(frm);
		bankBrchCodeSelectionForEdit(frm);			
		bankBranchCitySelectionForEdit(frm);
		bankBrchSelectionForEdit(frm);
		bankBrchProvinceSelection(frm);
		courierServiceSelectionForEdit(frm);
		secretWordSelectionForEdit(frm);	
}
function bankBranchNameAdvcdBeneSelectionEdit(frm){
		bnkBranchNMBeneficiarySelection(frm,"true");
		bnkBranchCDBeneficiarySelection(frm,"true");
		bnkBrchBeneficiarySelection(frm,"true");
		citizenResidenceIDSelectionForEdit(frm)
		accntNumberSelectionForEdit(frm);
		bankBranchCitySelectionForEdit(frm);
		bankBrchProvinceSelection(frm);		
		courierServiceSelectionForEdit(frm);
		secretWordSelectionForEdit(frm);	
		routNumSelectionForEdit(frm);			
}
function bankNameProvinceAdvcdBeneSelectionEdit(frm){
		bnkBranchCDBeneficiarySelection(frm,"true");
		bnkBranchNMBeneficiarySelection(frm,"true");
		bnkBrchProvinceBeneficiarySelection(frm,"true");
		routNumSelectionForEdit(frm);		
		bankBrchSelectionForEdit(frm);
		accntNumberSelectionForEdit(frm);
		citizenResidenceIDSelectionForEdit(frm);
		bankBranchCitySelectionForEdit(frm);
		courierServiceSelectionForEdit(frm);
		secretWordSelectionForEdit(frm);		
		}
function bankProvinceAdvcdBeneSelectionEdit(frm){
		bnkBranchNMBeneficiarySelection(frm,"true");
		bnkBrchProvinceBeneficiarySelection(frm,"true");
		routNumSelectionForEdit(frm);
		citizenResidenceIDSelectionForEdit(frm);		
		accntNumberSelectionForEdit(frm);			
		bankBrchCodeSelectionForEdit(frm);
		bankBranchCitySelectionForEdit(frm);
		bankBrchSelectionForEdit(frm);		
		courierServiceSelectionForEdit(frm);
		secretWordSelectionForEdit(frm);				
}

function bankBrchNameSelectionForEdit(frm){
		bankBrchNameSelectionPresent = false;
		for (i=0;i<frm.length;i++){
		if (frm.elements[i].name == "bankBranchNameSelection"){
			bankBrchNameSelectionPresent = true;
			break;
		}	
		}
		if (bankBrchNameSelectionPresent == true){
		if (frm.bankBranchNameSelection.checked == true){
			bnkBranchNMBeneficiarySelection(frm,"true");
		}
		if (frm.bankBranchNameSelection.checked == false){
			bnkBranchNMBeneficiarySelection(frm,"false");
		}
		}
		}
function courierServiceSelectionForEdit(frm){
		courierServiceSelectionPresent = false;
		for (i=0;i<frm.length;i++){
		if (frm.elements[i].name == "courierServiceSelection"){
			courierServiceSelectionPresent = true;
			break;
		}	
		}
		if (courierServiceSelectionPresent == true){
		if (frm.courierServiceSelection.checked == true){
			courierServiceAdvcdBeneficiarySelection(frm,"true");
		}
		if (frm.courierServiceSelection.checked == false){
			courierServiceAdvcdBeneficiarySelection(frm,"false");	
		}	
		}
		}
function secretWordSelectionForEdit(frm){
		secretWordSelectionPresent = false;
		for (i=0;i<frm.length;i++){
		if (frm.elements[i].name == "secretWordSelection"){
			secretWordSelectionPresent = true;
			break;
		}	
		}
		if (secretWordSelectionPresent == true){
		if (frm.secretWordSelection.checked == true){
			secretWordAdvcdBeneficiarySelection(frm,"true");
		}
		if (frm.secretWordSelection.checked == false){
			secretWordAdvcdBeneficiarySelection(frm,"false");	
		}
		}
		}
function routNumSelectionForEdit(frm){	
		routNumSelectionPresent = false;
		for (i=0;i<frm.length;i++){
		if (frm.elements[i].name == "routingNumberSelection"){
			routNumSelectionPresent = true;
			break;
		}	
		}	
		if (routNumSelectionPresent == true){
		if (frm.routingNumberSelection.checked == true){
			routAdvcdBeneficiarySelection(frm,"true");	
		}
		if (frm.routingNumberSelection.checked == false){
			routAdvcdBeneficiarySelection(frm,"false");	
		}
		}
		}
function citizenResidenceIDSelectionForEdit(frm){
		citizenResidenceIDSelectionPresent = false;
		for (i=0;i<frm.length;i++){
		if (frm.elements[i].name == "citizenResidencyIDSelection"){
			citizenResidenceIDSelectionPresent = true;
			break;
		}	
		}	
		if (citizenResidenceIDSelectionPresent == true){
		if (frm.citizenResidencyIDSelection.checked == true){
			citizenResidenceIDAdvcdBeneficiarySelection(frm,"true");
		}
		if (frm.citizenResidencyIDSelection.checked == false){
			citizenResidenceIDAdvcdBeneficiarySelection(frm,"false");
		}
		}
		}
function bankBrchSelectionForEdit(frm){
		bankBrchSelectionPresent = false;
		for (i=0;i<frm.length;i++){
		if (frm.elements[i].name == "bankBranchStateSelection"){
			bankBrchSelectionPresent = true;
			break;
		}	
		}	
		if (bankBrchSelectionPresent == true){
		if (frm.bankBranchStateSelection.checked == true){
			bnkBrchBeneficiarySelection(frm,"true");	
		}
		if (frm.bankBranchStateSelection.checked == false){
			bnkBrchBeneficiarySelection(frm,"false");
		}	
		}
		}
	
function accntNumberSelectionForEdit(frm){
		accntNumberSelectionPresent = false;
		for (i=0;i<frm.length;i++){
		if (frm.elements[i].name == "accountNumberSelection"){
			accntNumberSelectionPresent = true;
			break;
		}	
		}
		maxLengthPresent = false;	
			for (i=0;i<frm.length;i++){
			if (frm.elements[i].name == "maximumLength"){
			maxLengthPresent = true;
			break;
			}	
			}
		if (accntNumberSelectionPresent == true){	
		if (frm.accountNumberSelection.checked == true){
			accountNumberAdvcdBeneficiarySelection(frm,"true");
			if (maxLengthPresent == true){	
			frm.minimumLength.disabled = false;	
			frm.maximumLength.disabled = false;	
			}
		}
		if (frm.accountNumberSelection.checked == false){
			accountNumberAdvcdBeneficiarySelection(frm,"false");
		}
		}
}
function bankBranchCitySelectionForEdit(frm){
		bankBranchCitySelectionPresent = false;
		for (i=0;i<frm.length;i++){
		if (frm.elements[i].name == "bankBranchCitySelection"){
			bankBranchCitySelectionPresent = true;
			break;
		}	
		}
		if (bankBranchCitySelectionPresent == true){
		if (frm.bankBranchCitySelection.checked == true){
			bnkBranchCityAdvcdBeneSelection(frm,"true");	
		}
		if (frm.bankBranchCitySelection.checked == false){
			bnkBranchCityAdvcdBeneSelection(frm,"false");	
		}
		}
		}



function bankBrchCodeSelectionForEdit(frm){
		bankBrchCodeSelectionPresent = false;
		for (i=0;i<frm.length;i++){
		if (frm.elements[i].name == "bankBranchProvinceSelection"){
			bankBrchCodeSelectionPresent = true;
			break;
		}	
		}
		if (bankBrchCodeSelectionPresent == true){
		if (frm.bankBranchCodeSelection.checked == true){
			bnkBranchCDBeneficiarySelection(frm,"true");
		}
		if (frm.bankBranchCodeSelection.checked == false){
			bnkBranchCDBeneficiarySelection(frm,"false");
		}
		}
		}
function bankBrchProvinceSelection(frm){
		bankBrchProvinceSelectionPresent = false;
		for (i=0;i<frm.length;i++){
		if (frm.elements[i].name == "bankBranchProvinceSelection"){
			bankBrchProvinceSelectionPresent = true;
			break;
		}	
		}
		if (bankBrchProvinceSelectionPresent == true){	
	if (frm.bankBranchProvinceSelection.checked == true){
			bnkBrchProvinceBeneficiarySelection(frm,"true")	
		}
		if (frm.bankBranchProvinceSelection.checked == false){
			bnkBrchProvinceBeneficiarySelection(frm,"false")	
		}
		}	
}

function advdBeneUserInterfaceSelection(frm){
	for(var i=0;i<frm.advdBeneUserInterface.length;i++){
	if (frm.advdBeneUserInterface[i].checked &&
			frm.advdBeneUserInterface[i].value == "50"){			
		routingNunmberAdvcdBeneSelection(frm);
		break;
	}else if (frm.advdBeneUserInterface[i].checked && 
					frm.advdBeneUserInterface[i].value == "51"){
		bankBranchNameAdvcdBeneSelection(frm);
		break;
	}else if (frm.advdBeneUserInterface[i].checked && 
					frm.advdBeneUserInterface[i].value == "52"){
		bankProvinceAdvcdBeneSelection(frm);		
		break;
	}else if (frm.advdBeneUserInterface[i].checked && 
					frm.advdBeneUserInterface[i].value == "53"){
		bankNameProvinceAdvcdBeneSelection(frm);		
		break;
	}else if (frm.advdBeneUserInterface[i].checked && 
					frm.advdBeneUserInterface[i].value == "0"){
		notApplicableAdvcdBeneSelection(frm);
		break;
	}
	}
}

function routingNunmberAdvcdBeneSelection(frm){
		bnkBranchCDBeneficiarySelection(frm,"false");	
		bnkBranchNMBeneficiarySelection(frm,"false");
		bnkBrchProvinceBeneficiarySelection(frm,"false")
		bnkBrchBeneficiarySelection(frm,"false");	
		accountNumberAdvcdBeneficiarySelection(frm,"false");
		courierServiceAdvcdBeneficiarySelection(frm,"false");
		secretWordAdvcdBeneficiarySelection(frm,"false");
		bnkBranchCityAdvcdBeneSelection(frm,"false");	
		routAdvcdBeneficiarySelection(frm,"true");
		citizenResidenceIDAdvcdBeneficiarySelection(frm,"false");
}

function bankBranchNameAdvcdBeneSelection(frm){
		routAdvcdBeneficiarySelection(frm,"false");
		bnkBranchNMBeneficiarySelection(frm,"true");
		bnkBranchCDBeneficiarySelection(frm,"true");
		bnkBrchProvinceBeneficiarySelection(frm,"false");
		citizenResidenceIDAdvcdBeneficiarySelection(frm,"false");
		accountNumberAdvcdBeneficiarySelection(frm,"false");
		courierServiceAdvcdBeneficiarySelection(frm,"false");
		secretWordAdvcdBeneficiarySelection(frm,"false");
		bnkBranchCityAdvcdBeneSelection(frm,"false");	
		bnkBrchBeneficiarySelection(frm,"true");
}
function bankProvinceAdvcdBeneSelection(frm){
		routAdvcdBeneficiarySelection(frm,"false");
		bnkBranchCDBeneficiarySelection(frm,"false");
		bnkBranchNMBeneficiarySelection(frm,"true");
		bnkBrchBeneficiarySelection(frm,"false");
		citizenResidenceIDAdvcdBeneficiarySelection(frm,"false");
		accountNumberAdvcdBeneficiarySelection(frm,"false");
		courierServiceAdvcdBeneficiarySelection(frm,"false");	
		secretWordAdvcdBeneficiarySelection(frm,"false");	
		bnkBranchCityAdvcdBeneSelection(frm,"false");
		bnkBrchProvinceBeneficiarySelection(frm,"true");
}

function bankNameProvinceAdvcdBeneSelection(frm){
		routAdvcdBeneficiarySelection(frm,"false");
		bnkBranchCDBeneficiarySelection(frm,"true");
		bnkBrchBeneficiarySelection(frm,"false");
		accountNumberAdvcdBeneficiarySelection(frm,"false");
		bnkBranchNMBeneficiarySelection(frm,"true");
		citizenResidenceIDAdvcdBeneficiarySelection(frm,"false");
		bnkBranchCityAdvcdBeneSelection(frm,"false");
		bnkBrchProvinceBeneficiarySelection(frm,"true");
		courierServiceAdvcdBeneficiarySelection(frm,"false");	
		secretWordAdvcdBeneficiarySelection(frm,"false");
		}
		
function notApplicableAdvcdBeneSelection(frm){
		routingNumberSelectionPresent = false;	
		for (i=0;i<frm.length;i++){
		if (frm.elements[i].name == "routingNumberSelection"){
		routingNumberSelectionPresent = true;
		break;
		}	
		}
		if (routingNumberSelectionPresent == true){
		if (frm.routingNumberSelection.checked == false){
		routAdvcdBeneficiarySelection(frm,"false");
		}
		}
		if (frm.bankBranchCodeSelection.checked == false){		
		bnkBranchCDBeneficiarySelection(frm,"false");
		}
		if (frm.bankBranchNameSelection.checked == false){
			bnkBranchNMBeneficiarySelection(frm,"false");
		}
		if (frm.bankBranchStateSelection.checked == false){
			bnkBrchBeneficiarySelection(frm,"false");
		}
		if (frm.bankBranchProvinceSelection.checked == false){		
			bnkBrchProvinceBeneficiarySelection(frm,"false");
		}
}
function bnkBranchCityAdvcdBeneSelection(frm,stateOfctrl){
	bankBranchCitySelectionPresent = false;	
	for (i=0;i<frm.length;i++){
	if (frm.elements[i].name == "bankBranchCitySelection"){
	bankBranchCitySelectionPresent = true;
	break;
	}	
	}
	if (bankBranchCitySelectionPresent == true && stateOfctrl == "false"){
		frm.bankBranchCitySelection.checked=false;
		frm.newNameBankBrchCity.disabled = true;	
		}else if (bankBranchCitySelectionPresent == true && stateOfctrl == "tue"){
		frm.bankBranchCitySelection.checked=true;
		frm.newNameBankBrchCity.disabled = false;
		}
	}
function citizenResidenceIDAdvcdBeneficiarySelection(frm,stateOfctrl){
	if (stateOfctrl == "false"){
		frm.citizenResidencyIDSelection.checked=false;
		frm.citizenResidencyID.disabled = true;	
		}else if (stateOfctrl == "true"){
		frm.citizenResidencyIDSelection.checked=true;
		frm.citizenResidencyID.disabled = false;	
		}
		}

function routAdvcdBeneficiarySelection(frm,stateOfctrl){
	routingNumberSelectionPresent = false;	
		for (i=0;i<frm.length;i++){
		if (frm.elements[i].name == "routingNumberSelection"){
		routingNumberSelectionPresent = true;
		break;
		}	
		}
	if (routingNumberSelectionPresent == true){
	if (stateOfctrl == "false"){
	frm.routingNumberSelection.checked=false;
	frm.newNameRoutNum.disabled = true;
	}else if (stateOfctrl == "true"){
	frm.routingNumberSelection.checked=true;
	frm.newNameRoutNum.disabled = false;
	}
	}
}

function bnkBranchCDBeneficiarySelection(frm,stateOfctrl){
	if (stateOfctrl == "false"){
	frm.bankBranchCodeSelection.checked=false;
	frm.newNameBankBrchCode.disabled = true;
	}else if (stateOfctrl == "true"){
	frm.bankBranchCodeSelection.checked=true;
	frm.newNameBankBrchCode.disabled = false;
	}
}

function bnkBranchNMBeneficiarySelection(frm,stateOfctrl){
	if (stateOfctrl == "false"){
	frm.bankBranchNameSelection.checked=false;
	frm.newNameBankBrchName.disabled = true;
	}else if (stateOfctrl == "true"){
	frm.bankBranchNameSelection.checked=true;
	frm.newNameBankBrchName.disabled = false;
	}
}

function bnkBrchBeneficiarySelection(frm,stateOfctrl){
	if (stateOfctrl == "false"){
	frm.bankBranchStateSelection.checked=false;
	frm.newNameBankBrchState.disabled = true;
	}else if (stateOfctrl == "true"){
	frm.bankBranchStateSelection.checked=true;
	frm.newNameBankBrchState.disabled = false;
	}
	}

function bnkBrchProvinceBeneficiarySelection(frm,stateOfctrl){
		if (stateOfctrl == "false"){
		frm.bankBranchProvinceSelection.checked=false;
		frm.newNameBankBrchProvince.disabled = true;	
		}else if (stateOfctrl == "true"){
		frm.bankBranchProvinceSelection.checked=true;
		frm.newNameBankBrchProvince.disabled = false;	
		}
	}
	
function accountNumberAdvcdBeneficiarySelection(frm,stateOfctr){
	accountNumberSelectionPresent = false;	
	for (i=0;i<frm.length;i++){
	if (frm.elements[i].name == "accountNumberSelection"){
	accountNumberSelectionPresent = true;
	break;
	}	
	}
	if (accountNumberSelectionPresent == true && stateOfctr == "false"){
	frm.accountNumberSelection.checked=false;
	frm.newNameAccntNum.disabled = true;
	}else if (accountNumberSelectionPresent == true && stateOfctr == "true"){
	frm.accountNumberSelection.checked=true;
	frm.newNameAccntNum.disabled = false;
	}
	maxLengthPresent = false;	
	for (i=0;i<frm.length;i++){
	if (frm.elements[i].name == "maximumLength"){
	maxLengthPresent = true;
	break;
	}	
	}
	if (maxLengthPresent == true){	
	frm.minimumLength.disabled = true;	
	frm.maximumLength.disabled = true;	
	}
}

function courierServiceAdvcdBeneficiarySelection(frm,stateOfctr){
	courierServiceSelectionPresent = false;	
	for (i=0;i<frm.length;i++){
	if (frm.elements[i].name == "courierServiceSelection"){
	courierServiceSelectionPresent = true;
	break;
	}	
	}
	if (courierServiceSelectionPresent == true && stateOfctr == "false"){
	frm.courierServiceSelection.checked=false;
	frm.courierService.disabled = true;
	}else if (courierServiceSelectionPresent == true && stateOfctr == "true"){
	frm.courierServiceSelection.checked=true;
	frm.courierService.disabled = false;
	}	
}
function secretWordAdvcdBeneficiarySelection(frm,stateOfctr){
	secretWordSelectionPresent = false;	
	for (i=0;i<frm.length;i++){
	if (frm.elements[i].name == "secretWordSelection"){
	secretWordSelectionPresent = true;
	break;
	}	
	}
	if (secretWordSelectionPresent == true && stateOfctr == "false" ){
	frm.secretWordSelection.checked=false;
	frm.secretWordName.disabled = true;
	}else if (secretWordSelectionPresent == true && stateOfctr == "true" ){
	frm.secretWordSelection.checked=true;
	frm.secretWordName.disabled = false;
	}	
}

function pladminselection(value,frm){
//alert(value);
     
    document.forms[0].action = "getSbAndRbList.do?method=getSBAndRBList";
     var len = document.forms[0].adminId.length;
        for (var i = 0; i < len; i++) {
            document.forms[0].adminId[i].disabled = "";
        }
    document.forms[0].submit();
   
   
   
	//document.forms[0].spSelect.option[1].isSelected = true;
}
function disablEnablePladmin(frm,type){

 if (type == 1) {
        frm.rbSelect.disabled = false;
        frm.sbSelect.disabled = true;
    } else {
        if (type == 2) {
            frm.sbSelect.disabled = false;
            frm.rbSelect.disabled = true;
        } else {
            if (type == 3) {
                frm.sbSelect.disabled = true;
                frm.rbSelect.disabled = true;
            }
        }
    }
}
function confirmAdminCreateUserEmail() {

        var agree = confirm("When you click Submit the User will get an email with a temporary password. In addition each User will receive a message to their cell phone with a four digit PIN. They will need their username , password, and PIN in order to log on to the system. The email to the User will also contain these instructions. Please be sure that email and mobile information you entered is correct. Are you ready to submit?");
        if (agree) {
            document.forms[0].action = "adminCreateComplete.do?method=adminCreateComplete";
            document.forms[0].submit();
    	}
}
function confirmAdminEditUserEmail() {
		if(document.forms[0].resetPassword.checked){
	        var agree = confirm("When you click Submit the User will get an email with a temporary password. In addition each User will receive a message to their cell phone with a four digit PIN. They will need their username , password, and PIN in order to log on to the system. The email to the User will also contain these instructions. Please be sure that email and mobile information you entered is correct. Are you ready to submit?");
	        if (agree) {
	           document.forms[0].action = "adminUserEditComplete.do?method=adminUserEditComplete";	 
	           document.forms[0].submit(); 
	                     
	    	}
	    }else{
	     		 document.forms[0].action  = "adminUserEditComplete.do?method=adminUserEditComplete";
	     		 document.forms[0].submit(); 
	     }
	     
	  
	     
}

function confirmActivation(userId,partyType,branchID) {	
	if(branchID == "0"){
		branchID="";
	}else {
	   branchID = branchID;
	}	
    var confirmString = confirm("When you activate the user they will be granted access to the application. If you need to reset their password please access their account after activation and reset the password. Are you sure you want to continue?");
    if (confirmString == true) {
    	 if (partyType == "13") {
        	window.location.href="ActivateSpUser.do?userID="+userId+"&method=activateUser";
        }else if (partyType == "7") {
        	window.location.href="activatedResult.do?userID="+userId+"&method=activateUser";
        }else if (partyType == "8") {
        	window.location.href="activatedResult.do?userID="+userId+"&method=activateUser";
        }else if (partyType == "9") {
        	window.location.href="activatedResult.do?userID="+userId+"&method=activateUser";
        }else if (partyType == "10") {
        	window.location.href="ActivateSpUser.do?userID="+userId+"&method=activateUser";
        }else if (partyType == "11") {
            window.location.href="RbActiveRegUser.do?userID="+userId+"&method=activateUser";
        }else if (partyType == "12") {
            window.location.href="SbActivateUser.do?userID="+userId+"&method=activateUser&partyType="+partyType+"&branchID="+branchID+"";
        }else if (partyType == "15") {
            window.location.href="SbActivateUser.do?userID="+userId+"&method=activateUser&partyType="+partyType+"&branchID="+branchID+"";
        }  
    }
}

function confirmCreateRegUserEmail() {

        var agree = confirm("When you click submit the user will get an email with a temporary password. They will need to access the Website and login to reset their password. The username will be user's email address.  The email sent to the user will also  contain the instructions.  Please  be sure that email address is correct for this user.  Are you ready to submit?");
        if (agree) {
           window.location.href= "NewUserComplete.do?method=saveuser";
    	}
}

function confirmCreateRBRegUserEmail() {

        var agree = confirm("When you click Submit the user will get an email with a username and password. The new user should log in with the username and password provided in the email and click on the change password link to update their password.  Please be sure the email is correct.  Are you ready to submit?");
        if (agree) {
           window.location.href= "NewUserComplete.do?method=saveuser";
    	}
}

function confirmEditRegUserEmail(branchID) {
	if(branchID == "0"){
		branchID="";
		
	}else {
	   branchID = branchID;
	}
		if(document.forms[0].resetPassword.checked){
	       var agree = confirm("When you click Submit the user will get an email with a username and password. The new user should log in with the username and password provided in the email and click on the change password link to update their password.  Please be sure the email is correct.  Are you ready to submit?");
        	if (agree) {
        	if(branchID != "") {
	     		    document.forms[0].action = "regUserEditComplete.do?method=regUserEditComplete&branchID="+branchID+"";
	                document.forms[0].submit();
	            }else {
	            	document.forms[0].action = "complUserEditComplete.do?method=complUserEditComplete&branchID="+branchID+"";
		            document.forms[0].submit();
	            }         
	    	}
	    }else{
	    	if(branchID != "") {
	     		document.forms[0].action = "regUserEditComplete.do?method=regUserEditComplete&branchID="+branchID+"";
	            document.forms[0].submit();
            }else {
            	document.forms[0].action = "complUserEditComplete.do?method=complUserEditComplete&branchID="+branchID+"";
	            document.forms[0].submit();
            }
	     }
}	     
function confirmEditBranchManager() {
		if(document.forms[0].resetPassword.checked){
	        var agree = confirm("When you click Submit the Branch Manager will get an email with a temporary password. In addition each Branch Manager will receive a message to their cell phone with a four digit PIN. They will need their username , password, and PIN in order to log on to the system. The email to the User will also contain these instructions. Please be sure that email and mobile information you entered is correct. Are you ready to submit?");
	        if (agree) {
	           document.forms[0].action = "saveChanges.do?method=saveChanges";	 
	           document.forms[0].submit();           
	    	}
	    }else{
    	   document.forms[0].action  = "saveChanges.do?method=saveChanges";
    	   document.forms[0].submit();
	    }	    
}

function openChangeAuthorization() {
window.open('editBranchAuthorization.do?method=editBranchAuthorization','BLANK','width=600,height=600,scrollbars=yes,statusbar=no,left=50,top=100,resizable=yes');
}

function confirmCreateBranchManager() {
        var agree = confirm("When you click Submit the Branch Manager will receive an email with a temporary password. In addition each Branch Manager will receive a message to their cell phone with a four digit PIN. They will need their username , password, and PIN in order to log on to the system. The email to the Branch Manager will also contain these instructions. Please be sure that email and mobile information you entered is correct. Are you ready to submit?");
        if (agree) {
           window.location.href= "showBranchManagerComplete.do?method=showBranchManagerComplete";
    	}
}

function CreateBranchManager() {		
	           document.forms[0].action = "showCreateBranchManager.do?method=showCreateBranchManager";
	           document.forms[0].submit();            	    
} 

function CreateBranchManagerBranchList() {		
	           document.forms[0].action = "showBranchList.do?method=showBranchList";
	           document.forms[0].submit();            	    
}	

function saveSBBranch(){
		if(document.forms[0].branchLocations.value == ""){			
		    document.forms[0].action = "showCreateNewBranchComplete.do";
	        document.forms[0].submit();   		
		}
		else{		
		    document.forms[0].action = "showBranchUploadComplete.do?upload=saveBranchXl";
	        document.forms[0].submit();		
		}		
}

function hideViewUpload(divID){
	divID.style.visibility = "hidden";	
	if(document.all && !window.opera) {  
	var oHelperIframe = document.getElementById("HELPER_IFRAME_ID");
	oHelperIframe.style.visibility = 'hidden';
	}
}

function saveCity(){
	flag = 1;
 	var html = "";
 	var string = document.forms[0].uploadCity.value;
	var len = string.length
	var position = eval(len - 4)
	var fileType = string.substring(position, len)
	var ni = document.getElementById("divuploaderror");
	var olddiv = document.getElementById("divuploaderror1");
	if (olddiv != null) {
        ni.removeChild(olddiv);
        }
	var newdiv = document.createElement("div");
	newdiv.innerHTML = "";
	newdiv.setAttribute("id", "divuploaderror1");
	if (document.forms[0].uploadCity.value == "") {
 	html += "<li>Select a  <strong> Excel sheet</strong>.</li>";
        show(divuploaderror);
        flag = 0;
    }
   else if(fileType != ".xls" && fileType != ".XLS"){
   html += "<li>Select a <strong> Excel sheet</strong>.</li>";
        show(divuploaderror);
        flag = 0;
   }
 
 	if (flag == 0) {
        uploadCreatorCity.style.visibility = "visible";
        newdiv.innerHTML = html;
        ni.appendChild(newdiv);
        show(divuploaderror);
 	} else {
        if (flag == 1) {
            hide(uploadCreatorCity);
            hide(divuploaderror);
           document.forms[0].action = "showCityUploadComplete.do?upload=uploadXl";
    		document.forms[0].submit(); 
        }
    }
    
}


function saveState(){
	flag = 1;
 	var html = "";
 	var string = document.forms[0].uploadState.value;
	var len = string.length
	var position = eval(len - 4)
	var fileType = string.substring(position, len)
	var ni = document.getElementById("divuploadstateerror");
	var olddiv = document.getElementById("divuploadstateerror1");
	if (olddiv != null) {
        ni.removeChild(olddiv);
        }
	var newdiv = document.createElement("div");
	newdiv.innerHTML = "";
	newdiv.setAttribute("id", "divuploadstateerror1");
	if (document.forms[0].uploadState.value == "") {
 	html += "<li>Select a  <strong> Excel sheet</strong>.</li>";
        show(divuploadstateerror);
        flag = 0;
    }
   else if(fileType != ".xls" && fileType != ".XLS"){
   html += "<li>Select a <strong> Excel sheet</strong>.</li>";
        show(divuploadstateerror);
        flag = 0;
   }
 
 	if (flag == 0) {
        uploadCreatorState.style.visibility = "visible";
        newdiv.innerHTML = html;
        ni.appendChild(newdiv);
        show(divuploadstateerror);
 	} else {
        if (flag == 1) {
            hide(uploadCreatorState);
            hide(divuploadstateerror);
            document.forms[0].action = "showCityUploadComplete.do?upload=uploadStateXl";
    		document.forms[0].submit(); 
        }
    }	
}

function edituploadCity(){
	flag = 1;
 	var html = "";
 	var string = document.forms[0].uploadCity.value;
	var len = string.length
	var position = eval(len - 4)
	var fileType = string.substring(position, len)
	var ni = document.getElementById("divuploaderror");
	var olddiv = document.getElementById("divuploaderror1");
	if (olddiv != null) {
        ni.removeChild(olddiv);
        }
	var newdiv = document.createElement("div");
	newdiv.innerHTML = "";
	newdiv.setAttribute("id", "divuploaderror1");
	if (document.forms[0].uploadCity.value == "") {
 	html += "<li>Select a  <strong> Excel sheet</strong>.</li>";
        show(divuploaderror);
        flag = 0;
    }
   else if(fileType != ".xls" && fileType != ".XLS"){
   html += "<li>Select a <strong> Excel sheet</strong>.</li>";
        show(divuploaderror);
        flag = 0;
   }
 
 	if (flag == 0) {
        uploadCreatorCity.style.visibility = "visible";
        newdiv.innerHTML = html;
        ni.appendChild(newdiv);
        show(divuploaderror);
 	} else {
        if (flag == 1) {
            hide(uploadCreatorCity);
            hide(divuploaderror);
            document.forms[0].action = "editUploadComplete.do?upload=uploadXl";
    		document.forms[0].submit(); 
        }
    }
}

function edituploadState(){
	flag = 1;
 	var html = "";
 	var string = document.forms[0].uploadState.value;
	var len = string.length
	var position = eval(len - 4)
	var fileType = string.substring(position, len)
	var ni = document.getElementById("divuploadstateerror");
	var olddiv = document.getElementById("divuploadstateerror1");
	if (olddiv != null) {
        ni.removeChild(olddiv);
        }
	var newdiv = document.createElement("div");
	newdiv.innerHTML = "";
	newdiv.setAttribute("id", "divuploadstateerror1");
	if (document.forms[0].uploadState.value == "") {
 	html += "<li>Select a  <strong> Excel sheet</strong>.</li>";
        show(divuploadstateerror);
        flag = 0;
    }
   else if(fileType != ".xls" && fileType != ".XLS"){
   html += "<li>Select a <strong> Excel sheet</strong>.</li>";
        show(divuploadstateerror);
        flag = 0;
   }
 
 	if (flag == 0) {
        uploadCreatorState.style.visibility = "visible";
        newdiv.innerHTML = html;
        ni.appendChild(newdiv);
        show(divuploadstateerror);
 	} else {
        if (flag == 1) {
            hide(uploadCreatorState);
            hide(divuploadstateerror);
            document.forms[0].action = "editUploadComplete.do?upload=uploadStateXl";
    		document.forms[0].submit(); 
        }
    }		
}

function manageCity(){
	flag = 1;
 	var html = "";
 	var string = document.forms[0].uploadCity.value;
	var len = string.length
	var position = eval(len - 4)
	var fileType = string.substring(position, len)
	var ni = document.getElementById("divuploaderror");
	var olddiv = document.getElementById("divuploaderror1");
	if (olddiv != null) {
        ni.removeChild(olddiv);
        }
	var newdiv = document.createElement("div");
	newdiv.innerHTML = "";
	newdiv.setAttribute("id", "divuploaderror1");
	if (document.forms[0].uploadCity.value == "") {
 	html += "<li>Select a  <strong> Excel sheet</strong>.</li>";
        show(divuploaderror);
        flag = 0;
    }
   else if(fileType != ".xls" && fileType != ".XLS"){
   html += "<li>Select a <strong> Excel sheet</strong>.</li>";
        show(divuploaderror);
        flag = 0;
   }
 
 	if (flag == 0) {
        uploadCreatorCity.style.visibility = "visible";
        newdiv.innerHTML = html;
        ni.appendChild(newdiv);
        show(divuploaderror);
 	} else {
        if (flag == 1) {
            hide(uploadCreatorCity);
            hide(divuploaderror);
            document.forms[0].action = "manageUploadComplete.do?upload=uploadXl";
    		document.forms[0].submit(); 
        }
    }	
}

function manageState(){
	flag = 1;
 	var html = "";
 	var string = document.forms[0].uploadState.value;
	var len = string.length
	var position = eval(len - 4)
	var fileType = string.substring(position, len)
	var ni = document.getElementById("divuploadstateerror");
	var olddiv = document.getElementById("divuploadstateerror1");
	if (olddiv != null) {
        ni.removeChild(olddiv);
        }
	var newdiv = document.createElement("div");
	newdiv.innerHTML = "";
	newdiv.setAttribute("id", "divuploadstateerror1");
	if (document.forms[0].uploadState.value == "") {
 	html += "<li>Select a  <strong> Excel sheet</strong>.</li>";
        show(divuploadstateerror);
        flag = 0;
    }
   else if(fileType != ".xls" && fileType != ".XLS"){
   html += "<li>Select a <strong> Excel sheet</strong>.</li>";
        show(divuploadstateerror);
        flag = 0;
   }
 
 	if (flag == 0) {
        uploadCreatorState.style.visibility = "visible";
        newdiv.innerHTML = html;
        ni.appendChild(newdiv);
        show(divuploadstateerror);
 	} else {
        if (flag == 1) {
            hide(uploadCreatorState);
            hide(divuploadstateerror);
            document.forms[0].action = "manageUploadComplete.do?upload=uploadStateXl";
    		document.forms[0].submit(); 
        }
    }		
}

function submitForPassword (url) {
    document.forms[0].action = url;
	document.forms[0].submit();
	
}

function refreshBranchList() {		
	           document.forms[0].action = "refreshBranchList.do?method=refreshBranchList";
	           document.forms[0].submit();            	    
}

function cancelBranchAuthorization(branchMgrID) {	        
	        var agree = confirm("When you click Cancel all of your changes, including any new branch assignments, will not be saved. The user's original profile will be restored. Are you sure you want to continue?");
	        if (agree) {
	           window.close();
	           document.forms[0].action = "showEditBranchManager.do?method=showEditBranchManager&branchManagerID="+branchMgrID+"";
	           document.forms[0].submit();        
	    	}	         
	        	
	    	//window.open('showEditBranchManager.do?method=showEditBranchManager&branchManagerID='+branchMgrID,'','');   	      
	    	//window.close();	       
}

function updateBranchAuthorisation(branchMgrID)
{
	document.forms[0].action = "updateBranchAuthorisation.do?method=updateBranchAuthorisation&changeStatus=true";	
	document.forms[0].submit();	
	checkedFlag = false;
	for (i=0;i<document.forms[0].elements.length;i++){
	if (document.forms[0].elements[i].type == "checkbox" &&
	document.forms[0].elements[i].name != "check"){
	if (document.forms[0].elements[i].checked == true){
		checkedFlag = true;
	}
	}
	}
	if (checkedFlag == true){
		alert("Your Authorized Branches are updated with the newly selected one.");				
		window.close(); 
	}		
}


function showDisableEnableUsers(frm, type) {
    if (type == 1) {
        frm.citySelect.disabled = true;
        frm.lastNameSelect.disabled = true;
    } else if (type == 2) {
        frm.citySelect.disabled = true;
 		frm.lastNameSelect.disabled = true;
    } else if (type == 3) {
        frm.citySelect.disabled = false;
 		frm.lastNameSelect.disabled = true;
    } else if (type == 4) {
        frm.citySelect.disabled = true;
 		frm.lastNameSelect.disabled = false;
    }
}

function confirmDeactivation(userId,partyType,branchID) {
	if(branchID == "0"){
		branchID="";
	}else {
	   branchID = branchID;
	}
    var confirmString = confirm("When you disable this user they will no longer be able to log in to the application.There access privileges will be immediately revoked. They will become a deactivated user. You will be able to active the user at a later date. Are you sure you want to continue?");
    if (confirmString == true) {
        if (partyType == "12") {
            window.location.href="SbDisableUser.do?userID="+userId+"&method=deactivateUser&partyType="+partyType+"&branchID="+branchID+"";
        }else if (partyType == "15") {
            window.location.href="SbDisableUser.do?userID="+userId+"&method=deactivateUser&partyType="+partyType+"&branchID="+branchID+"";
        }  
    }
}

function showDisableEnableDates(frm, type) {

	//frm.futureDate.value = "";
    //frm.dateOption.value = "";		
    if (type == 1) {
        frm.futureDate.disabled = true;
        //frm.futureDate.value = "";
        frm.dateOption.value = "";
    } else if (type == 2) {
        frm.futureDate.disabled = false;
         //frm.futureDate.value = "";
         frm.dateOption.value = "";
    }
}

function logOut() {		
	           document.forms[0].action = "../showLogOut.do?method=logout";
	           document.forms[0].submit();            	    
}

function logOutRB() {		
	           document.forms[0].action = "actrpt/LogOut.do";
	           document.forms[0].submit();            	    
}

function showPleaseWait(){
divIDOne = document.getElementById("replaceButton");
divIDOne.style.visibility = "hidden";
divIDTwo = document.getElementById("newPleaseWaitButton");
document.forms[0].submit();
divIDTwo.style.visibility = "visible";
document.getElementById("wait1").src="images/wait.gif";
}  

function enableCustomField(){
	enableFlag = false;
	for (i = 0 ; i < document.forms[0].availabiltyDateSelection.length; i++ ){
	if (document.forms[0].availabiltyDateSelection[i].checked){
	if (document.forms[0].availabiltyDateSelection[i].value == "custom"){
	enableFlag = true;
	break;
	}
	}
	}	
	if (enableFlag == true){
	document.forms[0].availabiltyDateCustomDay.disabled=false;
}else{
	document.forms[0].availabiltyDateCustomDay.value = "";
	document.forms[0].availabiltyDateCustomDay.disabled=true;
}

}  


function confirmEditRegUser(val) {	
			var agree = "";
			if (val == "rbAdmin"){
			 agree = confirm("When you click Submit the User will get an email with a temporary password. They will need their username and password in order to log on to the system. The email to the User will also contain these instructions. Please be sure that email information you entered is correct. Are you ready to submit?");
			}else{
	         agree = confirm("When you click Submit the User will get an email with a temporary password. In addition each User will receive a message to their cell phone with a four digit PIN. They will need their username , password, and PIN in order to log on to the system. The email to the User will also contain these instructions. Please be sure that email and mobile information you entered is correct. Are you ready to submit?");
	        }
	        if (agree) {
           		window.location.href= "adminCreateComplete.do?method=adminCreateComplete";
    	    }	        
}	

function clearDate(frm) {	
	frm.futureDate.value = "";
}

function clarifyClaimSubmit(){
	agree = confirm("Please review your response carefully.Once you click Ok it will be immediately posted to the site and sent via email to the Remitter.  You will not be able to edit this message.  Do you want to post the message?");
	if (agree) {
           		document.forms[0].action='showClaimComplete.do';
           		document.forms[0].submit();
    	 }	        
}

function toggleMsgBoxDisplay(){
dispalyFlag=0;
for(i=0;i<document.forms[0].paidornot.length;i++){
if (document.forms[0].paidornot[i].checked){
dispalyFlag=1;
}
}
if (dispalyFlag == 1){
toggleMsgBox.style.visibility = "visible";
}else{
toggleMsgBox.style.visibility = "hidden";
}
}

function showDailyReport() {	
				
	           document.forms[0].action = "showDownloadDailyReport.do?method=downloadDailyReport";
	           document.forms[0].submit();            	    
}

function showRBDailyReport() {		
	           document.forms[0].action = "downloadDailyReportDistribution.do?method=downloadRbDailyReportResult";
	           document.forms[0].submit();            	    
}

function showRBDailyReportDirect() {		
	           document.forms[0].action = "downloadDailyReport.do?method=downloadRbDailyReportResult";
	           document.forms[0].submit();            	    
}

function downloadSBDailyReport(){	              
	           document.forms[0].action = "downloadDailyReport.do?method=downloadSBDailyReport";
	           document.forms[0].submit();            	    
}
function showTransactionReport(){
			   document.forms[0].action = "showDownloadTransactionStatus.do?method=downloadTransactionStatusReport";
			   document.forms[0].submit();
}
function showMonthlyReport(){
 document.forms[0].action = "showDownloadMonthlyReportRB.do?method=downLoadmonthlyReportRB";
 document.forms[0].submit();
}
function displayDailyReport(){
				document.forms[0].action = "showDailyReportResult.do?method=dailyReportResult";
			    document.forms[0].submit(); 
}

function displayRBDailyReport(){
			   document.forms[0].action = "showDailyReportResultDistribution.do?method=rbdailyReportResult";
	           document.forms[0].submit(); 
}


function displayRBDailyReportDirect(){
				document.forms[0].action = "showDailyReportResult.do?method=rbdailyReportResult";
	            document.forms[0].submit(); 
}

function displaySBDailyReport(){
               document.forms[0].action = "showDailyReportResult.do?method=daily";
	           document.forms[0].submit(); 
}
	           
	           

function getNrcptMsgBox(divTag) {

    divTag = document.getElementById("toggleMsgBox");
    divTag.style.visibility = "visible";   		
    var html = "<table>";
    html += "<tr valign='top'>";
    html += "<td colspan='3' valign='top' class='arial-black-12'>";
    html += "Message (optional)";
    html += "<br>";
    html += "<textarea name='message' cols='50' rows='5'>";
    html += "</textarea>";
    html += "</td>";
    html += "</tr>";    
    html += "<tr>";
    html += "<td height='22' colspan='4' align='center' class='arial-black-12'>";
    html += "<table width='85%' border='0' cellspacing='2' cellpadding='2'>";
    html += "<tr>";
    html += "<td class='arial-black-12'>";
    html += "Maximum of 250 characters";
    html += "</td>";
    html += "</tr>";
    html+="<tr><td height='22' colspan='4' align='center' class='arial-black-12'>";
    html+="<input type='button' Class='button1' name='buttonSubmit' id='buttonSubmit' value='Submit' onclick='clarifyClaimSubmit();' onmouseover='mouseOverFunct(this)' onmouseout='mouseOutFunct(this)'>";
    html += "</td></tr>";
    html += "</table>";
    html += "</td>";
    html += "</tr>";
    html += "</table>";
    html += "<table width='100%'>";
    html += "<tr>";
    html += "<td align='center' class='arial-black-12'>";
    html += "</td>";
    html += "</tr>";
    html += "</table>";
    html += "<table width='100%'>";
    html += "<tr>";
    html += "<td height='12' colspan='4' align='left' background='images/dotted_horiz1.gif' class='arial-black-12'>";
    html += "</td>";
    html += "</tr>";
    html += "</table>";
   
    divTag.innerHTML = html;    
}

function enableTextField(frm){
	document.forms[0].reasonText.value="";
}

function printTermsAndCondition1(){
WinPrint =window.open('','',"width=900,height=800,scrollbars=yes,statusbar=no,resizable=yes");
WinPrint.document.open();
var htmlheading ="<table align= 'center'>";
htmlheading=htmlheading+"<tr>";
htmlheading=htmlheading+"<td style='font-size: 14px; font-family: arial; color: #000000; text-decoration: none;' align='center'>";
htmlheading=htmlheading+"<strong>TERMS AND CONDITIONS<strong>";
htmlheading=htmlheading+"</td>";
htmlheading =htmlheading+"</tr>";
htmlheading =htmlheading+"</table>"
var html = "<table align= 'center'>";
html =html+"<tr>";
html =html+"<td style='font-size: 12px; font-family: arial; color: #000000; text-decoration: none;' align='center'>";
html=html+"<input type='button' value='Cancel' id='buttonClose' style=\"font-size= '12px'; font-family= 'arial'; width='65px'; color= '#003399'; text-decoration='none';\" onmouseover=\"this.style.color='#000000';cursor= 'pointer';\" onmouseout=\"this.style.color='#003399'\" onclick='window.close()'>";
html=html+"<input type='button' value='Print' id='buttonPrint'  style=\"font-size= '12px'; font-family= 'arial'; width='65px'; color= '#003399'; text-decoration='none';\" onmouseover=\"this.style.color='#000000';cursor= 'pointer';\" onmouseout=\"this.style.color='#003399'\" onclick='window.print()'>";

html =html+"</td>";
html =html+"</tr>";
html =html+"</table>";
var divhtml =(document.getElementById('printdiv').innerHTML);
var combinedhtml = htmlheading+divhtml+html;
WinPrint.document.write(combinedhtml);
WinPrint.document.close();
}
function additionalPaymentInfoDisplay(){	
 for (var ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){
    	if (document.forms[0].elements[ctrl].name == "dynamicProps(bankName)"){    		   		
    		loadAdvcdBeneInfFields(document.forms[0].elements[ctrl].value);
    	}
    	}   
}
/* 
For new Bene requirement
*/
function loadAdvcdBeneInfFields(val) {	
	 if (val == "0"){
    	divTag = document.getElementById("bankBranchCodeVal");
    	if (null != divTag){
     	divTag.innerHTML = "";  
     	}    	
     	for (ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){		
		if (document.forms[0].elements[ctrl].name == "dynamicProps(bankBranchState)" ||
			document.forms[0].elements[ctrl].name == "dynamicProps(bankBranchProvince)"){
			document.forms[0].elements[ctrl].options.length=0;
			document.forms[0].elements[ctrl].options[0] = new Option("Select One","0");
			}
			}
		for (ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){		
		if (document.forms[0].elements[ctrl].name == "dynamicProps(bankBrchName)"){
			document.forms[0].elements[ctrl].options.length=0;
			document.forms[0].elements[ctrl].options[0] = new Option("Select One","0");
			}
			}		
   	 }else{	
 for (ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){		
		if (document.forms[0].elements[ctrl].name == "dynamicProps(bankBranchState)" ||
			document.forms[0].elements[ctrl].name == "dynamicProps(bankBranchProvince)"){
			document.forms[0].elements[ctrl].options.length=0;
			document.forms[0].elements[ctrl].options[0] = new Option("Select One","0");
			}
			}
    retrieveURLAdvcdBeneInf("ajaxXMLServiceActionAdvcBeneInf.do?method=advancedBeneFields&prodTyp=2&service=PaymentDetails&bankID=" + escape(val), processStateChangeAdvcdBeneInf);
    }
   
}

function retrieveURLAdvcdBeneInf(url, processStateChange) {		
    if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChange;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChange;
                req.send();
            }
        }
    }
    
}
function processStateChangeAdvcdBeneInf() {		
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
				//alert(req.responseText);
            generateIncludeDocAdvcdBeneInf(req.responseXML);
          }
    }
}
function generateIncludeDocAdvcdBeneInf(xml) {
	if (xml){	
	 var title = xml.getElementsByTagName("title");
	 if (title.length > 0){
     var val = title[0].firstChild.nodeValue;
    if (val == "RoutingNumber"){
	 var routNum = xml.documentElement.getElementsByTagName("RoutingNumber");
	 name = routNum[0].firstChild.firstChild.nodeValue;                 
     value = routNum[0].lastChild.firstChild.nodeValue; 
     divTag = document.getElementById("bankBranchCodeVal");
     divTag.innerHTML = "<input type='hidden' name='routingNumberHidden' id='routingNumberHidden' value='"+value+"'/>"+value;    
	}else {
	var states = xml.documentElement.getElementsByTagName("StateOrProvince");	
	for (ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){
		//alert(document.forms[0].elements[ctrl].name);
	if (document.forms[0].elements[ctrl].name == "dynamicProps(bankBranchState)" ||
			document.forms[0].elements[ctrl].name == "dynamicProps(bankBranchProvince)"){
			var ctrlName = document.forms[0].elements[ctrl].name;					
			 for (var j = 0; j < states.length; j++) { 
                state = states[j].firstChild.firstChild.nodeValue;               
                document.forms[0].elements[ctrl].options[j+1] = new Option(state,state);
          }		
	}
	}
	}
	}
	}
	for (ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){
		//alert(document.forms[0].elements[ctrl].name);
	if (document.forms[0].elements[ctrl].name == "dynamicProps(bankBranchState)" ||
			document.forms[0].elements[ctrl].name == "dynamicProps(bankBranchProvince)"){
			document.forms[0].elements[ctrl].disabled=false;
			openIt(document.forms[0].elements[ctrl]);
         }	
	}
	for (var ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){
    	if (document.forms[0].elements[ctrl].name == "dynamicProps(bankName)"){
    	if(document.forms[0].elements[ctrl].value != "0"){	    		
    		loadDeliveryOptsForDirect(document.forms[0].elements[ctrl].value);
    		}
    	}
    	} 	 	    
}

/* 
For new Bene requirement
*/
function createBranches(val) {		
	if (val == "0"){
	divTag = document.getElementById("bankBranchCodeVal");
    	if (null != divTag){
     	divTag.innerHTML = "";  
     	}   
    	for (ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){		
		if (document.forms[0].elements[ctrl].name == "dynamicProps(bankBrchName)"){
			document.forms[0].elements[ctrl].options.length=0;
			document.forms[0].elements[ctrl].options[0] = new Option("Select One","0");
			}
			}  
	}else{
	for (ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){		
		if (document.forms[0].elements[ctrl].name == "dynamicProps(bankBrchName)"){
			document.forms[0].elements[ctrl].options.length=0;
			document.forms[0].elements[ctrl].options[0] = new Option("Select One","0");
			}
			}
		divTag = document.getElementById("bankBranchCodeVal");    	
    	if (null != divTag){    	
     	divTag.innerHTML = "";  
     	}  
    retrieveURLAdvcdBeneInf("ajaxXMLServiceActionShowBranchNames.do?method=showBranchNames&prodTyp=2&service=PaymentDetails&state=" + escape(val), processStateChangeShowBranches);      
    }
}

function processStateChangeShowBranches() {	
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
				//alert(req.responseText);
            generateIncludeDocShowBranches(req.responseXML);
          }
    }
}
function generateIncludeDocShowBranches(xml) {	
	var branches = xml.documentElement.getElementsByTagName("branches");
	for (ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){
		//alert(document.forms[0].elements[ctrl].name);
	if (document.forms[0].elements[ctrl].name == "dynamicProps(bankBrchName)" ){
			var ctrlName = document.forms[0].elements[ctrl].name;					
			 for (var j = 0; j < branches.length; j++) { 
                name = branches[j].firstChild.firstChild.nodeValue;                 
                value = branches[j].lastChild.firstChild.nodeValue;             
                document.forms[0].elements[ctrl].options[j+1] = new Option(name,value);
          }
         
	
	}
	}
	for (var ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){
    	if (document.forms[0].elements[ctrl].name == "dynamicProps(bankName)"){ 
    	if(document.forms[0].elements[ctrl].value != "0"){	   		
    		loadDeliveryOptsForDirect(document.forms[0].elements[ctrl].value);
    		}
    	}
    	}    
	for(ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){					
		if (document.forms[0].elements[ctrl].name == 
			"dynamicProps(bankBrchName)" && document.forms[0].elements[ctrl].type=="select-one"){
			document.forms[0].elements[ctrl].disabled=false;
			openIt(document.forms[0].elements[ctrl]);
		}				
	}
	 for (var ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){
    	if (document.forms[0].elements[ctrl].name == "dynamicProps(bankName)"){   
    		if(document.forms[0].elements[ctrl].value != "0"){	 		
    		loadDeliveryOptsForDirect(document.forms[0].elements[ctrl].value);
    		}
    	}
    	} 	    
}


/* 
For new Bene requirement
*/
function showBranchCode(val) {		
	if (val == "0"){
		divTag = document.getElementById("bankBranchCodeVal");
    	if (null != divTag){
     	divTag.innerHTML = "";  
     	}  
	}else{
    retrieveURLAdvcdBeneInf("ajaxXMLServiceActionShowBranchCode.do?method=showBranchCode&prodTyp=2&service=PaymentDetails&brchID=" + escape(val), processStateChangeShowBranchCode);
    }
}

function processStateChangeShowBranchCode() {	
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
				//alert(req.responseText);
            generateIncludeDocBranchCode(req.responseXML);
          }
    }
}
		function generateIncludeDocBranchCode(xml) {
		var branchCode = xml.documentElement.getElementsByTagName("BranchCode");
		if (branchCode.length >0){	
            code = branchCode[0].firstChild.firstChild.nodeValue;  
            divTag = document.getElementById("bankBranchCodeVal");
    	divTag.innerHTML = "<input type='hidden' name='bankBrchCodeHidden' id='bankBrchCodeHidden' value='"+code+"'/>"+code;    
    	}
    	//Generating currecy delivery option based on the branch name
       for (var ctrl=0;ctrl<document.forms[0].elements.length;ctrl++){
    	if (document.forms[0].elements[ctrl].name == "dynamicProps(bankBrchName)"){ 
    		if(document.forms[0].elements[ctrl].value != "0"){		
    		loadDeliveryOptsForDirect(document.forms[0].elements[ctrl].value);
    		}
    	}
    	} 
    	
}

function frozenByUserDetails(frozeName){
var url = "ajaxXMLServiceActionGetFrozenByUser.do?method=frozenByDetails&service=AjaxDetails&frozenByName="+escape(frozeName);
  retrieveURLfrozenByUserDetails(url);
  divTag = document.getElementById("viewUserDetails");
  show(divTag);
}

function retrieveURLfrozenByUserDetails(url) {

   if (window.XMLHttpRequest) { // Non-IE browsers
        req = new XMLHttpRequest();
        try {
            req.open("GET", url, true);
            req.onreadystatechange = processStateChangefrozenByUserDetails;
        }
        catch (e) {
            alert(e);
        }
        req.send(null);
    } else {
        if (window.ActiveXObject) { // IE
            isIE = true;
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.open("GET", url, true);
                req.onreadystatechange = processStateChangefrozenByUserDetails;
                req.send();
            }
        }
    }
}
function processStateChangefrozenByUserDetails() {
    if (req.readyState == 4) { // Complete
        if (req.status == 200) {
            generatefrozenByUserDetails(req.responseXML);
        }
    }
}

//Use this function for GET/POST/REDIRECT functionality

function next(url) {
		
			var pathName = window.location.pathname;
			var desPath = pathName.substring((pathName.indexOf("/")+1),pathName.length);
			var path = desPath.substring(0,(desPath.indexOf("/")+1));
			var finalPath;
				if(path == "PayLynxs/"){
					finalPath = path+url;
				}else{
					finalPath = "Logincommon.do?method=sessionTimeOut&selectproduct=adminProduct";
				}
			        window.parent.location = window.location.protocol + "//" + window.location.hostname + ":" + window.location.port +"/"+ finalPath;
}


function generatefrozenByUserDetails(xml){

 var html = "<table width='100%' border='0' cellspacing='1' cellpadding='1' class='arial-black-12'>";    
	    // parse the XML
 try {
      if (xml) {
           var userdetails = xml.documentElement.getElementsByTagName("userdetailschild");
           var firstName= userdetails[0].firstChild.firstChild.nodeValue;
           var lastName=userdetails[0].childNodes.item(1).firstChild.nodeValue;
           var email=userdetails[0].childNodes.item(2).firstChild.nodeValue;
           var empID = userdetails[0].childNodes.item(3).firstChild.nodeValue;
           var phone =userdetails[0].childNodes.item(4).firstChild.nodeValue;
       }
     html += "<tr>";
     html += "<td height='27' valign='middle' class='arial-black-12' bgcolor='#F2F2F2' align='center'>";
     html += "<strong>User Details</strong>";
     html +="</td>";
     html +="</tr>";
     html += "<tr>";
     html +="<td height='27' valign='middle' class='arial-black-12'>";
     html +="<strong>First Name </strong>:";html+="&nbsp;"+firstName+"";
     html += "</td.";
     html +="</tr>";
     html += "<tr>";
     html +="<td height='27' valign='middle' class='arial-black-12'>";
     html +="<strong>Last Name </strong>:";html+="&nbsp;"+lastName+"";
     html += "</td>";
     html +="</tr>";
     html += "<tr>";
     html +="<td height='27' valign='middle' class='arial-black-12'>";
     html +="<strong>Email </strong>:";html+="&nbsp;"+email+"";
     html += "</td>";
     html +="</tr>";
     html += "<tr>";
     html +="<td height='27' valign='middle' class='arial-black-12'>";
     html +="<strong>Employee ID</strong>:";html+="&nbsp;"+empID+"";
     html += "</td>";
     html +="</tr>";
     html += "<tr>";
     html +="<td height='20' valign='middle' class='arial-black-12'>";
     html +="<strong>Phone</strong>:";html+="&nbsp;"+phone+"";
     html += "</td>";
     html +="</tr>";
     html +="<tr>";html += "<td height='27'>";html += "</td>";html +="</tr>";
     html +="<tr>";
     html += "<td class='arial-black-12' align='center'>";
     html+="<input type='button' value='Cancel' Class='button1' onclick='hide(divTag)' border='0' alt='' onmouseover='mouseOverFunct(this)' onmouseout='mouseOutFunct(this)' >"
     html += "</td>";
     html +="</tr>";
     html +="</table>";
     divTag = document.getElementById("viewUserDetails");
     divTag.innerHTML = html;    
    
    }catch(e){
      alert(e);
    }

}

var topDivZIndex = 10000;
function showViewBankDetailsDIV(divID){
	if(document.all && !window.opera) {  
	var oBody = document.getElementsByTagName("BODY").item(0);
	var oHelperIframe = document.createElement("IFRAME");
	oHelperIframe.setAttribute("id", "HELPER_IFRAME_ID");
	oHelperIframe.style.border = 0;
	oHelperIframe.width = 0;
	oHelperIframe.height = 0;
	oHelperIframe.style.position = "absolute";
	oBody.appendChild(oHelperIframe);
	
	var oBody = document.getElementsByTagName("BODY").item(0);
	var oHelperIframe = document.getElementById("HELPER_IFRAME_ID");
	var oDiv = document.getElementById("viewBankDetails");
	oDiv.style.zIndex = topDivZIndex;
	oHelperIframe.style.zIndex = topDivZIndex - 1000;
	topDivZIndex += 1;
	oHelperIframe.style.top = oDiv.style.top;
	oHelperIframe.style.left = oDiv.style.left;
	oHelperIframe.width = getDivWidth(divID) - 1;
	oHelperIframe.height = getDivHeight(divID) - 1;
	oHelperIframe.style.visibility = 'visible';
	oDiv.style.visibility = 'visible';
	}			
    divID.style.visibility = "visible";
}

function getDivWidth(divID){
return divID.offsetWidth;
}

function getDivHeight(divID){
return divID.offsetHeight;
}

function showViewFXResultDiv(divID){
if(document.all && !window.opera) {  
	var oBody = document.getElementsByTagName("BODY").item(0);
	var oHelperIframe = document.createElement("IFRAME");
	oHelperIframe.setAttribute("id", "HELPER_IFRAME_ID");
	oHelperIframe.style.border = 0;
	oHelperIframe.width = 0;
	oHelperIframe.height = 0;
	oHelperIframe.style.position = "absolute";
	oBody.appendChild(oHelperIframe);
	
	var oBody = document.getElementsByTagName("BODY").item(0);
	var oHelperIframe = document.getElementById("HELPER_IFRAME_ID");
	var oDiv = document.getElementById("viewFXResult");
	oDiv.style.zIndex = topDivZIndex;
	oHelperIframe.style.zIndex = topDivZIndex - 1000;
	topDivZIndex += 1;
	oHelperIframe.style.top = oDiv.style.top;
	oHelperIframe.style.left = oDiv.style.left;
	oHelperIframe.width = getDivWidth(divID) - 1;
	oHelperIframe.height = getDivHeight(divID) - 1;
	oHelperIframe.style.visibility = 'visible';
	oDiv.style.visibility = 'visible';
	}			
    divID.style.visibility = "visible";
}

function hideViewFXResultDiv(divID){
	divID.style.visibility = "hidden";	
	if(document.all && !window.opera) {  
	var oHelperIframe = document.getElementById("HELPER_IFRAME_ID");
	oHelperIframe.style.visibility = 'hidden';
	}
}


//For Div in Address.jsp of country
var topDivZIndex = 10000;
function showCashPickUpBranchLocationsDiv(divID) {
	if(document.all && !window.opera) {  
	var oBody = document.getElementsByTagName("BODY").item(0);
	var oHelperIframe = document.createElement("IFRAME");
	oHelperIframe.setAttribute("id", "HELPER_IFRAME_ID");
	oHelperIframe.style.border = 0;
	oHelperIframe.width = 0;
	oHelperIframe.height = 0;
	oHelperIframe.style.position = "absolute";
	oBody.appendChild(oHelperIframe);
	
	var oBody = document.getElementsByTagName("BODY").item(0);
	var oHelperIframe = document.getElementById("HELPER_IFRAME_ID");
	var oDiv = document.getElementById("cashPickUpBranchLocations");
	oDiv.style.zIndex = topDivZIndex;
	oHelperIframe.style.zIndex = topDivZIndex - 1000;
	topDivZIndex += 1;
	oHelperIframe.style.top = oDiv.style.top;
	oHelperIframe.style.left = oDiv.style.left;
	oHelperIframe.width = getDivWidth(divID) - 1;
	oHelperIframe.height = getDivHeight(divID) - 1;
	oHelperIframe.style.visibility = 'visible';
	oDiv.style.visibility = 'visible';
	}		
	cityDiv = document.getElementById("cityAddres");	
	cityDiv.innerHTML="";
    divID.style.visibility = "visible";
}

function hideCashPickUpBranchLocationsDiv(divID){
	divID.style.visibility = "hidden";	
	if(document.all && !window.opera) {  
	var oHelperIframe = document.getElementById("HELPER_IFRAME_ID");	
	if (null != oHelperIframe){
	oHelperIframe.style.visibility = 'hidden';
	}
	}
}
function moveTop(divTag) {
	 var html = "<a name='top'>";
	 html += "</a>";
	 html += "<a href='#top'>";
	 html += "</a>"; 
	 divTag.innerHTML = html;
}
function showTxnDisclaimer(){
  
  	divTag = document.getElementById("viewTransaction");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#FFFFFF'>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";
        html += "<a name='top'>";
        html += "</a>";
        html += "<a href='#top'>";
        html += "</a>";
        html += document.forms[0].txnDisclaimer.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' align='center'>";
        html += "<input type='button' value='Close' Class='button1' onclick='hide(divTag)' border='0' alt='' onmouseover='mouseOverFunct(this)' onmouseout='mouseOutFunct(this)' >";		        
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}

function showNonReceiptDisclaimer(){  
    
  	divTag = document.getElementById("viewNonRecipt");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#FFFFFF'>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";
        html += "<a name='top'>";
        html += "</a>";
        html += "<a href='#top'>";
        html += "</a>";
        html += document.forms[0].nonreceiptDisc.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' align='center'>";
        html += "<input type='button' value='Close' Class='button1' onclick='hide(divTag)' border='0' alt='' onmouseover='mouseOverFunct(this)' onmouseout='mouseOutFunct(this)' >";		        
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}

function showDeleteAccountDisclaimer(){  
    
  	divTag = document.getElementById("deleteAccount");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#FFFFFF'>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";
        html += "<a name='top'>";
        html += "</a>";
        html += "<a href='#top'>";
        html += "</a>";
        html += document.forms[0].delAccDisclaimer.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' align='center'>";
        html += "<input type='button' value='Close' Class='button1' onclick='hide(divTag)' border='0' alt='' onmouseover='mouseOverFunct(this)' onmouseout='mouseOutFunct(this)' >";		        
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}

function showTermsConditionDisclaimer(){  
    
  	divTag = document.getElementById("termsCondition");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#FFFFFF'>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";
        html += "<a name='top'>";
        html += "</a>";
        html += "<a href='#top'>";
        html += "</a>";
        html += document.forms[0].termsConditionDisc.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' align='center'>";
        html += "<input type='button' value='Close' Class='button1' onclick='hide(divTag)' border='0' alt='' onmouseover='mouseOverFunct(this)' onmouseout='mouseOutFunct(this)' >";		        
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}

function showPrivacyPolicyDisclaimer(){  
    
  	divTag = document.getElementById("privacypolicy");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#FFFFFF'>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";
        html += "<a name='top'>";
        html += "</a>";
        html += "<a href='#top'>";
        html += "</a>";        
        html += document.forms[0].privacyPolicyDisc.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' align='center'>";
        html += "<input type='button' value='Close' Class='button1' onclick='hide(divTag)' border='0' alt='' onmouseover='mouseOverFunct(this)' onmouseout='mouseOutFunct(this)' >";		        
        html += "</td>";
        html += "</tr>";
        html += "</table>";           
    divTag.innerHTML = html;
}

function showSbTxnDisclaimer(){  
   
   	divID = document.getElementById("txnDisc");
  	var html ="<table width='100%'>"
       	html += "<tr>";
        html += "<td width='4%' class='arial-black-12'>";
        html += document.forms[0].txnDisclaimer.value;
        html += "</td>";
        html += "</tr>";
        html += "</table>";
    divID.innerHTML = html;
}

function showSbTxnDisc(){
  
  	divTag = document.getElementById("listCreatorTransaction");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#ffffff'>";
        html += "<tr bgcolor='#F2F2F2'>";
        html += "<td colspan='3' class='arial-black-12'>";
        html += "<table width='100%'>";
        html += "<tr>";
        html += "<td colspan='2' valign='top' align='center' width='90%'>";
        html += "<strong>";
        html += "Disclaimer Details";
        html += "</strong>";
        html += "</td>";
        html += "<td width='10%' align='right'>";
        html += "<a href='javascript:hide(divTag)' onclick='javascript:hide(divTag)' class='arial-black-12-mOver'>";
        html += "<strong>";
        html += "Close";
        html += "</strong>";
        html += "</a>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' colspan='2' valign='top'>";
        html += "<strong>";
        html += "Transaction Receipt Disclaimer:";
        html += "</strong>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";          
        html += document.forms[0].txnDisclaimer.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td colspan='3' align='center'>";       
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}

function showSbNonReceiptDisc(){
  
  	divTag = document.getElementById("listCreatorNonReceipt");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#ffffff'>";
        html += "<tr bgcolor='#F2F2F2'>";
        html += "<td colspan='3' class='arial-black-12'>";
        html += "<table width='100%'>";
        html += "<tr>";
        html += "<td colspan='2' valign='top' align='center' width='90%'>";
        html += "<strong>";
        html += "Disclaimer Details";
        html += "</strong>";
        html += "</td>";
        html += "<td width='10%' align='right'>";
        html += "<a href='javascript:hide(divTag)' onclick='javascript:hide(divTag)' class='arial-black-12-mOver'>";
        html += "<strong>";
        html += "Close";
        html += "</strong>";
        html += "</a>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' colspan='2' valign='top'>";
        html += "<strong>";
        html += "Non-Receipt Disclaimer:";
        html += "</strong>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";          
        html += document.forms[0].nonreceiptDisc.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td colspan='3' align='center'>";       
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}

function showSbDeleteAcctDisc(){
  
  	divTag = document.getElementById("listCreatorDelete");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#ffffff'>";
        html += "<tr bgcolor='#F2F2F2'>";
        html += "<td colspan='3' class='arial-black-12'>";
        html += "<table width='100%'>";
        html += "<tr>";
        html += "<td colspan='2' valign='top' align='center' width='90%'>";
        html += "<strong>";
        html += "Disclaimer Details";
        html += "</strong>";
        html += "</td>";
        html += "<td width='10%' align='right'>";
        html += "<a href='javascript:hide(divTag)' onclick='javascript:hide(divTag)' class='arial-black-12-mOver'>";
        html += "<strong>";
        html += "Close";
        html += "</strong>";
        html += "</a>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' colspan='2' valign='top'>";
        html += "<strong>";
        html += "Delete Account Disclaimer:";
        html += "</strong>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";          
        html += document.forms[0].delAccDisclaimer.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td colspan='3' align='center'>";       
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}

function showSbTermsCondDisc(){
  
  	divTag = document.getElementById("listCreatorTermsAndCond");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#ffffff'>";
        html += "<tr bgcolor='#F2F2F2'>";
        html += "<td colspan='3' class='arial-black-12'>";
        html += "<table width='100%'>";
        html += "<tr>";
        html += "<td colspan='2' valign='top' align='center' width='90%'>";
        html += "<strong>";
        html += "Disclaimer Details";
        html += "</strong>";
        html += "</td>";
        html += "<td width='10%' align='right'>";
        html += "<a href='javascript:hide(divTag)' onclick='javascript:hide(divTag)' class='arial-black-12-mOver'>";
        html += "<strong>";
        html += "Close";
        html += "</strong>";
        html += "</a>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' colspan='2' valign='top'>";
        html += "<strong>";
        html += "Terms and Conditions of the Service:";
        html += "</strong>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";          
        html += document.forms[0].termsConditionDisc.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td colspan='3' align='center'>";       
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}
function showSbIntroDisc(){
  
  	divTag = document.getElementById("listCreatorIntroCond");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#ffffff'>";
        html += "<tr bgcolor='#F2F2F2'>";
        html += "<td colspan='3' class='arial-black-12'>";
        html += "<table width='100%'>";
        html += "<tr>";
        html += "<td colspan='2' valign='top' align='center' width='90%'>";
        html += "<strong>";
        html += "Disclaimer Details";
        html += "</strong>";
        html += "</td>";
        html += "<td width='10%' align='right'>";
        html += "<a href='javascript:hide(divTag)' onclick='javascript:hide(divTag)' class='arial-black-12-mOver'>";
        html += "<strong>";
        html += "Close";
        html += "</strong>";
        html += "</a>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' colspan='2' valign='top'>";
        html += "<strong>";
        html += "Introduction";
        html += "</strong>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";          
        html += document.forms[0].intrDisc.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td colspan='3' align='center'>";       
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}

function showSbPmtDisc(){
  
  	divTag = document.getElementById("listCreatorPmtCond");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#ffffff'>";
        html += "<tr bgcolor='#F2F2F2'>";
        html += "<td colspan='3' class='arial-black-12'>";
        html += "<table width='100%'>";
        html += "<tr>";
        html += "<td colspan='2' valign='top' align='center' width='90%'>";
        html += "<strong>";
        html += "Disclaimer Details";
        html += "</strong>";
        html += "</td>";
        html += "<td width='10%' align='right'>";
        html += "<a href='javascript:hide(divTag)' onclick='javascript:hide(divTag)' class='arial-black-12-mOver'>";
        html += "<strong>";
        html += "Close";
        html += "</strong>";
        html += "</a>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' colspan='2' valign='top'>";
        html += "<strong>";
        html += document.forms[0].pmtText.value;
        html += "</strong>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";          
        html += document.forms[0].pmtDisc.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td colspan='3' align='center'>";       
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}

function showSbDisbursementDisc(){
  
  	divTag = document.getElementById("listCreatorDisbCond");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#ffffff'>";
        html += "<tr bgcolor='#F2F2F2'>";
        html += "<td colspan='3' class='arial-black-12'>";
        html += "<table width='100%'>";
        html += "<tr>";
        html += "<td colspan='2' valign='top' align='center' width='90%'>";
        html += "<strong>";
        html += "Disclaimer Details";
        html += "</strong>";
        html += "</td>";
        html += "<td width='10%' align='right'>";
        html += "<a href='javascript:hide(divTag)' onclick='javascript:hide(divTag)' class='arial-black-12-mOver'>";
        html += "<strong>";
        html += "Close";
        html += "</strong>";
        html += "</a>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' colspan='2' valign='top'>";
        html += "<strong>";
        html += document.forms[0].disbText.value;
        html += "</strong>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";          
        html += document.forms[0].disbDisc.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td colspan='3' align='center'>";       
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}

function showSbLimitDisc(){
  
  	divTag = document.getElementById("listCreatorLimitCond");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#ffffff'>";
        html += "<tr bgcolor='#F2F2F2'>";
        html += "<td colspan='3' class='arial-black-12'>";
        html += "<table width='100%'>";
        html += "<tr>";
        html += "<td colspan='2' valign='top' align='center' width='90%'>";
        html += "<strong>";
        html += "Disclaimer Details";
        html += "</strong>";
        html += "</td>";
        html += "<td width='10%' align='right'>";
        html += "<a href='javascript:hide(divTag)' onclick='javascript:hide(divTag)' class='arial-black-12-mOver'>";
        html += "<strong>";
        html += "Close";
        html += "</strong>";
        html += "</a>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' colspan='2' valign='top'>";
        html += "<strong>";
        html += document.forms[0].limitText.value;
        html += "</strong>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";          
        html += document.forms[0].limitService.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td colspan='3' align='center'>";       
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}

function showSbCancelRfndDisc(){
  
  	divTag = document.getElementById("listCreatorCancelCond");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#ffffff'>";
        html += "<tr bgcolor='#F2F2F2'>";
        html += "<td colspan='3' class='arial-black-12'>";
        html += "<table width='100%'>";
        html += "<tr>";
        html += "<td colspan='2' valign='top' align='center' width='90%'>";
        html += "<strong>";
        html += "Disclaimer Details";
        html += "</strong>";
        html += "</td>";
        html += "<td width='10%' align='right'>";
        html += "<a href='javascript:hide(divTag)' onclick='javascript:hide(divTag)' class='arial-black-12-mOver'>";
        html += "<strong>";
        html += "Close";
        html += "</strong>";
        html += "</a>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' colspan='2' valign='top'>";
        html += "<strong>";
        html += document.forms[0].cancelRfndText.value;
        html += "</strong>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";          
        html += document.forms[0].cancelRefund.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td colspan='3' align='center'>";       
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}

function showSbGenInfoDisc(){  
    
  	divTag = document.getElementById("listCreatorGenInfoCond");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#ffffff'>";
        html += "<tr bgcolor='#F2F2F2'>";
        html += "<td colspan='3' class='arial-black-12'>";
        html += "<table width='100%'>";
        html += "<tr>";
        html += "<td colspan='2' valign='top' align='center' width='90%'>";
        html += "<strong>";
        html += "Disclaimer Details";
        html += "</strong>";
        html += "</td>";
        html += "<td width='10%' align='right'>";
        html += "<a href='javascript:hide(divTag)' onclick='javascript:hide(divTag)' class='arial-black-12-mOver'>";
        html += "<strong>";
        html += "Close";
        html += "</strong>";
        html += "</a>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' colspan='2' valign='top'>";
        html += "<strong>";
        html += document.forms[0].genInfoText.value;
        html += "</strong>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";          
        html += document.forms[0].genInfoDisc.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td colspan='3' align='center'>";       
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}


function showSbPrivacyPolicyDisc(){
  
  	divTag = document.getElementById("listCreatorPrivacyPolicy");
  	divTag.style.visibility = "visible";
        var html = "<table width='400' border='0' bgcolor='#ffffff'>";
        html += "<tr bgcolor='#F2F2F2'>";
        html += "<td colspan='3' class='arial-black-12'>";
        html += "<table width='100%'>";
        html += "<tr>";
        html += "<td colspan='2' valign='top' align='center' width='90%'>";
        html += "<strong>";
        html += "Disclaimer Details";
        html += "</strong>";
        html += "</td>";
        html += "<td width='10%' align='right'>";
        html += "<a href='javascript:hide(divTag)' onclick='javascript:hide(divTag)' class='arial-black-12-mOver'>";
        html += "<strong>";
        html += "Close";
        html += "</strong>";
        html += "</a>";
        html += "</td>";
        html += "</tr>";
        html += "</table>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12' colspan='2' valign='top'>";
        html += "<strong>";
        html += "Privacy Policy:";
        html += "</strong>";
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td class='arial-black-12'>";          
        html += document.forms[0].privacyPolicyDisc.value;
        html += "</td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td colspan='3' align='center'>";       
        html += "</td>";
        html += "</tr>";
        html += "</table>";        
    divTag.innerHTML = html;
}

function userEntriesCity() {	
showDiv(listCreatorCity);hide(listCreatorState);hide(listCreatorCounty);hide(listCreatorProvince);hide(listCreatorDept);hide(listCreatorMuncipality);
}
function userEntriesState() {	
showDiv(listCreatorState);hide(listCreatorCity);hide(listCreatorCounty);hide(listCreatorProvince);hide(listCreatorDept);hide(listCreatorMuncipality);
}
function userEntriesCountry() {	
showDiv(listCreatorCounty);hide(listCreatorCity);hide(listCreatorState);hide(listCreatorProvince);hide(listCreatorDept);hide(listCreatorMuncipality);
}
function userEntriesProvince() {	
showDiv(listCreatorProvince);hide(listCreatorCity);hide(listCreatorState);hide(listCreatorCounty);hide(listCreatorDept);hide(listCreatorMuncipality);
}
function userEntriesDepartment() {	
showDiv(listCreatorDept);hide(listCreatorCity);hide(listCreatorState);hide(listCreatorCounty);hide(listCreatorProvince);hide(listCreatorMuncipality);
}
function userEntriesMunicipality() {	
showDiv(listCreatorMuncipality);hide(listCreatorCity);hide(listCreatorState);hide(listCreatorCounty);hide(listCreatorProvince);hide(listCreatorDept);
}

function viewEntriesCity() {	
showDivCountryPage(listCreatorCity);hide(listCreatorState);hide(listCreatorCountry);hide(listCreatorProvince);hide(listCreatorDepartment);hide(listCreatorMunicipality);
}
function viewEntriesState() {	
showDivCountryPage(listCreatorState);hide(listCreatorCity);hide(listCreatorCountry);hide(listCreatorProvince);hide(listCreatorDepartment);hide(listCreatorMunicipality);
}
function viewEntriesCountry() {	
showDivCountryPage(listCreatorCountry);hide(listCreatorCity);hide(listCreatorState);hide(listCreatorProvince);hide(listCreatorDepartment);hide(listCreatorMunicipality);
}
function viewEntriesProvince() {	
showDivCountryPage(listCreatorProvince);hide(listCreatorCity);hide(listCreatorState);hide(listCreatorCountry);hide(listCreatorDepartment);hide(listCreatorMunicipality);
}
function viewEntriesDepartment() {	
showDivCountryPage(listCreatorDepartment);hide(listCreatorCity);hide(listCreatorState);hide(listCreatorCountry);hide(listCreatorProvince);hide(listCreatorMunicipality);
}
function viewEntriesMunicipality() {	
showDivCountryPage(listCreatorMunicipality);hide(listCreatorCity);hide(listCreatorState);hide(listCreatorCountry);hide(listCreatorProvince);hide(listCreatorDepartment);
}

function viewTxnDisclaimer() {	
	showTxnDisclaimer();hide(viewNonRecipt);hide(deleteAccount);hide(termsCondition);hide(privacypolicy);
	hide(listCreatorIntroCond);hide(listCreatorPmtCond);hide(listCreatorDisbCond);
	hide(listCreatorLimitCond);hide(listCreatorCancelCond);hide(listCreatorGenInfoCond);
}
function viewNonReceiptDisclaimer() {	
	showNonReceiptDisclaimer();hide(viewTransaction);hide(deleteAccount);hide(termsCondition);hide(privacypolicy);
	hide(listCreatorIntroCond);hide(listCreatorPmtCond);hide(listCreatorDisbCond);
	hide(listCreatorLimitCond);hide(listCreatorCancelCond);hide(listCreatorGenInfoCond);
}
function viewDeleteAcctDisclaimer() {	
	showDeleteAccountDisclaimer();hide(viewTransaction);hide(viewNonRecipt);hide(termsCondition);
	hide(privacypolicy);hide(listCreatorIntroCond);hide(listCreatorPmtCond);hide(listCreatorDisbCond);
	hide(listCreatorLimitCond);hide(listCreatorCancelCond);hide(listCreatorGenInfoCond);
}
function viewTermsCondsDisclaimer() {	
	showTermsConditionDisclaimer();hide(viewTransaction);hide(viewNonRecipt);hide(deleteAccount);hide(privacypolicy);
	hide(listCreatorIntroCond);hide(listCreatorPmtCond);hide(listCreatorDisbCond);
	hide(listCreatorLimitCond);hide(listCreatorCancelCond);hide(listCreatorGenInfoCond);
}
function viewPrivPolicDisclaimer() {	
	showPrivacyPolicyDisclaimer();hide(viewTransaction);hide(viewNonRecipt);hide(deleteAccount);hide(termsCondition);
	hide(listCreatorIntroCond);hide(listCreatorPmtCond);hide(listCreatorDisbCond);
	hide(listCreatorLimitCond);hide(listCreatorCancelCond);hide(listCreatorGenInfoCond);
}

function viewSbTxnDisclaimer() {
	showSbTxnDisc();hide(listCreatorNonReceipt);hide(listCreatorDelete);hide(listCreatorTermsAndCond);hide(listCreatorPrivacyPolicy);
	hide(listCreatorIntroCond);hide(listCreatorPmtCond);hide(listCreatorDisbCond);
	hide(listCreatorLimitCond);hide(listCreatorCancelCond);hide(listCreatorGenInfoCond);
}
function viewSbNonReceiptDisclaimer() {	
	showSbNonReceiptDisc();hide(listCreatorTransaction);hide(listCreatorDelete);hide(listCreatorTermsAndCond);
	hide(listCreatorPrivacyPolicy);hide(listCreatorIntroCond);hide(listCreatorPmtCond);
	hide(listCreatorDisbCond);hide(listCreatorLimitCond);hide(listCreatorCancelCond);hide(listCreatorGenInfoCond);
}
function viewSbDeleteAcctDisclaimer() {	
	showSbDeleteAcctDisc();hide(listCreatorTransaction);hide(listCreatorNonReceipt);
	hide(listCreatorTermsAndCond);hide(listCreatorPrivacyPolicy);
	hide(listCreatorIntroCond);hide(listCreatorPmtCond);hide(listCreatorDisbCond);hide(listCreatorLimitCond);
	hide(listCreatorCancelCond);hide(listCreatorGenInfoCond);
}
function viewSbTermsCondsDisclaimer() {	
	showSbTermsCondDisc();hide(listCreatorTransaction);hide(listCreatorNonReceipt);
	hide(listCreatorDelete);hide(listCreatorPrivacyPolicy);
	hide(listCreatorIntroCond);hide(listCreatorPmtCond);hide(listCreatorDisbCond);hide(listCreatorLimitCond);
	hide(listCreatorCancelCond);hide(listCreatorGenInfoCond);
}
function viewSbPrivPolicDisclaimer() {	
	showSbPrivacyPolicyDisc();hide(listCreatorTransaction);hide(listCreatorNonReceipt);
	hide(listCreatorDelete);hide(listCreatorTermsAndCond);
	hide(listCreatorIntroCond);hide(listCreatorPmtCond);hide(listCreatorDisbCond);hide(listCreatorLimitCond);
	hide(listCreatorCancelCond);hide(listCreatorGenInfoCond);
}

function uploadEntriesCity() {	
showDiv(uploadCreatorCity);hide(uploadCreatorState);hide(uploadCreatorCounty);hide(uploadCreatorProvince);hide(uploadCreatorDept);hide(uploadCreatorMuncipality);
}

function uploadEntriesState() {	
hide(uploadCreatorCity);showDiv(uploadCreatorState);hide(uploadCreatorCounty);hide(uploadCreatorProvince);hide(uploadCreatorDept);hide(uploadCreatorMuncipality);
}

function setSelectCity() {
	var a = document.forms[0].hiddenCity.value;
	s = a.split(":");
	for (var i = 0; i<s.length; i++)
	{
	document.forms[0].userEntriesCity.options = new Option(s[i],s[i]);
	}
	
}

function showInstructions(divID) {	
	var y = window.document.body.scrollTop;
	divID.style.top = y + 70;
	divID.style.left = 430;
    divID.style.visibility = "visible";
}

function showDivCountryPage(divID) {	
	var y = window.document.body.scrollTop;
	divID.style.top = y + 100;
	divID.style.left = 450;
    divID.style.visibility = "visible";
}

function showUser(divID) {	
	var y = window.document.body.scrollTop;
	divID.style.top = y + 70;
	divID.style.left = 350;
    divID.style.visibility = "visible";
}

function showMore(divID) {	
	var y = window.document.body.scrollTop;
	divID.style.top = y + 100;
	divID.style.left = 280;
    divID.style.visibility = "visible";
}

function showMoreContact(divID) {	
	var y = window.document.body.scrollTop;
	divID.style.top = y + 200;
	divID.style.left = 520;
    divID.style.visibility = "visible";
}


function showAnswer(divID) {	
	var y = window.document.body.scrollTop;
	divID.style.top = y + 100;
	divID.style.left = 670;
    divID.style.visibility = "visible";
}
function showInstr(divID) {	
	var y = window.document.body.scrollTop;
	divID.style.top = y+15;
	divID.style.left = 580;
    divID.style.visibility = "visible";
}
	var spacer = null; 
 	var curObj = null; 
  function openIt(obj){ 
       //For IE
       	 if (window.ActiveXObject) {
             obj.style.top  = getAbsPos(obj, "Top"); 
             obj.style.position  = "absolute"; 
             obj.style.width='auto';
             //For Non IE
             }else if (window.XMLHttpRequest) {
             if(spacer) return; 
 		         spacer = document.createElement("span"); 
 		         spacer.style.width = obj.offsetWidth; 
 		         spacer.style.height = obj.offsetHeight; 
 		         spacer.style.display = "none"; 
 		         obj.parentNode.insertBefore(spacer, obj);  		               
 		         obj.style.left  = getAbsPos(obj, "Left"); 
 		         obj.style.top  = getAbsPos(obj, "Top"); 
 		         obj.style.position  = "absolute"; 
 		         obj.style.width = obj.scrollWidth+20; 
 		         obj.focus(); 
 		         spacer.style.display = "inline"; 
 		         curObj = obj; 
             }
       } 
       function closeIt(curObj){ 
       	//For IE
             if (window.ActiveXObject) {                  
              } else if (window.XMLHttpRequest) {
              	if(spacer) 
 		              { 
 		                spacer.parentNode.removeChild(spacer); 
 		                spacer = null; 
 		              } 
 		              if(curObj) 
 		              {  		                
 		                curObj.style.position  = "static"; 
 		              } 
              }			                   		            
        } 
       function getAbsPos(o,p) 
       { 
               var i=0; 
               while(o!=null) 
               {i+=o["offset"+p]; 
               o=o.offsetParent;} 
               return i; 
       } 