function validate_recommend()
{ 
	var d = document.add_form;

	if (d.sender_id.value=="")
	{
		alert("Please enter your email");
		d.sender_id.focus();
        return false;
	}

	if(d.sender_id.value.indexOf('@')==-1 || d.sender_id.value.indexOf('.')==-1 || d.sender_id.value.indexOf('a-z')==1 || d.sender_id.value.indexOf('0-9')==1)
	{
		alert("Please enter the valid email address");
		d.sender_id.focus();
		return false;
	}

	if (d.sender_name.value=="")
	{
		alert("Please enter your name");
		d.sender_name.focus();
        return false;
	}

	if (d.reciever_id.value=="")
	{
		alert("Please enter your friend's email");
		d.reciever_id.focus();
        return false;
	}

	if(d.reciever_id.value.indexOf('@')==-1 || d.reciever_id.value.indexOf('.')==-1 || d.reciever_id.value.indexOf('a-z')==1 || d.reciever_id.value.indexOf('0-9')==1)
	{
		alert("Please enter the valid email address");
		d.reciever_id.focus();
		return false;
	}

	if (d.reciever_name.value=="")
	{
		alert("Please enter your friend's name");
		d.reciever_name.focus();
        return false;
	}

}
function validate_profile_Personal()
{ 
	if (document.add_form.fname.value=="")
	{
		alert("Please enter your name");
		document.add_form.fname.focus();
        return false;
	}

	if (document.add_form.lname.value=="")
	{
		alert("Please enter your last name");
		document.add_form.lname.focus();
        return false;
	}

	if (document.add_form.mobile.value=="")
	{
		alert("Please enter your mobile");
		document.add_form.mobile.focus();
        return false;
	}
	if (isNaN(document.add_form.mobile.value))
	{
		alert("Only numerics allowed");
		document.add_form.mobile.focus();
        return false;
	}

	if (document.add_form.email.value=="")
	{
		alert("Please Enter the email")
		document.add_form.email.focus();
		return false;
	}

	var d = document.add_form;
	if(d.email.value.indexOf('@')==-1 || d.email.value.indexOf('.')==-1 || d.email.value.indexOf('a-z')==1 || d.email.value.indexOf('0-9')==1)
	{
		alert("Please enter the valid email address");
		d.email.focus();
		return false;
	}

}


function change_pass()
{ 
	if (document.add_form.pass.value=="")
	{
		alert("Please enter your mew password");
		document.add_form.pass.focus();
        return false;
	}
	if (document.add_form.cpass.value=="")
	{
		alert("Please enter the same password to comfirm");
		document.add_form.cpass.focus();
        return false;
	}
	if (document.add_form.pass.value!=document.add_form.cpass.value)
	{
		alert("both the passwords must be same");
		document.add_form.pass.focus();
		document.add_form.pass.value="";
		document.add_form.cpass.value=""
        return false;
	}
}
function validate_members()
{ 
	if (document.add_form.name.value=="")
	{
		alert("Please enter your name");
		document.add_form.name.focus();
        return false;
	}
	if (document.add_form.email.value=="")
	{
		alert("Please enter your email");
		document.add_form.email.focus();
        return false;
	}
	if (document.add_form.mobile.value=="")
	{
		alert("Please enter your mobile");
		document.add_form.mobile.focus();
        return false;
	}
	if (isNaN(document.add_form.mobile.value))
	{
		alert("Only numerics allowed");
		document.add_form.mobile.focus();
        return false;
	}
	if (document.add_form.cmobile.value=="")
	{
		alert("Please enter your mobile no again to confirm");
		document.add_form.cmobile.focus();
        return false;
	}
	if (isNaN(document.add_form.cmobile.value))
	{
		alert("Only numerics allowed");
		document.add_form.cmobile.focus();
        return false;
	}
	if (document.add_form.mobile.value!=document.add_form.cmobile.value)
	{
		alert("both mobile nos must be same");
		document.add_form.mobile.focus();
		document.add_form.mobile.value="";
		document.add_form.cmobile.value=""
        return false;
	}
}

