<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: 			*/
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004-2010 ARMIA INC                                    |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts VistaCart                     |
// +----------------------------------------------------------------------+
// | Authors: Jipson<jipson.thomas@armiasystems.com>             		  |
// +----------------------------------------------------------------------+
?>
<?php	echo $javascript->link('jquery.js'); ?>
<?php	echo $javascript->link('alphanumeric.js'); ?>
<script>
$(document).ready(function() 
{
   var dflt_bcntry=$.trim($('#UserBcountry').val());
   setBillStates(dflt_bcntry);
   var dflt_scntry=$.trim($('#UserScountry').val());
   setShipStates(dflt_scntry);

});
</script>
<script language="javascript" type="text/javascript">

function chk(thisform){
	    var errorstr = '';
		var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";
		var i=0;
		var flag=0;
		var fcs_fld=new Array();
		var illegalChars = /\W/; /* For User name validtion*/
		var illegalChars1 = /[\W_]/;  /* For Password validtion*/
	    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;   /* For Email Address*/


		if ($.trim($('#UserUname').val())=='') { errorstr += "- Please Enter User Name.\n";  fcs_fld[i]='UserUname'; i++;}		
		if ($.trim($('#UserUname').val())!='') 
		{
         if ($.trim($('#UserUname').val()).length < 5) { errorstr += "- Username should contain atleast 5 characters.\n";   fcs_fld[i]='UserUname'; i++;}
		}		
		
		 var chk_uname=$.trim($('#UserUname').val());
		 if (chk_uname.indexOf(' ') != -1) 
         { errorstr += "- User Name cannot contain spaces.\n";  fcs_fld[i]='UserUname'; i++;}	
        
		//if (illegalChars.test($('#UserUname').val())) { errorstr += "- The username contains illegal characters.\n";   fcs_fld[i]='UserUname'; i++;}

		
		if ($.trim($('#UserEmail').val())=='') { errorstr += "- Please enter Email Address.\n";   fcs_fld[i]='UserEmail'; i++;}
		if ($.trim($('#UserEmail').val())!='') 
		{
		 if(reg.test($.trim($('#UserEmail').val())) == false) { errorstr += "- Invalid Email Address.\n";   fcs_fld[i]='UserEmail'; i++;}
		}		
		
		if ($.trim($('#UserPassword').val())=='')  { errorstr += "- Please enter Password.\n";  fcs_fld[i]='UserPassword'; i++;}				
		if ($.trim($('#UserPassword').val())!='') 
		{
         if ($.trim($('#UserPassword').val()).length < 6) { errorstr += "- Password should contain atleast 6 characters.\n";   fcs_fld[i]='UserPassword'; i++;}
		}
		
		/*
		if ($.trim($('#UserPassword').val()).length >= 6 ) {
		  if (illegalChars1.test($('#UserPassword').val())) { errorstr += "- The password should contain letters and numbers only.\n";   fcs_fld[i]='UserPassword'; i++;}
	    }	
		*/	
		
		if ($.trim($('#UserPassword').val()).length >= 6 && $.trim($('#UserPassword').val())!='') {
		if ($.trim($('#UserConpassword').val())=='') { errorstr += "- Please Confirm Password.\n";   fcs_fld[i]='UserConpassword'; i++;}
		}
		if ($.trim($('#UserConpassword').val())!='' ) {
		if ($.trim($('#UserPassword').val()) != $.trim($('#UserConpassword').val())) { errorstr += "- Password Mismatch.\n";  fcs_fld[i]='UserConpassword'; i++;}					
		}
		
		
		if ($.trim($('#UserBzip').val())!='' )
		 {
		   var bcntry=$.trim($('#UserBcountry').val());
		   var bzip=$.trim($('#UserBzip').val());
		   if(bcntry=='US') 
		   {
			   if(bzip.length < 5 || bzip.length > 5 )
			   {   errorstr += "- Billing Zip code should contain only 5 numeric digits.\n";fcs_fld[i]='UserBzip'; i++; }		
		   }	   			
		}
		
		  
		  var usrbphone=$.trim($('#UserBphone').val());
		  var usrbmobile=$.trim($('#UserBmobile').val());


		  var usrbfax=$.trim($('#UserBfax').val());
		  
		  if(usrbphone!='' )
		   {		  
		      if(verify(usrbphone)==false)
              { errorstr += "- Billing Phone number should contain only numbers, spaces, (, ), - and + \n";fcs_fld[i]='UserBphone'; i++;}
		   }	  
			if(usrbmobile!='' )
		   {
			  if(verify(usrbmobile)==false)
              { errorstr += "- Billing Mobile number should contain only numbers, spaces, (, ), - and + \n"; fcs_fld[i]='UserBmobile'; i++;}
		   }
		   
		   if(usrbfax!='' )
		   {	  
			  if(verify(usrbfax)==false)
              { errorstr += "- Billing Fax number should contain only numbers, spaces, (, ), - and + \n"; fcs_fld[i]='UserBfax'; i++;}
			}  

		
		if ($.trim($('#UserSzip').val())!='' )
		 {
		   var scntry=$.trim($('#UserScountry').val());
		   var szip=$.trim($('#UserSzip').val());
		   if(scntry=='US') 
		   {
			   if(szip.length < 5 || szip.length > 5)
			   {   errorstr += "- Shipping Zip code should contain only 5 numeric digits.\n";fcs_fld[i]='UserSzip'; i++; }		
		   }	   			
		}
		
		
		 var usrsphone=$.trim($('#UserSphone').val());
		 var usrsmobile=$.trim($('#UserSmobile').val());
		 var usrsfax=$.trim($('#UserSfax').val());
		  
		  if(usrsphone!='' )
		   {		  
		      if(verify(usrsphone)==false)
              { errorstr += "- Shipping Phone number should contain only numbers, spaces, (, ), - and + \n";fcs_fld[i]='UserSphone'; i++;}
		   }	  
			if(usrsmobile!='' )
		   {
			  if(verify(usrsmobile)==false)
              { errorstr += "- Shipping Mobile number should contain only numbers, spaces, (, ), - and + \n"; fcs_fld[i]='UserSmobile'; i++;}
		   }
		   
		   if(usrsfax!='' )
		   {	  
			  if(verify(usrsfax)==false)
              { errorstr += "- Shipping Fax number should contain only numbers, spaces, (, ), - and + \n"; fcs_fld[i]='UserSfax'; i++;}
			}  

		
	        
	
	if (errorstr != '')
	{
		msgstr = msgstr + errorstr;
		alert(msgstr);
		$('#'+fcs_fld[0]+'').focus();$('#'+fcs_fld[0]+'').select();
		return false;
	}
	else
	{
		thisform.submit();
		return true;
	}
} 

