// JavaScript Document
function LoginFocus() {
	document.loginFrm.txtUsername.focus();
	return true;
}
function loginFrmValid(){
	if( IsEmpty(document.loginFrm.txtUsername) ){
		alert("Please enter a username");
		document.loginFrm.txtUsername.focus();
		return false;
	}else if( IsEmpty(document.loginFrm.txtPassword) ){
		alert("Please enter a password");
		document.loginFrm.txtPassword.focus();
		return false;
	}
}

function updateDisplay(act,name,frmName){
	frmName[name].value = act;
	if(confirm("Do you want update display status?")){
		frmName.action = "functions.php";
		frmName.submit();
		return false;
	}else{
		return false;
	}
	return false;
}
function check(name,frmName)
{
	if(!isNaN(frmName[name].length))
	{	
		for( i=0;i<frmName[name].length;i++ )
		{
			if(frmName[name][i].checked == true)
			{
				
				return true;
			}
		}
	return false;
	}
	else if( frmName[name].checked == false )
	{
		return false;
	}
	else if( frmName[name].checked == true )
	{
		return true;
	}
		
	return false;
}

function confrm(str,msg,name,frmName,act,dName)
{		
	if(check(name,frmName))
	{
		if(confirm(str))
		{
			frmName[dName].value = act;
			frmName.action = "functions.php";
			frmName.submit();
		}
		else
		{	
			return false;
		}
	}
	else{alert(msg);return false;}
}

//Only Enter Numbers
function isNumberKey(evt){
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57)){
		return false;
	}else{
		return true;
	}
}

