	var menuButton = ""
	function ShowLogin()
	{
		var strLogin = ""
		strLogin += "	<table BORDER=\"0\" bgcolor=\"white\" CELLSPACING=\"0\" CELLPADDING=\"0\" width=\"100%\" style=\"border:solid thin #f47829;\">"
		strLogin += "	<tr>"
		strLogin += "		<td VALIGN=\"top\" ALIGN=\"center\" style=\"background-color:#f47829;color:white;height:14px;font-size:12pt;font-weight:800;\">SWFHomes Login&nbsp;&nbsp;&nbsp;<\/td>"
		strLogin += "		<td VALIGN=\"top\" ALIGN=\"right\" style=\"background-color:#f47829;height:14px;font-size:12pt;font-weight:800;\"><IMG SRC=\"/images/close.jpg\" alt=\"Close\" height=\"20\" onclick=\"closePopup(false)\"><\/td>"
		strLogin += "	<\/tr>"
		strLogin += "	<tr><td align=center colspan=2>"
		strLogin += "	<form name=\"LoginForm\" ID=\"LoginForm\" method=\"post\" action=\""+cCurURL+"\">"
		strLogin += "	<input type=hidden name=action id=action value=login>"
		strLogin += "		<table>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">User ID:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><INPUT type=\"text\" id=\"cLogin\" name=\"cLogin\" size=\"18\" maxlength=\"50\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">Password:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><INPUT type=\"password\" id=\"cPassword\" name=\"cPassword\" size=\"18\" maxlength=\"30\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">Remember Me:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><INPUT type=\"checkbox\" id=\"RememberMe\" name=\"RememberMe\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr><td colspan=\"2\" align=\"center\"><a href=\"javascript:ShowPassGet()\"><b>Help! I forgot my Password.<\/b><\/a><\/td><\/tr>"
		strLogin += "			<tr><td colspan=\"2\" align=\"center\">&nbsp;<\/td><\/tr>"
		strLogin += "			<tr><td colspan=\"2\" align=\"center\"><INPUT type=\"button\" value=\"Cancel\" id=btnCancel name=btnCancel onclick=\"closePopup(false)\">&nbsp;&nbsp;&nbsp;&nbsp;<INPUT type=\"submit\" value=\"Login\" id=btnLogin name=btnLogin><\/td><\/tr>"
		strLogin += "			<tr><td colspan=\"2\"><hr><\/td><\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td colspan=\"2\" align=\"left\" class=\"FieldLabel2\"><center>Not Registered Yet?<\/center><ul style=\"margin-left: 15; padding-left: 0;\">"
		strLogin += "				<li>Create Custom Searches<\/li>"
		strLogin += "				<li>Have your Searches Emailed to you.<\/li>"
		strLogin += "				<li>Save your shopping cart for latter use.<\/li>"
		strLogin += "				<\/ul><center><a href=\"javascript:ShowRegister()\"><b>Click Here<\/b> to Register<\/a><\/center><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "		<\/table>"
		strLogin += "	<\/form>"
		strLogin += "	<\/td><\/tr>"	
		strLogin += "	<\/table>"

		document.getElementById("LoginBlock").className = "modalPopUp"
		document.getElementById("LoginBlock").innerHTML = strLogin
		document.getElementById("cLogin").focus()
	}
	function ShowRegister()
	{

		var strLogin = ""
		strLogin += "	<table BORDER=\"0\" bgcolor=\"white\" CELLSPACING=\"0\" CELLPADDING=\"0\" width=\"100%\" style=\"border:solid thin #f47829;\">"
		strLogin += "	<tr>"
		strLogin += "		<td VALIGN=\"top\" ALIGN=\"center\" style=\"background-color:#f47829;color:white;height:14px;font-size:12pt;font-weight:800;\" nowrap>SWFHomes Registration&nbsp;&nbsp;&nbsp;<\/td>"
		strLogin += "		<td VALIGN=\"top\" ALIGN=\"right\" style=\"background-color:#f47829;height:14px;font-size:12pt;font-weight:800;\"><IMG SRC=\"/images/close.jpg\" alt=\"Close\" height=\"20\" onclick=\"closePopup(false)\"><\/td>"
		strLogin += "	<\/tr>"
		strLogin += "	<tr><td align=center colspan=2>"
		strLogin += "	<form name=\"RegisterForm\" ID=\"RegisterForm\" method=\"post\" action=\""+cCurURL+"\">"
		strLogin += "	<input type=hidden name=action id=action value=register>"
		strLogin += "		<table>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">First Name:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><INPUT type=\"text\" id=\"cFName\" name=\"cFName\" size=\"20\" maxlength=\"50\" value=\""+cFName+"\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">Last Name:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><INPUT type=\"text\" id=\"cLName\" name=\"cLName\" size=\"20\" maxlength=\"50\" value=\""+cLName+"\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">Email:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><INPUT type=\"text\" id=\"cEmail\" name=\"cEmail\" size=\"30\" maxlength=\"150\" value=\""+cEmail+"\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">User ID:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><INPUT type=\"text\" id=\"cUID\" name=\"cUID\" size=\"20\" maxlength=\"30\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">Password:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><INPUT type=\"password\" id=\"cPassword\" name=\"cPassword\" size=\"20\" maxlength=\"30\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">Verify Password:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><INPUT type=\"password\" id=\"cVPassword\" name=\"cVPassword\" size=\"20\" maxlength=\"30\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td colspan=\"2\" align=\"left\" class=\"FieldLabel2\">You must fill this information in completely and use a valid email address. You will be sent a confirmation email. Please read this email and follow its directions to complete the registration process.<br><center>Thank You.<\/center><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td colspan=\"2\" align=\"center\" class=\"FieldLabel\"><INPUT type=\"button\" value=\"Cancel\" id=btnCancel name=btnCancel onclick=\"closePopup(false)\">&nbsp;&nbsp;<INPUT type=\"button\" value=\"Register\" id=btnLogin name=btnLogin onclick=\"cmdRegister()\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "	<tr><td>&nbsp;<\/td><\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td colspan=\"2\" align=\"center\" class=\"FieldLabel\">If you have already registered,<br><a href=\"javascript:ShowLogin()\">click here to login.<\/a><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "		<\/table>"
		strLogin += "	<\/form>"
		strLogin += "	<\/td><\/tr>"	
		strLogin += "	<\/table>"

		document.getElementById("LoginBlock").className = "modalPopUp";
		document.getElementById("LoginBlock").innerHTML = strLogin;
	}
	function ShowPassGet()
	{
		var strLogin = ""
		strLogin += "	<table BORDER=\"0\" bgcolor=\"white\" CELLSPACING=\"0\" CELLPADDING=\"0\" width=\"100%\" style=\"border:solid thin #f47829;\">"
		strLogin += "	<tr>"
		strLogin += "		<td VALIGN=\"top\" ALIGN=\"center\" style=\"background-color:#f47829;color:white;height:14px;font-size:12pt;font-weight:800;\" nowrap>SWFHomes Get Password&nbsp;&nbsp;&nbsp;<\/td>"
		strLogin += "		<td VALIGN=\"top\" ALIGN=\"right\" style=\"background-color:#f47829;height:14px;font-size:12pt;font-weight:800;\"><IMG SRC=\"/images/close.jpg\" alt=\"Close\" height=\"20\" onclick=\"closePopup(false)\"><\/td>"
		strLogin += "	<\/tr>"
		strLogin += "	<tr><td align=center colspan=2>"
		strLogin += "	<form name=\"LoginForm\" ID=\"LoginForm\" method=\"post\" action=\""+cCurURL+"\">"
		strLogin += "	<input type=hidden name=action id=action value=passget>"
		strLogin += "		<table>"
		strLogin += "			<tr>"
		strLogin += "				<td colspan=\"2\" class=\"FieldLabel2\">Type in your Email Address or User ID. You will be sent both your User ID and Password by email. <br><font color=red> <i>Be sure to check your junk mail folder if you do not see it in your inbox.<\/i><\/font><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">Email Address:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><INPUT type=\"text\" id=\"cEmail\" name=\"cEmail\" size=\"30\" maxlength=\"200\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">User ID:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><INPUT type=\"text\" id=\"cUserID\" name=\"cUserID\" size=\"18\" maxlength=\"50\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td colspan=\"2\" align=\"center\"><INPUT type=\"submit\" value=\"Submit\" id=btnLogin name=btnLogin><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "		<\/table>"
		strLogin += "	<\/form>"
		strLogin += "	<\/td><\/tr>"	
		strLogin += "	<tr><td>&nbsp;<\/td><\/tr>"
		strLogin += "	<\/table>"

		document.getElementById("LoginBlock").className = "modalPopUp"
		document.getElementById("LoginBlock").innerHTML = strLogin
		document.getElementById("cEmail").focus()
	}

	function xxxShowQuickSearch()
	{
		var strLogin = ""
		strLogin += "	<table BORDER=\"0\" bgcolor=\"white\" CELLSPACING=\"0\" CELLPADDING=\"0\" width=\"100%\" style=\"border:solid thin #f47829;\">"
		strLogin += "	<tr>"
		strLogin += "		<td VALIGN=\"top\" ALIGN=\"center\" style=\"background-color:#f47829;color:white;height:14px;font-size:12pt;font-weight:800;\" nowrap>Listings Alert Wizard&nbsp;&nbsp;&nbsp;<\/td>"
		strLogin += "		<td VALIGN=\"top\" ALIGN=\"right\" style=\"background-color:#f47829;height:14px;font-size:12pt;font-weight:800;\"><IMG SRC=\"/images/close.jpg\" alt=\"Close\" height=\"20\" onclick=\"closePopup(false)\"><\/td>"
		strLogin += "	<\/tr>"
		strLogin += "	<tr><td align=center colspan=2>"
		strLogin += "	<form name=\"SearchForm\" ID=\"SearchForm\" method=\"post\" action=\""+cCurURL+"\">"
		strLogin += "	<input type=hidden name=action id=action value=SearchSignup>"
		strLogin += "	<input type=hidden name=SearchName id=SearchName>"
		strLogin += "		<table>"
		strLogin += "			<tr>"
		strLogin += "				<td colspan=\"2\" class=\"FieldLabel2\"><hr><IMG SRC=\"/images/step1.gif\"><br>Please Enter Your Email Address.<\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">Email Address:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><INPUT type=\"text\" id=\"Email\" name=\"Email\" size=\"30\" maxlength=\"200\" value=\""+cEmail+"\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td colspan=\"2\" class=\"FieldLabel2\"><hr><IMG SRC=\"/images/step2.gif\"><br>What are you looking for in a house?<\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">City:<\/td>"
		strLogin += "				<td class=\"FieldInfo\">"+cCityDLL+"<\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">Property Type:<\/td>"
		strLogin += "				<td class=\"FieldInfo\">"+cPropType+"<\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">Bedrooms:<\/td>"
		strLogin += "				<td class=\"FieldInfo\">"+cBedRooms+"<\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">Maximum Price:<\/td>"
		strLogin += "				<td class=\"FieldInfo\">"+cPriceRange+"<\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td colspan=\"2\" class=\"FieldLabel2\" nowrap><hr><IMG SRC=\"/images/step3.gif\"><br>How would you like to receive your report?&nbsp;&nbsp;&nbsp;&nbsp;<\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">How Often:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><SELECT id=HowOften name=HowOften><OPTION value=1>Monthly<\/OPTION><OPTION value=2>Weekly<\/OPTION><OPTION value=3>Daily<\/OPTION><\/SELECT><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">How Long:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><SELECT id=HowLong name=HowLong><OPTION value=1 selected>1 Month<\/OPTION><OPTION value=3>3 Months<\/OPTION><OPTION value=6>6 Months<\/OPTION><\/SELECT><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td nowrap class=\"FieldLabel\">New Listings<br>Only?:<\/td>"
		strLogin += "				<td class=\"FieldInfo\"><INPUT type=\"radio\" id=NewOnly name=NewOnly value=1 checked> Yes &nbsp;&nbsp;&nbsp;&nbsp;<INPUT type=\"radio\" id=NewOnly name=NewOnly value=0> No<\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr>"
		strLogin += "				<td colspan=\"2\" align=\"center\"><hr><INPUT type=\"button\" value=\"Cancel\" id=btnCancel name=btnCancel onclick=\"closePopup(false)\">&nbsp;&nbsp;<INPUT type=\"button\" value=\"Create My Search\" id=btnCreateSearch name=btnCreateSearch onclick=\"cmdCreateSearch()\"><\/td>"
		strLogin += "			<\/tr>"
		strLogin += "		<\/table>"
		strLogin += "	<\/form>"
		strLogin += "	<\/td><\/tr>"	
		strLogin += "	<tr><td>&nbsp;<\/td><\/tr>"
		strLogin += "	<\/table>"
//document.getElementById("test1").value = strLogin
		document.getElementById("LoginBlock").className = "modalPopUp"
		document.getElementById("LoginBlock").innerHTML = strLogin
		document.getElementById("Email").focus()
	}
	
	function cmdCreateSearch()
	{
		//var sn = prompt("What would you like to name this search?\nExamples: \"My Condos\", \"Weekly Search\" . . . ","Quick Search")
		//if (sn != null)
		//{
			//document.SearchForm.SearchName.value=sn
			if ((document.getElementById("eSearchName").className == "ErrorShow")&&(document.getElementById("eEmail").className == "ErrorShow"))
			{
				alert("You must resolve the errors before you can submit this form.\nLook for the red text under each field for more information.")
			}
			else
			{
				document.SearchForm.submit();
			}
		//}
	}
	
	function closePopup(Reload)
	{
		
		document.getElementById("LoginBlock").innerHTML = "";
		document.getElementById("LoginBlock").className = "modalHidden";
		if (Reload)
		{
			document.location.href = cCurURL
		}
	}

	function ShowProcessing(mode)
	{
		var ProgressText, os;
		switch (mode)
		{
			case "COM":
				ProgressText="LOADING<br>COMMUNITY LIST";
				break;
			case "CON":
				ProgressText="LOADING<br>CONDO LIST";
				break;
		}
		os="<div style='background-color:#77a0b5;color:white;font-size:12pt;font-weight:bold;'>";
		os += "<img src='/images/work_in_progress.gif' border=0><br>"+ProgressText+"<br>&nbsp;</div>";
		
		document.getElementById("LoginBlock").className = "modalPopUp";
		document.getElementById("LoginBlock").style.height = 250;
		document.getElementById("LoginBlock").innerHTML = os;
	}
	

	function openMenu(divName)
	{
		var newMenu = ""
		if (document.getElementById(divName+1)) {document.getElementById(divName+1).style.display = "block"}
		if (document.getElementById(divName+2)) {document.getElementById(divName+2).style.display = "block"}
		if (document.getElementById(divName+3)) {document.getElementById(divName+3).style.display = "block"}
		if (document.getElementById(divName+4)) {document.getElementById(divName+4).style.display = "block"}
		if (document.getElementById(divName+5)) {document.getElementById(divName+5).style.display = "block"}
		if (document.getElementById(divName+6)) {document.getElementById(divName+6).style.display = "block"}
		if (document.getElementById(divName+7)) {document.getElementById(divName+7).style.display = "block"}
		if (document.getElementById(divName+8)) {document.getElementById(divName+8).style.display = "block"}
		if (document.getElementById(divName+9)) {document.getElementById(divName+9).style.display = "block"}
		if (document.getElementById(divName+10)) {document.getElementById(divName+10).style.display = "block"}
	}
	
	function closeMenu(divName)
	{
		if (document.getElementById(divName+1)) {document.getElementById(divName+1).style.display = "block"}
		if (document.getElementById(divName+2)) {document.getElementById(divName+2).style.display = "none"}
		if (document.getElementById(divName+3)) {document.getElementById(divName+3).style.display = "none"}
		if (document.getElementById(divName+4)) {document.getElementById(divName+4).style.display = "none"}
		if (document.getElementById(divName+5)) {document.getElementById(divName+5).style.display = "none"}
		if (document.getElementById(divName+6)) {document.getElementById(divName+6).style.display = "none"}
		if (document.getElementById(divName+7)) {document.getElementById(divName+7).style.display = "none"}
		if (document.getElementById(divName+8)) {document.getElementById(divName+8).style.display = "none"}
		if (document.getElementById(divName+9)) {document.getElementById(divName+9).style.display = "none"}
		if (document.getElementById(divName+10)) {document.getElementById(divName+10).style.display = "none"}
	}
	function cmdRegister()
	{
		var outStr = ""
		outStr += (document.getElementById("cFName").value == "") ? "First Name cannot be Blank.\n" : ""
		outStr += (document.getElementById("cLName").value == "") ? "Last Name cannot be Blank.\n" : ""
		outStr += (document.getElementById("cEmail").value == "") ? "Email cannot be Blank.\n" : ""
		outStr += (document.getElementById("cEmail").value.indexOf("@") < 0) ? "Your Email Address is not formatted correctly.\n" : ""
		outStr += (document.getElementById("cUID").value == "") ? "User ID cannot be Blank.\n" : ""
		outStr += (document.getElementById("cPassword").value == "") ? "Password cannot be Blank.\n" : ""
		outStr += (document.getElementById("cVPassword").value != document.getElementById("cPassword").value) ? "Password and Verify Password do not match please try again.\n" : ""
		
		if (outStr =="")	
		{
			document.RegisterForm.submit()
		}
		else
		{
			alert(outStr)
		}
	}
	function ShowLogout()
	{
		var strLogin = ""
		strLogin += "	<table BORDER=\"0\" bgcolor=\"white\" CELLSPACING=\"0\" CELLPADDING=\"0\" width=\"100%\" style=\"border:solid thin #f47829;\">"
		strLogin += "	<tr>"
		strLogin += "		<td VALIGN=\"top\" ALIGN=\"center\" style=\"background-color:#f47829;color:white;height:14px;font-size:12pt;font-weight:800;\" nowrap>SWFHomes Logout&nbsp;&nbsp;&nbsp;<\/td>"
		strLogin += "		<td VALIGN=\"top\" ALIGN=\"right\" style=\"background-color:#f47829;height:14px;font-size:12pt;font-weight:800;\"><IMG SRC=\"/images/close.jpg\" alt=\"Close\" height=\"20\" onclick=\"closePopup(false)\"><\/td>"
		strLogin += "	<\/tr>"
		strLogin += "	<tr><td align=center colspan=2>"
		strLogin += "	<form name=\"LoginForm\" ID=\"LoginForm\" method=\"post\" action=\""+cCurURL+"\">"
		strLogin += "	<input type=hidden name=action id=action value=logout>"
		strLogin += "		<table>"
		strLogin += "			<tr>"
		strLogin += "				<td class=\"FieldInfo\">Click Logout below if you wish to continue to logout of the site.<\/td>"
		strLogin += "			<\/tr>"
		strLogin += "			<tr><td align=\"center\"><INPUT type=\"button\" value=\"Cancel\" id=btnCancel name=btnCancel onclick=\"closePopup(false)\">&nbsp;&nbsp;&nbsp;&nbsp;<INPUT type=\"submit\" value=\"Logout\" id=btnLogin name=btnLogin><\/td><\/tr>"
		strLogin += "		<\/table>"
		strLogin += "	<\/form>"
		strLogin += "	<\/td><\/tr>"	
		strLogin += "	<\/table>"

		document.getElementById("LoginBlock").className = "modalPopUp"
		document.getElementById("LoginBlock").innerHTML = strLogin
	}
	
	function addbookmark(URL,TITLE)
	{
		bookmarkurl=URL
		bookmarktitle=TITLE
		if (document.all)
		{
			window.external.AddFavorite(bookmarkurl,bookmarktitle)
		}
		else
		{
			alert("You browser requires that you press [CTRL]+[D] to add a bookmark.")
		}
	}
	function popWin(URL, Name, Options)
	{
		var PopWin = window.open(URL,Name,Options)
		PopWin.focus()
		
	}
	function AdminEditArea(e,URL,ELEMENT)
	{
		var nav4 = window.Event ? true : false;
		if (nav4) { 
			var a = e.modifiers & Event.ALT_MASK;
			var c = e.modifiers & Event.CONTROL_MASK;
			var s = e.modifiers & Event.SHIFT_MASK;
			var m = e.modifiers & Event.META_MASK;
		} else {
			var a = window.event.altKey;
			var c = window.event.ctrlKey;
			var s = window.event.shiftKey;
			var m = false;
		}
		
		if (c)
		{
			document.location.href =  "/intranet/functions/PageEditor.asp?PageSpec="+cMapPath+"\\"+URL.toString()+"&PageElement="+ELEMENT.toString()
		}
		else
		{
		
		}
	}
	function GetSelectedValue(SelectBox)
{
	return document.getElementById(SelectBox)[document.getElementById(SelectBox).selectedIndex].text
//	SelectValue = document.getElementById(SelectBoxName)[document.getElementById(SelectBoxName).selectedIndex].value
}
function GetCityLink(SelectBox)
{
	re = new RegExp("[ ]","g")
	var cty = document.getElementById(SelectBox)[document.getElementById(SelectBox).selectedIndex].text
	return cty.replace(re,"-")
}
function GoCom(City)
{
	if (City=="Select-All-Cities")
	{
		document.location.href = "/Southwest-Florida/Communities.asp"
	}
	else
	{
		document.location.href = "/" +PCase(City)+ "-Communities.asp"
	}
}
function GoCondo(City)
{
	if (City=="Select-All-Cities")
	{
		document.location.href = "/Southwest-Florida/Condos.asp"
	}
	else
	{
		document.location.href = "/" +PCase(City)+ "-Condos.asp"
	}
}
function GoNew(City)
{
	if (City=="Select-All-Cities")
	{
		document.location.href = "/Southwest-Florida/Homes.asp"
	}
	else
	{
		document.location.href = "/" +PCase(City)+ "-Homes.asp"
	}
}
function GoFore(City)
{
	if (City=="Select-All-Cities")
	{
		document.location.href = "/Southwest-Florida/Foreclosures.asp"
	}
	else
	{
		document.location.href = "/" +PCase(City)+ "-Foreclosures.asp"
	}
}
function GoFore2(City)
{
	if (City=="Select-All-Cities")
	{
		document.location.href = "/Southwest-Florida/Foreclosures.asp#Property-List"
	}
	else
	{
		document.location.href = "/" +PCase(City)+ "-Foreclosures.asp#Property-List"
	}
}
function GoGolf(City)
{
	if (City=="Select-All-Cities")
	{
		document.location.href = "/Southwest-Florida/Golf-Courses.asp"
	}
	else
	{
		document.location.href = "/" +PCase(City)+ "-Golf-Courses.asp"
	}
}
function GoRE(City)
{
	if (City=="Select-All-Cities")
	{
		document.location.href = "/Southwest-Florida/Real-Estate.asp"
	}
	else
	{
		document.location.href = "/" +PCase(City)+ "-Real-Estate.asp"
	}
}
function GoCity(City)
{
	if (City=="Select-All-Cities")
	{
		document.location.href = "/Southwest-Florida/Information.asp"
	}
	else
	{
		document.location.href = "/" +PCase(City)+ "-Florida.asp"
	}
}
function RecordChange(tst)
{
	var mRecordCount = parseInt(document.getElementById("RecordCount").value);
	var mCurrentPage = parseInt(document.getElementById("curPage").value)
	var mItemsPerPage = parseInt(GetSelectedValue("itemsPerPage"))
	var mTotalPages = ((mRecordCount-(mRecordCount%mItemsPerPage))/mItemsPerPage)
//alert(mTotalPages)
	if ((mRecordCount%mItemsPerPage)>0) {mTotalPages++}
//alert(mTotalPages)
	switch (tst)
	{
		case "F":
			document.getElementById("curPage").value=1
			document.MyForm.submit();
			break
		case "P":
			if ((mCurrentPage-1) > 0)
			{
				document.getElementById("curPage").value=mCurrentPage-1
			}
			else
			{
				document.getElementById("curPage").value=mCurrentPage
			}
			document.MyForm.submit();
			break
		case "N":
			if ((mCurrentPage+1) <= mTotalPages)
			{
				document.getElementById("curPage").value=mCurrentPage+1
			}
			else
			{
				document.getElementById("curPage").value=mCurrentPage
			}
			document.MyForm.submit();
			break
		case "L":
			document.getElementById("curPage").value=mTotalPages
			document.MyForm.submit();
			break
		case "X":
			document.getElementById("curPage").value=1
			document.MyForm.submit();
			break			
		case "T":
			document.MyForm.submit();
			break			
	}
}
function PCase(STRING){
	var strReturn_Value = "";
	var iTemp = STRING.length;
	if(iTemp==0){
		return"";
	}
	var UcaseNext = false;
	strReturn_Value += STRING.charAt(0).toUpperCase();
	for(var iCounter=1;iCounter < iTemp;iCounter++){
		if(UcaseNext == true){
			strReturn_Value += STRING.charAt(iCounter).toUpperCase();
		}
		else{
			strReturn_Value += STRING.charAt(iCounter).toLowerCase();
		}
		var iChar = STRING.charCodeAt(iCounter);
		if(iChar == 32 || iChar == 45 || iChar == 46){
			UcaseNext = true;
		}
		else{
			UcaseNext = false
		}
		if(iChar == 99 || iChar == 67){
			if(STRING.charCodeAt(iCounter-1)==77 || STRING.charCodeAt(iCounter-1)==109){
				UcaseNext = true;
			}
		}
	} //End For

	return strReturn_Value;

}
function RememberMyCart()
{
	var os="";
		os += "<table BORDER=\"0\" bgcolor=\"white\" CELLSPACING=\"0\" CELLPADDING=\"0\" width=\"100%\" style=\"\">";
		os +=	"<tr>";
		os +=		"<td VALIGN=\"middle\" ALIGN=\"left\" style=\"background-color:#f47829;color:white;height:28px;font-size:12pt;font-weight:800;\">Remember My Cart<\/td>";
		os +=		"<td VALIGN=\"top\" ALIGN=\"right\" style=\"background-color:#f47829;height:28px;font-size:12pt;font-weight:800;\"><IMG SRC=\"/images/close.jpg\" alt=\"Close\" height=\"20\" onclick=\"closePopup(false)\" style=\"border:thin inset;\" onmouseover=\"this.style.border='thin outset'\" onmouseout=\"this.style.border='thin inset'\"><\/td>";
		os +=	"<\/tr>";
		os +=	"<tr>";
		os +=		"<td align=center colspan=2>";
		os +=			"<form name=\"RememberMe\" ID=\"RememberMe\" method=\"post\" action=\""+cCurURL+"\">";
		os +=			"<input type=hidden name=action id=action value=REMEMBERME>";
		os +=			"<table CELLSPACING=\"0\" CELLPADDING=\"0\" width=\"90%\" style=\"\" align=\"center\">";
		os +=				"<tr>";
		os +=					"<th align=left style=\"padding-top:10px;\">Please type your email address.<\/th>";
		os +=				"<\/tr>";
		os +=				"<tr>";
		os +=					"<td align=left><INPUT type=\"text\" id=\"Email1\" name=\"Email1\" size=\"70\"><\/td>";
		os +=				"<\/tr>";
		os +=				"<tr>";
		os +=					"<th align=left style=\"padding-top:10px;\">Email once again to validate.<\/th>";
		os +=				"<\/tr>";
		os +=				"<tr>";
		os +=					"<td align=left><INPUT type=\"text\" id=\"Email2\" name=\"Email2\" size=\"70\"><\/td>";
		os +=				"<\/tr>";
		os +=				"<tr>";
		os +=					"<td align=center style=\"padding-top:10px;\"><INPUT type=\"button\" value=\"Turn Remember My Cart On\" id=\"btnRememberMe\" name=\"btnRememberMe\">&nbsp;&nbsp;&nbsp;&nbsp;";
		os +=					"<INPUT type=\"button\" value=\"Cancel\" id=\"btnCancel\" name=\"btnCancel\" onclick=\"closePopup(false)\"><\/td>";
		os +=				"<\/tr>";
		os +=				"<tr>";
		os +=					"<td align=left style=\"font-size:10pt;color:darkgreen;\"><hr>";
		os +=					"The use of this feature depends on how your browser is setup to handle cookies. If long term cookies are disables then you may have to use this button to recall your cart information each time you visit the site.";
		os +=					"";
		os +=					"<\/td>";
		os +=				"<\/tr>";
		os +=				"";
		os +=				"";
		os +=				"";
		os +=			"<\/table>";
		os += "	<\/form>";
		os += "	<\/td><\/tr>";
		os += "	<\/table>";

	document.getElementById("LoginBlock").className = "modalPopUp"
	document.getElementById("LoginBlock").style.width="400px"
	document.getElementById("LoginBlock").style.height="270px"
	document.getElementById("LoginBlock").innerHTML = os
	//document.getElementById("cLogin").focus()

}
function LaunchMLSSearch(GotoURL){
				 document.QuickSearch.RapidSearch.value=document.QuickSearch.MLSSearch.value
				 document.QuickSearch.action=GotoURL
				 document.QuickSearch.submit()
}
function LaunchYardSearch(GotoURL){
				 //document.QuickSearch.RapidSearch.value=document.QuickSearch.YardSearch.value
				 document.QuickSearch.action=GotoURL
				 document.QuickSearch.submit()
}
function LaunchBuilderSearch(GotoURL){
				 document.QuickSearch.RapidSearch.value=document.QuickSearch.BuilderSearch.value
				 document.QuickSearch.action=GotoURL
				 document.QuickSearch.submit()
}
function DoMenu(cell,action,misc,classname){
	var aID = cell.id.split("_");
	var testinfo="Cell Name: "+cell.id+"\n";

	switch (action)
	{
		case "shellover":
			break;
		case "shellout":
			break;
		case "shellclick":
			break;
		case "itemover":
			var cLeft=getAbsoluteLeft(cell.id);
			var cTop=getAbsoluteTop(cell.id);
			cell.className=classname;
			if (aID.length==3)
			{			
				if (document.getElementById(aID[0]+"_"+aID[1].toString()+"_"+aID[2].toString()+"_1"))
				{
					var sm = document.getElementById(aID[0]+"_"+aID[1].toString()+"_"+aID[2].toString()+"_1");
					sm.style.display='block';
					if (document.all)
					{
						sm.style.top=cTop;
						sm.style.left=cLeft+170;
					}
					else if (sm.offsetLeft)
					{
						sm.style.position="relative";
						sm.style.left=cLeft+200;
					}
				}
			}
			if (aID.length==4)
			{
			}
			break;
		case "itemout":
			cell.className=classname;
			if (aID.length==3)
			{			
				if (document.getElementById(aID[0]+"_"+aID[1].toString()+"_"+aID[2].toString()+"_1"))
				{
					var sm = document.getElementById(aID[0]+"_"+aID[1].toString()+"_"+aID[2].toString()+"_1");
					sm.style.display='none';
				}
			}
			break;
		case "itemclick":
			document.location.href=misc;
			break;
	}
//document.getElementById("testvar").value=testinfo;
}

