<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>Welcome to Sounit. free group texting.</title>
    <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
    <link rel="stylesheet" type="text/css" href="<?=base_url()?>css/style.css">
	<script type="text/javascript">
<!--
var letters=' ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
var numbers='1234567890'
var signs=',.:;@-\''
var mathsigns='+-=()*/'
var custom='<>#$%&?'
var none = ''
 
function alpha(e,allow) {
     
	 var k;
     k=document.all?parseInt(e.keyCode): parseInt(e.which);
     //alert(k);
	 if(k==8 || k==8)
	 return true;
	 else
	 return (allow.indexOf(String.fromCharCode(k))!=-1);
}

// -->
</script>

</head>
<body>
    <div align="center">
        <table border="0" cellspacing="0" cellpadding="0" width="1216">
<tr><td>
<? $this->load->view('header1'); ?>
</td></tr>

              <tr>
                <td align="center"><table border="0" cellspacing="0" cellpadding="0" width="1150px"><tr><td valign="top">
                    <table border="0" cellspacing="0" cellpadding="0" class="boxtop">
                        <tr>
                            <td valign="top">
							
<script>
function Inint_AJAX() {
   try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {} //IE
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE
   try { return new XMLHttpRequest();          } catch(e) {} //Native Javascript
   alert("XMLHttpRequest not supported");
   return null;
};

							
function checkAvb(f,div,val) {
	
	if(val.length>1)
	{
     var req = Inint_AJAX();
     req.onreadystatechange = function () { 
          if (req.readyState==4) {
               if (req.status==200) {
                    document.getElementById(div).innerHTML=req.responseText;
               } 
          }
     };
     req.open("GET", "<?=base_url()?>welcome/checkavb/"+f+"/"+div+"/"+val+"/"); 
	 
     req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
     req.send(null); 
	}
}

							</script>
                                <table class="textheading" border="0" cellspacing="0" cellpadding="0">
                                   
<script>

		function validateEmpty(fld,dfn) {
		var error = "";	

		
						 
		if(fld)
			if (fld.value.length == 0 )
			{
				error = "Field is empty : "+ dfn +"\n"
		    }
			return error; 
		}

		function checkForm()
			{
					var reason='';
					
					if(document.getElementById('password').value!=document.getElementById('rpassword').value || document.getElementById('password').value=='')
				{
					document.getElementById('password').value='';
					document.getElementById('rpassword').value=''
					reason = "Fields `Password` and `Retype Password` do not match"+"\n";
			   	}
		   	
					reason +=validateEmpty(document.getElementById('fullname'),'Full Name');
					reason +=validateEmpty(document.getElementById('username'),'Username');
					reason +=validateEmpty(document.getElementById('email'),'Email address');
					reason +=validateEmpty(document.getElementById('password'),'Password');
					reason +=validateEmpty(document.getElementById('rpassword'),'Retype Password');
					reason +=validateEmpty(document.getElementById('number'),'Mobile Number');
					

					
					if(reason !="")
						{
							alert("Error\n---------------------------------------------------------------\n" +reason);
							return false;	
						}
					else
						{
							document.getElementById('myform').submit();
						}
			}
			

</script>									
									