//Contact Form Validation
function contactValid(){
	if(IsEmpty(document.contactFrm.fNameTxt)){
		alert("Please enter a first name");
		document.contactFrm.fNameTxt.focus();
		return false;
	}
	if(IsEmpty(document.contactFrm.sNameTxt)){
		alert("Please enter a last name");
		document.contactFrm.sNameTxt.focus();
		return false;
	}
	if(IsEmpty(document.contactFrm.mailTxt)){
		alert("Please enter a email");
		document.contactFrm.mailTxt.focus();
		return false;
	}
	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.contactFrm.mailTxt.value)) && document.contactFrm.mailTxt.value!=""){
		alert("Please enter a valid E-mail address");
		document.contactFrm.mailTxt.focus();
		return false;
	}
	if(document.contactFrm.stateCmbo.value == "select"){
		alert("Please select a state");
		document.contactFrm.stateCmbo.focus();
		return false;
	}
	if(IsEmpty(document.contactFrm.phoneTxt)){
		alert("Please enter a phone");
		document.contactFrm.phoneTxt.focus();
		return false;
	}
}
//Calendar Page Contact Us Validation
function calValid(){
	if(IsEmpty(document.calenderFrm.txtCName)){
		alert("Please enter a contact name");
		document.calenderFrm.txtCName.focus();
		return false;
	}
	if(IsEmpty(document.calenderFrm.txtSName)){
		alert("Please enter a stage name");
		document.calenderFrm.txtSName.focus();
		return false;
	}
	if(IsEmpty(document.calenderFrm.txtPhone)){
		alert("Please enter a phone number");
		document.calenderFrm.txtPhone.focus();
		return false;
	}
	if(IsEmpty(document.calenderFrm.txtMail)){
		alert("Please enter an email");
		document.calenderFrm.txtMail.focus();
		return false;
	}
	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.calenderFrm.txtMail.value)) && document.calenderFrm.txtMail.value!=""){
		alert("Please enter an valid email address");
		document.calenderFrm.txtMail.focus();
		return false;
	}
	if(IsEmpty(document.calenderFrm.fleBio)){
		alert("Please select a bio");
		document.calenderFrm.fleBio.focus();
		return false;
	}
	if(!IsEmpty(document.calenderFrm.fleBio)){
		path=document.calenderFrm.fleBio;
		if(checkext(path,".txt")==false && checkext(path,".TXT")==false && checkext(path,".doc") == false && checkext(path,".DOC")==false && checkext(path,"docx")==false  && checkext(path,"DOCX")==false && checkext(path,".rtf")==false && checkext(path,".RTF")==false && checkext(path,".pdf")==false && checkext(path,".PDF")==false){
			alert("Please select a valid bio");
			document.calenderFrm.fleBio.focus();
			return false;
		}
	}
	if(IsEmpty(document.calenderFrm.flePhoto)){
		alert("Please select a attach photo");
		document.calenderFrm.flePhoto.focus();
		return false;
	}
	if(!IsEmpty(document.calenderFrm.flePhoto)){
		path=document.calenderFrm.flePhoto;
		if(checkext(path,".jpg")==false && checkext(path,".JPG")==false && checkext(path,".gif") == false && checkext(path,"jpeg")==false && checkext(path,"JPEG")==false  && checkext(path,".GIF")==false && checkext(path,".png")==false && checkext(path,".PNG")==false && checkext(path,".bmp")==false && checkext(path,".BMP")==false ){
			alert("Please select a valid attach photo");
			document.calenderFrm.flePhoto.focus();
			return false;
		}
	}
}
//Event Registration Form Validation
function eventFrmValid(){
	if(IsEmpty(document.eventFrm.txtEName)){
		alert("Please enter a event name");
		document.eventFrm.txtEName.focus();
		return false;
	}
	if(IsEmpty(document.eventFrm.txtEDay)){
		alert("Please enter a event day");
		document.eventFrm.txtEDay.focus();
		return false;
	}
	if(IsEmpty(document.eventFrm.txtCompany)){
		alert("Please enter a company");
		document.eventFrm.txtCompany.focus();
		return false;
	}
	if(IsEmpty(document.eventFrm.txtEDate)){
		alert("Please enter a event date");
		document.eventFrm.txtEDate.focus();
		return false;
	}
	if(IsEmpty(document.eventFrm.txtEShort)){
		alert("Please enter a event info short version");
		document.eventFrm.txtEShort.focus();
		return false;
	}
	if(IsEmpty(document.eventFrm.txtELong)){
		alert("Please enter a event info long version");
		document.eventFrm.txtELong.focus();
		return false;
	}
	if(IsEmpty(document.eventFrm.txtCost)){
		alert("Please enter a cost & inclusions");
		document.eventFrm.txtCost.focus();
		return false;
	}
	if(IsEmpty(document.eventFrm.txtTime)){
		alert("Please enter a time");
		document.eventFrm.txtTime.focus();
		return false;
	}
	if(IsEmpty(document.eventFrm.txtVenue)){
		alert("Please enter a venue");
		document.eventFrm.txtVenue.focus();
		return false;
	}
	if(IsEmpty(document.eventFrm.txtPhone)){
		alert("Please enter a phone");
		document.eventFrm.txtPhone.focus();
		return false;
	}
	if(IsEmpty(document.eventFrm.txtMail)){
		alert("Please enter an email");
		document.eventFrm.txtMail.focus();
		return false;
	}
	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.eventFrm.txtMail.value)) && document.eventFrm.txtMail.value!=""){
		alert("Please enter an valid email address");
		document.eventFrm.txtMail.focus();
		return false;
	}
	if(IsEmpty(document.eventFrm.flePhoto)){
		alert("Please select a attach relevant photo");
		document.eventFrm.flePhoto.focus();
		return false;
	}
	if(!IsEmpty(document.eventFrm.flePhoto)){
		path=document.eventFrm.flePhoto;
		if(checkext(path,".jpg")==false && checkext(path,".JPG")==false && checkext(path,".gif") == false && checkext(path,"jpeg")==false && checkext(path,"JPEG")==false  && checkext(path,".GIF")==false && checkext(path,".png")==false && checkext(path,".PNG")==false && checkext(path,".bmp")==false && checkext(path,".BMP")==false ){
			alert("Please select a valid attach relevant photo");
			document.eventFrm.flePhoto.focus();
			return false;
		}
	}
}
//Special Registration Form Validation
function specialFrmValid(){
	if(IsEmpty(document.specialFrm.txtSName)){
		alert("Please enter a name of special");
		document.specialFrm.txtSName.focus();
		return false;
	}
	if(IsEmpty(document.specialFrm.txtSDay)){
		alert("Please enter a valid date & time of special offer");
		document.specialFrm.txtSDay.focus();
		return false;
	}
	if(IsEmpty(document.specialFrm.txtSShort)){
		alert("Please enter a special's info short version");
		document.specialFrm.txtSShort.focus();
		return false;
	}
	if(IsEmpty(document.specialFrm.txtSLong)){
		alert("Please enter a special's info long version");
		document.specialFrm.txtSLong.focus();
		return false;
	}
	if(IsEmpty(document.specialFrm.txtSVenue)){
		alert("Please enter a venue");
		document.specialFrm.txtSVenue.focus();
		return false;
	}
	if(IsEmpty(document.specialFrm.txtSPhone)){
		alert("Please enter a phone");
		document.specialFrm.txtSPhone.focus();
		return false;
	}
	if(IsEmpty(document.specialFrm.txtSMail)){
		alert("Please enter an email");
		document.specialFrm.txtSMail.focus();
		return false;
	}
	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.specialFrm.txtSMail.value)) && document.specialFrm.txtSMail.value!=""){
		alert("Please enter an valid email address");
		document.specialFrm.txtSMail.focus();
		return false;
	}
	if(IsEmpty(document.specialFrm.fleSPhoto)){
		alert("Please select a attach relevant photo");
		document.specialFrm.fleSPhoto.focus();
		return false;
	}
	if(!IsEmpty(document.specialFrm.fleSPhoto)){
		path=document.specialFrm.fleSPhoto;
		if(checkext(path,".jpg")==false && checkext(path,".JPG")==false && checkext(path,".gif") == false && checkext(path,"jpeg")==false && checkext(path,"JPEG")==false  && checkext(path,".GIF")==false && checkext(path,".png")==false && checkext(path,".PNG")==false && checkext(path,".bmp")==false && checkext(path,".BMP")==false ){
			alert("Please select a valid attach relevant photo");
			document.specialFrm.fleSPhoto.focus();
			return false;
		}
	}
}
//Photo Confirm
function confrmDel(del,cid){
	if(confirm("Do you want to Delete?")){
		document.frmPhoto.memberPmode.value = "delete";
		document.frmPhoto.action = "functions.php?del="+del+"&cid="+cid;
		document.frmPhoto.submit();
	}else{
		return false;
	}
}
//Photo Category
function onchangeCate(){
	if(document.frmPhoto.category.value != "select"){
		document.frmPhoto.action = "manage-photo.php?cid="+document.frmPhoto.category.value;
	}else{
		document.frmPhoto.action = "manage-photo.php";
	}
	document.frmPhoto.submit();
}
//Event Validation
function Eaddvalid(){
	if(IsEmpty(document.frmAddEvents.txtName)){
		alert("Please enter a name");
		document.frmAddEvents.txtName.focus();
		return false;
	}
	if(IsEmpty(document.frmAddEvents.txtDate)){
		alert("Please select date");
		document.frmAddEvents.txtDate.focus();
		return false;
	}
	if(IsEmpty(document.frmAddEvents.fileImage)){
		alert("Please select a image");
		document.frmAddEvents.fileImage.focus();
		return false;
	}
	if(checkext(document.frmAddEvents.fileImage,".jpg")==false && checkext(document.frmAddEvents.fileImage,".JPG")==false && checkext(document.frmAddEvents.fileImage,".gif") == false && checkext(document.frmAddEvents.fileImage,"jpeg")==false && checkext(document.frmAddEvents.fileImage,"JPEG")==false  && checkext(document.frmAddEvents.fileImage,".GIF")==false && checkext(document.frmAddEvents.fileImage,".png")==false && checkext(document.frmAddEvents.fileImage,".PNG")==false ){
		//alert("hi");Please upload only mp3 format audio
		alert("Please upload only jpg, jpeg, gif, png format image");
		document.frmAddEvents.fileImage.focus();
		return false;
	}
}
function Eeditvalid(){
	if(IsEmpty(document.frmAddEvents.txtName)){
		alert("Please enter a name");
		document.frmAddEvents.txtName.focus();
		return false;
	}
	if(IsEmpty(document.frmAddEvents.txtDate)){
		alert("Please select date");
		document.frmAddEvents.txtName.focus();
		return false;
	}
	if(!IsEmpty(document.frmAddEvents.fileImage)){
		if(checkext(document.frmAddEvents.fileImage,".jpg")==false && checkext(document.frmAddEvents.fileImage,".JPG")==false && checkext(document.frmAddEvents.fileImage,".gif") == false && checkext(document.frmAddEvents.fileImage,"JPEG")==false && checkext(document.frmAddEvents.fileImage,"jpeg")==false  && checkext(document.frmAddEvents.fileImage,".GIF")==false && checkext(document.frmAddEvents.fileImage,".png")==false && checkext(document.frmAddEvents.fileImage,".PNG")==false ){
			//alert("hi");
			alert("Please upload only jpg, jpeg, gif, png format image");
			document.frmAddEvents.fileImage.focus();
			return false;
		}
	}
}
//Manage Photo Gallery
function countImg(){
	if(document.frmPhoto.category.value =="select"){
		alert("Please select a category");
		document.frmPhoto.category.focus();
		return false;
	}
	if(IsEmpty(document.frmPhoto.txtCount)){
		alert("Please enter the number of photos to be added");
		document.frmPhoto.txtCount.focus();
		return false;
	}
	if((chkNumber(document.frmPhoto.txtCount.value) == false) || (document.frmPhoto.txtCount.value == 0)){
		alert("Please enter a valid number of photos");
		document.frmPhoto.txtCount.focus();
		return false;
	}
}
function pValid(){
	if(document.frmAddPhoto.cmboCate.value == "select"){
		alert("Please select a category");
		document.frmAddPhoto.cmboCate.focus();
		return false;
	}
	count=document.getElementsByName("fleImage[]");
	p=count.length;
	for(c=0; c<p; c++){
		if(IsEmpty(count[c])){
			alert("Please select a image");
			count[c].focus();
			return false;
		}
		if(checkext(count[c], ".png")==false && checkext(count[c], ".gif")==false && checkext(count[c], ".jpg")==false && checkext(count[c], "jpeg")==false)
		{
			alert("Please upload only jpg, jpeg, gif, png format image");	
			count[c].focus();
			return false;
		}
	}
}
function UppValid(){
	if(document.frmAddPhoto.cmboCate.value == "select"){
		alert("Please select a category");
		document.frmAddPhoto.cmboCate.focus();
		return false;
	}
	if(!IsEmpty(document.frmAddPhoto.fleImage)){
		fleImage=document.frmAddPhoto.fleImage;
		if(checkext(fleImage, ".png")==false && checkext(fleImage, ".gif")==false && checkext(fleImage, ".jpg")==false && checkext(fleImage, "jpeg")==false){
			alert("Please upload only jpg, jpeg, gif, png format image");	
			fleImage.focus();
			return false;
		}
	}
}
//Manage Photo category
function onChangeCmbo(){
	//alert(document.frmAddPhotoCate.cmboTalent.value);
	if(document.frmAddPhotoCate.cmboTalent.value != "select"){
		document.frmAddPhotoCate.action="manage-photo-category.php?eid="+document.frmAddPhotoCate.cmboTalent.value;
	}else{
		document.frmAddPhotoCate.action="manage-photo-category.php";
	}
	document.frmAddPhotoCate.submit();
	return false;
}
function pcValid(){
	if(IsEmpty(document.frmAddPhotoCate.txtName)){
		alert("Please enter a name");
		document.frmAddPhotoCate.txtName.focus();
		return false;
	}
	if(IsEmpty(document.frmAddPhotoCate.txtDesc)){
		alert("Please enter a description");
		document.frmAddPhotoCate.txtDesc.focus();
		return false;
	}
}
//Video Validation
function vValid(){
	if(IsEmpty(document.frmAddVideo.txtName)){
		alert("Please enter a name");
		document.frmAddVideo.txtName.focus();
		return false;
	}
	if(IsEmpty(document.frmAddVideo.fleVideo)){
		alert("Please select a video");
		document.frmAddVideo.fleVideo.focus();
		return false;
	}
	if(checkext(document.frmAddVideo.fleVideo, ".flv")==false  && checkext(document.frmAddVideo.fleVideo, ".FLV")==false)
	{
		alert("Please upload only flv format video");	
		document.frmAddVideo.fleVideo.focus();
		return false;
	}
	if(IsEmpty(document.frmAddVideo.fleImage)){
		alert("Please select a image");
		document.frmAddVideo.fleImage.focus();
		return false;
	}
	if(checkext(document.frmAddVideo.fleImage, ".png")==false && checkext(document.frmAddVideo.fleImage, ".gif")==false && checkext(document.frmAddVideo.fleImage, ".jpg")==false && checkext(document.frmAddVideo.fleImage, "jpeg")==false)
	{
		alert("Please upload only jpg, jpeg, gif, png format image");	
		document.frmAddVideo.fleImage.focus();
		return false;
	}
	document.frmAddVideo.action="functions.php";
	document.frmAddVideo.submit();
}
function UpvValid(){
	if(IsEmpty(document.frmAddVideo.txtName)){
		alert("Please enter a name");
		document.frmAddVideo.txtName.focus();
		return false;
	}
	if(!IsEmpty(document.frmAddVideo.fleVideo)){
		if(checkext(document.frmAddVideo.fleVideo, ".flv")==false && checkext(document.frmAddVideo.fleVideo, ".FLV")==false)
		{
			alert("Please upload only flv format video");	
			document.frmAddVideo.fleVideo.focus();
			return false;
		}
	}
	
	if(!IsEmpty(document.frmAddVideo.fleImage)){
		if(checkext(document.frmAddVideo.fleImage, ".png")==false && checkext(document.frmAddVideo.fleImage, ".gif")==false && checkext(document.frmAddVideo.fleImage, ".jpg")==false && checkext(document.frmAddVideo.fleImage, "jpeg")==false)
		{
			alert("Please upload only jpg, jpeg, gif, png format image");	
			document.frmAddVideo.fleImage.focus();
			return false;
		}
	}
}
//Audio Validation
function aValid(){
	if(IsEmpty(document.frmAddAudios.txtAudName)){
		alert("Please enter a name");
		document.frmAddAudios.txtAudName.focus();
		return false;
	}
	if(IsEmpty(document.frmAddAudios.fileAudio)){
		alert("Please select an audio");
		document.frmAddAudios.fileAudio.focus();
		return false;
	}
	if(!IsEmpty(document.frmAddAudios.fileAudio)){
		if(checkext(document.frmAddAudios.fileAudio,".mp3")==false && checkext(document.frmAddAudios.fileAudio,".MP3")==false){
			//alert("hi");
			alert("Please upload only mp3 format audio");
			document.frmAddAudios.fileAudio.focus();
			return false;
		}
	}
}
function UpaValid(){
	if(IsEmpty(document.frmAddAudios.txtAudName)){
		alert("Please enter a name");
		document.frmAddAudios.txtAudName.focus();
		return false;
	}
	if(!IsEmpty(document.frmAddAudios.fileAudio)){
		if(checkext(document.frmAddAudios.fileAudio,".mp3")==false && checkext(document.frmAddAudios.fileAudio,".MP3")==false){
			//alert("hi");
			alert("Please upload only mp3 format audio");
			document.frmAddAudios.fileAudio.focus();
			return false;
		}
	}
}
//Category Validation
function cValid(){
	if(document.frmAddCategory.cmboCategory.value == "select"){
		alert("Please select a category");
		document.frmAddCategory.cmboCategory.focus();
		return false;
	}

		if(document.frmAddCategory.cmboCategory.value == 1)
		  {
			if(IsEmpty(document.frmAddCategory.txtName)){
			alert("Please enter a genre");
			document.frmAddCategory.txtName.focus();
			return false;
			}
	     }

			if(document.frmAddCategory.cmboCategory.value ==2)
		  {
			if(IsEmpty(document.frmAddCategory.txtName)){
			alert("Please enter a cuisine");
			document.frmAddCategory.txtName.focus();
			return false;
			}
	     }








}
//Musicians Validation