function getAbsoluteLeft(objectId) {
	// Get an object left position from the upper left viewport corner
	// Tested with relative and nested objects
	o = document.getElementById(objectId)
	if (o.offsetParent)
	{
		oLeft = o.offsetLeft            // Get left position from the parent object
		while(o.offsetParent!=null) {   // Parse the parent hierarchy up to the document element
			oParent = o.offsetParent    // Get parent object reference
			oLeft += oParent.offsetLeft // Add parent left position
			o = oParent
		}
	}
//	else if (o.offsetLeft) 
//	{
//		oLeft += o.x;
//		while(o.parentNode!=null) {   // Parse the parent hierarchy up to the document element
//			oParent = o.parentNode   // Get parent object reference
//			oLeft += oParent.x // Add parent left position
//			o = oParent
//		}
//	}
	// Return left postion
//		alert(oLeft)
	return oLeft
}

function getAbsoluteTop(objectId) {
	// Get an object top position from the upper left viewport corner
	// Tested with relative and nested objects
	o = document.getElementById(objectId)
	oTop = o.offsetTop            // Get top position from the parent object
	while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent  // Get parent object reference
		oTop += oParent.offsetTop // Add parent top position
		o = oParent
	}
	// Return top position
	return oTop
}
function getLeft(objectId) {
	o = document.getElementById(objectId)
	oLeft = o.offsetLeft            // Get left position from the parent object
	return oLeft
}