function verify(str) 
{
    return /^[0-9\-\s\)\(\+]{1,}$/.test(str);
}


function same(){	
	if($('#sameas').attr('checked')==true)
	{
	 $('#UserSfname').val($('#UserBfname').val());
	  $('#UserSlname').val($('#UserBlname').val());
	  $('#UserSaddress').val($('#UserBaddress').val());
	  $('#UserScountry').val($('#UserBcountry').val());

	  if($('#UserBcountry').val() == 'US')
	  {
	    $('#ship_us_states').show();
		$('#ship_otherstates').hide();
	    $('#us_sstate').val($('#us_bstate').val());
	  }
	  else
	  {	  
	    $('#ship_otherstates').show();$('#ship_us_states').hide();
	    $('#UserSstate').val($('#UserBstate').val());
	  }
	
	  $('#UserScity').val($('#UserBcity').val());
	  $('#UserSzip').val($('#UserBzip').val());
	  $('#UserSphone').val($('#UserBphone').val());
	  $('#UserSmobile').val($('#UserBmobile').val());
	  $('#UserSfax').val($('#UserBfax').val());
	}
	else
	{
			 
			  $('#UserSfname').val('');
			  $('#UserSlname').val('');
			  $('#UserSaddress').val('');
			  $('#UserScountry').val('US');
			  $('#UserScity').val('');
			  $('#UserSzip').val('');
			  $('#UserSphone').val('');
			  $('#UserSmobile').val('');
			  $('#UserSfax').val('');			
			  $('#ship_us_states').show();
			  $('#ship_otherstates').hide();
			  $('#us_sstate').val('AL');
	}
}
</script>
            <div align="center" class="subheading">
              <div align="left">Users</div>
            </div>
            <br />
  <?php if($session->check('Message.flash')) { ?><div id="okbox"><font color="#446423"><?php $session->flash(); ?></font></div><?php } ?>			
            <div align="left" id="item_details_admin">
              <!--items display area start -->
              <div align="center" id="items_display_area_admin">
                <div align="left" class="inner_content_area_admin">
                 <?php echo $form->create('User', array('name' =>'User')); ?>
                  <div id="admin_heading">Add User</div>
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">User Name  <span class="required_field">*</span> </p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     
                        <span class="toplinks">
						<?php echo $form->input('uname', array('label' => '', 'class' =>'box2_admin', 'size' => 27)); ?>
                      
                        </span>
                      
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
				  
				   <div id="grid_admin">
									<div align="left" id="inner_leftcontent">
									  <p class="maintext_inner">User Type<span class="required_field">*</span></p>
									</div>
									<div align="right" id="inner_rightcontent">
										<span class="toplinks">
											<?php 
															$utypes['wholesale']='wholesale';
															$utypes['retail']='retail';
															echo $form->input('usertype', array('options' => $utypes,'label' => '','class' => 'box2_admin')); ?>
										</span>							
									</div>
									<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
					  </div>
				
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Email  <span class="required_field">*</span></p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     <span class="toplinks">
						<?php echo $form->input('email', array('label' => '', 'class' =>'box2_admin', 'size' => 27)); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Password  <span class="required_field">*</span></p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     <span class="toplinks">
						<?php echo $form->input('password', array('label' => '', 'type' => 'password', 'class' =>'box2_admin', 'size' => 27 , 'maxlength' => 25)); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Confirm Password  <span class="required_field">*</span></p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<?php echo $form->input('conpassword', array('label' => '','type' => 'password', 'class' =>'box2_admin', 'size' => 27 , 'maxlength' => 25)); ?>                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Billing First Name</p> 
                    </div>
                    <div align="right" id="inner_rightcontent">
                     <span class="toplinks">
						<?php echo $form->input('bfname', array('label' => '', 'class' =>'box2_admin', 'size' => 27 , 
						'onKeyUp'=>'same()')); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Billing Last Name</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<?php echo $form->input('blname',array('label' => '', 'class' =>'box2_admin', 'size' => 27, 
						'onKeyUp'=>'same()')); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Billing Address</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     <span class="toplinks">
						<?php echo $form->input('baddress',array('rows' => '3','label' => '', 'class' =>'box2_admin', 'size' => 27, 
						'onKeyUp'=>'same()'));?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  
				  
				  
				  
				  
               
				  
				  
				  
				  
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Billing Country</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     <span class="toplinks">
						<?php echo $form->input('bcountry', array('options' => $countrylist,'label' => '','class' => 'box2_admin','selected' => 'US','onchange' => 'javascript:setBillStates(this.value)'));?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  
				  
				  
				   <div id="bill_us_states" style="display:none;">
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Billing State</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                    <span class="toplinks">
						<select class="box2_admin" name="data[User][us_bstate]" id="us_bstate" onChange="return same();">
													<?php
													foreach($us_states as $stval) { ?>
													<option value="<?php echo $stval["Statecode"]["code"];?>"><?php echo $stval["Statecode"]["name"];?></option>
													<?php } ?>
													</select>  
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  </div>
				  
				  
				  
				   <div id="bill_otherstates" style="display:none;"> 
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Billing State</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                    <span class="toplinks">
						<?php echo $form->input('bstate',array('label' => '', 'class' =>'box2_admin', 'size' => 27, 
						'onKeyUp'=>'same()'));?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  </div>
				  
				  
				  
				     <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Billing City</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<?php echo $form->input('bcity',array('label' => '', 'class' =>'box2_admin', 'size' => 27, 
						'onKeyUp'=>'same()')); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  
				  
				  
				  
				 
				  
				  
				  
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Billing Zip Code</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<?php echo $form->input('bzip',array('label' => '', 'class' =>'box2_admin', 'size' => 27, 
						'onKeyUp'=>'same()')); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  
				  
				  
				  
				  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Billing Phone</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<?php echo $form->input('bphone',array('label' => '', 'class' =>'box2_admin', 'size' => 27, 
						'onKeyUp'=>'same()')); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Billing Mobile</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<?php echo $form->input('bmobile',array('label' => '', 'class' =>'box2_admin', 'size' => 27, 
						'onKeyUp'=>'same()')); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Billing Fax</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<?php echo $form->input('bfax',array('label' => '', 'class' =>'box2_admin', 'size' => 27, 
						'onKeyUp'=>'same()')); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				   <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner"></p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<input type="checkbox" name="sameas" id="sameas" onClick="javascript:same();"class="box2_admin" style="width:auto; float:left;">  <p class="maintext_inner" style="margin-top:3px;">Same as Billing Address</p> 
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Shipping First Name</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     <span class="toplinks">
						<?php echo $form->input('sfname', array('label' => '', 'class' =>'box2_admin', 'size' => 27)); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Shipping Last Name</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<?php echo $form->input('slname',array('label' => '', 'class' =>'box2_admin', 'size' => 27)); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Shipping Address</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     <span class="toplinks">
						<?php echo $form->input('saddress',array('rows' => '3','label' => '', 'class' =>'box2_admin', 'size' => 27));?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  
				  
				  
				  
                
				  
				  
				  
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Shipping Country</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     <span class="toplinks">
						<?php echo $form->input('scountry', array('options' => $countrylist,'label' => '','class' => 'box2_admin','selected' => 'US','onchange' => 'javascript:setShipStates(this.value)'));?>
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  
				
				  
				  
				  <div id="ship_us_states">
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Shipping State</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                    <span class="toplinks">
						<select class="box2_admin"  name="data[User][us_sstate]"   id="us_sstate" >
												<?php
												foreach($us_states as $stval) { ?>
												<option value="<?php echo $stval["Statecode"]["code"];?>"><?php echo $stval["Statecode"]["name"];?></option>
												<?php } ?>
												</select> 
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  </div>
				  
				  
				  
				  
				   <div id="ship_otherstates">
				    <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Shipping State</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                    <span class="toplinks">
						<?php echo $form->input('sstate',array('label' => '', 'class' =>'box2_admin', 'size' => 27));?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  </div>
				  
				  
				    
				    <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Shipping City</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<?php echo $form->input('scity',array('label' => '', 'class' =>'box2_admin', 'size' => 27)); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  
				  
				  
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Shipping Zip Code</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<?php echo $form->input('szip',array('label' => '', 'class' =>'box2_admin', 'size' => 27)); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  
				  
				  
				  
				  
				  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Shipping Phone</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<?php echo $form->input('sphone',array('label' => '', 'class' =>'box2_admin', 'size' => 27)); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Shipping Mobile</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<?php echo $form->input('smobile',array('label' => '', 'class' =>'box2_admin', 'size' => 27)); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Shipping Fax</p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      <span class="toplinks">
						<?php echo $form->input('sfax',array('label' => '', 'class' =>'box2_admin', 'size' => 27)); ?>
                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                 <div id="admin_bottom">
				<div align="left" id="inner_leftcontent">
				  <p class="maintext_inner">&nbsp;</p>
				</div>
				<div align="right" id="inner_rightcontent">
					<span class="toplinks">		
					<input type="button" value="Save" onClick="return chk(document.User);" class="buttn_admin" >
					<input type="button" value="Cancel" onClick="javascript:history.go(-1);" class="buttn_admin" >
					
					</span>
				</div>
				<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
			</div>
                </div>
                <!--form area end -->
				<?php echo $form->end(); ?>
              </div>
              <div align="left" class="float_clear1"></div>
            </div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
			
			
<script type="text/javascript">
/*
$('#UserBzip').alphanumeric();
$('#UserBzip').numeric();
$('#UserSzip').numeric();
$('#UserBphone').numeric({allow:"(,),-,+"});
$('#UserBmobile').numeric({allow:"(,),-,+"});
$('#UserBfax').numeric({allow:"(,),-,+"});
$('#UserSphone').numeric({allow:"(,),-,+"});
$('#UserSmobile').numeric({allow:"(,),-,+"});
$('#UserSfax').numeric({allow:"(,),-,+"});
*/

function setBillStates(val)
{
  if(val=='US')
  {
    $('#bill_us_states').show();
	$('#bill_otherstates').hide(); 
  }	
  else
  {
    $('#bill_otherstates').show(); 
	$('#bill_us_states').hide();
  }	
  same();
}

function setShipStates(val)
{
  if(val=='US')
  {
    $('#ship_us_states').show();
	$('#ship_otherstates').hide(); 
  }	
  else
  {
    $('#ship_otherstates').show(); 
	$('#ship_us_states').hide();
  }	
}
</script>