function SoundCmbo(){
	if(document.frmsound.cmboTalent.value != ''){
		document.frmsound.action = "sound.php?cid="+document.frmsound.cmboTalent.value;
	//}else{
		//document.frmsound.action = "sound.php";
	}
	document.frmsound.submit();
}


function mValid(){
	if(document.frmAddMusicians.cmboTalent.value == "select"){
		alert("Please select a category");
		document.frmAddMusicians.cmboTalent.focus();
		return false;
	}
	if(IsEmpty(document.frmAddMusicians.txtName)){
		alert("Please enter a name");
		document.frmAddMusicians.txtName.focus();
		return false;
	}
	if(IsEmpty(document.frmAddMusicians.fleImage)){
		alert("Please select a image");
		document.frmAddMusicians.fleImage.focus();
		return false;
	}
	if(checkext(document.frmAddMusicians.fleImage, ".png")==false && checkext(document.frmAddMusicians.fleImage, ".gif")==false && checkext(document.frmAddMusicians.fleImage, ".jpg")==false && checkext(document.frmAddMusicians.fleImage, "jpeg")==false)
	{
		alert("Please upload only jpg, jpeg, gif, png format image");	
		document.frmAddMusicians.fleImage.focus();
		return false;
	}
}
function UpmValid(){
	if(document.frmAddMusicians.cmboTalent.value == "select"){
		alert("Please select a sub talent");
		document.frmAddMusicians.cmboTalent.focus();
		return false;
	}
	if(IsEmpty(document.frmAddMusicians.txtName)){
		alert("Please enter a name");
		document.frmAddMusicians.txtName.focus();
		return false;
	}
	if(!IsEmpty(document.frmAddMusicians.fleImage)){
		if(checkext(document.frmAddMusicians.fleImage, ".png")==false && checkext(document.frmAddMusicians.fleImage, ".gif")==false && checkext(document.frmAddMusicians.fleImage, ".jpg")==false && checkext(document.frmAddMusicians.fleImage, "jpeg")==false)
		{
			alert("Please upload only jpg, jpeg, gif, png format image");	
			document.frmAddMusicians.fleImage.focus();
			return false;
		}	
	}
}
//Taste Validation

