// Support Script (668)
function AddToValidateArray(strElementName)
{
    var strName = strElementName

    if (!document.ValidateArray) 
    {
        document.ValidateArray = new Array
    }

    document.ValidateArray[document.ValidateArray.length] = strName
}

// Support Script (699)
function ValidateListBoxLimit() {
  var max = this.MaxSelections
  var iCount = parseInt(this.getCount())
  var selCount = 0;

  for (var i=0; i<iCount; i++) {
    if (this.elementID.options[i].selected) {
      selCount = selCount + 1;
    }
  }

  var msg = "";
  var msgInvalid = "Please limit selections to a maximum of "+max+" items.";

  if (selCount<=0) {
    if (!this.Required) {
        return ""
    }
	   else { 
        return "Required field. " + "Please make a selection."
    }
  }
  if (selCount > max) {
     msg = msgInvalid 
  }
  else {
     return ""
  }
  return msg
}
// Support Script (662)
function Validate(stopOnFailure)
{
	var ErrorMsg = "";
	var i
	var msg
	var tofocus = true;
	var ErrorMsg = "";
	
	// Go through the Validate Array that may or may not exist
	// and call the Validate function for all elements that have one.
	if (document.ValidateArray)
	{
		for (i = 0; i < document.ValidateArray.length; i ++)
		{
			msg = eval( document.ValidateArray[i] + ".Validate()")
			if (msg != "")
			{
				ErrorMsg += "\n\n" + document.ValidateArray[i] + ":  " + msg;
				if (tofocus) 
				{
					eval(document.ValidateArray[i] + ".focus()")
					tofocus = false;
				}
				
				if (stopOnFailure == "1") return ErrorMsg;
			}
  	}
  }
	return ErrorMsg;
}

// Support Script (667)
function subAwithBinC(a,b,c)
{

	var i = c.indexOf(a);
	var l = b.length;

	while (i != -1)	{
		c = c.substring(0,i) + b + c.substring(i + a.length,c.length);
  i += l
		i = c.indexOf(a,i);
	}
	return c;

}
function document_onLoad() {
AreaSelect.Validate = ValidateListBoxLimit
AreaSelect.MaxSelections = "30"
AreaSelect.Required = Number("0")
AddToValidateArray("AreaSelect")
 }
function SearchForm_onSubmit() {
errorMsg = Validate("0"); // don't stop on first error

if (errorMsg != "")
    alert("The form could not be submitted:" + errorMsg);

return (errorMsg == ""); // false prevents form submission
 }
function _SearchForm_onSubmit() { if (SearchForm) return SearchForm.onSubmit(); }
function T5_onClick() {
alert("Select a collage you would like to search by.\n[Units within close proximity of selected collage.]");
 }
function _T5_onClick() { if (T5) return T5.onClick(); }
function T8_onClick() {
alert("Are you looking for a complex that accepts pets?\n[See unit discription for size limitations.]");
 }
function _T8_onClick() { if (T8) return T8.onClick(); }
function T12_onClick() {
alert("Do you want a unit with a balcony or padio?");
 }
function _T12_onClick() { if (T12) return T12.onClick(); }
function T7_onClick() {
alert("Do you want a complex with a pool and/or spa?");
 }
function _T7_onClick() { if (T7) return T7.onClick(); }
function T10_onClick() {
alert("Would you like a recreation center or club house in the complex?");
 }
function _T10_onClick() { if (T10) return T10.onClick(); }
function T19_onClick() {
alert("Are you looking for a furnished or partly furnished unit?");
 }
function _T19_onClick() { if (T19) return T19.onClick(); }
function T20_onClick() {
alert("Do you want a first floor unit?\n[Hint: If you are looking for second floor unit or higher, select 'NO'.]");
 }
function _T20_onClick() { if (T20) return T20.onClick(); }
function T21_onClick() {
alert("Are you looking for short term rentals \n(less than 6 months.)");
 }
function _T21_onClick() { if (T21) return T21.onClick(); }
function T1_onClick() {
alert("Select the amount of bedrooms you would like to search by.");
 }
