function markSelection(mark_type){
	var objSel = document.selection.createRange();
	var txtSel = objSel.text
	
	if(mark_type == 'bold'){ 
		objSel.text = "<b>"+txtSel+"</b>"; 
	} 

	if(mark_type == 'underline'){ 
		objSel.text = "<u>"+txtSel+"</u>"; 
	}

	if(mark_type == 'italics'){ 
		objSel.text = "<i>"+txtSel+"</i>"; 
	} 

	if(mark_type == 'strike'){ 
		objSel.text = "<s>"+txtSel+"</s>"; 
	}

	if(mark_type == 'link'){ 
		objSel.text = "<a href='"+txtSel+"'>"+txtSel+"</a>"; 
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function link_property_pretty_view(intID){
	var loc = "PropertiesViewPretty.asp?Mode=Popup&Property_ID=" + intID;
	window.open(loc,"_blank","height=600,width=800,resizable=yes,scrollbars=yes");
}

function btnMembershipAppSubmit_onclick(){
	if(TrimString(document.frmMembershipApp.txtFirst_Name.value)=='')
	{
		alert("Please enter your First name.");
		document.frmMembershipApp.txtFirst_Name.focus();
		return false
	}
	if(TrimString(document.frmMembershipApp.txtLast_Name.value)=='')
	{
		alert("Please enter your Last name.");
		document.frmMembershipApp.txtLast_Name.focus();
		return false
	}
	if(TrimString(document.frmMembershipApp.txtAddress1.value)=='')
	{
		alert("Please enter your mailing address.");
		document.frmMembershipApp.txtAddress1.focus();
		return false
	}
	if(TrimString(document.frmMembershipApp.txtCity.value)=='')
	{
		alert("Please enter your city.");
		document.frmMembershipApp.txtCity.focus();
		return false
	}
	
	
	document.frmMembershipApp.submit();
	return true
}

function btnSubmit1_onclick()
{
	if(TrimString(document.frmEmail.txtUser_Comments.value)=='')
	{
		alert("Please enter your message.");
		document.frmEmail.txtUser_Comments.focus();
		return false
	}
	
	document.frmEmail.submit();
	return true
}

function btnContactUsSubmit_onclick()
{
	if(TrimString(document.frmContact.txtEmail.value)=='')
	{
		alert("Please enter your email address.");
		document.frmContact.txtEmail.focus();
		return false
	}
	
	//document.frmContact.submit();
	return true
}


function onchkAnonymous()
{
	if(document.frmEmail.chkContact.checked)
	{
		if(confirm("We can't contact you if you want to submit comments anonymously.\nAre you sure you want to be anonymous?"))
		{
			document.frmEmail.chkContact.checked = false;
		}
		else
		{
			document.frmEmail.chkAnonymous.checked = false;
		}
	}
}

function onchkContact()
{
	if(document.frmEmail.chkAnonymous.checked)
	{
		if(confirm("We can't contact you if you want to submit comments anonymously.\nDo you want us to contact you?"))
		{
			document.frmEmail.chkAnonymous.checked = false;
		}
		else
		{
			document.frmEmail.chkContact.checked = false;
		}
	}
}

function Tellafriend_btnSubmit_onclick()
{
	if(TrimString(document.frmContact.txtUser_Email.value)=='')
	{
		alert("Please enter your email address.");
		document.frmContact.txtUser_Email.focus();
		return false
	}
	
	if(TrimString(document.frmContact.txtFriend_Email.value)=='')
	{
		alert("Please enter the email address of your friend.");
		document.frmContact.txtFriend_Email.focus();
		return false
	}
	
	document.frmContact.submit();
	return true
}

function Send_Brochure_btnSubmit_onclick()
{
	if(TrimString(document.frmBrochure.txtFirst_Name.value)=='')
	{
		alert("Please enter your First name.");
		document.frmBrochure.txtFirst_Name.focus();
		return false
	}
	if(TrimString(document.frmBrochure.txtLast_Name.value)=='')
	{
		alert("Please enter your Last name.");
		document.frmBrochure.txtLast_Name.focus();
		return false
	}
	if(TrimString(document.frmBrochure.txtAddress1.value)=='')
	{
		alert("Please enter your mailing address.");
		document.frmBrochure.txtAddress1.focus();
		return false
	}
	if(TrimString(document.frmBrochure.txtCity.value)=='')
	{
		alert("Please enter your city.");
		document.frmBrochure.txtCity.focus();
		return false
	}
	
	
	document.frmBrochure.submit();
	return true
}

function PublicBrowse_link_view(intID)
{
	document.frmBrowse.cboGeoLocation.value = intID;	
	document.frmBrowse.submit();
}

function PropAvailNearFuture_link_view(intID){
	var loc = "PropertiesViewPretty.asp?Mode=Popup&Property_ID=" + intID;
	window.open(loc,"_blank","height=600,width=800,resizable=yes,scrollbars=yes");
}
	
	
