<?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'); ?>
<script language="javascript" type="text/javascript">
 $(document).ready(function()
  {
   $('#NewsletterFname').focus();
  });
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 fcs_fld=new Array();		
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;   /* For Email Address*/
		
		
		if ($.trim($('#NewsletterFname').val())=='') { errorstr += "- Please enter Your First Name.\n";   fcs_fld[i]='NewsletterFname'; i++;}		
		if ($.trim($('#NewsletterLname').val())=='') { errorstr += "- Please enter Your Last Name.\n";   fcs_fld[i]='NewsletterLname'; i++;}
		
		if ($.trim($('#NewsletterEmail').val())=='') { errorstr += "- Please enter Your Email Address.\n";   fcs_fld[i]='NewsletterEmail'; i++;}
		if ($.trim($('#NewsletterEmail').val())!='') 
		{
		 if(reg.test($.trim($('#NewsletterEmail').val())) == false) { errorstr += "- Please enter a valid Email Address.\n";   fcs_fld[i]='NewsletterEmail'; i++;}
		}	
	
	if (errorstr != '')
	{
		msgstr = msgstr + errorstr;
		alert(msgstr);
		$('#'+fcs_fld[0]+'').focus();$('#'+fcs_fld[0]+'').select();
		return false;
	}
	else
	{
		thisform.submit();
		return true;
	}
}
</script>
<div align="left" class="main_body">
		<!--mainbody area start -->		

		<div  class="loginbg_signup">
					<div class="login_userbox">
					<?php echo $form->create('Newsletter', array('action' => 'subscribe','name' =>'Newsletter')); ?>
					<div>
							<div class="loginhead_admin">Newsletter</div>
							<div class="invalid_user">
				          <?php $session->flash(); ?></div>
							<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
					  </div>							
<div style="padding-left:200px;"><?php if($session->check('Message.flash')) { ?><font color="#FF0000"><?php $session->flash(); ?></font><br /><?php } ?></div>          
<div align="left" class="inner_content_area">
						   <div align="right" id="inner_rightcontent">						    
						       <span class="toplinks">
							   <?php echo $form->input('fname', array('label' => '','class' => 'box2_admin','size' => 27 )); ?>						      
						       </span>					      
					       </div>
		
								  
			<div align="left" id="login_leftcontent">
				  <p class="maintext_admin">First Name *</p> 
				</div>
				<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				
				 <div align="right" id="inner_rightcontent">
						    
						       <span class="toplinks">
							   <?php echo $form->input('lname', array('label' => '','class' => 'box2_admin','size' => 27 )); ?>
						       
						       </span>					       
					       </div>
				
			<div align="left" id="login_leftcontent">
				  <p class="maintext_admin">Last Name*</p> 
				</div>
				<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
						   
						   <div align="right" id="inner_rightcontent">
						    
						       <span class="toplinks">
							   <?php echo $form->input('email', array('label' => '','class' => 'box2_admin','maxlength' => 35 )); ?>						      
						       </span>					       
					       </div>
			<div align="left" id="login_leftcontent">
				  <p class="maintext_admin">Email</p> 
				</div>  
						   <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
						   
						 
				 <div align="right" id="inner_rightcontent">
						   
						       <span class="toplinks">
							   <input type="submit" class="buttn_admin" value="Subscribe" onClick="return chk(document.Newsletter);">
						      
						       </span><span class="maintext_admin"><input type="button" class="buttn_admin" value="Cancel" onClick="javascript:history.go(-1);">			         
			                   </span>
			              
					       </div>
		
			    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
		
			<!--form area end -->
                         </div>
								<div align="left" class="float_clear1"></div>
					 <?php echo $form->end(); ?>
				  </div>
				  
						<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
		</div>
		</div>