



          function HS_Object(_1){this.name="";if(arguments.length>0){this.init(_1);}this.className="HS_Object";}HS_Object.prototype.init=function(_2){if(typeof _2!="undefined"){this.name=_2;}};HS_Object.prototype.toString=function(){var _3=this.className;if(this.name.length>0){_3+=" ("+this.name+")";}return _3;};HS_Object.prototype.log=function(_4){_Logger.log(_4,this);};HS_Object.prototype.error=function(_5){_Logger.error(_5,this);};
          var XMLHTTPREQUEST_TIMEOUT=-1;HS_XMLHTTP.prototype=new HS_Object();HS_XMLHTTP.prototype.constructor=HS_XMLHTTP;function HS_XMLHTTP(_1){if(arguments.length>0){this.init(_1);}this.className="HS_XMLHTTP";}HS_XMLHTTP.prototype.init=function(_2){this.baseInit=HS_Object.prototype.init;this.baseInit(_2);var _3=(typeof _2=="undefined"||_2==null)?null:_2;this.requests={};this.XMLHTTP=function(){var _4=null;try{_4=new XMLHttpRequest();}catch(e){try{_4=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{_4=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){_4=null;}}}return _4;};this.getCaller=function(_5){var _6=arguments.callee.caller;if(_5){for(var i=0;i<_5;i++){_6=_6.caller;}}var _8="";while(true){if(!_6){break;}_8+=this.getFName(_6.toString())+"|";_6=_6.caller;}return _8.substring(0,_8.length-1);};this.getFName=function(s){var i=s.indexOf("function");if(i<0){return s.substring(0,40);}var j=s.indexOf("(");if(j<0){return s.substring(11,50);}var _c=s.substring(i+8,j);if(_c.trim()==""){return s.substring(11,50);}return _c;};this.request=function(_d,_e,_f,_10){this.get(_d,_e,_f,_10);};this.get=function(_11,_12,_13,_14){this.send("GET",_11,null,_12,_13,_14);};this.post=function(_15,_16,_17,_18){this.send("POST",_15.action,HS_XMLHTTP.serializeForm(_15),_16,_17,_18);};this.send=function(_19,_1a,_1b,_1c,_1d,_1e){_19=_19.trim().toUpperCase();if(_19!="GET"&&_19!="POST"){return;}_1a=_1a.trim();if(_1a.length<=0){return;}if(typeof _1c!="undefined"&&_1c!=null){var _1f=null;for(var key in this.requests){var _21=null;try{_21=this.requests[key].handler;}catch(e){_21=null;}if(_21==_1c){_1f=key;break;}}if(_1f!=null){this.endRequest(_1f);}}var _22=this.XMLHTTP();if(_22==null){return;}var _23=new Date();var id=Math.floor(Math.random()*_23.getTime()*1000);var _25=new HS_XMLHTTPRequest(id,_22,_1a,_1c,_1d);if(_19=="GET"){if(_1a.indexOf("?")>=0){_1a+="&";}else{_1a+="?";}_1a+="xmlhttpid="+id;if(_1a.indexOf("out=")<0){_1a+="&testStr="+escape(this.getCaller(3));}}else{if(_1b==null){_1b="";}if(_1b.length>0){_1b+="&";}_1b+="xmlhttpid="+id;}try{_22.open(_19,_1a,true);if(_3!=null){_22.onreadystatechange=function(){if(typeof _XMLHTTP!="undefined"){eval(_3+".processResponse( "+id+" );");}};}else{_22.onreadystatechange=null;}if(_19=="POST"){_22.setRequestHeader("Content-Type","application/x-www-form-urlencoded");}_22.send(_1b);this.requests[id]=_25;if(XMLHTTPREQUEST_TIMEOUT>0){_25.timeout=setTimeout(this.name+".timeoutRequest( "+id+" );",XMLHTTPREQUEST_TIMEOUT);}}catch(e){_22=null;_25=null;}if(_22!=null){HS_UIWait();if(typeof _1e=="undefined"||_1e==null||_1e){HS_SetSessionTimeout();}}};this.timeoutRequest=function(id){this.endRequest(id);};this.endRequest=function(id){var _28=this.requests[id];if(typeof _28=="undefined"||_28==null){return;}this.requests[id]=null;try{if(!_28.completed){_28.xmlhttp.abort();clearTimeout(_28.timeout);}}catch(e){}HS_UIResume();};this.processResponse=function(id){var _2a=this.requests[id];if(_2a==null){return;}if(_2a.xmlhttp!=null){var _2b=_2a.xmlhttp.readyState;if(_2b==4){clearTimeout(_2a.timeout);_2a.completed=true;if(_2a.handler!=null){var _2c="";try{var _2d=_2a.xmlhttp.status;if(_2d==200){_2c=_2a.xmlhttp.responseText;var _2e=_2a.xmlhttp.getResponseHeader("Content-Type").toLowerCase();if(_2e.indexOf("text/html")==-1&&_2e!="text/plain"&&_2e!="text/xml"){var _2f=_2c.toLowerCase().indexOf("var");var _30=_2c.lastIndexOf(";");if(_2f>0||_30<_2c.length-1){_2c=_2c.substring(_2f,_30+1);}}}else{if(_2d==302){_2c=_2a.xmlhttp.responseText;}}_2a.handler(_2c,_2a.data);}catch(e){}}this.endRequest(id);}}};};HS_XMLHTTP.prototype.toString=function(){this.baseToString=HS_Object.prototype.toString;return this.baseToString();};HS_XMLHTTP.serializeForm=function(_31){var els=_31.elements;var len=els.length;var _34="";this.addField=function(_35,_36){if(_34.length>0){_34+="&";}_34+=encodeURIComponent(_35)+"="+encodeURIComponent(_36);};for(var i=0;i<len;i++){var el=els[i];if(!el.disabled){switch(el.type){case "text":case "password":case "hidden":case "textarea":this.addField(el.name,el.value);break;case "select-one":if(el.selectedIndex>=0){this.addField(el.name,el.options[el.selectedIndex].value);}break;case "select-multiple":for(var j=0;j<el.options.length;j++){if(el.options[j].selected){this.addField(el.name,el.options[j].value);}}break;case "checkbox":case "radio":if(el.checked){this.addField(el.name,el.value);}break;}}}return _34;};function HS_XMLHTTPRequest(id,_3b,_3c,_3d,_3e){if(arguments.length>0){this.init(id,_3b,_3c,_3d,_3e);}this.className="HS_XMLHTTPRequest";}HS_XMLHTTPRequest.prototype.init=function(id,_40,_41,_42,_43){this.id=id;this.xmlhttp=_40;this.url=_41;this.completed=false;this.timeout=null;this.handler=null;if(typeof _42!="undefined"){this.handler=_42;}this.data=null;if(typeof _43!="undefined"){this.data=_43;}};HS_XMLHTTPRequest.prototype.toString=function(){return this.className+" id="+this.id;};var gUIWaitRequests=0;var gUILoadingSign=null;var UIWAIT_GRACE_PERIOD=500;function HS_UIWait(){setTimeout(function(){gUIWaitRequests++;HS_UpdateUILoading();},UIWAIT_GRACE_PERIOD);}function HS_UIResume(){gUIWaitRequests--;HS_UpdateUILoading();}function HS_UpdateUILoading(){if(gUIWaitRequests>0){document.body.style.cursor="wait";}else{document.body.style.cursor="default";}}
	HS_Form.prototype=new HS_Object();HS_Form.prototype.constructor=HS_Form;function HS_Form(_1,_2,_3,_4){if(arguments.length>0){this.init(_1,_2,_3,_4);}this.className="HS_Form";}HS_Form.prototype.init=function(_5,_6,_7,_8){var _9="";this.baseInit=HS_Object.prototype.init;this.baseInit(_5);var id="";if(typeof _6!="undefined"&&_6!=null){id=_6;}var _b=null;if(id.length>0){_b=document.getElementById(id);}if(_b!=null){_b.name=_b.id;}this.formName="";this.updateFormName=function(){var _c=_9.lastIndexOf("/");if(_c>=0){this.formName=_9.substring(_c+1);}else{this.formName="";}if(this.formName.length>0&&_b!=null){_b.name=this.formName;}};if(typeof _7!="undefined"&&_7!=null){_9=_7;this.updateFormName();}var _d=null;var _e=new Array();var _f=true;var _10=false;var _11=null;if(typeof _8!="undefined"&&_8!=null){_11=_8;}var _12=new Array();var _13=true;this.enableErrorOutput=function(){_13=true;};this.disableErrorOutput=function(){_13=false;};this.getErrors=function(){return _12;};this.clearErrors=function(){_12=new Array();if(_13){var _14=document.getElementById("hsidHSErrorMessages");if(_14!=null){_14.innerHTML="";}var _15=document.getElementById("hsidHSErrorDialog");if(_15!=null){_15.style.display="none";}}};this.reportError=function(key){if(_13){var str="";if(typeof HS_ErrorDisplayHandler!="undefined"){str=HS_ErrorDisplayHandler(key);}if(str.length>0){var _18=document.getElementById("hsidHSErrorDialog");if(_18!=null){_18.style.display="block";var _19=document.getElementById("hsidHSErrorMessages");if(_19!=null){var _1a=document.createElement("div");_19.appendChild(_1a);_1a.innerHTML=str;}}}}this.log("report error: "+key);_12.push(key);};this.getServiceData=function(_1b){if(_d==null){return null;}if(typeof _1b=="undefined"||_1b==null||_1b.length<=0){return _d;}var _1c=_d[HS_HASHKEY_SUBARRAY+"2"];if(typeof _1c!="undefined"&&_1c!=null&&_1c.length>0){for(var i=0;i<_1c.length;i++){var _1e=_1c[i];if(_1b==_1e["stFieldName"]){return _1e;}}}return null;};this.getDisplayData=function(key){if(_d==null){return "";}var _20="";var _21=_d[HS_HASHKEY_SUBARRAY+"1"];if(typeof _21!="undefined"&&_21!=null&&_21.length>0){_20=_21[0][key];if(typeof _20=="undefined"||_20==null){_20="";}}return _20;};this.getForward=function(_22){if(typeof _22=="undefined"||_22==null||_22.trim().length<=0){return null;}for(var i=0;i<_e.length;i++){var _24=_e[i];if(_24[0].trim()==_22.trim()){return _24[1];}}return null;};this.setForward=function(_25,_26){if(typeof _25=="undefined"||_25==null||_25.trim().length<=0){return;}if(typeof _26=="undefined"||_26==null||_26.trim().length<=0){return;}for(var i=0;i<_e.length;i++){var _28=_e[i];if(_28[0].trim()==_25.trim()){return;}}_e.push(new Array(_25.trim(),_26.trim()));};this.setURL=function(_29){if(typeof _29!="undefined"&&_29!=null){_9=_29;this.updateFormName();}};this.modifyForward=function(_2a,_2b){if(typeof _2a=="undefined"||_2a==null||_2a.trim().length<=0){return;}if(typeof _2b=="undefined"||_2b==null||_2b.trim().length<=0){return;}for(var i=0;i<_e.length;i++){var _2d=_e[i];if(_2d[0].trim()==_2a.trim()){_2d[1]=_2b;return;}}_e.push(new Array(_2a.trim(),_2b.trim()));};this.run=function(_2e,_2f){if(_9.trim().length<=0){return;}_d=null;this.clearErrors();var _30=false;var _31=_9+"?out=arrFormData";if(typeof _2f!="undefined"&&_2f!=null){if(_2f){_30=true;}}if(!_30){var _32="";if(typeof _2e!="undefined"&&_2e!=null){_32=_2e;}if(_32.length<=0){_32=HS_GetQueryString("formid").trim();}if(_32.length>0){this.log("existing formid: "+_32);_f=false;_31+="&formid="+_32;}}_XMLHTTP.request(_31,HS_Form_DataService_Callback,eval(this.name));};this.run2=function(_33,_34,_35){if(_9.trim().length<=0){return;}_d=null;this.clearErrors();var _36=false;var _37=_9+"?out=arrFormData";if(typeof _35!="undefined"&&_35!=null){if(_35){_36=true;}}if(!_36){var _38="";if(typeof _34!="undefined"&&_34!=null){_38=_34;}if(_38.length<=0){_38=HS_GetQueryString("formid").trim();}if(_38.length>0){this.log("existing formid: "+_38);_f=false;_37+="&formid="+_38;}}_XMLHTTP.request2(_33,_37,eval(this.name));};this.buildOutputs=function(){if(_d==null){return;}var _39=_d[HS_HASHKEY_SUBARRAY+"1"];if(typeof _39!="undefined"&&_39!=null&&_39.length>0){for(var key in _39[0]){if(key!="size"){var obj=document.getElementById("hsid"+key);if(obj==null){obj=document.getElementById(key);}if(obj!=null){var _3c=_39[0][key];if(typeof _3c=="undefined"||_3c==null){_3c="";}var _3d=key.substring(0,2);if(_3d=="cy"){_3c=HS_Form_DisplayHandler_Currency(_3c);}else{if(_3d=="da"){_3c=HS_Form_DisplayHandler_Date(_3c);}else{if(_3d=="tm"){_3c=HS_Form_DisplayHandler_Time(_3c);}else{if(_3d=="dt"){_3c=HS_Form_DisplayHandler_DateTime(_3c);}}}}if(obj.tagName.toLowerCase()=="input"&&(obj.type.toLowerCase()=="hidden"||obj.type.toLowerCase()=="text")){obj.value=_3c;}else{obj.innerHTML=_3c;}}else{this.log("no element with id="+key);}}}}this.log("Build Form Outputs");};this.buildInputs=function(){var _3e=0;if(_d==null){return;}if(_b==null){return;}var _3f=_d[HS_HASHKEY_SUBARRAY+"2"];this.log(_3f.length+" inputs");if(typeof _3f!="undefined"&&_3f!=null&&_3f.length>0){for(var i=0;i<_3f.length;i++){var _41=_3f[i];var _42=_41["stFieldName"];var _43=_41["stObjectType"];var _44=_41["obInitialDataObject"];var _45=_41["obRawStringData"];var _46=_41["obValidatDataObject"];var _47=_41["ecFieldErrorValue"];var _48=_41[HS_HASHKEY_SUBARRAY];if(typeof _47!="undefined"&&_47!=null&&_47>0){this.reportError(_42+"::"+_47);}var _49=_46;if(typeof _49=="undefined"||_49==null){_49=_45;if(typeof _49=="undefined"||_49==null){_49=_44;if(typeof _49=="undefined"||_49==null){_49="";}}}if(_43.trim().toLowerCase()=="cy"){if(_49!=null&&_49.length>0){_49=HS_Form_DisplayHandler_Currency(_49);}}if(_43.trim().toLowerCase()=="da"){if(_45!=null){_49=_45;}}this.log("input data: "+_42+" - "+_49);var _4a=eval("document.getElementById( \""+id+"\" )."+_42);if(_4a!=null){if(typeof _48!="undefined"&&_48!=null&&_48.length>0){var _4b=new Array();if(_49!=null){if(IsArray(_49)){_4b=_49;}else{_4b.push(_49);}}if(_4a.tagName.toLowerCase()=="select"){for(var j=0;j<_48.length;j++){var _4d=_48[j];if(typeof _4d!="undefined"&&_4d!=null&&_4d.size()>1){var _4e="";if((_42.match("month")||_42.match("Month"))&&typeof monthMap!="undefined"&&monthMap!=null&&monthMap instanceof Array){_4e=monthMap[_4d["stKey"]];}else{if(typeof valueAndLabelMap!="undefined"&&valueAndLabelMap!=null&&valueAndLabelMap instanceof Array){_4e=valueAndLabelMap[_4d["stKey"]];if(typeof _4e=="undefined"&&_4e==null){_4e=_4d["stKey"].replace(_4d["stKey"].substring(0,1),_4d["stKey"].substring(0,1).toUpperCase());}}else{_4e=_4d["stKey"].replace(_4d["stKey"].substring(0,1),_4d["stKey"].substring(0,1).toUpperCase());}}var obj=document.createElement("option");try{_4a.add(obj);}catch(e){_4a.add(obj,null);}obj.text=_4e;obj.value=_4d["stValue"];if(_4b.length>0){for(var k=0;k<_4b.length;k++){if(_4b[k]==obj.value){obj.selected=true;break;}}}}}}if(_4a.tagName.toLowerCase()=="input"&&(_4a.type.toLowerCase()=="checkbox"||_4a.type.toLowerCase()=="radio")){if(typeof valueOrderMap!="undefined"&&valueOrderMap instanceof Array&&_4a.type.toLowerCase()=="radio"){var _51=new Array();if(valueOrderMap[0]!=_48[0]["stValue"]){_51[0]=_48[1];_51[1]=_48[0];}for(var j=0;j<_51.length;j++){_48[j]=_51[j];}}var _52=_4a.parentNode;var _53=null;if(typeof _52!="undefined"&&_52!=null){_53=_52.parentNode;}if(typeof _52!="undefined"&&_52!=null&&typeof _53!="undefined"&&_53!=null){var _54=_53.getElementsByTagName("td");if(_52.tagName.toLowerCase()=="td"&&typeof _54!="undefined"&&_54!=null){if(typeof numCellsToKeep=="undefined"||numCellsToKeep==null){numCellsToKeep=0;}for(var x=(_54.length-1);x>=numCellsToKeep;x--){_53.removeChild(_54[x]);}}else{_53.removeChild(_52);}for(var j=0;j<_48.length;j++){var _4d=_48[j];if(typeof valueAndLabelMap!="undefined"&&valueAndLabelMap instanceof Array){var _4e=valueAndLabelMap[_4d["stValue"]];}if(typeof _4e=="undefined"||_4e==null){var _4e=_4d["stValue"];}var _56=document.createElement("td");if(typeof labelClass!="undefined"||labelClass!=null){_56.className=labelClass;}var _57=document.createElement("span");_57.setAttribute("id",_4e+_3e);_3e++;_56.appendChild(_57);_57.innerHTML=_4e;var _58=_52.cloneNode(true);_53.appendChild(_58);_53.appendChild(_56);var _59=_42+j;var obj=getElementByName(_58,"input",_42);if(obj!=null&&(obj.type.toLowerCase()=="checkbox"||obj.type.toLowerCase()=="radio")){obj.id=_59;obj.value=_4d["stValue"];if(_4b.length>0){for(var k=0;k<_4b.length;k++){if(_4b[k]==obj.value){obj.checked=true;break;}}}}obj=getElementByName(_58,"div","display");if(obj==null){obj=getElementByName(_58,"span","display");if(obj==null){obj=getElementByName(_58,"a","display");if(obj==null){obj=getElementByName(_58,"label","display");}}}if(obj!=null){var tag=obj.tagName.toLowerCase();if(tag=="label"){try{obj.htmlFor=_59;}catch(e){}}obj.innerHTML=_4d["stKey"];}}}}if(_4a.tagName.toLowerCase()=="input"&&_4a.type.toLowerCase()=="radio"){}}else{if(_4a.tagName.toLowerCase()=="input"||_4a.tagName.toLowerCase()=="textarea"){_4a.value=_49;}if(_4a.tagName.toLowerCase()=="input"&&_4a.type.toLowerCase()=="checkbox"){_4a.value=true;if(_4a.value=="true"&&_49==true){_4a.checked=true;}else{_4a.checked=false;}}}}else{this.error(""+id+" has no child node named "+_42);}}}this.log("Build Form Inputs");};this.build=function(_5b,_5c){if(typeof _5b=="undefined"||_5b==null||_5b.size()<=0){this.log("Error: cannot build form - arrFormData is invalid or empty");if(typeof _5c=="undefined"||_5c==null||_5c){if(typeof HS_Form_Finalize!="undefined"&&HS_Form_Finalize!=null){HS_Form_Finalize(null);}}return;}_d=_5b;if(typeof HS_Form_PreProcess!="undefined"&&HS_Form_PreProcess!=null){HS_Form_PreProcess(_d);}var _5d=_d["ecFormErrorValue"];if(typeof _5d!="undefined"&&_5d!=null&&_5d>0){this.reportError(id+"::"+_5d);}var _5e=_d["ecProcessErrorValue"];if(typeof _5e!="undefined"&&_5e!=null&&_5e>0){this.reportError(id+"::"+_5e);}try{this.buildOutputs();this.buildInputs();}catch(e){}if(typeof _5c=="undefined"||_5c==null||_5c){HS_Form_Finalize(_d);}};this.submit=function(_5f){if(_b==null){this.log("Error: cannot submit form - form object is null");return false;}if(_10){this.log("Error: cannot submit form - form has already been submitted");return false;}if(typeof _5f=="undefined"||_5f==null||!_5f){if(this.getFormID().length<=0){this.log("Error: cannot submit form - no valid formid");return false;}}if(_9.length<=0){this.log("Error: cannot submit form - no target form service");return false;}_10=true;var obj=document.createElement("input");obj.type="hidden";obj.name="formid";obj.value=this.getFormID();_b.appendChild(obj);for(var i=0;i<_e.length;i++){var _62=_e[i];if(_62[0].trim().length>0){obj=document.createElement("input");obj.type="hidden";obj.name=_62[0];obj.value=_62[1];_b.appendChild(obj);}}_b.method="post";_b.action=_9;var _63=true;if(_11!=null){_63=_11();}if(_63){_b.submit();}else{this.log("Error: cannot submit form - onsubmit handler returned false");return;}this.log("Submit Form: "+this.getFormID());};this.submitDirect=function(_64,_65){if(_b==null){return false;}if(_9.length<=0){return false;}_10=true;var _66=(_e==null)?[]:_e;_66.push(["formid",this.getFormID()]);_66.push(["response","direct"]);for(var i=0;i<_66.length;i++){var f=_66[i];if(f[0].trim().length>0){obj=this.getField(f[0]);if(obj==null){obj=document.createElement("input");obj.name=f[0];obj.type="hidden";_b.appendChild(obj);}obj.value=f[1];}}_b.action=_9;var _69=true;if(_11!=null){_69=_11();}if(_69){_XMLHTTP.post(_b,_64,_65);}return true;};this.getFormID=function(){if(_d==null){return "";}var _6a=_d["stFormid"];if(typeof _6a=="undefined"||_6a==null){_6a="";}return _6a;};this.getForm=function(){return _b;};this.updateField=function(_6b,_6c){var _6d=this.getField(_6b);if(_6d!=null){_6d.value=_6c;}};this.getFieldValue=function(_6e){var _6f=this.getField(_6e);if(_6f!=null){return _6f.value;}return null;};this.getField=function(_70){if(_b==null){this.log("Error: cannot get field - form does not exist");return null;}var _71=getElementByName(_b,"input",_70)||getElementByName(_b,"select",_70)||getElementByName(_b,"textarea",_70);return _71;};};HS_Form.prototype.toString=function(){this.baseToString=HS_Object.prototype.toString;return this.baseToString();};function HS_Form_DataService_Callback(_72,_73){if(typeof _73=="undefined"||_73.length<=0){return;}_72=_72.replace("\r\n"," ");var _74=HS_ExtractArrayByName("arrFormData",_72.trim());if(_74!=null){_74=HS_FormatServiceData(_74,null,true,true);}if($$(_73)){_73.build(_74);}}function HS_Form_DisplayHandler_Currency(cy){return cy.toString();}function HS_Form_DisplayHandler_Date(da){return da.toString();}function HS_Form_DisplayHandler_Time(tm){return tm.toString();}function HS_Form_DisplayHandler_DateTime(dt){return dt.toString();}function HS_Form_PreProcess(_79){}function HS_Form_Finalize(_7a){}function HS_Form_SubmitDirectSuccessful(_7b,_7c){if(!_7b){return false;}var _7d=false;try{if(_7c&&_7c.length>0){var _7e=_7b.getForward("forward_success");if(_7e){eval(_7c);if(eval("typeof "+_7e+" != \"undefined\"")){_7d=true;}}}else{_7d=true;}}catch(ex){}return _7d;}
	function CheckAmountField(_1){var _2=document.getElementById(_1).value;if(_2!=""){_2=_2.replace(",","");_2=_2.replace("$","");_2=formatAmount(_2,2);document.getElementById(_1).value=_2;}}function onInstitutionalEnter(_3,_4,_5){var _6=(document.layers)?true:false;var _7=0;if(_6){_7=_3.which;}else{_7=_3.keyCode;}if(_7==13){_5();}}function onLoginEnter(_8,_9){var _a=(document.layers)?true:false;var _b=0;if(_a){_b=_8.which;}else{_b=_8.keyCode;}if(_b==13){submitForm_loginForm();}}function onUserEmailEnter(_c){var _d=(document.layers)?true:false;var _e=0;if(_d){_e=_c.which;}else{_e=_c.keyCode;}if(_e==13){HS_Submit();}}function cancelOpenAccount(_f){if(_f==1){if(confirm("Are you sure you want to quit opening a HedgeStreet account?")){document.cancelForm.submit();}else{return false;}}else{if(_f==0){if(confirm("Are you sure you want to cancel entering your confirmation at this time?")){document.cancelForm.submit();}else{return false;}}}}function CancelDeposit(){if(document.eValuCheckForm.agreeDeposit[1].checked){if(confirm("Are you sure you want to quit depositing to your HedgeStreet account?")){document.eValuCheckForm.submit();}else{return false;}}else{document.eValuCheckForm.submit();}}function onNewRegisterEnter(_10,_11,_12){var _13=(document.layers)?true:false;var _14=0;if(_13){_14=_10.which;}else{_14=_10.keyCode;}if(_14==13&&_11!=""){_11.submit();}else{if(_14==13&&_12=="HS_Submit"){HS_Submit();}}}function eValuCheckNumberOnlyKeyPress(ev,_16,_17){var e=(ev)?ev:((window.event)?event:null);var ch=e.keyCode?e.keyCode:e.charCode;if(ch!=null){if(e.ctrlKey){if(ch==67||ch==99||ch==86||ch==118||ch==88||ch==120){return true;}}else{if(ch==13){_16.submit();return true;}else{if((ch==46&&_17)||(ch>=48&&ch<=57)||ch==0||ch==8||ch==9||ch==39){return true;}}}}if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}return false;}function numberOnlyKeyPress(_1a,_1b,_1c){var _1d=(document.layers)?true:false;var _1e=-1;_1e=_1a.which;if(!_1e||_1e==-1){_1e=_1a.keyCode;}if(_1e==13&&_1b!=""){_1b.submit();}else{if(_1e==13&&_1c=="HS_Submit"){HS_Submit();}else{if((_1e<45||_1e>57)&&_1e!=37&&_1e!=39&&_1e!=8&&_1e!=9){if(_1a.preventDefault){_1a.preventDefault();}else{_1a.returnValue=false;}return false;}else{return true;}}}}function prefillChoiceItem(_1f,_20){var _21=_1f["obInitialDataObject"];var _22=_1f["obRawStringData"];var _23=_1f["obValidatDataObject"];var _24=_23;if(typeof _24=="undefined"||_24==null){_24=_22;if(typeof _24=="undefined"||_24==null){_24=_21;if(typeof _24=="undefined"||_24==null){_24="-";}}}var _25=document.getElementById(_20);if(typeof _25!="undefined"&&_25!=null){for(i=0;i<_25.length;i++){if(_25[i].value==_24){_25[i].selected=true;}}}}function showErrors(str,_27){if(typeof _27!="undefined"&&_27){str="Please enter/correct the fields in red."+str;}else{try{if(str.indexOf("<br>")==0){str=str.substring(4);}else{if(str.indexOf("<br/>")==0){str=str.substring(5);}else{if(str.indexOf("<br />")==0){str=str.substring(6);}}}}catch(ex){}}var _28=document.getElementById("hsidErrorDialog");if(_28!=null){_28.style.display="block";var _29=document.getElementById("hsidHSErrorMessages");if(_29!=null){var _2a=document.createElement("div");_2a.style.color="#cc0000";_29.appendChild(_2a);_2a.innerHTML=str;}}}
	function HS_ExtractArrayByName(arrayName, strBuffer) {
	    eval(strBuffer);
	
	    if (eval ('typeof ' + arrayName + ' != \'undefined\'')) {
	        eval('var newArray = ' + arrayName + ';');
	        return newArray;
	    } else {
	        return null;
	    }
	}
	
	function HS_CompareHedgeletSeries_New(_1,_2){return HS_CompareAssetHedgeletSeries_New(_1,_2);}function HS_CompareHedgeletList_New(_3,_4){return HS_CompareHedgeletSeries_New(_3,_4);}function HS_CompareAssetHedgeletSeries_desc(_5,_6){var _7;if(defaultSort=="desc"){if(_5[nVolPosn]>_6[nVolPosn]){return -1;}else{if(_5[nVolPosn]<_6[nVolPosn]){return 1;}else{if(_5[nOpenPosn]>_6[nOpenPosn]){return -1;}else{if(_5[nOpenPosn]<_6[nOpenPosn]){return 1;}else{return 0;}}}}}else{if(defaultSort=="asc"){if(_5[nVolPosn]<_6[nVolPosn]){return -1;}else{if(_5[nVolPosn]>_6[nVolPosn]){return 1;}else{if(_5[nOpenPosn]<_6[nOpenPosn]){return -1;}else{if(_5[nOpenPosn]>_6[nOpenPosn]){return 1;}else{return 0;}}}}}}}function HS_CompareAssetHedgeletSeries_Hedgelet(_8,_9){var n1=nAssetName;var n2=nSortKey;var n3=nLastTradingDate;iResult=HS_CompareDate(_8[n3],_9[n3]);if(iResult!=0){return iResult;}else{if(_8[n1]<_9[n1]){return -1;}else{if(_8[n1]>_9[n1]){return 1;}else{if(_8[n2]<_9[n2]){return -1;}else{if(_8[n2]>_9[n2]){return 1;}else{return 0;}}}}}}function HS_CompareAssetHedgeletSeries_HedgeletReverse(_d,_e){var n1=nAssetName;var n2=nSortKey;var n3=nLastTradingDate;iResult=-(HS_CompareDate(_d[n3],_e[n3]));if(iResult!=0){return iResult;}else{if(_d[n1]<_e[n1]){return -1;}else{if(_d[n1]>_e[n1]){return 1;}else{if(_d[n2]<_e[n2]){return -1;}else{if(_d[n2]>_e[n2]){return 1;}else{return 0;}}}}}}function HS_CompareAssetHedgeletSeries_Sort(_12,_13){var _14;var n1;if(colClicked==MOST_ACTIVES_HIGHEST_VOLUME){n1=nVolPosn;}else{if(colClicked==MOST_ACTIVES_ADVANCERS_PERCENT_CHANGE){n1=nChangePosn;}else{if(colClicked==MOST_ACTIVES_DECLINERS_PERCENT_CHANGE){n1=nChangePosn;}else{if(colClicked==MOST_ACTIVES_HIGHEST_OPEN_INTEREST){n1=nOpenPosn;}}}}if(colClicked!=MOST_ACTIVES_DECLINERS_PERCENT_CHANGE){if(_12[n1]>_13[n1]){return -1;}else{if(_12[n1]<_13[n1]){return 1;}else{return 0;}}}else{if(_12[n1]<_13[n1]){return -1;}else{if(_12[n1]>_13[n1]){return 1;}else{return 0;}}}}function HS_CompareAssetHedgeletSeries_New_Reverse(_16,_17){var _18;_18=-(HS_CompareDate(_16[nLastTradingDate],_17[nLastTradingDate]));if(_18!=0){return _18;}else{if(_16[nSortKey]<_17[nSortKey]){return -1;}else{if(_16[nSortKey]>_17[nSortKey]){return 1;}else{if(_16[nHedgeletTypePosn]<_17[nHedgeletTypePosn]){return -1;}else{if(_16[nHedgeletTypePosn]>_17[nHedgeletTypePosn]){return 1;}else{return 0;}}}}}}function HS_CompareAssetHedgeletSeries_Latest(_19,_1a){var _1b;_1b=HS_CompareDate(_19[nLastTradingDate],_1a[nLastTradingDate]);if(_1b!=0){return _1b;}else{if(_19[nSortKey]<_1a[nSortKey]){return -1;}else{if(_19[nSortKey]>_1a[nSortKey]){return 1;}else{if(_19[nHedgeletTypePosn]<_1a[nHedgeletTypePosn]){return -1;}else{if(_19[nHedgeletTypePosn]>_1a[nHedgeletTypePosn]){return 1;}else{return 0;}}}}}}function HS_CompareMarkets_New(_1c,_1d){if(_1c["stMarketName"]<_1d["stMarketName"]){return -1;}else{if(_1c["stMarketName"]>_1d["stMarketName"]){return 1;}else{return 0;}}}function HS_CompareSubmarkets_New(_1e,_1f){if(_1e["stSubmarketName"]<_1f["stSubmarketName"]){return -1;}else{if(_1e["stSubmarketName"]>_1f["stSubmarketName"]){return 1;}else{return 0;}}}function HS_CompareAssets_New(_20,_21){if(_20["stAssetName"]<_21["stAssetName"]){return -1;}else{if(_20["stAssetName"]>_21["stAssetName"]){return 1;}else{return 0;}}}function HS_ComparePendingSettledHedgeletSeries_New(_22,_23){var _24;if(HS_IsPending(_22["ecHedgeletStatus"])&&!HS_IsPending(_23["ecHedgeletStatus"])){return -1;}else{if(!HS_IsPending(_22["ecHedgeletStatus"])&&HS_IsPending(_23["ecHedgeletStatus"])){return 1;}else{_24=HS_CompareDate(_22["daSettlementDate"],_23["daSettlementDate"]);if(_24!=0){if(HS_IsSettled(_22["ecHedgeletStatus"])){return -(_24);}else{return _24;}}else{if(_22["stAssetName"]<_23["stAssetName"]){return -1;}else{if(_22["stAssetName"]>_23["stAssetName"]){return 1;}else{if(_22["stSortKey"]<_23["stSortKey"]){return -1;}else{if(_22["stSortKey"]>_23["stSortKey"]){return 1;}else{if(_22["ecHedgeletType"]<_23["ecHedgeletType"]){return -1;}else{if(_22["ecHedgeletType"]>_23["ecHedgeletType"]){return 1;}else{return 0;}}}}}}}}}}function HS_CompareHedgeletsHedgeletSeries_New(_25,_26){var _27;var dt1=new Array(_25["daLastTradingDate"][0],_25["daLastTradingDate"][1],_25["daLastTradingDate"][2],_25["tmLastTradingDayCloseTime"][0],_25["tmLastTradingDayCloseTime"][1],_25["tmLastTradingDayCloseTime"][2],_25["tmLastTradingDayCloseTime"][3],_25["tmLastTradingDayCloseTime"][4]);var dt2=new Array(_26["daLastTradingDate"][0],_26["daLastTradingDate"][1],_26["daLastTradingDate"][2],_26["tmLastTradingDayCloseTime"][0],_26["tmLastTradingDayCloseTime"][1],_26["tmLastTradingDayCloseTime"][2],_26["tmLastTradingDayCloseTime"][3],_26["tmLastTradingDayCloseTime"][4]);_27=HS_CompareDateTime(dt1,dt2);if(_27!=0){return _27;}else{if(_25["stAssetName"]<_26["stAssetName"]){return -1;}else{if(_25["stAssetName"]>_26["stAssetName"]){return 1;}else{if(_25["stSortKey"]<_26["stSortKey"]){return -1;}else{if(_25["stSortKey"]>_26["stSortKey"]){return 1;}else{if(_25["ecHedgeletType"]<_26["ecHedgeletType"]){return -1;}else{if(_25["ecHedgeletType"]>_26["ecHedgeletType"]){return 1;}else{return 0;}}}}}}}}function HS_CompareDailyBulletin_New(_2a,_2b){var _2c;if(_2a["stMarketName"]<_2b["stMarketName"]){return -1;}else{if(_2a["stMarketName"]>_2b["stMarketName"]){return 1;}else{if(_2a["stSubmarketName"]<_2b["stSubmarketName"]){return -1;}else{if(_2a["stSubmarketName"]>_2b["stSubmarketName"]){return 1;}else{if(_2a["stAssetName"]<_2b["stAssetName"]){return -1;}else{if(_2a["stAssetName"]>_2b["stAssetName"]){return 1;}else{if(_2a["stHedgeletName"]<_2b["stHedgeletName"]){return -1;}else{if(_2a["stHedgeletName"]>_2b["stHedgeletName"]){return 1;}else{if(_2a["nHedgeletType"]<_2b["nHedgeletType"]){return -1;}else{if(_2a["nHedgeletType"]>_2b["nHedgeletType"]){return 1;}else{return 0;}}}}}}}}}}}function HS_CompareOpenOrderDetail_New(_2d,_2e){iResult=HS_CompareDate(_2d["daOrderDate"],_2e["daOrderDate"]);}function HS_CompareTransactionHistory_New(_2f,_30){iResult=-(HS_CompareDateTime(_2f["dtTransactionDateTime"],_30["dtTransactionDateTime"]));if(iResult!=0){return iResult;}else{return 0;}}function HS_CompareOrderHistory_New(_31,_32){var _33=-(HS_CompareDateTime(_31["dtTimePlaced"],_32["dtTimePlaced"]));if(_33!=0){return _33;}else{return 0;}}function HS_CompareOrderHistory_New_Suborder(_34,_35){var _36=(HS_CompareDateTime(_34["dtTimePlaced"],_35["dtTimePlaced"]));if(_36!=0){return _36;}else{return 0;}}function HS_CompareAccounts_New(_37,_38){if(_37["isStatus"]>_38["isStatus"]){return -1;}else{if(_37["isStatus"]<_38["isStatus"]){return 1;}else{if(_37["stAccountName"]<_38["stAccountName"]){return -1;}else{if(_37["stAccountName"]>_38["stAccountName"]){return 1;}else{return 0;}}}}}function HS_CompareTraders_New(_39,_3a){if(_39["isActive"]>_3a["isActive"]){return -1;}else{if(_39["isActive"]<_3a["isActive"]){return 1;}else{if(_39["stFirstName"]<_3a["stFirstName"]){return -1;}else{if(_39["stFirstName"]>_3a["stFirstName"]){return 1;}else{return 0;}}}}}function HS_CompareGiveUp_New(_3b,_3c){if(_3b["stKey"]<_3c["stKey"]){return -1;}else{if(_3b["stKey"]>_3c["stKey"]){return 1;}else{return 0;}}}function HS_CompareDay(_3d,_3e){var _3f={};_3f["01"]=1;_3f["02"]=2;_3f["03"]=3;_3f["04"]=4;_3f["05"]=5;_3f["06"]=6;_3f["07"]=7;_3f["08"]=8;_3f["09"]=9;_3f["10"]=10;_3f["11"]=11;_3f["12"]=12;_3f["13"]=13;_3f["14"]=14;_3f["15"]=15;_3f["16"]=16;_3f["17"]=17;_3f["18"]=18;_3f["19"]=19;_3f["20"]=20;_3f["21"]=21;_3f["22"]=22;_3f["23"]=23;_3f["24"]=24;_3f["25"]=25;_3f["26"]=26;_3f["27"]=27;_3f["28"]=28;_3f["29"]=29;_3f["30"]=30;_3f["31"]=31;_3f["1"]=32;_3f["2"]=33;_3f["3"]=34;_3f["4"]=35;_3f["5"]=36;_3f["6"]=37;_3f["7"]=38;_3f["8"]=39;_3f["9"]=40;var x=_3f[_3d["stKey"]];var y=_3f[_3e["stKey"]];return ((x<y)?-1:((x>y)?1:0));}function HS_CompareDepartment(_42,_43){var x=_42["stKey"].toLowerCase();var y=_43["stKey"].toLowerCase();return ((x<y)?-1:((x>y)?1:0));}function HS_CompareMonth(_46,_47){var _48={};_48["jan"]=0;_48["feb"]=1;_48["mar"]=2;_48["apr"]=3;_48["may"]=4;_48["jun"]=5;_48["jul"]=6;_48["aug"]=7;_48["sep"]=8;_48["oct"]=9;_48["nov"]=10;_48["dec"]=11;_48["1"]=12;_48["2"]=13;_48["3"]=14;_48["4"]=15;_48["5"]=16;_48["6"]=17;_48["7"]=18;_48["8"]=19;_48["9"]=20;_48["10"]=21;_48["11"]=22;_48["12"]=23;var x=_48[_46["stValue"].toLowerCase()];var y=_48[_47["stValue"].toLowerCase()];return ((x<y)?-1:((x>y)?1:0));}function HS_ComparePositions_New(_4b,_4c){var _4d;if(_4b["stHedgeletName"]<_4c["stHedgeletName"]){return -1;}else{if(_4b["stHedgeletName"]>_4c["stHedgeletName"]){return 1;}else{if(_4b["ecHedgeletType"]<_4c["ecHedgeletType"]){return -1;}else{if(_4b["ecHedgeletType"]>_4c["ecHedgeletType"]){return 1;}else{_4d=-(HS_CompareDateTime(_4b["dtPostDateTime"],_4c["dtPostDateTime"]));if(_4d!=0){return _4d;}else{return 0;}}}}}}function HS_CompareTraders(_4e,_4f){if(_4e["stFirstName"]<_4f["stFirstName"]){return -1;}else{if(_4e["stFirstName"]>_4f["stFirstName"]){return 1;}else{return 0;}}}function HS_CompareAccounts(_50,_51){if(_50["stAccountNumber"]<_51["stAccountNumber"]){return -1;}else{if(_50["stAccountNumber"]>_51["stAccountNumber"]){return 1;}else{return 0;}}}function HS_CompareOrderbookBid(_52,_53){var _54=HS_GenerateCurrencyN(_52["cyBid"]);var _55=HS_GenerateCurrencyN(_53["cyBid"]);if(_54>_55){return -1;}else{if(_54<_55){return 1;}else{return 0;}}}function HS_CompareOrderbookAsk(_56,_57){var _58=HS_GenerateCurrencyN(_56["cyAsk"]);var _59=HS_GenerateCurrencyN(_57["cyAsk"]);if(_58<_59){return -1;}else{if(_58>_59){return 1;}else{return 0;}}}function HS_CompareOrderbookPrice(_5a,_5b){if(_5a[1]>_5b[1]){return -1;}else{if(_5a[1]<_5b[1]){return 1;}else{return 0;}}}function HS_CompareTimeAndSales(_5c,_5d){var _5e;var dt1=new Array(_5c["daDate"][0],_5c["daDate"][1],_5c["daDate"][2],_5c["daTime"][0],_5c["daTime"][1],_5c["daTime"][2],_5c["daTime"][3],_5c["daTime"][4]);var dt2=new Array(_5d["daDate"][0],_5d["daDate"][1],_5d["daDate"][2],_5d["daTime"][0],_5d["daTime"][1],_5d["daTime"][2],_5d["daTime"][3],_5d["daTime"][4]);_5e=HS_CompareDateTime(dt1,dt2);return -(_5e);}function HS_CompareFCM(_61,_62){if(_61["stKey"]<_62["stKey"]){return -1;}else{if(_61["stKey"]>_62["stKey"]){return 1;}else{return 0;}}}function HS_CompareDashboardHedgelets_New(_63,_64){var _65;var dt1=new Array(_63["daLastTradingDate"][0],_63["daLastTradingDate"][1],_63["daLastTradingDate"][2],_63["tmLastTradingDayCloseTime"][0],_63["tmLastTradingDayCloseTime"][1],_63["tmLastTradingDayCloseTime"][2],_63["tmLastTradingDayCloseTime"][3],_63["tmLastTradingDayCloseTime"][4]);var dt2=new Array(_64["daLastTradingDate"][0],_64["daLastTradingDate"][1],_64["daLastTradingDate"][2],_64["tmLastTradingDayCloseTime"][0],_64["tmLastTradingDayCloseTime"][1],_64["tmLastTradingDayCloseTime"][2],_64["tmLastTradingDayCloseTime"][3],_64["tmLastTradingDayCloseTime"][4]);_65=HS_CompareDateTime(dt1,dt2);return _65;}function HS_CompareDateTime(d1,d2){var _6a=HS_CompareDate(d1,d2);if(_6a!=0){return _6a;}else{if(d1[3]<d2[3]){return -1;}else{if(d1[3]>d2[3]){return 1;}else{if(d1[4]<d2[4]){return -1;}else{if(d1[4]>d2[4]){return 1;}else{if(d1[5]<d2[5]){return -1;}else{if(d1[5]>d2[5]){return 1;}else{return 0;}}}}}}}}function HS_CompareComplianceHedgelets(_6b,_6c){var _6d=_6b.headers||_6c.headers;if(!_6d){return 0;}var _6e=_6d["ecHedgeletType"];if(_6b[_6e]==HS_HEDGELET_TYPE_BINARY&&_6c[_6e]==HS_HEDGELET_TYPE_VARIABLE){return -1;}else{if(_6c[_6e]==HS_HEDGELET_TYPE_BINARY&&_6b[_6e]==HS_HEDGELET_TYPE_VARIABLE){return 1;}else{var _6f=_6d["daLastTradingDate"];return HS_CompareDate(_6b[_6f],_6c[_6f]);}}}
	hs.error={data:{},displayArea:null,messageArea:null,messageTemplate:null,delimiter:"::",fieldLabelPostfix:"_label",showFieldErrors:false,color:"red",generalErrorName:"General Error",generalErrorsShown:[],permanentErrors:[],initialize:function(_1,_2,_3){if(typeof _1!="undefined"&&_1!=null){hs.error.displayArea=_1;}if(typeof _2!="undefined"&&_2!=null){hs.error.messageArea=_2;}if(typeof _3!="undefined"&&_3!=null){hs.error.messageTemplate=_3;}var _4=["_errorActivateTrader","_errorAddAccount","_errorAddGiveUpCode","_errorAddTrader","_errorAdminLogin","_errorAffirmBlockTrade","_errorCancelBlockTrade","_errorCancelOrder","_errorChangePassword","_errorDeactivateAccount","_errorDeactivateTrader","_errorDeleteGiveUpCode","_errorDeleteWatchlist","_errorEditAccount","_errorEditMail","_errorEditProfile","_errorEditTrader","_errorEditUser","_errorFundsTransfer","_errorLogin","_errorLogout","_errorManageUserPreferences","_errorManageUserRole","_errorModifyOrder","_errorPlaceBlockTrade","_errorPlaceOrder","_errorPreselectAccount","_errorPreselectAccountPermission","_errorPreselectAffirmBlockTrade","_errorPreselectModifyOrder","_errorPreselectStatusBlockTrade","_errorReassignTrader","_errorReferAFriend","_errorReviewBlockTrade","_errorReviewCancelOrder","_errorReviewModifyOrder","_errorReviewPlaceOrder","_errorRecoverPassword","_errorRecoverUserId","_errorElectronicCheck","_errorElectronicCheckReview","_errorOpenaccount","_errorDisclosures","_errorQualifyingQuestions"];var _5=0;for(var i=0;i<_4.length;i++){var _7=_4[i];var _8="typeof "+_7+" != 'undefined' && "+_7+" != null && typeof "+_7+".name != 'undefined' && "+_7+".name != null && "+_7+".name.length > 0";var _9=eval(_8);if(_9){var _a=eval(_4[i]);if(hs.error.load(_a)){_5++;}}}},load:function(_b){if(typeof _b=="undefined"||_b==null){return false;}var _c=_b.name;var _d=_b.data;if(typeof _c=="undefined"||_c==null||_c.length<=0){return false;}if(typeof _d=="undefined"||_d==null){return false;}hs.error.data[_c]=_d;return true;},search:function(_e,_f,_10){var str="";if(typeof _e=="undefined"||_e==null||_e.length<=0){return str;}if(typeof _f=="undefined"||_f==null){return str;}var _12=hs.error.data[_e];if(typeof _12=="undefined"||_12==null){return str;}var _13=_f;if(typeof _10!="undefined"&&_10!=null&&_10.length>0&&_10.toLowerCase()!=_e.toLowerCase()){_13=_10+hs.error.delimiter+_13;}str=_12[_13];if(typeof str=="undefined"||str==null||str.length<=0){str=_12[_f];}if(typeof str=="undefined"||str==null){str="";}return str;},show:function(_14,_15,_16,_17){if(hs.error.displayArea==null){return;}if(hs.error.messageArea==null){return;}if(hs.error.messageTemplate==null){return;}var str=hs.error.search(_14,_15,_16);if(str.length<=0){_Logger.log("ERROR: cannot find error message ("+_14+", "+_15+", "+_16+")","hs.error");hs.error.showDirect("Error "+_15+" has occurred.  Please call/email customer service at 1-877-TO-HEDGE");return;}if(typeof _16!="undefined"&&_16!=null&&_16.length>0){var _19=_16+hs.error.fieldLabelPostfix;var _1a=null;if(typeof _17!="undefined"&&_17!=null){try{_1a=getElementByName(_17,"div",_19);if(_1a==null){_1a=getElementByName(_17,"span",_19);}if(_1a==null){_1a=getElementByName(_17,"a",_19);}if(_1a==null){_1a=getElementByName(_17,"label",_19);}if(_1a==null){_1a=getElementByName(_17,"td",_19);}}catch(e){}}if(_1a==null){_1a=$(_19);}if(_1a!=null){_1a.style.color=hs.error.color;}if(!hs.error.showFieldErrors){for(var i=0;i<hs.error.generalErrorsShown.length;i++){if(hs.error.generalErrorsShown[i]==_14){return;}}var _1c=hs.error.search(_14,hs.error.generalErrorName);str=_1c;hs.error.generalErrorsShown.push(_14);}}hs.error.showDirect(str);},showDirect:function(str,_1e){if(typeof str=="undefined"||str==null||str.length<=0){return;}if(hs.error.displayArea==null){return;}if(hs.error.messageArea==null){return;}if(hs.error.messageTemplate==null){return;}var _1f=_1e;if($$(_1f)&&_1f){for(var i=0;i<hs.error.permanentErrors.length;i++){if(str==hs.error.permanentErrors[i]){return;}}hs.error.permanentErrors.push(str);}var obj=hs.error.messageTemplate.cloneNode(true);if(obj!=null){hs.error.messageArea.appendChild(obj);obj.innerHTML=str;hs.error.displayArea.style.display="block";}},hide:function(_22){hs.error.generalErrorsShown=[];var _23=_22;if($$(_23)&&_23){hs.error.permanentErrors=[];}if(hs.error.permanentErrors.length>0){if(hs.error.messageArea!=null){var _24=[];for(var j=0;j<hs.error.messageArea.childNodes.length;j++){var _26=hs.error.messageArea.childNodes[j];var _27=false;for(var i=0;i<hs.error.permanentErrors.length;i++){var str=hs.error.permanentErrors[i];if(_26.innerHTML==str){_27=true;break;}}if(!_27){_24.push(_26);}}for(var i=0;i<_24.length;i++){hs.error.messageArea.removeChild(_24[i]);}}}else{if(hs.error.messageArea!=null){hs.error.messageArea.innerHTML="";}if(hs.error.displayArea!=null){hs.error.displayArea.style.display="none";}}},bufferfn:function(){}};
	var _errorOpenaccount={name:"open-account-introductory-information-form",data:{"firstName::257":"First Name is a required field.","firstName::258":"First Name may contain only alphabetic characters, spaces, hyphens, and apostrophes.","firstName::513":"First Name has to be at least 6 characters.","firstName::514":"First Name must be less than 32  characters.","lastName::257":"Last Name is a required field.","lastName::258":"Last  Name may contain only alphabetic characters, spaces, hyphens, and apostrophes.","lastName::513":"Last Name has to be at least 6 characters.","lastName::514":"Last Name must be less than 32 characters.","middleInitial::258":"Invalid characters entered for Middle Initial ","telephone::257":"Telephone is a required field.","telephone::258":"Telephone Number must contain a minimum of 10-digits.","telephone::513":"Telephone Number must contain a minimum of 10-digits.","telephone::514":"Telephone Number must contain a minimum of 10-digits.","email::257":"Email is a required field.","email::258":"The email address entered is invalid. Please re-enter your email address.","email::513":"The email address entered is invalid. Please re-enter your email address.","email::514":"The email address entered is invalid. Please re-enter your email address.","email::1025":"Email Address entered is already in use by another account. Please enter a unique email address.","userid::257":"Username is a required field.","userid::258":"Username has be to 6 to 14 alphanumeric characters.","userid::513":"Username has be to 6 to 14 alphanumeric characters.","userid::514":"Username has be to 6 to 14 alphanumeric characters.","password::513":"Password has to be at least 6 alphanumeric characters.","password::514":"Password can not be more than 14 alphanumeric characters.","password::257":"Password is a required field.","password::258":"Password has to be 6 to 14 alphanumeric characters.","password::1026":"Invalid Password.","verifyPassword::257":"Verify Password is a required field.","verifyPassword::258":"Verify Password has to be 6 to 14 alphanumeric characters.","2052":"The Passwords entered do not match. Please re-enter both Passwords.","4101":"User is alredy logged in.","4102":"Error 4102 has occurred.  Please call/email customer service at 1-877-TO-HEDGE.","4098":"The Username you selected is already in use. Please select another Username."}};
	var _openaccountinfo=null;var strtel="0000000000";function HS_OnPageLoad(){HS_InitializeRuntime(false,true);if(isUserLoggedIn){HS_GetElementByID("hsidErrorDialog").style.display="";HS_GetElementByID("loginerror").style.display="";return;}else{HS_GetElementByID("hsidOpenAccountBlock").style.display="";}HS_InitError();Run_OpenAccountInfo();}function HS_SetURL(){var _1=location.pathname;_1=_1.split("/");return _1[1];}var strUrlForward="/"+HS_SetURL()+"/create-account.html";var strUrlForwardFail="/"+HS_SetURL()+"/";function Run_OpenAccountInfo(){_openaccountinfo=new HS_Form("_openaccountinfo","openAccountIntroductoryInformationForm","/hedgelet/service/open-account-introductory-information-form",HS_ValidateForm);_openaccountinfo.setForward("forward_success",strUrlForward);_openaccountinfo.setForward("forward_fail",strUrlForwardFail);_openaccountinfo.setForward("forward_authenticationFail","/login/login.html");_openaccountinfo.setForward("forward_authorizationFail","/login/login.html");_openaccountinfo.setForward("forward_secureAccessFail","/login/login.html");_openaccountinfo.setForward("forward_backendFail",strUrlForwardFail);_openaccountinfo.setForward("forward_formSequenceFail",strUrlForwardFail);_openaccountinfo.setForward("forward_formIDInvalid",strUrlForwardFail);_openaccountinfo.run();}function populateTelephone(_2){if(_2!=null&&_2.length>1){var _3=_2.substring(0,3);var _4=_2.substring(3,6);var _5=_2.substring(6,10);HS_GetElementByID("hsidTelephone1ID").value=_3;HS_GetElementByID("hsidTelephone2ID").value=_4;HS_GetElementByID("hsidTelephone3ID").value=_5;}}function HS_Form_Finalize(_6){populateTelephone(HS_GetElementByID("hsidtelephone").value);var _7=_openaccountinfo.getErrors();_openaccountinfo.clearErrors();var _8=HS_GetElementByID("hsidOpenAccountBlock");if(_8==null){return;}for(var i=0;i<_7.length;i++){arr=_7[i].split("::");hs.error.show("open-account-introductory-information-form",arr[1],arr[0],_openaccountinfo);}}function HS_InitError(){var _a=HS_GetElementByID("hsidErrorDialog");var _b=null;if(_a!=null){_b=HS_GetElementByID("hsidHSErrorMessages");_b.id="hsidErrorContent";}var _c=document.createElement("div");_c.className="errortext";hs.error.initialize(_a,_b,_c);hs.error.showFieldErrors=true;hs.error.color="#cc0000";}function HS_Submit(){var _d="newusr001";HS_GetElementByID("hsidPasswordID").value=_d;HS_GetElementByID("hsidVerifyPasswordID").value=_d;if(_openaccountinfo!=null&&typeof _openaccountinfo=="object"){HS_SetStateCountryPhone();HS_SetFirstLastName();_openaccountinfo.submit();}else{return false;}}function HS_ValidateForm(){return true;}function HS_SetStateCountryPhone(){var _e=(null!=HS_GetElementByID("hsidCountryID")&&(HS_GetElementByID("hsidCountryID").value).length>0)?HS_GetElementByID("hsidCountryID").value:"US";var _f=(null!=HS_GetElementByID("hsidStateID")&&(HS_GetElementByID("hsidStateID").value).length>0)?HS_GetElementByID("hsidStateID").value:"IL";if(_e=="US"){strtel=HS_GetElementByID("hsidTelephone1ID").value+HS_GetElementByID("hsidTelephone2ID").value+HS_GetElementByID("hsidTelephone3ID").value;HS_GetElementByID("hsidtelephone").value=strtel;}else{HS_GetElementByID("hsidtelephone").value=strtel;strtel=HS_GetElementByID("hsidTelephone4ID").value+HS_GetElementByID("hsidTelephone5ID").value;}HS_SetCookie("strCountry",_e);HS_SetCookie("strState",_f);HS_SetCookie("strPhone",strtel);}function HS_SetFirstLastName(){var _10=HS_GetElementByID("hsidFirstNameID").value;var _11=HS_GetElementByID("hsidLastNameId").value;HS_SetCookie("strFirstName",_10);HS_SetCookie("strLastName",_11);}
	

