function deleteOpenHouse(link,id,realtorOnly) {

	while(link.tagName != "TR") {
		link = link.parentNode
	}
	link.style.backgroundColor = "#FFFFCC"
	if(window.confirm("Are you sure you want to delete this Open House?")) {
		document.forms[0].hidID.value = id
		var qs = (realtorOnly) ? "?r=y" : ""
		document.forms[0].action = "DeleteOpenHouse.aspx"+qs
		document.forms[0].method = "post"
		document.forms[0].submit()
	}
	else {
		link.style.backgroundColor = ""
	}
}


function addNewOpenHouse(realtorOnly) {
	var df = document.forms[0]
	df.hidID.value = "NEW"
	if(realtorOnly) {
		df.action = "EditOpenHouse.aspx?r=y"
	}
	else {
		df.action = "EditOpenHouse.aspx"
	}
	df.method = "post"
	df.submit()
}


function editOpenHouse(id,realtorOnly) {
	var df = document.forms[0]
	if(id == null) {
		df.hidID.value = "NEW"
	}
	else {
		df.hidID.value = id
	}
	if(realtorOnly) {
		df.action = "EditOpenHouse.aspx?r=y"
	}
	else {
		df.action = "EditOpenHouse.aspx"
	}
	df.method = "post"
	df.submit()
}


function realtorsOnlyMsg(chkBox) {	
	if(chkBox.checked) {
		alert("By choosing this option this open house will only be viewable to the users of this system who are realtors and not to the public.  These open houses can be viewed by choosing the \"View Realtor Open Houses\" option from the \"Realtor Functions\" menu at the top of the page")
	}
}