Location: PHPKode > projects > MembersGear > membersgear/templates/user_signup.tpl
<center>
  <table border="0" align="center"  cellspacing="0" cellpadding="0" id="ctl00_ContentPlaceHolder1_UpdatePanel1" style="width:650px%;height:35px;">
     <tr>
        <td>
            <table border="0" align="center"  cellspacing="0" cellpadding="0" style="width:100%;display:none;" id="ctl00_ContentPlaceHolder1_UpdateProgress1">
               <tr>
                   <td>
                         <center>
                            <div style="width:450px;">
                            <div style="width:45px;float:left"><img src="{$ADMIN_IMAGE_DIR}/DBRestoreloader.gif" align="absmiddle"></div>
                            <div style="width:400px;float:left;padding-top:7px;text-align:left;font-size:12px;" class="Lable" id="ctl00_ContentPlaceHolder1_UpdatePanelProgressLoading1_lblmessage">&nbsp;&nbsp;<b>Please wait while your request is being processed..</b></div>
                            </div>
                          </center>  
                      
                    </td>
                </tr>
             </table>            
        </td>
     </tr>
   </table>            
</center>     

<div id="formlayout"> 
      <div id="formlayout-top"></div>
           <div id="formlayout-bg">
            
               <form name="frmsignup" id="frmsignup" method="post" action="{$WEB_URL}/user_signup.php?action=insert" > 
                        <script language="javascript" type="text/javascript" src="{$WEB_URL}/js/functions.js"></script>  
                            <table border="0" align=""  cellspacing="5" cellpadding="0" style="width: 640px; margin-left: 8px; padding-right: 8px !important;">    
                                 <tr>
                                    <td colspan="2">
                                        <h1> Registration Form</h1>
                                    </td>
                                </tr>
                              {if $msg neq ''}
                               <tr>
                                  <td colspan="2" class="succmsg">
                                   <center>{$msg}</center>
                                  </td>
                                </tr>
                              {/if}
                              
                               <tr>   
                                 <td class="right-side-texttext" style="width:200px">
                                     <label>
                                         Membership Type 
                                              <label class="star">*</label>
                                      </label>
                                      <div class="FieldLabelNote">
                                      </div>
                                  </td>
                                 <td class="left-side-text" style="_padding:0px;" valign="top">
                                    {if $totalProducts eq '1'}
                                         <input type="radio" value="{$products[0].id}" id="{$products[0].id}" style="vertical-align:middle;display:none" name="products" checked> 
                                         <label for="{$products[0].id}" style="padding-right:8px;padding-left:5px" ><strong  style="color:#000;">{$products[0].name}&nbsp;{if $MEMBER_SHOWPRICE_SIGNUP_PAGE eq 'true'}(${$products[0].price|string_format:"%.2f"}){/if}</strong></label> 
                                         <br>
                                     {else}
                                        <table cellpadding="0" cellspacing="4" class="nospace">   
                                            {section name=product loop=$products}
                                                <tr>
                                                      <td style="padding-left:0px" valign="top">   
                                                         <input type="radio" class="chkcss" value="{$products[$smarty.section.product.index].id}" id="{$products[$smarty.section.product.index].id}" style="vertical-align:middle;" name="products" {if $post.products eq $products[$smarty.section.product.index].id } checked {/if} onclick="checkAgreement(this.value)" >  
                                                      </td>
                                                      <td style="padding-right:8px;">  
                                                            <label for="{$products[$smarty.section.product.index].id}"><strong  style="color:#000;">{$products[$smarty.section.product.index].name}&nbsp;{if $MEMBER_SHOWPRICE_SIGNUP_PAGE eq 'true'}(${$products[$smarty.section.product.index].price|string_format:"%.2f"}){/if}</strong></label> 
                                                      </td>
                                                 </tr>        
                                             {/section}
                                          </table>       
                                     {/if}                
                                  </td>
                      
                             </tr>                  
                             <tr style="display:none">
                                     <td class="right-side-text" style="width:200px"><label>Payment System</label></td>
                                      <td class="left-side-text" style="padding:8px">
                                          <label><b>Paygear</b></label>        
                                      </td>
                                      <td>
                                         <input type="hidden" value="usersignup" name="ajexvalidation" id="ajexvalidation">
                                      </td>
                             </tr>
                             <tr>
                               <td class="right-side-text" style="width:200px">
                                   <label>First Name <label class="star">*</label></label>
                               </td>
                               <td class="left-side-text" style="padding:6px">
                                 <input type="text"  name="fname" id="fname" class="txtcss" maxlength="45"  style="width:200px" value="{$post.fname}">
                               </td>
                             </tr>
                         
                            <tr>
                               <td class="right-side-text" style="width:200px"><label>Last Name <label class="star">*</label></label></td>
                                <td class="left-side-text" style="padding:6px">
                                     <input type="text"  name="lname" id="lname" class="txtcss" maxlength="45" style="width:200px" value="{$post.lname}"> 
                                </td>
                             </tr>
                         
                           <tr>
                              <td class="right-side-text" {if $MEMBER_USE_VALIDATE_INFO eq 'true'} style="width:200px;" {else} style="width:200px;padding-top:8px;" {/if} valign="top"><label>Your Email Address <label class="star">*</label></label>{if $MEMBER_USE_VALIDATE_INFO eq 'true' }<div class="FieldLabelNote" >(Confirmation Required)</div>{/if}
                              </td>
                              <td class="left-side-text" style="padding:6px">
                                  <input  type="text"   style="width:200px" name="email" id="email" class="txtcss" maxlength="45"   value="{$post.email}"  {if $MEMBER_UNIQUE_EMAIL eq 'true'} {/if}>
                                  <input  type="button" class="big-button" name="btnEmail" id="btnEmail" value="Choose another Email" style="display:none;padding:0;width:153px;" onclick="Emailvalidation()" >
                                  <input  type="hidden"   name="emailcheck" id="emailcheck" value="false">
                                  {if $MEMBER_UNIQUE_EMAIL eq 'true'}  
                                     <span id="spnemailvailableload" name="spnemailvailableload" style="display:none;"></span> 
                                   {/if}
                                   {if $MEMBER_UNIQUE_EMAIL eq 'true'}
                                        <div id="spnemailavailablelink" name="spnemailavailablelink" style="padding-top:10px;display:none;" ></div>
                                   {/if}
                             </td>
                          </tr>
                       
                          <tr>
                              <td class="right-side-text" style="width:200px;padding-top:8px" valign="top"><label>Username <label class="star">*</label></label><div class="FieldLabelNote" ></div>
                              </td>
                              <td class="left-side-text" style="padding:6px">
                                {if $MEMBER_GENERATE_USERNAME neq 'true'}
                                  <input  type="text" style="width:200px" name="username" id="username" class="txtcss" {if $MEMBER_LOGIN_MAX_LENGTH!=''}maxlength="{$MEMBER_LOGIN_MAX_LENGTH}"{/if}  value="{$post.username}" {if $MEMBER_GENERATE_USERNAME eq 'true'}readonly=""{/if}  {if $MEMBER_GENERATE_USERNAME neq 'true'} {/if}> 
                                  <input  type="button"   class="big-button" name="btnuser" id="btnuser" value="Choose another Username" style="display:none;padding:0;width:178px;"  >
                                  <input  type="hidden"   name="usercheck" id="usercheck" value="false">
                                {/if}
                               
                                   {if $MEMBER_GENERATE_USERNAME eq 'true'}
                                   &nbsp;<input type="checkbox" class="chkcss" name="gen_username" id="gen_username" value="1" style="display:none" checked=""><label><b>Auto Generated </b></label>
                                   {/if}
                                 
                                    {if $MEMBER_GENERATE_USERNAME neq 'true'}
                                       <span id="spnusernameavailableload" name="spnusernameavailableload" style="display:none;"></span>  
                                       <div id="spnusernameavailablelink" name="spnusernameavailablelink" style="padding-top:10px;display:none;"></div>  
                                    {/if}
                              </td>
                         </tr>
                      
                        <tr>
                           <td class="right-side-text" style="width:200px"><label>Choose a Password <label class="star">*</label></label><div class="FieldLabelNote" ></div>
                           </td>
                           <td class="left-side-text" style="padding:6px">
                           {if $MEMBER_GENERATE_PASSWORD neq 'true'} 
                                <input type="password" name="password" id="password" class="txtcss" {if $MEMBER_PASSWORD_MAX_LENGTH!=''}maxlength="{$MEMBER_PASSWORD_MAX_LENGTH}"{/if}  style="width:200px"   value="{$post.password}" {if $MEMBER_GENERATE_PASSWORD eq 'true'}readonly{/if}>
                            {/if}  
                              
                                {if $MEMBER_GENERATE_PASSWORD eq 'true'}
                                 &nbsp;<input type="checkbox" style="display:none" class="chkcss" name="gen_password" id="gen_password" value="1" checked=""><label><b>Auto Generated </b></label>
                                {/if}
                         </td>
                      </tr>
                      
                      {if $MEMBER_GENERATE_PASSWORD neq 'true'}   
                           <tr>
                             <td class="right-side-text" style="width:200px"><label>Confirm Password <label class="star">*</label></label><div class="FieldLabelNote"></div>
                             </td>
                             <td class="left-side-text" style="padding:6px">
                                <input type="password" name="confpassword" id="confpassword" class="txtcss" {if $MEMBER_PASSWORD_MAX_LENGTH!=''}maxlength="{$MEMBER_PASSWORD_MAX_LENGTH}"{/if} style="width:200px"  value="{$post.confpassword}" {if $MEMBER_GENERATE_PASSWORD eq 'true'}readonly{/if}>
                             </td>
                           </tr>
                      {/if}
                     
                        {if $MEMBER_USE_SUBSCRIBELINK eq 'true'}   
                           <tr>
                             <td class="right-side-text" style="width:200px"><label>Subscribe to Messaging</label><div class="FieldLabelNote"></div>
                             </td>
                             <td class="left-side-text">
                                <input type="checkbox" name="chksubscribe" id="chksubscribe" class="chkcss" checked value="0">
                             </td>
                           </tr>
                      {/if}
                      
                       <tr id="personalInfo" style="display:none">
                           <td class="right-side-text" ><label><font color="red">Personal Address</font></label>
                           </td>
                       </tr>
                     
                      <tr id="street" style="display:none"> 
                            <td   class="right-side-text"><label>Street Address</label>
                            </td>
                            <td class="left-side-text" style="padding:6px">
                                   <textarea  name="address" id="address" class="txtareacss" cols="30" maxlength="200" style="width:207px">{if $IsEdit eq 'yes'}{$userdata[0].address}{else}{$post.address}{/if}</textarea> 
                            </td>
                      </tr>
                      
                      <tr  id="countrydiv" style="display:none">
                          <td  class="right-side-text"><label>Country<label class="star">*</label></label>
                          </td>
                          
                           <td class="left-side-text" style="padding:6px">
                               <div style="width:auto">
                                    <div style="float:left;width:230px"> 
                                          <select id="country" name="country" class="selectcss" style="width:208px">
                                             <option value='0'>select</option>
                                             {section name=country_name loop=$country}
                                                 <option value="{$country[$smarty.section.country_name.index].id}" {if $country[$smarty.section.country_name.index].id eq   $post.country} selected{/if}>{$country[$smarty.section.country_name.index].name}</option>
                                              {/section}
                                          </select>
                                          <input type="hidden" name="countryhiddval" id="countryhiddval" value="">
                                    </div>
                                       <div id='loading' style="visibility:hidden;padding:1px">
                                            Cargando...
                                        </div>
                                </div>
                            </td>     
                      </tr>
                      
                      <tr id="statediv" style="display:none">
                            <td   class="right-side-text"><label>State <label class="star">*</label></label>
                            </td>
                                <td class="left-side-text" style="padding:6px">
                                      <span id="spnstate" name="spnstate" style="font-weight: normal;">
                                          <select id="state" name="state" class="selectcss" style="font-weight: normal;width:208px">
                                             <option value='0'>select..</option>
                                             {section name=state_name loop=$state}
                                                <option value="{$state[state_name].id}" {if  $state[state_name].id eq $post.state}selected{/if}>{$state[state_name].name}</option>
                                             {/section}
                                          </select>
                                       </span>
                                      <input type="hidden" name="stathiddval" id="stathiddval" value="">    
                                </td>
                       </tr>
                            
                       <tr id="citydiv" style="display:none"> 
                           <td   class="right-side-text"><label>City <label class="star">*</label></label>
                           </td>
                           <td class="left-side-text" style="padding:6px">
                                   <input type="text"  name="city" id="city" style="width:200px" class="txtcss" maxlength="45"  value="{$post.city}"/>
                           </td>
                       </tr>
                       
                       <tr id="zipdiv" style="display:none">
                           <td   class="right-side-text"><label>Zipcode <label class="star">*</label></label>
                           </td>
                           <td class="left-side-text" style="padding:6px">
                                    <input type="text"class="txtcss" style="width:200px" name="zipcode" id="zipcode" maxlength="15"  value="{$post.zipcode}"/>
                           </td>
                       </tr>
                           
                       <tr id="phonediv" style="display:none">
                                <td   class="right-side-text"><label>Phone</label>
                                </td>
                                <td class="left-side-text" style="padding:6px">
                                    <input type="text" class="txtcss" name="phone" style="width:200px" id="phone" maxlength="45"  value="{$post.phone}"/>
                                </td>
                       </tr>    
                       <tr id="samerec" style="display:none">
                           <td   class="right-side-text" ><label><font color="red">Shipping Address</font></label>
                           </td>
                           <td class="left-side-text" style="vertical-aglign:top;padding:0px">
                                <span style="color: black;" id="ctl00_ContentPlaceHolder1_chkShp1">
                                  <input type="checkbox" class="chkcss" onclick="ShippingCheckBoxChecked();" id="ctl00_ContentPlaceHolder1_chkShp" name="ctl00$ContentPlaceHolder1$chkShp"/>
                                  <span id="asabove"> <label for="ctl00_ContentPlaceHolder1_chkShp"><strong  style="color:#000;">As Above</strong></lable></span>
                                </span>
                            </td>
                       </tr>
                           
                       <tr id="streetSHP" style="display:none">
                          <td  class="right-side-text"  style="width:200px"><label>Street Address </label>
                          </td>
                          <td class="left-side-text" style="padding:6px">
                                   <textarea  name="addressSHP" id="addressSHP" class="txtareacss" cols="30" style="width:207px">{$post.addressSHP}</textarea>
                          </td>
                       </tr>
                       
                       <tr id="citydivSHP" style="display:none">
                                <td   class="right-side-text" ><label>City <label class="star">*</label></label>
                                </td>
                                <td class="left-side-text" style="padding:6px">
                                   <input type="text"  name="citySHP" id="citySHP" class="txtcss" maxlength="45" style="width:200px" value="{$post.citySHP}"/>
                                </td>
                       </tr>

                       <tr  id="countrydivSHP" style="display:none">   
                                <td   class="right-side-text"><label>Country <label class="star">*</label></label>
                                </td>  
                                 <td class="left-side-text" style="padding:6px">
                                 
                                     <div style="width:auto">
                                         <div style="float:left;width:230px">
                                              <select class="selectcss" id="billing_country" name="billing_country"  style="width:208px" onchange="shipping_st();">                        
                                                  <option value='0'>select</option>
                                                   {section name=country_name loop=$billing_country}
                                                       <option value="{$billing_country[country_name].id}" {if $billing_country[country_name].id eq $post.billing_country}selected{/if}>{$billing_country[country_name].name}</option>
                                                   {/section}
                                               </select>
                                                 <input type="hidden" name="shcountryhiddval" id="shcountryhiddval" value="">
                                            </div>    
                                          <div id='loading_country' style="visibility:hidden;padding:1px">
                                             Cargando...
                                         </div> 
                                      </div>
                                 </td>
                       </tr>
                             
                        <tr id="statedivSHP" style="display:none"> 
                            <td class="right-side-text"><label>State<label class="star">*</label></label>
                            </td>
                            <td class="left-side-text" style="padding:6px">
                                <span id="spnstate_billing" name="spnstate_billing" style="font-weight: normal;">
                                    <select id="bllling_state" name="bllling_state" class="selectcss" style="width:208px"> 
                                       <option value='0'>select..</option>
                                        {section name=state_name loop=$billing_state}
                                                <option value="{$billing_state[state_name].id}"
                                                {if $IsEdit eq 'yes'}
                                                    {if $billing_state[state_name].id eq  $userdata[0].billing_state}
                                                        selected
                                                    {/if}
                                                {elseif  $billing_state[state_name].id eq $post.billing_state}
                                                      selected
                                                {/if}>{$billing_state[state_name].name}</option>                                                                             
                                          {/section}  
                                    </select> 
                                </span>
                                <input type="hidden" name="shstathiddval" id="shstathiddval" value="">  
                            </td>

                       </tr>
                           
                       <tr id="zipdivSHP" style="display:none">
                                <td   class="right-side-text" ><label>Zipcode<label class="star">*</label></label>
                                </td>
                                 <td class="left-side-text"  style="padding:6px">
                                    <input type="text" name="zipcodeSHP" id="zipcodeSHP" maxlength="15"  style="width:200px" value="{$post.zipcodeSHP}" class="txtcss"/>
                                 </td>
                        </tr>
                            
                       <tr id="phonedivSHP" style="display:none">
                                <td   class="right-side-text" ><label>Phone </label>
                                </td>
                                 <td class="left-side-text" style="padding:6px">
                                    <input type="text" name="phoneSHP" id="phoneSHP" maxlength="45" style="width:200px" value="{$post.phone}" class="txtcss"/>
                                 </td>           
                       </tr>
                            
                       {*--------------------------------------------------------------------------------------------------------------------------*}
                           {if $controlresult neq ''}
                           <tr style="display:none" id="personalInfo">
                                <td class="right-side-text"><label><font color="red">Addtional Information</font></label>
                                </td>
                           </tr>
                           {/if}
                           {$controlresult}  
                       {*--------------------------------------------------------------------------------------------------------------------------*}
                      <tr>
                         <td class="right-side-text"><div id="agdisp" style="display:none"><label><b>Agreement </b><label class="star">*</label></label></div>
                          </td>
                          <td class="left-side-text" style="padding:6px">
                               <div style="height:300px;width:365px;overflow:auto;display:none;border:1px solid #cccccc" id="agreement">
                                  {php}
                                        $filename=PHYSICAL_DIR."/templates/agreement.html";
                                        if(file_exists($filename))
                                          $handle=fopen($filename, 'r') or die('can not open file to read file');
                                          while(!feof($handle))
                                          {
                                              if("\n"!=$handle || "\r\n"!=$handle)
                                                echo fgets($handle);
                                          }
                                          fclose($handle);
                                  {/php}
                               </div>
                              <div id="dispAgree" style="display:none;width:285px;padding-top:10px;" > 
                                    <input type="radio" value="Agree" checked name="agreements" id="agreements" style="vertical-align:middle;" class="chkcss"><strong style="color:#000;">I Agree</strong>&nbsp;
                                    <input type="radio" name="agreements" value="dotagree" id="agreements" style="vertical-align:middle;"  class="chkcss"><strong style="color:#000;">Don't Agree</strong>
                              </div>
                           </td>
                      </tr>         
                     <tr>      
                          <td  class="right-side-text">&nbsp;</td>
                                <td class="buttontd" style="padding-left:5px;"> 
                                       <input type="hidden"  name="personalInfoValidation" value="no" id="personalInfoValidation" >
                                       <input type="hidden"  name="shippingInfoValidation" value="no" id="shippingInfoValidation" >
                                       <input type="hidden"  name="userNameValidation" value="" id="userNameValidation" >
                                       <input class="small-button" type="submit" id="submit" value="Submit"  name="submit" onsubmit="emailchecktest()">&nbsp;&nbsp;&nbsp;
                          </td>
                     </tr>          
                      
               </table>
               
              </form>
                           
      </div>       
     <div id="formlayout-bottom"></div>   