function _T1_onClick() { if (T1) return T1.onClick(); }
function T2_onClick() {
alert("Select the amount of bathrooms you would like to search by.");
 }
function _T2_onClick() { if (T2) return T2.onClick(); }
function T3_onClick() {
alert("Select the price range you would like to search by.");
 }
function _T3_onClick() { if (T3) return T3.onClick(); }
function T4_onClick() {
alert("Select the general type of unit you are looking for.");
 }
function _T4_onClick() { if (T4) return T4.onClick(); }
function T6_onClick() {
alert("Leave this box blank to include all areas in your search. \nTo select a specific location, just click on the area of interest. \nFor multiple locations, select while holding  the <Ctrl> key down. \n(Limited to 30 selections.) \n \n[Hint: Use the map icon above to find out more about these areas.]");
 }
function _T6_onClick() { if (T6) return T6.onClick(); }
function SDMap_onClick() {
var options="";
options+="status="+(("0"=="1")?"yes":"no")
options+=",directories="+(("0"=="1")?"yes":"no")
options+=",location="+(("0"=="1")?"yes":"no")
options+=",toolbar="+(("0"=="1")?"yes":"no")
options+=",menubar="+(("0"=="1")?"yes":"no")
options+=",scrollbars="+(("1"=="1")?"yes":"no")
options+=",resizable="+(("0"=="1")?"yes":"no")

if (parseInt("385")  > 0) options+=",width="+"385"
if (parseInt("455") > 0) options+=",height="+"455"

if (parseInt("25") >= 0)
{
	options+=",top="+"25"
	options+=",screenY="+"25"
}
if (parseInt("25") >= 0)
{
	options+=",left="+"25"
	options+=",screenX="+"25"
}

page = "";
if (page.length == 0) page = "SDJavaMap.asp";

window.open(page,"RemoteMap",options);
 }
function _SDMap_onClick() { if (SDMap) return SDMap.onClick(); }
function SDMap_onMouseOver() {
window.status="Open interactive map window of San Diego";
return true;
 }
function _SDMap_onMouseOver() { if (SDMap) return SDMap.onMouseOver(); }
function SDMap_onMouseOut() {
window.status="";
return true;
 }
function _SDMap_onMouseOut() { if (SDMap) return SDMap.onMouseOut(); }
function T9_onClick() {
alert("Would you like a fitness center or gym on site?");
 }
function _T9_onClick() { if (T9) return T9.onClick(); }
function T11_onClick() {
alert("Looking for controlled access options or gated community?");
 }
function _T11_onClick() { if (T11) return T11.onClick(); }
function T15_onClick() {
alert("Would you like a unit with washer and dryer hookups? \n(Some even come with the washer & dryer!)");
 }
function _T15_onClick() { if (T15) return T15.onClick(); }
function T16_onClick() {
alert("Should your unit include a garage or covered parking?");
 }
function _T16_onClick() { if (T16) return T16.onClick(); }
function T13_onClick() {
alert("Should your unit have air conditioning?");
 }
function _T13_onClick() { if (T13) return T13.onClick(); }
function T14_onClick() {
alert("Would you like a Dishwasher in your unit?");
 }
function _T14_onClick() { if (T14) return T14.onClick(); }
function T17_onClick() {
alert("Would you like a complex with on-site laundry facilities?");
 }
function _T17_onClick() { if (T17) return T17.onClick(); }
function T18_onClick() {
alert("Need extra storage space?");
 }
function _T18_onClick() { if (T18) return T18.onClick(); }
function MB1_onMouseOver() {
window.status="Home";
return true;
 }
function _MB1_onMouseOver() { if (MB1) return MB1.onMouseOver(); }
function MB1_onMouseOut() {
window.status="";
return true;
 }
function _MB1_onMouseOut() { if (MB1) return MB1.onMouseOut(); }
function MB2_onMouseOver() {
window.status="Basic Search";
return true;
 }
function _MB2_onMouseOver() { if (MB2) return MB2.onMouseOver(); }
function MB2_onMouseOut() {
window.status="";
return true;
 }