<form method="post" name="signup" action="<?=base_url();?><?=index_page();?>/welcome/signup/" onSubmit="return checkForm();" />
<input type="hidden" value="<?= (isset($membertype)?$membertype:1) ?>" name="membertype">
                                    <tr>
                                        <td  valign="top">
                                            Full name:
                                        </td>
                                        <td class="hspacing">
                                        </td>
                                        <td>
                                             <strong>&nbsp;&nbsp;&nbsp;&nbsp;</strong><input type="text" class="txtbox1" name="fullname" id="fullname" />
											 
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="spacing">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td valign="top">
                                            Username:
                                        </td>
                                        <td class="hspacing">
                                        </td>
                                        <td>
                                             <strong>&nbsp;&nbsp;&nbsp;&nbsp;</strong><input type="text" class="txtbox1" name="username" id="username"  onKeyUp="checkAvb('username','d1',this.value);"   />
											
											 <div id="d1"></div>
											 
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="spacing">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td  valign="top">
                                            Email:
                                        </td>
                                        <td class="hspacing">
                                        </td>
                                        <td>
                                            <strong>&nbsp;&nbsp;&nbsp;&nbsp;</strong><input type="text" class="txtbox1" name="email" id="email"  onKeyUp="checkAvb('email','d2',this.value);" />
 											
											 <div id="d2"></div>
                                       </td>
                                    </tr>
                                    <tr>
                                        <td class="spacing">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Password:
                                        </td>
                                        <td class="hspacing">
                                        </td>
                                        <td>
                                            <strong>&nbsp;&nbsp;&nbsp;&nbsp;</strong><input type="password" class="txtbox1" name="password" id="password" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="spacing">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Retype Password:
                                        </td>
                                        <td class="hspacing">
                                        </td>
                                        <td>
                                            <strong>&nbsp;&nbsp;&nbsp;&nbsp;</strong><input type="password" class="txtbox1" name="rpassword" id="rpassword" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="spacing">
                                        </td>
                                    </tr>

                                    <tr>
                                        <td valign="top">
                                            Mobile:
                                        </td>
                                        <td class="hspacing">
                                        </td>
                                        <td>
                                            <strong>+1</strong><input type="text" class="txtbox1" name="number"  onkeypress="return alpha(event,numbers)"  onKeyUp="checkAvb('number','d3',this.value);" maxlength="10" id="number"/>
											 <br>
											 <div id="d3"></div>
                                        </td>
                                    </tr>
									<tr><td colspan="3">
											<small style="font-size:12px">E.g. (+1)9163204455</small>
									</td></tr>
                                    <tr>
                                        <td class="spacing">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3" align="right">
                                            <table border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td>
                                                     <?php /*?>   <a href="<?=base_url();?><?=index_page();?>/welcome/signup/">
														</a><?php */?>
                                                          <input type="image" src="<?=base_url()?>images/btnsignup.jpg" onClick="signup.submit"> 
														
                                                    </td>
                                                    <td class="hspacing">
                                                    </td>
                                                    <td>
                                                        <?php /*?><a href="#">
                                                            <img src="<?=base_url()?>images/btnreset.jpg" /></a><?php */?>
															<input type="image" src="<?=base_url()?>images/btnreset.jpg" onClick="signup.reset"> 
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
</form>
                                    <tr>
                                        <td class="spacing1">
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
                <td align="left">
<form  method="post" name="login" action="<?=base_url();?>welcome/login/">
                    <table border="0" cellspacing="0" cellpadding="0" class="boxbottom">
                        <tr>
                            <td valign="top" align="left"><table class="textheading" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td >
                                        Username/E-mail or Phone:<br>
										<font color="#CCCCCC"><small>(e.g. 9163203245)</small></font>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input type="text" class="txtbox" name="email" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="spacing">
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Password:
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input type="password" class="txtbox" name="password" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="spacing">
                                    </td>
                                </tr> 
								<tr>
                                                    <td class="spacing1">
                                                    </td>
                                                </tr>
                                <tr>
                                    <td>
                                      <?php /*?>  <a href="#">
                                            <img src="<?=base_url()?>images/btnlogin.jpg" /></a><?php */?>
											<input type="image" name="login" src="<?=base_url()?>images/btnlogin.jpg" onClick="login.submit" >
                                    </td>
                                </tr>
                                <tr>
                                    <td class="spacing1">
                                    </td>
                                </tr>
								
								 <tr>
                                                    <td class="spacing1">
                                                    </td>
                                                </tr>
                                <tr>
                                    <td class="pwd">
                                        <a href="<?=base_url()?>index.php/welcome/forgot_password/ ">Forgot or Reset Password?</a>
                                    </td>
                                </tr>
                             </table></td></tr>
							 
					</table>
</form>  
                           
							</td>
                        </tr>
                    </table>
                </td></tr></table></td>
            </tr>
        </table>  
		<table width="100%">
		<tr>
		<td valign="bottom">
		<? $this->load->view('footer1'); ?>
		</td></tr></table>

    </div>
</body>
</html>
