function ArrangeViewing_Forms_Validate(oForm){
	/*if ( oForm.slSalutation.value.length == 0 ){
		alert("Please select an appropriate salutation");
		oForm.slSalutation.focus();
		return false;
	}*/
	if ( oForm.txtContactName.value.length == 0 ){
		alert("Please enter your name");
		oForm.txtContactName.focus();
		return false;
	}
	
	if ( oForm.txtHomeTelephone.value.length == 0 ){
		alert("Please provide a primary telephone number so that we can contact you");
		oForm.txtHomeTelephone.focus();
		return false;
	}

	oCookieManager.StoreFormData();
	return true;
}

function ArrangeViewing_OnPropertySelectedViewChange(){
	if (typeof document.frmArrangeViewing.chkSavedProperties_SelectedItem.length != "undefined"){
		var iSelected = 0;
		for ( var i = 0; i < document.frmArrangeViewing.chkSavedProperties_SelectedItem.length; i ++ ){
			var oItem = document.frmArrangeViewing.chkSavedProperties_SelectedItem[i];
			if ( oItem.checked ){
				iSelected ++;
			}
		}
		if ( iSelected == 0 ){
			alert("You must select at least one property to view");
			return false;
		}
		
	}else{
		alert("You must select at least one property to view");
		return false;
	}
}

function Page_ArrangeViewing_Calendar_OnClick(){
	HttpManager.Document.GetObject("pnlCalendar").style.visibility = "visible";
}

function Calendar_OnDateSelected(newdate){
	HttpManager.Document.GetObject("_ctl1_CenterRegion_txtDateText").innerHTML = newdate;
	Calendar_OnCancel();
}

function Calendar_OnCancel(){
	HttpManager.Document.GetObject("pnlCalendar").style.visibility = "hidden";
}