function getTop(objectId) {
	o = document.getElementById(objectId)
	oTop = o.offsetTop            // Get top position from the parent object
	return oTop
}

function MenuPop(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}

function ChangePic(amnt)
{
	var cimg = document.getElementById("CurPicID").value;
	var PicPrefix = document.getElementById("PicPrefix").value;
	var max = PicPrefix.length
	switch (amnt)
	{
	case 1:
		if (cimg<max)
		{
			document.getElementById("CurPicID").value=cimg+1
		}
		break;
	case -1:
		if (cimg>0)
		{
			document.getElementById("CurPicID").value=cimg-1
		}
		break;
	}
	alert(amnt);
}
function ChangeCurrentPage(Direction,CurrentPage,TotalPages)
{
//alert("Direction: "+Direction+" / CurrentPage: "+CurrentPage+" / TotalPages: "+TotalPages)
	var d=Direction		
	var cp=parseInt(CurrentPage)
	var tp=parseInt(TotalPages)	
	switch (d)
	{
		case "F":
			document.getElementById("CurrentPage").value=1
			break
		case "P":
			if (cp>0)
			{
				cp--
				document.getElementById("CurrentPage").value=cp
			}
			else
			{
				document.getElementById("CurrentPage").value=1
			}
			break
		case "N":
			if (cp<tp)
			{
				cp++
				document.getElementById("CurrentPage").value=cp
			}
			else
			{
				document.getElementById("CurrentPage").value=tp
			}
			break
		case "L":
			document.getElementById("CurrentPage").value=tp
			break
	}
	document.MyForm.submit();
}

