<!--
//New Bingo Sites
function formValidation(f1){
	if(type=="Delete"){	
		answer=confirm('Are you sure you want to delete?');
		if(answer==0){
			window.location.href="newbingosites.php";
			return false;// change newbingosites name 
		}
		else{
			return true;
		}
	}
	else{
		if(notEmpty(f1.title,"Title")){
		if(notEmpty(f1.bannerurl,"Banner Image URL")){
		if(notEmpty(f1.desc,"Description")){
		if(notEmpty1(f1.content)){
		return true;
		}}}}
		return false;
	}
}

//Recommended Sites
function Recommended(f1){
	if(type=="Delete"){	
		answer=confirm('Are you sure you want to delete?');
		if(answer==0){
			window.location.href="recommendedsites.php";
			return false;
		}
		else{
			return true;
		}
	}
	else
	{	
		if(notEmpty(f1.title,"Title")){
		//if(notEmpty(f1.bannerurl,"Banner Image URL")){
		if(notEmpty(f1.playurl,"Play URL")){
		if(notEmpty(f1.desc,"Description")){
		return true;
		}}}//}
		return false;
	}
}

//Banners
function addbanner(f1){
	if(type=="Delete"){	
		answer=confirm('Are you sure you want to delete?');
		if(answer==0){
			window.location.href="banners.php";
			return false;
		}
		else{
			return true;
		}
	}
	else
	{
		if(notEmpty(f1.title,"Title")){
		if(notEmpty(f1.bannerurl,"Banner Image URL")){
		if(radioValidate(f1.position)){
		return true;
		}}}
		return false;
	}
}

//Bingo Reviews
function bingoreviews(f1){
	if(type=="Delete"){	
		answer=confirm('Are you sure you want to delete?');
		if(answer==0){
			window.location.href="bingoreviews.php";  
			return false;// change newbingosites name 
		}
		else{
			return true;
		}
	}
	else
	{	
		if(notEmpty(f1.title,"Title")){
		if(notEmpty(f1.bannerurl,"Banner Image URL")){
		if(notEmpty1(f1.content)){
		return true;
		}}}
		return false;
	}
}

//Bookmark
function bookmark(f1){
	if(type=="Delete"){	
		answer=confirm('Are you sure you want to delete?');
		if(answer==0){
			window.location.href="bookmark.php"; 
			return false;// change newbingosites name 
		}
		else{
			return true;
		}
	}
	else
	{
		if(notEmpty(f1.title,"Title")){
		if(notEmpty(f1.bannerurl,"Banner Image URL")){
		return true;
		}}
		return false;
	}
}

//Promotions
function promotions(f1){
	if(type=="Delete"){	
		answer=confirm('Are you sure you want to delete?');
		if(answer==0){
			window.location.href="promotions.php";   
			return false;// change newbingosites name 
		}
		else{
			return true;
		}
	}
	else
	{
		if(notEmpty(f1.title,"Title")){
		if(notEmpty(f1.bannerurl,"Banner Image URL")){
		if(notEmpty1(f1.content)){
		return true;
		}}}
		return false;
	}
}

//Site Of Month
function siteofmonth(f1){
	if(type=="Delete"){	
		answer=confirm('Are you sure you want to delete?');
		if(answer==0){
			window.location.href="siteofmonth.php";   
			return false;// change newbingosites name 
		}
		else{
			return true;
		}
	}
	else 
	{
		if(notEmpty(f1.title,"Title")){
		if(notEmpty(f1.bannerurl,"Banner Image URL")){
		if(notEmpty(f1.sdesc,"Description")){
		if(notEmpty1(f1.content)){	
		return true;
		}}}}
		return false;
	}
}

//Hororscope
function horoscope(f1){
	if(type=="Delete"){	
		answer=confirm('Are you sure you want to delete?');
		if(answer==0){
			window.location.href="horoscope.php";
			return false;// change newbingosites name 
		}
		else{
			return true;
		}
	}
	else
	{
		//if(notEmpty(f1.bannerurl,"Banner Image URL")){
		if(notEmpty1(f1.content)){
		return true;
		}//}
		return false;
	}
}

//Categories
function categories(f1){
	if(type=="Delete"){	
		answer=confirm('Are you sure you want to delete?');
		if(answer==0){
			window.location.href="addcategories.php";
			return false;
		}
		else{
			return true;
		}
	}
	else{
		if(notEmpty(f1.catname,"Category")){
		return true;
		}
		return false;
	}
}

//Tags
function tagValidation(f1){
	if(type=="Delete"){	
		answer=confirm('Are you sure you want to delete?');
		if(answer==0){
			window.location.href="addtags.php";
			return false;
		}
		else{
			return true;
		}
	}
	else{
		if(notEmpty(f1.tagname,"Tag Name")){
		return true;
		}
		return false;
	}
}

//News
function news(f1){
	if(type=="Delete"){	
		answer=confirm('Are you sure you want to delete?');
		if(answer==0){
			return false;
			window.location.href="news.php"; 
			return false;// change newbingosites name 
		}
		else{
			return true;
		}
	}
	else
	{
		if(notEmpty(f1.title,"Title")){
		if(notEmpty1(f1.content)){
		return true;
		}}
		return false;
	}
}

//News Email
function emailValidate(f1){
if(notEmpty(f1.rname,"Name")){
if(notEmpty(f1.remail,"Email")){
if(isEmail(f1.remail)){
return true;
}}}
return false;
}


//LinkExchange
function linkexchangeValidate(f1){
if(notEmpty(f1.cname,"Contact Name")){
if(notEmpty(f1.cemail,"Contact Email")){
if(notEmpty(f1.urlsite,"URL of the site")){
if(notEmpty(f1.tsite,"Title of your site")){
if(notEmpty(f1.desc,"Description of your site")){
if(notEmpty(f1.reciprocal,"Reciprocal URL")){
if(notEmpty(f1.message,"Message")){
if(isEmail(f1.cemail)){
return true;
}}}}}}}}
return false;
}


//Comments
function commentsValidate(f1){
if(notEmpty(f1.cname,"Name")){
if(notEmpty(f1.email,"Email")){
if(notEmpty(f1.website,"Website")){
if(notEmpty(f1.message,"Message")){
if(isEmail(f1.email)){	
return true;
}}}}}
return false;
}

//Password
function chgpwd(f1){
if(notEmpty(f1.uname,"User Name")){
if(notEmpty(f1.opasswd,"Old Password")){
if(notEmpty(f1.npasswd,"New Password")){				
if(notEmpty(f1.cpasswd,"Confirm Password")){
if(psswdCheck(f1.npasswd,f1.cpasswd)){			
return true;			
}}}}}
return false;	
}

function psswdCheck(np,cp){
	if(np.value==cp.value){
		return true;
	}
	else{
		alert("Passwords didnot match");
		return false;	
	}
}

function notEmpty(elem,name){
var s1=elem.value;

if(s1.length==0){
alert("Required Field : "+ name);
elem.focus();
return false;
}
else
return true;
}

function notEmpty1(elem){
var s1=elem.value;

if(s1.length==0){
alert("Required Field : Content");
return false;
}
else
return true;
}

function radioValidate(elem){
myOption = -1;
for (i=elem.length-1; i > -1; i--) {
if (elem[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("Required Field : Position");
return false;
}
return true;
}

function isEmail(elem){
var emailExp=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;
if(elem.value.match(emailExp)){
return true;
}
else{
alert("Enter a valid Email Id");
elem.focus();
return false;
}
}

//-->