</div>       
{literal} 
   <script language="JavaScript" type="text/javascript">       
                                     
     var $j = jQuery.noConflict();  
     
     
     function onCountryChange(){
           var dataString = 'country='+ $j('#country').val() + '&ajexvalidation=' + $j('#ajexvalidation').val() ;
           var country=$j('#country').val();
           var MEMBER_USE_ADDRESS_INFO='{/literal}{$MEMBER_USE_ADDRESS_INFO}{literal}';
           var web_url='{/literal}{$WEB_URL}{literal}';    
           $j.ajax({
               type: "POST",
               url: web_url+"/includes/fill_states.php",
               datatype: 'html',
               data: dataString,
               success: function(msg){
                    var alldata=msg;   
                    var array_val=alldata.split("[|||]");   
                    var returnVal1=array_val[0]; 
                    var returnVal12=array_val[1];  
                    returnVal1=rtrim(ltrim(returnVal1));
                    returnVal12=rtrim(ltrim(returnVal12));
                    if(returnVal1=='usersignup') 
                     {
                         $j('#spnstate').html(returnVal12);  
                         var ispersonalinfo=$j('#personalInfoValidation').val();
                         var isShipping=$j('#shippingInfoValidation').val();
                         /*if(ispersonalinfo=='yes')
                           {
                              
                               frmvalidator.addValidation('state','dontselect=0','Please select State.'); 
                               frmvalidator.addValidation('country','dontselect=0','Please select County.'); 
                          }
                          if(isShipping=='yes')
                          {
                              frmvalidator.addValidation('billing_country','dontselect=0','Please select shipping County.'); 
                              frmvalidator.addValidation('bllling_state','dontselect=0','Please select shipping State.'); 
                          }  */  
                
                         frmvalidator.addValidation("state","dontselect=0","Please select State.","document.getElementById('personalInfoValidation').value=='yes'"); 
                         frmvalidator.addValidation("country","dontselect=0","Please select County.","document.getElementById('personalInfoValidation').value=='yes'"); 
             
                         frmvalidator.addValidation("billing_country","dontselect=0","Please select Shipping County.","document.getElementById('shippingInfoValidation').value=='yes'"); 
                         frmvalidator.addValidation("bllling_state","dontselect=0","Please select Shipping State.","document.getElementById('shippingInfoValidation').value=='yes'"); 
                     
                       
                     }
                   else if(returnVal1=='adminusersignup')
                   {
                        $j('#spnstate').html(returnVal12);              
                            if(MEMBER_USE_ADDRESS_INFO=='visible_required')
                            {  
                               frmvalidator.addValidation("state","dontselect=0","Please select State."); 
                               frmvalidator.addValidation("country","dontselect=0","Please select County."); 
                      
                            } 
                   
                 
                      } 
                 
                 
               }
           });  
            
        }
                
     function shipping_st()
     {
          var dataString = 'billing_country='+ $rn('#billing_country').val();
           var billing_country=$rn('#billing_country').val();
           var MEMBER_USE_ADDRESS_INFO='{/literal}{$MEMBER_USE_ADDRESS_INFO}{literal}';
           var web_url='{/literal}{$WEB_URL}{literal}';    
           $rn.ajax({
               type: "POST",
               url: web_url+"/includes/fill_states.php",
               datatype: 'html',
               data: dataString,
               success: function(msg){

                   $rn('#spnstate_billing').html(msg); 
                        
                    var state = document.getElementById("state");

                    var selectedstate;
                        
                    if(state)
                        selectedstate = state.options[state.selectedIndex].text; 
                        
                     selectdropdownoption(document.getElementById("bllling_state"),selectedstate);
                          
                     
                       if(MEMBER_USE_ADDRESS_INFO=='visible_required')
                        {  
                             frmvalidator.addValidation('bllling_state','dontselect=0','Please select Billing State.');
                         }    
                   
                 } 
           
           });  

     
     }          
         
      $j(document).ready(function(){  
  
        $j('#btnuser').click(function(){usernamevalidation()});
        $j('#btnEmail').click(function(){Emailvalidation()});
    
        $j('#username').blur(function(){
           var dataString = 'username='+ $j('#username').val();
           var username=$j('#username').val();
           
           var mem_login_min_length='{/literal}{$MEMBER_LOGIN_MIN_LENGTH}{literal}';
           var mem_login_max_length='{/literal}{$MEMBER_LOGIN_MAX_LENGTH}{literal}';
           var web_url='{/literal}{$WEB_URL}{literal}';
           var generate_user='{/literal}{$MEMBER_GENERATE_USERNAME}{literal}';    
           var user_exist='{/literal}{$MESSAGE_USER_EXIST}{literal}';
           
           if(generate_user!='true')
           {
              var chkattUser=$j("#username").attr("readonly");
    
               if(chkattUser==false &&  ltrim(rtrim(username))!="")
                { 
                       $j.ajax({
                       type: "POST",
                       url: web_url+"/includes/ctl_isusernameavailable.php",
                       datatype: 'html',
                       data: dataString,
                       success: function(msg){
                           msg=ltrim(rtrim(msg));
                           if(msg=='yes') 
                            {
                               $j('#usercheck').val('true');
                               $j('#btnuser').css('display','');
                               $j('#username').attr('readonly','true');
                               $j('#spnusernameavailablelink').show();
                               $j('#spnusernameavailablelink').html('Congratulations!! <b>'+ ltrim(rtrim(username)) + '</b> is available');
                           }
                           else if(msg=='user_exist')
                           {
                               $j('#usercheck').val('false'); 
                               $j('#spnusernameavailablelink').show();  
                               $j('#spnusernameavailablelink').html('<font color=red><b>'+ ltrim(rtrim(username)) + '</b> '+ user_exist + '</font>');
                               $j('#btnuser').css('display','none');      
                              
                           } 
                           else if(msg=='not_in_length')
                            {
                            
                               $j('#usercheck').val('false'); 
                               $j('#spnusernameavailablelink').show();    
                               $j('#spnusernameavailablelink').html('<font color=red>Username length must in between ' + mem_login_min_length + ' to ' + mem_login_max_length +' character</font>');
                               $j('#btnuser').css('display','none');
                                  
                            
                            }
                          else if(msg=='invalid_username')
                           {
                              $j('#usercheck').val('false'); 
                              $j('#spnusernameavailablelink').show();    
                              $j('#spnusernameavailablelink').html('<font color=red><b>' + username + '</b> is invalid username.</font>');
                              $j('#btnuser').css('display','none');  
                             
                           
                           }
                          else
                           {
                               $j('#btnuser').css('display','none');  
                               $j('#usercheck').val('false'); 
                               $j('#spnusernameavailablelink').hide(); 
                               $j('#spnusernameavailablelink').html('');
                           
                           }    
                         
                       }
                   }); 
                }  
           }   
            
        });
        
       
          $j('#email').blur(function(){
           var dataString = 'email='+ $j('#email').val() + '&uid=' + $j('#uid').val() ;
           var email=$j('#email').val();
           var web_url='{/literal}{$WEB_URL}{literal}';
           var email_exist='{/literal}{$MESSAGE_DUPLICATE_EMAIL}{literal}';
           var unique_email='{/literal}{$MEMBER_UNIQUE_EMAIL}{literal}';
         
          if (unique_email=='true')
          {
                  var chkAttr=$j("#email").attr("readonly");
                   if( chkAttr==false && ltrim(rtrim(email))!='')
                    {  
                           $j.ajax({
                           type: "POST",
                           url: web_url+"/includes/ctl_isemailavailable.php",
                           datatype: 'html',
                           data: dataString,
                           success: function(msg){
                               msg=ltrim(rtrim(msg));
                               if(msg=='yes') 
                                {
                                   $j('#emailcheck').val('true');
                                   $j('#btnEmail').css('display','');
                                   $j('#email').attr('readonly','true');
                                    $j('#spnemailavailablelink').show();
                                   $j('#spnemailavailablelink').html('Congratulations!! <b>'+ ltrim(rtrim(email)) + '</b> is available');
                               }
                               else if(msg=='already_exist')
                               {
                                   $j('#emailcheck').val('false');   
                                    $j('#spnemailavailablelink').show();
                                   $j('#spnemailavailablelink').html('<font color=red><b>'+ ltrim(rtrim(email)) + '</b> '+ email_exist + '</font>');
                                   $j('#btnEmail').css('display','none'); 
                             
                               
                               } 
                              else if(msg=='invalid_email')
                               {
                                  $j('#emailcheck').val('false');  
                                  $j('#spnemailavailablelink').show();
                                  $j('#spnemailavailablelink').html('<font color=red><b>' + ltrim(rtrim(email)) + '</b> is invalid Email address.</font>');
                                  $j('#btnEmail').css('display','none'); 
                              
                               
                               }
                              else
                               {
                                    $j('#btnEmail').css('display','none'); 
                                    $j('#emailcheck').val('false'); 
                                     $j('#spnemailavailablelink').hide(); 
                                    $j('#spnemailavailablelink').html('');
                               
                               }    
                             
                           }
                       });  
                   
                    }
                   
                }                  
                    
           }); 
             
        
        
           $j('#country').change(function(){onCountryChange();});
        
    
    });
    
    $j(document).ajaxStart($j.blockUI).ajaxStop($j.unblockUI);
   
  function usernamevalidation()
 {   
      document.getElementById("username").removeAttribute('readonly','readonly'); 
      document.getElementById("username").focus();
      document.getElementById("btnuser").style.display='none';
      document.getElementById("usercheck").value="false";     
      document.getElementById("spnusernameavailablelink").innerHTML='';
        document.getElementById("spnusernameavailablelink").style.display='none'; 
      
      
 }
  function Emailvalidation()
 {   
      document.getElementById("email").removeAttribute('readonly','readonly'); 
      document.getElementById("email").focus();
      document.getElementById("btnEmail").style.display='none';
      document.getElementById("emailcheck").value="false";   
      document.getElementById("spnemailavailablelink").style.display='none';   
      document.getElementById("spnemailavailablelink").innerHTML=''; 
      
 }
 
         
  function shipping_st()
  {
       var dataString = 'billing_country='+ $j('#billing_country').val() + '&ajexvalidation=' + $j('#ajexvalidation').val() ;
       var country=$j('#billing_country').val();
       var MEMBER_USE_ADDRESS_INFO='{/literal}{$MEMBER_USE_ADDRESS_INFO}{literal}';
       var web_url='{/literal}{$WEB_URL}{literal}';    
       $j.ajax({
           type: "POST",
           url: web_url+"/includes/shipping_st.php",
           datatype: 'html',
           data: dataString,
           success: function(msg){
                var alldata=msg;   
                var array_val=alldata.split("[|||]");   
                var returnVal1=array_val[0]; 
                var returnVal12=array_val[1];  
                returnVal1=rtrim(ltrim(returnVal1));
                returnVal12=rtrim(ltrim(returnVal12));
                if(returnVal1=='usersignup') 
                 {
               
                    $j('#spnstate_billing').html(returnVal12);
                      frmvalidator.addValidation("billing_country","dontselect=0","Please select Shipping County.","document.getElementById('shippingInfoValidation').value=='yes'"); 
                      frmvalidator.addValidation("bllling_state","dontselect=0","Please select Shipping State.","document.getElementById('shippingInfoValidation').value=='yes'"); 
                           var state = document.getElementById("state");

                       var selectedstate;
                    
                       if(state)
                        selectedstate = state.options[state.selectedIndex].text; 
                       
                       selectdropdownoption(document.getElementById("bllling_state"),selectedstate);
                  
                  
                 }
               
             
             
           }
       });  
    
  }
 </script>
 <style type="text/css" charset="utf-8">