function ChangeCurrentPageCol(Direction,CurrentPage,TotalPages,preFix)
{
//alert("Direction: "+Direction+" / CurrentPage: "+CurrentPage+" / TotalPages: "+TotalPages)
	var d=Direction		
	var cp=parseInt(CurrentPage)
	var tp=parseInt(TotalPages)	
	switch (d)
	{
		case "F":
			document.getElementById(preFix+"CurrentPage").value=1
			break
		case "P":
			if (cp>0)
			{
				cp--
				document.getElementById(preFix+"CurrentPage").value=cp
			}
			else
			{
				document.getElementById(preFix+"CurrentPage").value=1
			}
			break
		case "N":
			if (cp<tp)
			{
				cp++
				document.getElementById(preFix+"CurrentPage").value=cp
			}
			else
			{
				document.getElementById(preFix+"CurrentPage").value=tp
			}
			break
		case "L":
			document.getElementById(preFix+"CurrentPage").value=tp
			break
	}
	document.MyForm.submit();
}
function ChangeIPP(ipp)
{
	document.getElementById("CurrentPage").value=1
	document.MyForm.submit();

}
function ChangeIPPCol(ipp,preFix)
{
	document.getElementById(preFix+"CurrentPage").value=1
	document.MyForm.submit();

}
function leftTrim(sString) 
{
	while (sString.substring(0,1) == ' ')
	{
		sString = sString.substring(1, sString.length);
	}
	return sString;
}
function rightTrim(sString) 
{
	while (sString.substring(sString.length-1, sString.length) == ' ')
	{
		sString = sString.substring(0,sString.length-1);
	}
	return sString;
}
function trimAll(sString) 
{
	while (sString.substring(0,1) == ' ')
	{
		sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length) == ' ')
	{
		sString = sString.substring(0,sString.length-1);
	}
	return sString;
}
function AddNewComOrCon(type,dName)
{
	var fType=PCase(type);
	var CName="";
	var fDiv=document.getElementById(dName);
	var oldText=fDiv.innerHTML
	var os=""
	os+="<span style=\"color:darkred;font-size:12pt;align:center;text-align:center;\">"
	os+="Please type in the new name of the "+fType+" you wish to create.<br>"
	os+="<input type=text name=tbCName id=tbCName size=60><br>"
	os+="<input type=button value=\"Create New "+fType+" now\" onclick=\"LoadNewComOrCon('"+fType+"',document.getElementById('tbCName').value)\">"
	os+="</span>"
	fDiv.innerHTML=os
}
function LoadNewComOrCon(type,fName)
{
	var fType=PCase(type);
	var CName=trimAll(fName);
	if (CName!="")
	{
		switch (fType)
		{
			case "Community":
				document.location.href="/intranet/a_AddNewCo.asp?CName="+CName+"&BasePage=/Southwest-Florida/Communities.XXX";
				break
			case "Condo":
				document.location.href="/intranet/a_AddNewCo.asp?CName="+CName+"&BasePage=/Southwest-Florida/Condos.XXX";
				break
			default:
				alert("There seems to be an error in the page. Please contact admin@swfhomes.com to  report the problem.");
		}
	}else{
	alert("There seems to be an error in the page. Please contact admin@swfhomes.com to  report the problem.");
	}
}