



	function HS_SetContentFooter(_1){var id="hsidContentFooter";HS_ReplaceInnerHTML(id,_1);}function HS_SetContentStatus(_3,_4){var id="hsidContentEmpty";if(_3){HS_ReplaceInnerHTML(id,"");HS_HideElementById(id);}else{HS_ReplaceInnerHTML(id,_4);HS_ShowElementById(id,"inline");}}function HS_GetTimeDelayFooter(_6){var _7="";if(typeof _6!="undefined"){if(_6<=0){if(arrSession.get("ecSystemState")==HTS_SYSTEMSTATE_UNAVAILABLE){_7="delayed HedgeStreet prices";}else{_7="Real-time HedgeStreet prices";}}else{_6/=1000;if(_6>=60){_7=Math.round(_6/60)+"-minute";}else{_7=_6+"-second";}_7+=" delayed prices.";}}else{if(isUserLoggedIn){if(arrSession.get("ecSystemState")==HTS_SYSTEMSTATE_UNAVAILABLE){_7="delayed HedgeStreet prices";}else{_7="Real-time HedgeStreet prices";}}else{_7="30-minute delayed prices.";}}return _7;}function HS_WriteHedgeletTimeDelayFooter(_8){HS_WriteBodyFooter("hsidHSHedgeletTimeDelayFooter",HS_GetTimeDelayFooter(_8));}function HS_WriteHedgeletTradeFooter(){var _9="";_9="Please note that it is the Member's responsiblity to ensure that any order placed on the market has sufficient funds/contracts upon execution of such orders.  If, upon execution of any order, the member does not have adequate funds or contracts available to satisfy the transaction, an Insufficent Funds Fee will apply.";HS_WriteBodyFooter("hsidHSHedgeletTradeFooter",_9);}function HS_WriteBodyFooter(id,_b){HS_ReplaceInnerHTML(id,"<span class=\"footertext\">"+_b+"</span>");}function HS_GenerateHedgeletsSubmenu(_c){var _d=document.URL;var _e,arrSideLinks;_e=new Array();arrSideLinks=new Array(new Array("Pending and Settled Contracts","javascript:HS_PendingSettledHedgelets( false );",""));_e[0]=new Array("quotesandcharts.gif","/hedgelets/quotes/",false);_e[1]=new Array("profiletab.gif","/hedgelets/profile/",false);_e[2]=new Array("details.gif","/hedgelets/prospectus/",false);if(_d.match("/hedgelets/quotes/")){_e[0][0]="quotesandcharts_select.gif";_e[0][2]=true;}if(_d.match("/hedgelets/profile/")){_e[1][0]="profiletab_select.gif";_e[1][2]=true;}if(_d.match("/hedgelets/prospectus/")){_e[2][0]="details_select.gif";_e[2][2]=true;}return HS_GenerateSubmenu(_e,arrSideLinks,_c);}function HS_GenerateTradeSubmenu(_f){return HS_GenerateTradeSubmenu2(_f,false);}function HS_GenerateTradeSubmenu2(_10,_11){var _12=document.URL;var _13,arrSideLinks;_13=new Array();arrSideLinks=new Array(new Array("Calculator","javascript:HS_Calculator();",""));_13[0]=new Array("placeorders.gif","/trade/order/",false);_13[1]=new Array("openorder.gif","/trade/openorders/",false);_13[2]=new Array("hist.gif","/trade/history/",false);if(_12.match("/trade/order/")){_13[0][0]="placeorders_select.gif";_13[0][2]=true;}if(_12.match("/trade/openorders/")){_13[1][0]="openorder_select.gif";_13[1][2]=true;}if(_12.match("/trade/history/")){_13[2][0]="hist_select.gif";_13[2][2]=true;}return HS_GenerateSubmenu(_13,arrSideLinks,_10);}function HS_GenerateSubmenu(_14,_15,_16){var _17="";_17+="<table class=\"fillwidth\"><tr><td class=\"height5\"></td></tr><tr><td class=\"fillwidth\">";_17+="<table class=\"bgrepeatx fillwidth whitebg\" background=\""+_16+"/hedgelets_submenu/subnav_bg.gif\"><tr>";_17+="<td class=\"width15\" nowrap></td>";for(i=0;i<_14.length;i++){if(i>0){}_17+="<td class=\"alignleft padall0\" nowrap><a href=\""+_14[i][1]+"\"><img src=\""+_16+"/hedgelets_submenu/"+_14[i][0]+"\"></a></td>";}_17+="<td class=\"fillwidth alignright valignmiddle\">";for(i=0;i<_15.length;i++){var _18=_15[i];if(i>0){_17+="&nbsp;&nbsp;&nbsp;";}if(_18!=null&&_18.length>2){_17+="<a class=\"linkBold\" href=\""+_18[1]+"\"";if(_18[2]!=""){_17+=" target=\""+_18[2]+"\"";}_17+=">"+_18[0]+"</a>";}}_17+="</td>";_17+="<td class=\"width10\" nowrap></td>";_17+="</tr></table>";_17+="</td></tr></table>";return _17;}function HS_GenerateRetailTradeSubheader(_19,_1a,_1b){var _1c;_1c="";_1c+="<table><tr>";_1c+="<td class=\"valigntop\"><span class=titleBold>"+_19+"</span>";_1c+="<span class=title>"+_1a+"</span></td>&nbsp;&nbsp;";_1c+="<td class=\"valignmiddle\">";if(_1b){_1c+="<a href=\"/trade/preferences/\">Order Preferences</a>";}_1c+="</td>";_1c+="</tr></table>";return _1c;}function HS_GenerateTradeSubheader(_1d,_1e,_1f){var _20;_20="";_20+="<table><tr>";_20+="<td class=\"valigntop\"><h1>"+_1d+"</h1></td>";_20+="<td class=\"valignmiddle\">";if(_1e){if(_1f){_20+="<a href=\"/trade/preferences/\">Order Preferences</a>";}else{_20+="<a href=\"/i/trading/preferences/\">Order Preferences</a>";}}_20+="</td>";_20+="</tr></table>";return _20;}function HS_WriteBoxedContent(id,_22,_23,_24,_25){HS_WriteBoxedContent2(id,_22,_23,"left",_24,_25);}function HS_WriteBoxedContent2(id,_27,_28,_29,_2a,_2b){HS_ReplaceInnerHTML(id,HS_GenerateBoxedContent2(_27,_28,_29,_2a,_2b));}function HS_GenerateBoxedContent(_2c,_2d,_2e,_2f){return HS_GenerateBoxedContent2(_2c,_2d,"left",_2e,_2f);}function HS_GenerateBoxedContent2(_30,_31,_32,_33,_34){return HS_GenerateBoxedContent3(_30,_31,_32,new Array(5,5,5,5),_33,_34,new Array(5,5,5,5));}function HS_GenerateBoxedContent3(_35,_36,_37,_38,_39,_3a,_3b){return HS_GenerateBoxedContent4(_35,_36,_37,_38,_39,_3a,"left",_3b,true);}function HS_GenerateBoxedContent4(_3c,_3d,_3e,_3f,_40,_41,_42,_43,_44){var _45,rowColor="",Contentcolor="";var _46="toptextsmall ";var _47="";if(_3c=="#006600"){rowColor="greenbg";}if(_44){_46=_46+"silverborder ";_47=_47+"silverborder ";}if(_3e=="left"){_46=_46+"alignleft "+"valigncenter "+"padall5";}else{_46=_46+"valigncenter "+"padall5";}if(_42=="center"){_47=_47+"aligncenter "+"valigncenter "+"padall5";}else{_47=_47+"valigncenter "+"padall5";}if(_40==""){Contentcolor="greybg";}_45=""+"<table class=\"fillwidth\">\n"+"<tr class=\""+rowColor+"\">\n"+"  <td class=\""+_46+"\">\n"+"    "+_3d+"\n"+"  </td>\n"+"</tr>\n"+"<tr class=\""+Contentcolor+"\">\n"+"  <td class=\""+_47+"\">\n"+"    "+_41+"\n"+"  </td>\n"+"</tr>\n"+"</table>\n";return _45;}function HS_GenerateRightRail(_48,_49){var _4a,strOutput;strOutput="";for(i=0;i<_49.length;i++){strOutput+="<li><a href=\""+_49[i][1]+"\">"+_49[i][0]+"</a></li>";}return HS_GenerateBoxedContent("#006600",_48,"",strOutput);}function HS_DropdownOpen(id,_4c){var _4d;_4d="<select class=\"valignmiddle dropdown\" ";if(id!=""){_4d+=" id=\""+id+"\"";}if(_4c!=""){_4d+=" onchange=\""+_4c+"\"";}_4d+=">";return (_4d);}function HS_DropdownAddOption(_4e,_4f,_50){var _51;_51="<option value=\""+_4e+"\"";if(_50){_51+=" selected";}_51+=">"+_4f+"</option>";return (_51);}function HS_DropdownClose(){return ("</select>");}function HS_Generate_FAQ(_52,_53){var _54="<table>";var _55="";for(var i=0;i<_52.length;i++){_55=_52[i][1]+"/"+_52[i][2]+"#"+_52[i][3];_54+="<tr><td style=\"padding-right:2px;\" valign=top><a href=\"javascript:PopUpWindow('"+_55+"');\"><img src=\"/images/arrow_yellow_sm.gif\" alt=\"\" /></a> </td><td style=\"padding-left:2px;\" valign=top> <a href=\"javascript:PopUpWindow('"+_55+"');\">"+_52[i][0]+"</a></td></tr>";}_54+="</table>";HS_ReplaceInnerHTML("hsidRightRailFaqDetails",_54);HS_ReplaceInnerHTML("hsidRightRailFaqHeader",_53);}
	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;}}}
	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 HS_ExtractArrayByName(arrayName, strBuffer) {
	    eval(strBuffer);
	
	    if (eval ('typeof ' + arrayName + ' != \'undefined\'')) {
	        eval('var newArray = ' + arrayName + ';');
	        return newArray;
	    } else {
	        return null;
	    }
	}
	
	var _errorEditUser={name:"edit-user-form",data:{"General Error":"A general error has occurred.  Please try again.","telephone1::257":"Please enter a Telephone Number.","telephone1::258":"Telephone Number must contain a minimum of 10-digits.","telephone1::513":"Telephone Number must contain a minimum of 10-digits.","telephone1::514":"Telephone Number must contain a minimum of 10-digits.","street1::257":"Please enter a Street Address.","street1::258":"Street Address cannot contain the characters "<" or ">".","street1::514":"Street Address is too long.","street2::258":"Street Address cannot contain the characters "<" or ">".","street2::514":"Street Address is too long.","city::257":"Please enter a City.","city::258":"City cannot contain the characters "<" or ">".","city::514":"City length is too long.","state::257":"Please select a State. ","state::258":"Please select a State. ","zip::257":"Please enter a Zip Code. ","zip::258":"Zip Code must be either 5 or 9 digits (e.g. 11111 or 11111-1111).","zip::513":"Zip Code must be either 5 or 9 digits (e.g. 11111 or 11111-1111).","zip::514":"Zip Code must be either 5 or 9 digits (e.g. 11111 or 11111-1111).","4097":"We are unable to identify this account based on the current user information we have on file for you. Please <a href=\"/faq/contactus.html\">contact us</a>."}};
	function onEnter(_1,_2){var _3=(document.layers)?true:false;var _4=0;if(_3){_4=_1.which;}else{_4=_1.keyCode;}if(_4==13){_2.submit();}}function onFormEnter(_5){var _6=(document.layers)?true:false;var _7=0;if(_6){_7=_5.which;}else{_7=_5.keyCode;}if(_7==13){HS_Submit();}}
	var _edituser=null;function Run_EditUser(){_edituser=new HS_Form("_edituser","hsidEditUserForm","/hedgelet/service/edit-user-form",HS_ValidateForm);_edituser.setForward("forward_success","/account/edituserconfirm.html");_edituser.setForward("forward_fail","/account/edituser.html");_edituser.setForward("forward_authenticationFail","/login/login.html");_edituser.setForward("forward_authorizationFail","/login/login.html");_edituser.setForward("forward_secureAccessFail","/login/login.html");_edituser.setForward("forward_backendFail","/account/");_edituser.setForward("forward_formSequenceFail","/account/edituser.html");_edituser.setForward("forward_formIDInvalid","/account/edituser.html");_edituser.run();}function HS_Form_Finalize(_1){var _2=_edituser.getDisplayData("stEntityName");var _3=_edituser.getDisplayData("stUserName");if(typeof _2!="undefined"&&_2!=null&&_2.length>0){setInnerHTML("hsidUserNameTag",_2);}if(typeof _3!="undefined"&&_3!=null&&_3.length>0){setInnerHTML("hsidUserNameTag",_3);}var _4=_edituser.getServiceData("state");prefillChoiceItem(_4,"hsidStateID");var _5=_edituser.getErrors();var _6;var _7="";if(_5.length>0){var _8=false;_edituser.clearErrors();for(var i=0;i<_5.length;i++){_6=_5[i].split("::");if(_6[1]=="257"&&(_6[0]=="telephone1"||_6[0]=="telephone2"||_6[0]=="telephone3")){HS_GetElementByID("telephone_label").className="errorlabel";_8=true;if(_7.match("Please enter a Telephone Number")==null){_7+="<br/>Please enter a Telephone Number. ";}}else{if(_6[1]=="258"&&(_6[0]=="telephone1"||_6[0]=="telephone2"||_6[0]=="telephone3")){HS_GetElementByID("telephone_label").className="errorlabel";_8=true;if(_7.match("Telephone Number must contain a minimum of 10-digits.")==null){_7+="<br/>Telephone Number must contain a minimum of 10-digits.";}}else{if(_6[1]=="4097"){_7+="<br/>"+_errorEditUser.data[_6[1]];}else{_7+="<br/>"+_errorEditUser.data[_5[i]];if(HS_GetElementByID(_6[0]+"_label")){HS_GetElementByID(_6[0]+"_label").className="errorlabel";_8=true;}}}}}showErrors(_7,_8);}}function HS_Submit(){_edituser.submit();}function HS_ValidateForm(){return true;}
	