.nospace input
{
    margin:4px 0px;
    _margin:1px 0px;
}

</style>
 {/literal}                   
   
  {literal} 
   <script language="JavaScript" type="text/javascript">
      
       var frmvalidator  = new Validator("frmsignup"); 
      frmvalidator.EnableMsgsTogether();   
   
      var mem_login_min_len='{/literal}{$MEMBER_LOGIN_MIN_LENGTH}{literal}';
      var mem_login_max_len='{/literal}{$MEMBER_LOGIN_MAX_LENGTH}{literal}';
      var mem_pass_min_len='{/literal}{$MEMBER_PASSWORD_MIN_LENGTH}{literal}'; 
      var mem_pass_max_len ='{/literal}{$MEMBER_PASSWORD_MAX_LENGTH}{literal}';
      var mem_user_add_info='{/literal}{$MEMBER_USE_ADDRESS_INFO}{literal}';
      var mem_generate_user='{/literal}{$MEMBER_GENERATE_USERNAME}{literal}'; 
      var mem_generate_password='{/literal}{$MEMBER_GENERATE_PASSWORD}{literal}';
      var mem_generate_email='{/literal}{$MEMBER_UNIQUE_EMAIL}{literal}'; 
      
      var mem_pass_not_match ="{/literal}{$MESSAGE_PASSWORD_NOT_MATCH}{literal}"; 
      var mem_email_verify ="{/literal}{$MESSAGE_EMAIL_NOT_VARIFIED}{literal}"; 
      var mem_pass_not_enter ="{/literal}{$MESSAGE_NO_PASSWORD_NORMAL}{literal}"; 
      
      var isedit='{/literal}{$IsEdit}{literal}'; 
      var email='{/literal}{$userdata[0].email}{literal}';
      var totalproducts='{/literal}{$totalProducts}{literal}';
     
      
           function UserNameAvailableRequest()
           {
            if(document.getElementById('usercheck').value!='true' && trim(document.getElementById('username').value)!="" )
              {
                 UserNameAvailable();
              }
           
           
           } 
           function EmailAvailableRequest()
           {
             if(document.getElementById('emailcheck').value!='true' && trim(document.getElementById('email').value)!="" )
              {
                 EmailAvailable();
              }  
           }
      
           function emailchecktest()
               {
                  
                
                  if(document.getElementById('emailcheck').value=='true')
                      {
                       
                       
                            finalresult=true;
                        }
                     
                      else
                      {
                        finalresult=false;
                      }
                       
                   return  finalresult;
               }
               
      
          function useravailableCheck()
               {
                        
                  if(document.getElementById('usercheck').value=='true')
                      {
                       
                            finalresult=true;
                        }
                     
                      else
                      {
                        finalresult=false;
                      }
                       
                   return  finalresult;
               }
               
     
      function DoCustomValidationforconfirmpassword()
        {
        
        
           var countryhtml = document.getElementById("country");
           var countryVal = countryhtml.options[countryhtml.selectedIndex].text;
           document.getElementById('countryhiddval').value=countryVal;
      
           var stathtml = document.getElementById("state");
           var statVal = stathtml.options[stathtml.selectedIndex].text;
           document.getElementById('stathiddval').value=statVal;
           
           var countryhtmlsh = document.getElementById("billing_country");
           var countryValsh = countryhtmlsh.options[countryhtmlsh.selectedIndex].text;
           document.getElementById('shcountryhiddval').value=countryValsh;
          
                                                                            
           var stathtmlsh = document.getElementById("bllling_state");
           var statValsh = stathtmlsh.options[stathtmlsh.selectedIndex].text;
           document.getElementById('shstathiddval').value=statValsh;
      
          
          
          var frm = document.forms["frmsignup"];
          if(frm.password.value != frm.confpassword.value)
          {
              //alert('The Password and Confirm password do not match!'); 
              //document.getElementById('confpassword').focus(); 
              return false;
              
          }
          else
          { 
           // alert(userenameavailable);
            return true;
          }
          
          
        }
        
        
         function DoCustomValidation()
        {   
              var finalresult=true; 
              var frm = document.forms["frmsignup"];
              
              /*Confirm Password*/
               var error="";
               var focus=''; 
               var foc=1;
               
                 /* Email availability*/
             
              /* Username availability*/  
              
              
             
              if(mem_generate_email=='true')
             { 
                  if(emailchecktest()==true)
                   {
                       finalresult=true;     
                   
                   }
                 else
                  {
                  
                     finalresult=false;
                     error +='The given Email address already taken.Please enter diffrent Email address.' +'\r\n';  
                     
                     if(foc==1)
                      {
                        focus='email'; 
                         foc=0;
                      }          
                  } 
             } 
              if(mem_generate_user!='true')
              { 
                   if(useravailableCheck()==true)
                   {
                     finalresult=true;     
                   
                   }
                 else
                  {
                  
                     finalresult=false;
                     error +='The given username already taken.Please enter diffrent username.' +'\r\n';  
                     
                      if(foc==1)
                      {
                         focus='username';
                         foc=0;
                      }  
                                 
                  } 
                
              }
              else
              {
                     
                finalresult=true;
              }   
              
              
              if(mem_generate_password=='false')  
              {
                  if(false == DoCustomValidationforconfirmpassword())
                  {
                      //alert('The Password and Confirm password do not match!'); 
                      //document.getElementById('confpassword').focus(); 
                      error += mem_pass_not_match +'\r\n'; 
                      if(foc==1)
                      {
                        focus='confpassword';
                        foc=0;
                      }
                      finalresult=false;
                  }
              }
              else 
              { 
                    finalresult=true;
              }
                            
              if(error!='')
              {
                    alert(error);
                    var FocusControl = document.getElementById(focus);
                     FocusControl.focus();
                     return false;
              }
              //return finalresult;
              
              
        }  
        

     
      //frmvalidator.EnableOnPageErrorDisplaySingleBox();
      if(mem_generate_user=='false' && isedit!='yes')
      {
            frmvalidator.addValidation("username","req","Please enter Username.");
            frmvalidator.addValidation("username","alnum","Please enter valid Username.");  
            if(parseInt(mem_login_min_len)<=parseInt(mem_login_max_len))
           {
              frmvalidator.addValidation("username","minlen=mem_login_min_len","Min length  for Username is "+mem_login_min_len+".");  
              frmvalidator.addValidation("username","maxlen=mem_login_max_len","Max length for Username is "+mem_login_max_len+".");
           }
      }
      else if(mem_generate_user=='true')
      {    
           if(isedit!='yes')
           {
                frmvalidator.addValidation("gen_username","shouldselchk=on ","Please select Username generate.");   
           }
      
      } 
     
     
      //frmvalidator.addValidation("username","alpha","Alphabetic chars only");
      if(mem_generate_password=='false')
      {
        frmvalidator.addValidation("password","req",mem_pass_not_enter); 
           if(parseInt(mem_pass_min_len)<=parseInt(mem_pass_max_len))
          {
             
             frmvalidator.addValidation("password","minlen=mem_pass_min_len","Min length  for Password is "+mem_pass_min_len+".");
             frmvalidator.addValidation("password","maxlen=mem_pass_max_len","Max length  for Password is "+mem_pass_max_len+".");
          }
      }
       else if(mem_generate_password=='true')
      {
            if(isedit!='yes')
            {
                frmvalidator.addValidation("gen_password","shouldselchk=on ","Please select Password generate.");
            }
      }
       if(mem_generate_password=='false')
      {
        frmvalidator.addValidation("confpassword","req","Please enter confirm Password."); 
           if(parseInt(mem_pass_min_len)<=parseInt(mem_pass_max_len))
          {
             
             frmvalidator.addValidation("confpassword","minlen=mem_pass_min_len","Min length  for Confirm Password is "+mem_pass_min_len+".");
             frmvalidator.addValidation("confpassword","maxlen=mem_pass_max_len","Max length  for Confirm Password is "+mem_pass_max_len+".");
          }
      }
      
        if(totalproducts!=1)
         frmvalidator.addValidation("products","selone_radio","Please select product.");
           
           frmvalidator.addValidation("email","req","Please enter Email Address.");  
           frmvalidator.addValidation("email","maxlen=100","Max length for Email is 100.");
           frmvalidator.addValidation("email","email","Please enter valid Email Address.");

           frmvalidator.addValidation("fname","req","Please enter Firstname.");
           frmvalidator.addValidation("fname","maxlen=45",    "Max length for Firstname is 45.");
           
                                                                                                                       
           frmvalidator.addValidation("lname","req","Please enter Lastname.");
           frmvalidator.addValidation("lname","maxlen=45",    "Max length for lastName is 45.");
           
           frmvalidator.setAddnlValidationFunction("DoCustomValidation");

      
            var PersonalInfo = document.getElementById('personalInfoValidation');
            var isReqire=PersonalInfo.value;
   
                frmvalidator.addValidation("city","req","Please enter City.","document.getElementById('personalInfoValidation').value=='yes'");
                frmvalidator.addValidation("city","maxlen=45","Max length for City  is 45.","document.getElementById('personalInfoValidation').value=='yes'");
                
                frmvalidator.addValidation("state","dontselect=0","Please select State.","document.getElementById('personalInfoValidation').value=='yes'"); 
                frmvalidator.addValidation("country","dontselect=0","Please select County.","document.getElementById('personalInfoValidation').value=='yes'"); 
          
                frmvalidator.addValidation("zipcode","req","Please enter Zipcode.","document.getElementById('personalInfoValidation').value=='yes'");
 
                frmvalidator.addValidation("zipcode","alnum","Please enter valid Zipcode.","document.getElementById('personalInfoValidation').value=='yes'");
              
                
                frmvalidator.addValidation("address","maxlen=200",    "Max length for  Street Address is 200.","document.getElementById('personalInfoValidation').value=='yes'");
                
                
                frmvalidator.addValidation("phone","maxlen=45", "Max length for Phone is 45.","document.getElementById('personalInfoValidation').value=='yes'");
                
    
            var ShipingInfo = document.getElementById('shippingInfoValidation');
            var isReqireShiping=ShipingInfo.value;
            
                
                frmvalidator.addValidation("addressSHP","maxlen=200",    "Max length for  Street Address is 200.","document.getElementById('shippingInfoValidation').value=='yes'"); 
                  
                frmvalidator.addValidation("citySHP","req","Please enter Shipping City.","document.getElementById('shippingInfoValidation').value=='yes'");
                frmvalidator.addValidation("citySHP","maxlen=45","Max length for Shipping City  is 45.","document.getElementById('shippingInfoValidation').value=='yes'");
                                
                frmvalidator.addValidation("billing_country","dontselect=0","Please select Shipping County.","document.getElementById('shippingInfoValidation').value=='yes'"); 
                frmvalidator.addValidation("bllling_state","dontselect=0","Please select Shipping State.","document.getElementById('shippingInfoValidation').value=='yes'"); 
                
                frmvalidator.addValidation("zipcodeSHP","req","Please enter Shipping Zipcode.","document.getElementById('shippingInfoValidation').value=='yes'");
                
                frmvalidator.addValidation("zipcodeSHP","alnum","Please enter valid Shipping Zipcode.","document.getElementById('shippingInfoValidation').value=='yes'");
                
                
                frmvalidator.addValidation("phoneSHP","maxlen=45","Max length for Shipping Phone is 45.","document.getElementById('shippingInfoValidation').value=='yes'");
                
            
               // frmvalidator.addValidation("txtSecretCode","req","Please enter secret code.");  
                {/literal}{$controlvalidationresult}{literal};   
             function checkAgreement(product)
               {
                   //document.getElementById("modelpopup").style.display='';
                   // document.getElementById('ctl00_ContentPlaceHolder1_UpdateProgress1').style.display='';
                   //var ElementsToExclude="button,submit,radio,checkbox,select-one";
                   //var pFormName="frmsignup";
                   //EnabledDisableForm(pFormName,ElementsToExclude);
                     
                         
                      document.frmsignup.agreements[0].checked=true;
                   
                       var dataString = 'products='+ product;
                       var products=product;
                       
                       var web_url='{/literal}{$WEB_URL}{literal}';    
                       $j.ajax({
                           type: "POST",
                           url: web_url+"/includes/agreementavailable.php",
                           datatype: 'html',
                           data: dataString,
                           success: function(msg){
                                var alldata=msg;   
                                var array_val=alldata.split("[|||]");   
                                var agreementAvail=rtrim(ltrim(array_val[0])); 
                                var personalAddAvail=rtrim(ltrim(array_val[1]));
                                var shippingAddAvail=rtrim(ltrim(array_val[2]));  
                                
             
                                if(agreementAvail=='yes') 
                                 {
                                       frmvalidator.addValidation("agreements","shouldselchk=Agree","Please read the agreement and click on I Agree.");
                                       $j('#agreement').show();  
                                       $j('#dispAgree').show();
                                       $j('#agdisp').show();  
                                      
                                    
                                 }
                               else if(agreementAvail=='no')
                                {
                                       $j('#agreement').hide();  
                                       $j('#dispAgree').hide();  
                                       $j('#agdisp').hide();  
                                            
                                  }  
                              
                               if(personalAddAvail=='yes')
                                {
                                
                                    
                                      $j('#personalInfoValidation').val('yes');  
                                        
                                      $j('#street').show(); 
                                      $j('#citydiv').show();
                                      $j('#countrydiv').show();
                                      $j('#statediv').show();
                                      $j('#zipdiv').show();
                                      $j('#phonediv').show();
                                      
                                      $j('#personalInfo').show();  
                                      
                                      
                                    
                      
                      
                                }
                               if(personalAddAvail=='no')
                                {
                                      $j('#personalInfoValidation').val('no');  
                                      $j('#street').hide(); 
                                      $j('#citydiv').hide();
                                      $j('#countrydiv').hide();
                                      $j('#statediv').hide();
                                      $j('#zipdiv').hide();
                                      $j('#phonediv').hide();
                                      
                                      $j('#personalInfo').hide();  
                                      
                                
                                
                                }
                               
                               if(shippingAddAvail=='yes')
                               {
                               
                               
          
                  
                                    if(personalAddAvail=='no')
                                      {  
                                          $j('#samerec').show();
                                          $j('#ctl00_ContentPlaceHolder1_chkShp1').hide(); 
                                          $j('#asabove').hide();    
                                         
                                      }
                                    else if(personalAddAvail=='yes')
                                      {
                                          $j('#samerec').show(); 
                                          $j('#ctl00_ContentPlaceHolder1_chkShp1').show(); 
                                          $j('#asabove').show();
                                         
                                      }
                                    
                                     $j('#streetSHP').show(); 
                                     $j('#citydivSHP').show();   
                                     $j('#countrydivSHP').show(); 
                                     $j('#statedivSHP').show(); 
                                     $j('#zipdivSHP').show();     
                                     $j('#phonedivSHP').show();  
                                    
                                      $j('#shippingInfoValidation').val('yes');   

                                      
                               
                               } 
                               if(shippingAddAvail=='no')
                                {
                               
              
                                     $j('#samerec').hide(); 
                                     $j('#streetSHP').hide(); 
                                     $j('#citydivSHP').hide();   
                                     $j('#countrydivSHP').hide(); 
                                     $j('#statedivSHP').hide(); 
                                     $j('#zipdivSHP').hide();     
                                     $j('#phonedivSHP').hide();  
                                     
                                     $j('#shippingInfoValidation').val('no');   
                                
                                }         

                             
                             
                           }
                     
                     
                       });  
                        
                 
                 
               
               }
               
              function EnabledDisableForm(pFormName, ElementsToExclude)
                   {
                          var mySplitResult = ElementsToExclude.split(","); 
                          var frm=document.getElementById(pFormName);
                          for (i=0; i<frm.length; i++)
                            {            
                                        doc = frm.elements[i]; 
                                        var type = doc.type;
                                        for(j = 0; j < mySplitResult.length; j++){
                                            if(mySplitResult[j]==type)
                                            {
                                                 doc.disabled=true;
                                                 if(mySplitResult[j]=="button" || mySplitResult[j]=="submit")
                                                  {
                                                     doc.className='btndisabled';
                                                  }  
                                               }
                                        }
                                 
                                  }
                                  
                           return true;               
                       
                   } 
                   
                 
               
              
               
          

