	function login_validation() {
	if (document.form2.username.value=="") {
		document.getElementById("spp_username").style.display="";
		document.getElementById("username").focus();
		return false;
	} else {
		document.getElementById("spp_username").style.display="none";
	} 
	/*if (document.form1.email_id.value!=document.form1.email_id2.value) {
		document.getElementById("sp_email_id2").style.display="";
		return false;
	} else {
		document.getElementById("sp_email_id2").style.display="none";
	}*/
	if (document.form2.password.value=="") {
		document.getElementById("spp_password").style.display="";
		document.getElementById("password").focus();
		return false;
	} else {
		document.getElementById("spp_password").style.display="none";
	} 
	return true;
}

function deletebooking() {
	if(confirm('Are you sure you want to delete your entire booking?'))
	{
		document.form1.action="update_profile.php?action=delete";
		document.form1.submit();
		}
}
function valid_form() {
	if (document.form1.first_name.value=="")  {
		document.getElementById("sp_first_name").style.display="";
		document.getElementById("first_name").focus();
		return false;
	} else {
		document.getElementById("sp_first_name").style.display="none";
	}
	if (document.form1.last_name.value=="") {
		document.getElementById("sp_last_name").style.display="";
		document.getElementById("last_name").focus();
		return false;
	} else {
		document.getElementById("sp_last_name").style.display="none";
	}
	if (document.form1.email_id.value=="" || !check_email(document.form1.email_id)) {
		document.getElementById("sp_email_id").style.display="";
		document.getElementById("email_id").focus();
		return false;
	} else {
		document.getElementById("sp_email_id").style.display="none";
	}
	if (document.form1.email_id2.value=="" || !check_email(document.form1.email_id2)) {
		document.getElementById("sp_email_id2").style.display="";
		document.getElementById("email_id2").focus();
		return false;
	} else {
		document.getElementById("sp_email_id2").style.display="none";
	}
	if (document.form1.email_id.value!=document.form1.email_id2.value) {
		document.getElementById("sp_email_id2").style.display="";
		return false;
	} else {
		document.getElementById("sp_email_id2").style.display="none";
	}
	if (document.form1.password.value=="") {
		document.getElementById("sp_password").style.display="";
		document.getElementById("password").focus();
		return false;
	} else {
		document.getElementById("sp_password").style.display="none";
	} 
	if (document.form1.phone.value=="" || !isNumeric(document.form1.phone)) {
		document.getElementById("sp_phone").style.display="";
		document.getElementById("phone").focus();
		return false;
	} else {
		document.getElementById("sp_phone").style.display="none";
	} 
	return true;
}
function check_email(field) {
if (field.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) { 
	
	return true
} else {
	
	return false
}
} 
function isNumeric(elem, helperMsg){
	var numericExpression = /^[0-9]+$/;
	///(^\d{5}-\d{7}-\d{1}$)/;
	if(elem.value.match(numericExpression)){
		return true;
	}
	else{
		//alert(helperMsg);
		elem.focus();
		return false;
	}
}

//Add Row Function
function addtablerow() {
	var tbl=document.getElementById('table1');
	var lastRow=tbl.rows.length;
	var row = tbl.insertRow(lastRow);
	var cell_1 = row.insertCell(0);
	cell_1.innerHTML='<input type="hidden" name="sub_id[]" value="'+lastRow+'">'+'<input type="text" name="first_name1[]" size="20" maxlength="20" id="first_name'+lastRow+'"> ';
	var cell_2 = row.insertCell(1);
	cell_2.innerHTML='<input type="text" name="last_name1[]" size="20" maxlength="20" id="last_name'+lastRow+'"> ';
	var cell_3 = row.insertCell(2);
	cell_3.innerHTML="<br> <a href='javascript:void(0)' onClick='deleteRow(this.parentNode.parentNode.rowIndex)'>Delete<\/a>";
	
	

}


function deleteRow(i){
    document.getElementById('table1').deleteRow(i)
}

//-----------------------------------
<!-- 	
// by Nannette Thacker
// http://www.shiningstar.net
// This script checks and unchecks boxes on a form
// Checks and unchecks unlimited number in the group...
// Pass the Checkbox group name...
// call buttons as so:
// <input type=button name="CheckAll"   value="Check All"
	//onClick="checkAll(document.myform.list)">
// <input type=button name="UnCheckAll" value="Uncheck All"
	//onClick="uncheckAll(document.myform.list)">
// -->

<!-- Begin
function checkAll(field)
{
for (i = 0; i < document.getElementById('counter').value; i++)
document.getElementById('list'+i).checked = true ;
}

function uncheckAll(field)
{
for (i = 0; i < document.getElementById('counter').value; i++)
document.getElementById('list'+i).checked = false ;
}

function checkBoxes()
{
	var checked;
checked=false;	
for (i = 0; i < document.getElementById('counter').value; i++){
if (document.getElementById('list'+i).checked == true)
 checked=true;
 }
 if(checked==false)
 {
	 alert('Atleast one member must be selected');
	 return false;
 }
 else
  return true;
}

//  End -->

//////xxxxxxxxxxxxxxxxxx//////