function validate_category()
{ 
	if (document.add_form.cat.value=="")
	{
		alert("Please enter the category name");
		document.add_form.cat.focus();
        return false;
	}
}

function validate_admin()
{ 
	if (document.add_form.username.value=="")
	{
		alert("Please the username");
		document.add_form.username.focus();
        return false;
	}
	if (document.add_form.password.value=="")
	{
		alert("Please enter password");
		document.add_form.password.focus();
        return false;
	}
	if (document.add_form.cpassword.value=="")
	{
		alert("Please enter your password again to confirm");
		document.add_form.cpassword.focus();
        return false;
	}
	if (document.add_form.password.value!=document.add_form.cpassword.value)
	{
		alert("both passwrods must be same");
		document.add_form.password.focus();
		document.add_form.password.value="";
		document.add_form.cpassword.value=""
        return false;
	}

}
function validate_sms()
{ 
//alert(document.add_form.sms.value);
	if (document.add_form.cat_id.value=="")
	{
		alert("Please select the category");
		document.add_form.cat_id.focus();
        return false;
	}
	if (document.add_form.title.value=="")
	{
		alert("Please enter the sms title");
		document.add_form.title.focus();
        return false;
	}
//var EditorInstance = FCKeditorAPI.GetInstance(document.add_form.sms.value) ; //message is name of field to be validate
if(document.add_form.sms.EditorDocument.body.innerText.length<=0)
{
alert("This firld is mandatory");
document.add_form.sms.EditorDocument.body.focus();
return false;
}
}

function store_add_subproduct()
{
//alert("hello");	
if(document.getElementById('product_name').value=="0")
{
alert("please select Product name.");
document.frm.prodiuct_name.focus();
return false;
}
if(document.getElementById('inctype').value=="")
{
alert("please enter product type.");
document.frm.inctype.focus();
return false;
}
if(document.getElementById('price').value=="")
{
alert("please enter price.");
document.frm.price.focus();
return false;
}
else
{
document.frm.action="store_add_subproduct.php";	
document.frm.submit();
}


}
function validate_store_delete()
{
document.frm.action="store_delete.php";
document.frm.submit();

}

function validate_store_back()
{
window.location="inner.php?name=test&work=admin_store";	

}
///////////////////// for international - delete page
function validate_int_store_delete()
{
document.frm.action="store_int_delete.php";
document.frm.submit();

}

function validate_int_store_back()
{
window.location="inner.php?name=test&work=admin_international_store";	

}
///////////////////////for international - delete page ends
function validate_store_edit()
{
	//var name=document.getElementById('pimage').value;
if(document.getElementById('pname').value=="")
{
alert("enter product Name.");	
document.frm.pname.focus();

}
if(document.getElementById('pimage').value=="")
{
document.frm.action="store_edit.php";
document.frm.submit();

}
else
{

var photo=document.getElementById('pimage').value;
var ext=fileExt=photo.split(".");
 if(fileExt[1]=='jpg' || fileExt[1]=='gif' || fileExt[1]=='jpeg' || fileExt[1]=='png')
	{
document.frm.action="store_edit.php";
document.frm.submit();
	}
else
{
alert("enter valid image type.");	
document.frm.pimage.focus();

}
}
return ;
//alert(name);
}
///////////////////////////////
function validate_int_store_edit()
{
	//var name=document.getElementById('pimage').value;
if(document.getElementById('pname').value=="")
{
alert("enter product Name.");	
document.frm.pname.focus();

}
if(document.getElementById('pimage').value=="")
{
document.frm.action="store_int_edit.php";
document.frm.submit();

}
else
{

var photo=document.getElementById('pimage').value;
var ext=fileExt=photo.split(".");
 if(fileExt[1]=='jpg' || fileExt[1]=='gif' || fileExt[1]=='jpeg' || fileExt[1]=='png')
	{
document.frm.action="store_int_edit.php";
document.frm.submit();
	}
else
{
alert("enter valid image type.");	
document.frm.pimage.focus();

}
}
return ;
//alert(name);
}
///////////////////////////////

