function placeFocus() 
{
	if (document.forms.length > 0) 
	{
		var field = document.forms[0];
		for (i = 0; i < field.length; i++) 
		{
			//alert(field.elements[i].type);
			if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) 
			{
				document.forms[0].elements[i].focus();
				break;
		    }
	    }
    }
}
//==================================Reserve=========popup============================
function popupcontactinto(key1)
{ 
	var width = 500
	var height = 280
	LeftPosition = (screen.width-width) / 2;
	TopPosition = (screen.height-height) / 2;
	
	window.open("Admin_popreserve.aspx?ReserveID="+key1 , "myXMLload", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,directories=no,location=no,width="+width+",height="+height+",top="+TopPosition+",left="+LeftPosition)
	
}
//==================================end Reserve=========popup============================


//==================================MM_openContactUs=========popup============================

function MM_openContactUs(theURL,winName,features) { //v2.0
  var width = 500
	var height = 450
	//LeftPosition = (screen.width-width) / 2;
	//TopPosition = (screen.height-height) / 2;
	LeftPosition = ((document.body.offsetWidth-width) / 2)-15;
	TopPosition = ((document.body.offsetHeight-height) / 2)+120;
	window.open(theURL,"Privacypolicy","height="+height+",width="+width+",status=0,menubar=0,toolbar=0,location=no,top="+TopPosition+",left="+LeftPosition);
 }
 //==================================end MM_openContactUs=========popup============================



function MM_openBrWindow(theURL,winName,features) { //v2.0
  var width = 700
	var height = 400
	//LeftPosition = (screen.width-width) / 2;
	//TopPosition = (screen.height-height) / 2;
		LeftPosition = ((document.body.offsetWidth-width) / 2)-15;
	TopPosition = ((document.body.offsetHeight-height) / 2)+120;
	window.open(theURL,"Privacypolicy","height="+height+",width="+width+",status=0,menubar=0,toolbar=0,location=no,top="+TopPosition+",left="+LeftPosition);
 }
function MM_openBrWindowprivacy(theURL,winName,features) { //v2.0
  var width = 500
	var height = 350
	//LeftPosition = (screen.width-width) / 2;
	//TopPosition = (screen.height-height) / 2;
		LeftPosition = ((document.body.offsetWidth-width) / 2)-15;
	TopPosition = ((document.body.offsetHeight-height) / 2)+120;
	window.open(theURL,"Privacypolicy","height="+height+",width="+width+",status=0,menubar=0,toolbar=0,location=no,top="+TopPosition+",left="+LeftPosition);
 }
function placeFocusSubmit(frm)
{
//alert("");
	if(event.keyCode==13)
	{
		//document.forms[0].elements[12].focus();
		document.forms[0].elements[3].focus();
	}
	
}



function getcontent1()
{

	var strText ;
	

	if (document.Form1.htmleditor_mode.value=="1" || document.Form1.htmleditor_mode.value=="")
	{
			strText = iView.innerHTML;
	}
	else
	{
			strText = iView.innerText;
	}

	strText = strText.replace("<SPAN id=AdminContent_thewateroasis_Admin_MainNavigation_ph_content>","");
	strText = strText.replace("&lt;SPAN id=AdminContent_thewateroasis_Admin_MainNavigation_ph_content&gt;","");
	strText = strText.replace("</SPAN>","");
	strText = strText.replace("&lt;/SPAN&gt;","");

	document.Form1.content.value=strText;	

	if (document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtnavname.value=="")
	{
		alert("Navigation Name field is required");
		document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtnavname.focus();
		return false;
	}

	if (document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtdisplayorder.value=="")
	{
		alert("Display Order field is required");
		document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtdisplayorder.focus();
		return false;
	}
	
	return true;
	
}

function login_validate()
{
	if (document.Form1.AdminContent_thewateroasis_Admin_Logins_txtusername.value=="")
	{
		alert("Username field is required");
		document.Form1.AdminContent_thewateroasis_Admin_Logins_txtusername.focus();
		return false;
	}
	if (document.Form1.AdminContent_thewateroasis_Admin_Logins_txtpassword.value=="")
	{
		alert("Password field is required");
		document.Form1.AdminContent_thewateroasis_Admin_Logins_txtpassword.focus();
		return false;
	}
	if (document.Form1.AdminContent_thewateroasis_Admin_Logins_txtfirstname.value=="")
	{
		alert("First Name field is required");
		document.Form1.AdminContent_thewateroasis_Admin_Logins_txtfirstname.focus();
		return false;
	}
	if (document.Form1.AdminContent_thewateroasis_Admin_Logins_txtlastname.value=="")
	{
		alert("Last Name field is required");
		document.Form1.AdminContent_thewateroasis_Admin_Logins_txtlastname.focus();
		return false;
	}

	if (document.Form1.AdminContent_thewateroasis_Admin_Logins_txtemail.value=="")
	{
		alert("Email field is required");
		document.Form1.AdminContent_thewateroasis_Admin_Logins_txtemail.focus();
		return false;
	}

	if (document.Form1.AdminContent_thewateroasis_Admin_Logins_dlroleid.value=="")
	{
		alert("Role field is required");
		document.Form1.AdminContent_thewateroasis_Admin_Logins_dlroleid.focus();
		return false;
	}	
	return true;
}

function state_of_america_validate()
{
	
			if (document.Form1.AdminContent_thewateroasis_Admin_States_Of_America_txtstateshort.value=="")
		{
			alert("State ID Field is required");
			document.Form1.AdminContent_thewateroasis_Admin_States_Of_America_txtstateshort.focus();
			return false;
		}
	
		if (document.Form1.AdminContent_thewateroasis_Admin_States_Of_America_txtstatename.value=="")
	{
		alert("State Name Field is required");
		document.Form1.AdminContent_thewateroasis_Admin_States_Of_America_txtstatename.focus();
		return false;
	}
	
	return true;
}

function role_validate()
{

	if (document.Form1.AdminContent_thewateroasis_Admin_Role_txtrole.value=="")
	{
		alert("Role field is required.")
		document.Form1.AdminContent_thewateroasis_Admin_Role_txtrole.focus();
		return false;
	}
	if (document.Form1.AdminContent_thewateroasis_Admin_Role_lbnavids.value=="")
	{
		alert("Please select navigation pertaining to the role.");
		document.Form1.AdminContent_thewateroasis_Admin_Role_lbnavids.focus();
		return false;
	}	
	return true;
}
//=====================================================================Occasions
function Occasions_validate()
{

	if (document.Form1.AdminContent_thewateroasis_Admin_Occasions_txtOccasionName.value=="")
	{
		alert("Occasion Name is required.")
		document.Form1.AdminContent_thewateroasis_Admin_Occasions_txtOccasionName.focus();
		return false;
	}	
	return true;
}
//=====================================================================
//==================================Facility===================================

function FacilitySection_validate()
{

	if (document.Form1.AdminContent_thewateroasis_Admin_FacilitySection_txtFacilityName.value=="")
	{
		alert("Facility Name is required.")
		document.Form1.AdminContent_thewateroasis_Admin_FacilitySection_txtFacilityName.focus();
		return false;
	}	
	return true;
}
//=====================================================================

function AdminNavigation_Validate()
{	var strText ;
	

	if (document.Form1.htmleditor_mode.value=="1" || document.Form1.htmleditor_mode.value=="")
	{
			strText = iView.innerHTML;
	}
	else
	{
			strText = iView.innerText;
	}

	strText = strText.replace("<SPAN id=AdminContent_thewateroasis_Admin_AdminNavigation_ph_content>","");
	strText = strText.replace("&lt;SPAN id=AdminContent_thewateroasis_Admin_AdminNavigation_ph_content&gt;","");
	strText = strText.replace("</SPAN>","");
	strText = strText.replace("&lt;/SPAN&gt;","");


	document.Form1.content.value=strText;	
	

	if (document.Form1.AdminContent_thewateroasis_Admin_AdminNavigation_txtnavname.value=="")
	{
		alert("Navigation Name field is required");
		document.Form1.AdminContent_thewateroasis_Admin_AdminNavigation_txtnavname.focus();
		return false;
	}

	if (document.Form1.AdminContent_thewateroasis_Admin_AdminNavigation_txtdisplayorder.value=="")
	{
		alert("Display Order field is required");
		document.Form1.AdminContent_thewateroasis_Admin_AdminNavigation_txtdisplayorder.focus();
		return false;
	}
	if (isNaN(document.Form1.AdminContent_thewateroasis_Admin_AdminNavigation_txtdisplayorder.value))
		{	
			alert("Display order Must be a Numeric Value without Special Characters.")
			document.Form1.AdminContent_thewateroasis_Admin_AdminNavigation_txtdisplayorder.focus();
			return false;
		}
	
	return true;
}


function getcontent()
{

var strText ;
	

	if (document.Form1.htmleditor_mode.value=="1" || document.Form1.htmleditor_mode.value=="")
	{
			strText = iView.innerHTML;
	}
	else
	{
			strText = iView.innerText;
	}
	strText = strText.replace("<SPAN id=AdminContent_thewateroasis_Admin_MainNavigation_ph_content>","");
	strText = strText.replace("&lt;SPAN id=AdminContent_thewateroasis_Admin_MainNavigation_ph_content&gt;","");
	strText = strText.replace("</SPAN>","");
	strText = strText.replace("&lt;/SPAN&gt;","");

	document.Form1.content.value=strText;	

	if (document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtnavname.value=="")
	{
		alert("Navigation Name field is required");
		document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtnavname.focus();
		return false;
	}

	if (document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtdisplayorder.value=="")
	{
		alert("Display Order field is required");
		document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtdisplayorder.focus();
		return false;
	}
		if (isNaN(document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtdisplayorder.value))
		{	
			alert("Display order Must be a Numeric Value without Special Characters.")
			document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtdisplayorder.focus();
			return false;
		}
		if (document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtWidth.value=="")
	{
		alert("Width field is required");
		document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtWidth.focus();
		return false;
	}
		if (isNaN(document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtWidth.value))
		{	
			alert("Width Must be a Numeric Value without Special Characters.")
			document.Form1.AdminContent_thewateroasis_Admin_MainNavigation_txtWidth.focus();
			return false;
		}
	return true;
}

function link_validate()
{
if (document.Form1.AdminContent_thewateroasis_Admin_Links_dlCategory.value=="")
		{
			alert("Category Field is required.")
			document.Form1.AdminContent_thewateroasis_Admin_Links_dlCategory.focus();
			return false;
		}
	if (document.Form1.AdminContent_thewateroasis_Admin_Links_txtLink.value=="")
	{
		alert("Link Name field is required");
		document.Form1.AdminContent_thewateroasis_Admin_Links_txtLink.focus();
		return false;
	}
	if (document.Form1.AdminContent_thewateroasis_Admin_Links_txtURL.value=="")
	{
		alert("URL Name should not be blank");
		document.Form1.AdminContent_thewateroasis_Admin_Links_txtURL.focus();
		return false;
	}
	return true;
}

function Category_validate()
{						
	if (document.Form1.AdminContent_thewateroasis_Admin_Categories_txtCategory.value=="")
	{
		alert("Category Name field is required");
		document.Form1.AdminContent_thewateroasis_Admin_Categories_txtCategory.focus();
		return false;
	}
	return true;
}

function btnUpload_ServerClick(c)
{
	var strText ;
	var strfilename;

	if (document.Form1.htmleditor_mode.value=="1" || document.Form1.htmleditor_mode.value=="")
	{
			strText = iView.innerHTML;
	}
	else
	{
			strText = iView.innerText;
	}

	strText = strText.replace("<SPAN id=AdminContent_thewateroasis_Admin_GazeboImages_ph_content>","");
	strText = strText.replace("&lt;SPAN id=AdminContent_thewateroasis_Admin_GazeboImages_ph_content&gt;","");
	strText = strText.replace("</SPAN>","");
	strText = strText.replace("&lt;/SPAN&gt;","");
	document.Form1.content.value=strText;
	if (c == "1")
		{		
			if (document.Form1.AdminContent_thewateroasis_Admin_GazeboImages_MyFile.value=="")
			{
			alert("Browse an image");
			document.Form1.AdminContent_thewateroasis_Admin_GazeboImages_MyFile.focus();
			return false;
			}
			
			if (document.Form1.content.value=="")
			{
				alert("Content is required")
				return false;
			}
		}
			
	if (c == "2")
		{
		
			if (document.Form1.content.value=="")
			{
				alert("Content is required")
				return false;
			}
		}
		
		return true;
}



function btnPondImages_ServerClick(c)
{
	var strText ;
	

	if (document.Form1.htmleditor_mode.value=="1" || document.Form1.htmleditor_mode.value=="")
	{
			strText = iView.innerHTML;
	}
	else
	{
			strText = iView.innerText;
	}

	strText = strText.replace("<SPAN id=AdminContent_thewateroasis_Admin_PondImages_ph_content>","");
	strText = strText.replace("&lt;SPAN id=AdminContent_thewateroasis_Admin_PondImages_ph_content&gt;","");
	strText = strText.replace("</SPAN>","");
	strText = strText.replace("&lt;/SPAN&gt;","");
	document.Form1.content.value=strText;
	if (c == "1")
		{						
			if (document.Form1.AdminContent_thewateroasis_Admin_PondImages_MyFile.value=="")
			{
			alert("Browse an image");
			document.Form1.AdminContent_thewateroasis_Admin_PondImages_MyFile.focus();
			return false;
			}
			if (document.Form1.content.value=="")
			{
				alert("Content is required")
				return false;
			}
		}
			
	if (c == "2")
		{
		
			if (document.Form1.content.value=="")
			{
				alert("Content is required")
				return false;
			}
		}
		
		return true;
}


function popupphotogallery(pid)
{
	var width = 798
	var height = 545
	//LeftPosition = (screen.width-width) / 2;
	//TopPosition = (screen.height-height) / 2;
	LeftPosition = ((document.body.offsetWidth-width) / 2)-15;
	TopPosition = ((document.body.offsetHeight-height) / 2)+120;
window.open("PhotoGallerySlideShow.aspx?Categoryid="+pid , "slideshow", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width="+width+",height="+height+",top="+TopPosition+",left="+LeftPosition)

}


function popupphoto (pid)
{
	var width = 550
	var height = 450
	//LeftPosition = (screen.width-width) / 2;
	//TopPosition = (screen.height-height) / 2;
	LeftPosition = ((document.body.offsetWidth-width) / 2)-15;
	TopPosition = ((document.body.offsetHeight-height) / 2)+120;
window.open("Default_Image.aspx?record="+pid , "slideshow", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width="+width+",height="+height+",top="+TopPosition+",left="+LeftPosition)

}

function FocusSubmit(control)
{
	if(event.keyCode==13)
	{
	
		document.forms[0].elements[control].focus();
	}
}
function placeFocusSubmit1(frm)
{
	if(event.keyCode==13)
	{
		document.forms[0].elements[5].focus();
		//document.forms[0].elements[9].focus();
	}
}
function placeFocusSubmit2(frm)
{
	if(event.keyCode==13)
	{
		document.forms[0].elements[2].focus();
		//document.forms[0].elements[9].focus();
	}
}

function GalleryCategories_validate()
{						
	if (document.Form1.AdminContent_thewateroasis_Admin_GalleryCategories_txtGalleryCategeries.value=="")
	{
		alert("Category Name field is required");
		document.Form1.AdminContent_thewateroasis_Admin_GalleryCategories_txtGalleryCategeries.focus();
		return false;
	}
	return true;
}

function Contact_validate()
{
	if (document.Form1.txtName.value=="")
	{
		alert("Name field is required");
		document.Form1.txtName.focus();
		return false;
	}
	if (document.Form1.txtAddress.value=="")
	{
		alert("Address field is required");
		document.Form1.txtAddress.focus();
		return false;
	}
	if (document.Form1.txtPhone.value=="")
		{	
			alert("Phone Field is required.")
			document.Form1.txtPhone.focus();
			return false;
		}
		if (isNaN(document.Form1.txtPhone.value))
		{	
			alert("Phone number Must be a Numeric Value without Special Characters.")
			document.Form1.txtPhone.focus();
			return false;
		}

	if(document.Form1.txtEmail.value=="")
	{
		alert("Please Enter Your email")
		document.Form1.txtEmail.focus();
		return false;
	}
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.Form1.txtEmail.value)==false)
		{ 
		
		alert("Please Enter Valid Email Address.")
		document.Form1.txtEmail.value="";
		document.Form1.txtEmail.focus();
		return false;
		}

	if (document.Form1.txtQuestion.value=="")
	{
		alert("Question field is required");
		document.Form1.txtQuestion.focus();
		return false;
	}

		return true;
}

function popupphotogallery()
{
LeftPosition = (screen.width) ? (screen.width-800)/2 : 0;
TopPosition = (screen.height) ? (screen.height-700)/2 : 0;

window.open("PhotoGallerySlideShow.aspx" ,"slideshow", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=798,height=645,top="+TopPosition+",left="+LeftPosition)

}

function btnchgpassword_click()
{
if (document.Form1.AdminContent_txtpwd.value=="")
{
	alert("Password field is required");
	document.Form1.AdminContent_txtpwd.focus();
	return false;
}
if (document.Form1.AdminContent_txtcpwd.value=="")
{
	alert("Confirm Password field is required");
	document.Form1.AdminContent_txtcpwd.focus();
	return false;
}
return true;

}
//==================================popup_Gazebo=========popup============================

function popup_Gazebo()
{ 
	var width = 650
	var height = 650
	//LeftPosition = (screen.width-width) / 2;
	//TopPosition = (screen.height-height) / 2;
 	LeftPosition = ((document.body.offsetWidth-width) / 2)-15;
	TopPosition = ((document.body.offsetHeight-height) / 2)+120;
window.open("Gazebo.xml" , "Gazebo", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width="+width+",height="+height+",top="+TopPosition+",left="+LeftPosition)
 
}
//==================================end popup_Gazebo=========popup============================
function popup_pond()
{ 
	var width = 650
	var height = 650
	//LeftPosition = (screen.width-width) / 2;
	//TopPosition = (screen.height-height) / 2;
 	LeftPosition = ((document.body.offsetWidth-width) / 2)-15;
	TopPosition = ((document.body.offsetHeight-height) / 2)+120;
window.open("pond.xml" , "Pond", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width="+width+",height="+height+",top="+TopPosition+",left="+LeftPosition)
 
}

function btnUpload_managegallery()
{
				if (document.Form1.AdminContent_thewateroasis_Admin_ManageGallery_MyFile.value=="")
			{
			alert("Browse an image");
			document.Form1.AdminContent_thewateroasis_Admin_ManageGallery_MyFile.focus();
			return false;
			}
		
	
		return true;
}

function PhotoGalleryCategories_validate()
{
				if (document.Form1.AdminContent_thewateroasis_Admin_ManageGallery_dlfacilityid.value=="")
			{
			alert("Please Select a Gallery Name.");
			document.Form1.AdminContent_thewateroasis_Admin_ManageGallery_dlfacilityid.focus();
			return false;
			}
		
	
		return true;
}
function popup_XMLGallery1(name)
{
	var width = 650
	var height = 650
	//LeftPosition = (screen.width-width) / 2;
	//TopPosition = (screen.height-height) / 2;
	LeftPosition = ((document.body.offsetWidth-width) / 2)-15;
	TopPosition = ((document.body.offsetHeight-height) / 2)+120;
window.open("photogallery/"+name, "Gazebo", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width="+width+",height="+height+",top="+TopPosition+",left="+LeftPosition)
 
}

function popup_slideshow(name)
{ 

	var width = 720
	var height = 400
	//LeftPosition = (screen.width-width) / 2;
	//TopPosition = (screen.height-height) / 2;
	LeftPosition = ((document.body.offsetWidth-width) / 2)-15;
	TopPosition = ((document.body.offsetHeight-height) / 2)+120;
	//alert(TopPosition)
window.open("photogallery/"+name, "slideshow", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width="+width+",height="+height+",top="+TopPosition+",left="+LeftPosition)
 
}
function PopupCenter(w,h)
{
LeftPosition = (screen.width-w) / 2;
TopPosition = (screen.height-h) / 2;
/*alert(LeftPosition);
alert(TopPosition);	*/
window.open("http://mail.yahoo.com","myXMLload", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition)
}



function cntfn1()
{
	var i= document.Form1.AdminContent_thewateroasis_Admin_ManageGallery_txtimgdes.value.length;
	//alert(i)
	document.getElementById("vcnt").innerHTML="<b>"+ (255-i) +"</b> Chars Only";
}
//==================================Reserve===================================

function Reserve_validate()
{


	if (document.Form1.Content_thewateroasis_Default_Reserve_dlDemo.value=="")
	{
		alert("Select Demographic Information .")
		document.Form1.Content_thewateroasis_Default_Reserve_dlDemo.focus();
		return false;
	}	
	if (document.Form1.Content_thewateroasis_Default_Reserve_dlPlace.value=="")
	{
		alert("Select Facility Name.")
		document.Form1.Content_thewateroasis_Default_Reserve_dlPlace.focus();
		return false;
	}	
		if (document.Form1.Content_thewateroasis_Default_Reserve_txtPhone.value=="")
		{	
			alert("Phone Field is required.")
			document.Form1.Content_thewateroasis_Default_Reserve_txtPhone.focus();
			return false;
		}
		if (isNaN(document.Form1.Content_thewateroasis_Default_Reserve_txtPhone.value))
		{	
			alert("Phone number Must be a Numeric Value without Special Characters.")
			document.Form1.Content_thewateroasis_Default_Reserve_txtPhone.focus();
			return false;
		}
		if (document.Form1.Content_thewateroasis_Default_Reserve_txtZipCode.value=="")
		{	
			alert("ZipCode Field is required.")
			document.Form1.Content_thewateroasis_Default_Reserve_txtZipCode.focus();
			return false;
		}
		if (isNaN(document.Form1.Content_thewateroasis_Default_Reserve_txtZipCode.value))
		{	
			alert("ZipCode Must be a Numeric Value without Special Characters.")
			document.Form1.Content_thewateroasis_Default_Reserve_txtZipCode.focus();
			return false;
		}
		if(document.Form1.Content_thewateroasis_Default_Reserve_txtEmail.value=="")
	{
		alert("Please Enter Your email")
		document.Form1.Content_thewateroasis_Default_Reserve_txtEmail.focus();
		return false;
	}
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.Form1.Content_thewateroasis_Default_Reserve_txtEmail.value)==false)
		{ 
		
		alert("Please Enter Valid Email Address.")
		document.Form1.Content_thewateroasis_Default_Reserve_txtEmail.value="";
		document.Form1.Content_thewateroasis_Default_Reserve_txtEmail.focus();
		return false;
		}
	return true;
}
//=====================================================================
function Reserve_validate_admin()
{

	//alert("hai")
	if ((document.Form1.AdminContent_thewateroasis_Admin_Reserve_txtSdate.value != "") || (document.Form1.AdminContent_thewateroasis_Admin_Reserve_txtEndDate.value!="" ))
	{
		if (isDate(document.Form1.AdminContent_thewateroasis_Admin_Reserve_txtSdate.value)== false)
		{
		document.Form1.AdminContent_thewateroasis_Admin_Reserve_txtSdate.focus();
		return false;
		}
		if (isDate(document.Form1.AdminContent_thewateroasis_Admin_Reserve_txtEndDate.value)== false)
		{
		document.Form1.AdminContent_thewateroasis_Admin_Reserve_txtEndDate.focus();
		return false;
	
		}
	if (document.Form1.AdminContent_thewateroasis_Admin_Reserve_txtSdate.value=="" && document.Form1.AdminContent_thewateroasis_Admin_Reserve_txtEndDate.value!="" )
		{	
			alert("Start date Field is required.")
			document.Form1.AdminContent_thewateroasis_Admin_Reserve_txtSdate.focus();
			return false;
		}
		if (document.Form1.AdminContent_thewateroasis_Admin_Reserve_txtSdate.value!="" && document.Form1.AdminContent_thewateroasis_Admin_Reserve_txtEndDate.value=="" )
		{	
			alert("End date Field is required.")
			document.Form1.AdminContent_thewateroasis_Admin_Reserve_txtEndDate.focus();
			return false;
		}
	}
		
		return true;
		
}
function isDate(dateStr) {
var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
var matchArray = dateStr.match(datePat); // is the format ok?

if (matchArray == null) {
alert("Please enter date in mm/dd/yyyy format.");
return false;
}

month = matchArray[1]; // p@rse date into variables
day = matchArray[3];
year = matchArray[5];

if (month < 1 || month > 12) { // check month range
alert("Month must be between 1 and 12.");
return false;
}

if (day < 1 || day > 31) {
alert("Day must be between 1 and 31.");
return false;
}

if ((month==4 || month==6 || month==9 || month==11) && day==31) {
alert("Month "+month+" doesn`t have 31 days!")
return false;
}

if (month == 2) { // check for february 29th
var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
if (day > 29 || (day==29 && !isleap)) {
alert("February " + year + " doesn`t have " + day + " days!");
return false;
}
}
return true; // date is valid
}


function getDetails(obj){
clickX = window.event.x-obj.offsetLeft;
clickY = window.event.y-obj.offsetTop;
//alert("left :"+clickX);
//alert(clickY);
}

function changeimage()
{
//alert("adfas");
//alert(document.Form1.Content_thewateroasis_Default_Reserve_dlPlace.value);
var imgid;
var imageName;
imgid=document.Form1.Content_thewateroasis_Default_Reserve_dlPlace.value;
if (imgid==6)
{
imageName="images/images/Gazebo1.jpg";
}
else if(imgid==7)
{
imageName="images/images/Pond1.jpg";
}
else if(imgid==10)
{
imageName="images/images/reserve1.jpg";
}
else if(imgid==11)
{
imageName="images/images/Columns1.jpg";
}
else if(imgid==12)
{
imageName="images/images/Cabana1.jpg";
}
else 
{
//if(imgid==15)
imageName="images/images/Beach1.jpg";
}
document.Form1.Content_thewateroasis_Default_Reserve_Image1.src=imageName;

}