</script>
{/literal}
{literal} 
    
<script language="JavaScript" type="text/javascript">
$j(document).ready(function(){  
        
        var is_postback='{/literal}{$is_postback}{literal}'; 
        if(is_postback=='yes')
         {
         
           val_selected_pro=$j("#frmsignup input[name=products]");
           slected=0;
           for (i = 0; i < val_selected_pro.length; i++)
              if (val_selected_pro[i].checked){
                 slected=val_selected_pro[i].value ;
              }

            checkAgreement(slected);
            onCountryChange();
            shipping_st();
          
         }
        
   
     
        var totalproduct='{/literal}{$totalProducts}{literal}';
          if(totalproduct==1) 
                checkAgreement({/literal}{$products[0].id}{literal})
       });  
                     
            function ShippingCheckBoxChecked()
             {
             
                 var Chk = document.getElementById('ctl00_ContentPlaceHolder1_chkShp');

                 if (Chk)
                 {
                 
                 if (document.getElementById('address') && document.getElementById('addressSHP'))
                 {
                     if (Chk.checked == true)
                     {
                        document.getElementById('addressSHP').value= document.getElementById('address').value;
                     }
                     else
                     {
                       document.getElementById('addressSHP').value='';
                     }
                 }
                  if (document.getElementById('city') && document.getElementById('citySHP'))
                   {
                      if (Chk.checked == true)
                      {
                          document.getElementById('citySHP').value= document.getElementById('city').value;
                       }
                     else
                     {
                        document.getElementById('citySHP').value='';
                      }
                  }
                  
                 if (document.getElementById('country') && document.getElementById('billing_country'))
                 {
                     if (Chk.checked == true)
                     {
                       var selected= document.getElementById('country').selectedIndex;
                       document.getElementById('billing_country').selectedIndex=selected;
                     
                     }
                     else
                     {
                      document.getElementById('billing_country').selectedIndex=0;
                     }
                 }

                 if (document.getElementById('zipcode') && document.getElementById('zipcodeSHP'))
                 {
                     if (Chk.checked == true)
                     {
                       document.getElementById('zipcodeSHP').value= document.getElementById('zipcode').value;
                     }
                     else
                     {
                       document.getElementById('zipcodeSHP').value='';
                     }
                }
                 if (document.getElementById('phone') && document.getElementById('phoneSHP'))
                 {
                     if (Chk.checked == true)
                     {
                        document.getElementById('phoneSHP').value= document.getElementById('phone').value;
                     }
                     else
                     {
                         document.getElementById('phoneSHP').value='';
                     }
                 }
                 
                 }
                  if (document.getElementById('state') && document.getElementById('bllling_state'))
                   {
                    if (Chk.checked == true)
                    {
                       
                       var selected1= document.getElementById('state').selectedIndex;
                       //if(selected1>0)
                       document.getElementById('bllling_state').selectedIndex=0;
                         shipping_st();
                       //document.getElementById('stateSHP').selectedIndex=selected1;
                      
                       
                       
                     }
                     else
                     {
                        document.getElementById('bllling_state').selectedIndex=0;
                         shipping_st();
                     }
                   }
       } 
 
 
         
    </script>  
  
    
{/literal}
{foreach from=$post key=k item=v}
   {* {$k}=>{$v} *}
   {literal} 
    <script language="JavaScript" type="text/javascript"> 
   $j(document).ready(function(){     
      var key='{/literal}{$k}{literal}';
      var val='{/literal}{$v}{literal}';
      var ele=$j("#" + key).attr("type");

      if(ele=='text')
       {
        $j("#" + key).val(val);
       
       } 
        if(ele=='select-one')
       {
         $j("#" + key).val(val);
       
       }  
       if(ele=='hidden')
       {
         $j("#" + key).val(val);
       } 
     });  
   </script>    
   {/literal}
{/foreach}
Return current item: MembersGear