function _MB2_onMouseOut() { if (MB2) return MB2.onMouseOut(); }
function MB4_onMouseOver() {
window.status="Featured Complex List";
return true;
 }
function _MB4_onMouseOver() { if (MB4) return MB4.onMouseOver(); }
function MB4_onMouseOut() {
window.status="";
return true;
 }
function _MB4_onMouseOut() { if (MB4) return MB4.onMouseOut(); }
function MB3_onMouseOver() {
window.status="Advanced Search";
return true;
 }
function _MB3_onMouseOver() { if (MB3) return MB3.onMouseOver(); }
function MB3_onMouseOut() {
window.status="";
return true;
 }
function _MB3_onMouseOut() { if (MB3) return MB3.onMouseOut(); }
function MB5_onMouseOver() {
window.status="CityGuide Information";
return true;
 }
function _MB5_onMouseOver() { if (MB5) return MB5.onMouseOver(); }
function MB5_onMouseOut() {
window.status="";
return true;
 }
function _MB5_onMouseOut() { if (MB5) return MB5.onMouseOut(); }
function MB6_onMouseOver() {
window.status="Useful Resources";
return true;
 }
function _MB6_onMouseOver() { if (MB6) return MB6.onMouseOver(); }
function MB6_onMouseOut() {
window.status="";
return true;
 }
function _MB6_onMouseOut() { if (MB6) return MB6.onMouseOut(); }
function MB7_onMouseOver() {
window.status="Services Offered";
return true;
 }
function _MB7_onMouseOver() { if (MB7) return MB7.onMouseOver(); }
function MB7_onMouseOut() {
window.status="";
return true;
 }
function _MB7_onMouseOut() { if (MB7) return MB7.onMouseOut(); }
function MB8_onMouseOver() {
window.status="SiteMap and Information";
return true;
 }
function _MB8_onMouseOver() { if (MB8) return MB8.onMouseOver(); }
function MB8_onMouseOut() {
window.status="";
return true;
 }
function _MB8_onMouseOut() { if (MB8) return MB8.onMouseOut(); }
function Seach_onClick() {
var addChar = "?" 
var j
var okToSubmit = false;

if ("".length > 1)
{
    SearchForm.setAction(subAwithBinC(" ", "%20", ""));
}

// execute the onSubmit() event handler and try to 
// determine if it already validated the form
Result = SearchForm.onSubmit();

//   If there is no onSubmithander the return value is null
//   If there is a validation handler it returns true to submit
//   or false to not submit
if (Result==null)  // there is no validation already defined
{
    if ("1" == "1")
    {
        Result = Validate("0"); // don't stop on first error
        if (Result == "") okToSubmit = true;
        else alert("The form could not be submitted:" + Result);
    }
    else okToSubmit = true;
}
else // there is a validation already defined
{
    if (Result==true)
        okToSubmit = true;
}

if (okToSubmit) 
{
    // We have to
    // put the source in the query string so the generic database contracts
    // still work.

    // NOTE: this only works if the method of the form is POST


    act = SearchForm.getAction();
    if (act.indexOf("?") != -1)
    {    
        addChar = "&"
    }

    act += addChar + "Seach=1"
    SearchForm.setAction(act);


    SearchForm.submit();
}
 }
function _Seach_onClick() { if (Seach) return Seach.onClick(); }
function Seach_onMouseOver() {
window.status="Submit Search";
Seach.setIndex("1");
return true;
 }
function _Seach_onMouseOver() { if (Seach) return Seach.onMouseOver(); }
function Seach_onMouseOut() {
window.status="";
Seach.setIndex("0");
return true;
 }
function _Seach_onMouseOut() { if (Seach) return Seach.onMouseOut(); }
function Seach_onMouseDown() {
window.status="Submit Search";
Seach.setIndex("2");
return true;
 }
function _Seach_onMouseDown() { if (Seach) return Seach.onMouseDown(); }
function Seach_onMouseUp() {
window.status="Submit Search";
Seach.setIndex("1");
return true;
 }
function _Seach_onMouseUp() { if (Seach) return Seach.onMouseUp(); }


