
function DelCheck()
{
	if(confirm("Do you want to Delete"))
	{
		return true;
	}
	else
	{
		return false;
	}
}


function emailCheck(str)
{
	 if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)))
	 {
		 return 1;
	 }
	 else
	 {
	 return 0;
	 }
}

function emptyField(str)
{
	if(str=="")
	return 0;
	else
	return 1;
}

function validBook(str)
{
	var x=1;
	if(!emptyField(str.title.value))
	{
	alert("Please Enter Title");
	x=0;
	}
	else if(!emptyField(str.author.value))
	{
	alert("Please Enter Auther Name");
	x=0;
	}
	else if(!emptyField(str.isbn.value))
	{
	alert("Please Enter ISBN Number");
	x=0;
	}
	else if(!emptyField(str.publisher.value))
	{
	alert("Please Enter Publisher Name");
	x=0;
	}
	else if(!emptyField(str.yearofpub.value))
	{
	alert("Please Enter Publish Year");
	x=0;
	}
	else if(!emptyField(str.price.value))
	{
	alert("Please Enter Price");
	x=0;
	}
	else if(!emptyField(str.descript.value))
	{
	alert("Please Enter Description Title");
	x=0;
	}
	else if(!emptyField(str.bookimage.value))
	{
	alert("Please Select Image of Books");
	x=0;
	}
	if(x==0)
	return false;
	else
	return true;
}


function validContact(st)
{
	var x=0;
	if(!emptyField(st.fname.value))
	{
		alert("Please Enter the Name");
		x=1;	
	}
	else if(!emptyField(st.address.value))
	{
		alert("Please Enter the Address");
		x=1;	
	}
	else if(!emptyField(st.city.value))
	{
		alert("Please Enter the City Name");
		x=1;	
	}
	else if(!emptyField(st.state.value))
	{
		alert("Please Enter the State Name");
		x=1;	
	}
	else if(!emptyField(st.phone.value))
	{
		alert("Please Enter the Phone No");
		x=1;	
	}
	else if(emailCheck(st.emailid.value))
	{
		alert("Please Enter the Valid Email Id");
		x=1;	
	}
	else if(!emptyField(st.comments.value))
	{
		alert("Please Enter the Comments");
		x=1;	
	}
	if(x==0)
	return true;
	else
	return false;
	
}




function validEnquery(st)
{
	var x=0;
	if(!emptyField(st.name.value))
	{
		alert("Please Enter the Name");
		x=1;	
	}
	else if(!emptyField(st.lname.value))
	{
		alert("Please Enter the Last Name");
		x=1;	
	}
	else if(!emptyField(st.phone.value))
	{
		alert("Please Enter the Phone No");
		x=1;	
	}
	else if(emailCheck(st.email.value))
	{
		alert("Please Enter the Valid Email Id");
		x=1;	
	}
	else if(!emptyField(st.city.value))
	{
		alert("Please Enter the city Name");
		x=1;	
	}
	else if(!emptyField(st.state.value))
	{
		alert("Please Enter the State Name");
		x=1;	
	}
	else if(!emptyField(st.message.value))
	{
		alert("Please Enter the Message");
		x=1;	
	}
	if(x==0)
	return true;
	else
	return false;
	
}

function usercreatval(st)
{
	if(!emptyField(st.uname.value))
	{
		alert("Please Enter the User Name");
		x=1;	
	}
	else if(!emptyField(st.password.value))
	{
		alert("Please Enter the Password");
		x=1;	
	}
	if(x==0)
	return true;
	else
	return false;
}
function validdatainfo(st)
{
		if(!emptyField(st.values.value))
	{
		alert("Please Enter the Value");
		st.values.focus();
	return false;
	}
	else
	{
		return true;
	}

}