function validate_store_addnew()
{
if(document.getElementById('pname').value=="")
{
alert("enter product Name.");	
document.frm.pname.focus();
return false;
}
else if(document.getElementById('pimage').value=="")
{
alert("enter product image.");	
document.frm.pimage.focus();
return false;
}
var photo=document.getElementById('pimage').value;
var fileExt=photo.split(".");
 if(fileExt[1]=='jpg' || fileExt[1]=='gif' || fileExt[1]=='jpeg' || fileExt[1]=='png')
	{
document.frm.action="store_add_new.php";
document.frm.submit();
	}
else
{
alert("enter valid image type.");	
document.frm.pimage.focus();

}
return ;
//alert(name);
}
//////////////////
function validate_int_store_addnew()
{
if(document.getElementById('pname').value=="")
{
alert("enter product Name.");	
document.frm.pname.focus();
return false;
}
else if(document.getElementById('pimage').value=="")
{
alert("enter product image.");	
document.frm.pimage.focus();
return false;
}
var photo=document.getElementById('pimage').value;
var fileExt=photo.split(".");
 if(fileExt[1]=='jpg' || fileExt[1]=='gif' || fileExt[1]=='jpeg' || fileExt[1]=='png')
	{
document.frm.action="store_int_add_new.php";
document.frm.submit();
	}
else
{
alert("enter valid image type.");	
document.frm.pimage.focus();

}
return ;
//alert(name);
}
//////////////////

function delete_admin(id)
{
//alert(id);	
document.frm.action="delete_admin.php?of_id=" + id;
document.frm.submit();
return;
}

function save_link_content()
{
	if(document.getElementById('title').value=="")
{
alert("Enter Title");
document.getElementById('title').focus();
return false;
}
else if(document.getElementById('location').value=="")
{
alert("Enter Location");
document.getElementById('location').focus();
return false;
}

	document.frm.action="location_save.php";
	document.frm.submit();
	return;
//	alert(tab + " " + link1);
}

function admin_check()
{
var name=document.frm.name.value;
var password=document.frm.password.value;
if(name=="" || password=="")
{
alert("please enter name or password.");
document.frm.name.focus();
return false;
}
else
{
document.frm.action="admin_validation.php";	
document.frm.submit();
}
//return;
//password=document.getElementById("password");
//alter(name + " " + password);
//return;
}
function check_edit(id)
{
if(document.getElementById('title').value=="")
{
alert("Enter Title");
document.getElementById('title').focus();
return false;
}
else if(document.getElementById('name').value=="")
{
alert("Enter Name");
document.getElementById('Name').focus();
return false;
}

document.frm.action="night_club_edit.php?id=" + id;
document.frm.submit();
}
function check_back()
{
	
	window.location="inner.php?name=test&work=night_club";
//document.frm.action="back.php?name=" + id +"&work=create_tab";
//document.frm.submit();
//alert("hello" + id);
//return;
}
function check_delete(id)
{
//alert(id);	
document.frm.action="night_club_delete.php?id=" + id;
document.frm.submit();
//return;
}
function check()
{
//alert("hello");
	document.frm.action="admin_entety_save.php";
document.frm.submit();
	
}
function night_club_add()
{
if(document.getElementById('title').value=="")
{
alert("Enter Title");
document.getElementById('title').focus();
return false;
}
else if(document.getElementById('name').value=="")
{
alert("Enter Name");
document.getElementById('Name').focus();
return false;
}
document.frm.action="night_club_save.php";
document.frm.submit();
}