function TasteCmbo(){
	if(document.frmTaste.cmboTaste.value != ''){
		document.frmTaste.action = "taste.php?cid="+document.frmTaste.cmboTaste.value;
	//}else{
	//	document.frmTaste.action = "taste.php";
	}
	document.frmTaste.submit();
}

function tValid(){
	if(document.frmAddTaste.cmboTalent.value == "select"){
		alert("Please select a category");
		document.frmAddTaste.cmboTalent.focus();
		return false;
	}
	if(IsEmpty(document.frmAddTaste.txtName)){
		alert("Please enter a name");
		document.frmAddTaste.txtName.focus();
		return false;
	}
	if(IsEmpty(document.frmAddTaste.fleImage)){
		alert("Please select a image");
		document.frmAddTaste.fleImage.focus();
		return false;
	}
	if(checkext(document.frmAddTaste.fleImage, ".png")==false && checkext(document.frmAddTaste.fleImage, ".gif")==false && checkext(document.frmAddTaste.fleImage, ".jpg")==false && checkext(document.frmAddTaste.fleImage, "jpeg")==false)
	{
		alert("Please upload only jpg, jpeg, gif, png format image");	
		document.frmAddTaste.fleImage.focus();
		return false;
	}
}
function UptValid(){
	if(document.frmAddTaste.cmboTalent.value == "select"){
		alert("Please select a category");
		document.frmAddTaste.cmboTalent.focus();
		return false;
	}
	if(IsEmpty(document.frmAddTaste.txtName)){
		alert("Please enter a name");
		document.frmAddTaste.txtName.focus();
		return false;
	}
	if(!IsEmpty(document.frmAddTaste.fleImage)){
		if(checkext(document.frmAddTaste.fleImage, ".png")==false && checkext(document.frmAddTaste.fleImage, ".gif")==false && checkext(document.frmAddTaste.fleImage, ".jpg")==false && checkext(document.frmAddTaste.fleImage, "jpeg")==false)
		{
			alert("Please upload only jpg, jpeg, gif, png format image");	
			document.frmAddTaste.fleImage.focus();
			return false;
		}
	}
}
//Admin Event Validation
function AdminEaddvalid(){
	if(IsEmpty(document.frmAddAdminEvents.txtEventName)){
		alert("Please enter a event name");
		document.frmAddAdminEvents.txtEventName.focus();
		return false;
	}
	if(IsEmpty(document.frmAddAdminEvents.txtStartDate)){
		alert("Please select start date");
		document.frmAddAdminEvents.txtStartDate.focus();
		return false;
	}
	if(IsEmpty(document.frmAddAdminEvents.txtEndDate)){
		alert("Please select end date");
		document.frmAddAdminEvents.txtEndDate.focus();
		return false;
	}
	if(!IsEmpty(document.frmAddAdminEvents.txtStartDate) && !IsEmpty(document.frmAddAdminEvents.txtEndDate)){
		var months=new Array;
		months['Jan']=0;
		months['Feb']=1;
		months['Mar']=2;
		months['Apr']=3;
		months['May']=4;
		months['Jun']=5;
		months['Jul']=6;
		months['Aug']=7;
		months['Sep']=8;
		months['Oct']=9;
		months['Nov']=10;
		months['Dec']=11;
		
		var stDate=document.frmAddAdminEvents.txtStartDate.value;
		//alert(stDate);
		startSplit=stDate.split("-");
		/*alert(startSplit[2]);
		var month=startSplit[1];
		alert(months[month]);
		alert(startSplit[0]);*/
		var startDate=new Date(startSplit[2], months[startSplit[1]], startSplit[0]);
		//alert(startDate);
		
		var eDate=document.frmAddAdminEvents.txtEndDate.value;
		//alert(eDate);
		endSplit=eDate.split("-");
		/*alert(endSplit[2]);
		alert(endSplit[1]);
		alert(endSplit[0]);*/
		var endDate=new Date(endSplit[2], months[endSplit[1]], endSplit[0]);
		//alert(endDate);
		
		if(startDate>endDate){
			alert("End date should be greater than start date");
			document.frmAddAdminEvents.txtEndDate.focus();
			return false;
		}
	}
	/*if(IsEmpty(document.frmAddAdminEvents.txtEventTime)){
		alert("Please enter a event time");
		document.frmAddAdminEvents.txtEventTime.focus();
		return false;
	}
	if(IsEmpty(document.frmAddAdminEvents.txtLocation)){
		alert("Please enter a location");
		document.frmAddAdminEvents.txtLocation.focus();
		return false;
	}*/
	if(document.frmAddAdminEvents.cmboEventType.value == "select" ){
		alert("Please select the event type");
		document.frmAddAdminEvents.cmboEventType.focus();
		return false;
	}
}
//Change The type of view
function changeView(value){
	if(document.adminEventFrm.txtView.value == ""){
		document.adminEventFrm.action="manage-events-schedule.php?type=" + value;
		document.adminEventFrm.submit();
		return false;
	}else{
		document.adminEventFrm.action="manage-events-schedule.php?view=" + document.adminEventFrm.txtView.value +"&type=" + value;
		document.adminEventFrm.submit();
		return false;
	}
	return false;
}