// 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;

}
// 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;
}

function Previous_onClick() {
var thisfname = window.location.href;
if(thisfname.indexOf('_IE4') >= 0 || thisfname.indexOf('_40') >= 0 || thisfname.indexOf('_Nav3') >= 0 || thisfname.indexOf('_Gen') >= 0)
{
  window.history.go(-2);
}
else
{
  window.history.back();
}
 }
function _Previous_onClick() { if (Previous) return Previous.onClick(); }
function Next_onClick() {
var addChar = "?" 
var j
var okToSubmit = false;

if ("".length > 1)
{
    Form1.setAction(subAwithBinC(" ", "%20", ""));
}

// execute the onSubmit() event handler and try to 
// determine if it already validated the form
Result = Form1.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 ("0" == "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 = Form1.getAction();
    if (act.indexOf("?") != -1)
    {    
        addChar = "&"
    }

    act += addChar + "Next=1"
    Form1.setAction(act);


    Form1.submit();
}
 }
function _Next_onClick() { if (Next) return Next.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 Listing";
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 ComplexName_onClick() {
var addChar = "?" 
var j
var okToSubmit = false;

if ("".length > 1)
{
    Form1.setAction(subAwithBinC(" ", "%20", ""));
}

// execute the onSubmit() event handler and try to 
// determine if it already validated the form
Result = Form1.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 ("0" == "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 = Form1.getAction();
    if (act.indexOf("?") != -1)
    {    
        addChar = "&"
    }

    act += addChar + "ComplexName=1"
    Form1.setAction(act);


    Form1.submit();
}
 }
function _ComplexName_onClick() { if (ComplexName) return ComplexName.onClick(); }
function ComplexName_onMouseOver() {
window.status="Sort records by Complex Name";
return true;
 }
function _ComplexName_onMouseOver() { if (ComplexName) return ComplexName.onMouseOver(); }
function ComplexName_onMouseOut() {
window.status="";
return true;
 }
function _ComplexName_onMouseOut() { if (ComplexName) return ComplexName.onMouseOut(); }
function Location_onClick() {
var addChar = "?" 
var j
var okToSubmit = false;

if ("".length > 1)
{
    Form1.setAction(subAwithBinC(" ", "%20", ""));
}

// execute the onSubmit() event handler and try to 
// determine if it already validated the form
Result = Form1.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 ("0" == "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 = Form1.getAction();
    if (act.indexOf("?") != -1)
    {    
        addChar = "&"
    }

    act += addChar + "Location=1"
    Form1.setAction(act);


    Form1.submit();
}
 }
function _Location_onClick() { if (Location) return Location.onClick(); }
function Location_onMouseOver() {
window.status="Sort records by Location";
return true;
 }
function _Location_onMouseOver() { if (Location) return Location.onMouseOver(); }
function Location_onMouseOut() {
window.status="";
return true;
 }
function _Location_onMouseOut() { if (Location) return Location.onMouseOut(); }
function ZipCode_onClick() {
var addChar = "?" 
var j
var okToSubmit = false;

if ("".length > 1)
{
    Form1.setAction(subAwithBinC(" ", "%20", ""));
}

// execute the onSubmit() event handler and try to 
// determine if it already validated the form
Result = Form1.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 ("0" == "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 = Form1.getAction();
    if (act.indexOf("?") != -1)
    {    
        addChar = "&"
    }

    act += addChar + "ZipCode=1"
    Form1.setAction(act);


    Form1.submit();
}
 }
function _ZipCode_onClick() { if (ZipCode) return ZipCode.onClick(); }
function ZipCode_onMouseOver() {
window.status="Sort records by ZipCode";
return true;
 }
function _ZipCode_onMouseOver() { if (ZipCode) return ZipCode.onMouseOver(); }
function ZipCode_onMouseOut() {
window.status="";
return true;
 }
function _ZipCode_onMouseOut() { if (ZipCode) return ZipCode.onMouseOut(); }
function Units_onClick() {
var addChar = "?" 
var j
var okToSubmit = false;

if ("".length > 1)
{
    Form1.setAction(subAwithBinC(" ", "%20", ""));
}

// execute the onSubmit() event handler and try to 
// determine if it already validated the form
Result = Form1.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 ("0" == "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 = Form1.getAction();
    if (act.indexOf("?") != -1)
    {    
        addChar = "&"
    }

    act += addChar + "Units=1"
    Form1.setAction(act);


    Form1.submit();
}
 }
function _Units_onClick() { if (Units) return Units.onClick(); }
function Units_onMouseOver() {
window.status="Sorty records by number of Units";
return true;
 }
function _Units_onMouseOver() { if (Units) return Units.onMouseOver(); }
function Units_onMouseOut() {
window.status="";
return true;
 }
function _Units_onMouseOut() { if (Units) return Units.onMouseOut(); }
function Phone_onClick() {
var addChar = "?" 
var j
var okToSubmit = false;

if ("".length > 1)
{
    Form1.setAction(subAwithBinC(" ", "%20", ""));
}

// execute the onSubmit() event handler and try to 
// determine if it already validated the form
Result = Form1.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 ("0" == "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 = Form1.getAction();
    if (act.indexOf("?") != -1)
    {    
        addChar = "&"
    }

    act += addChar + "Phone=1"
    Form1.setAction(act);


    Form1.submit();
}
 }
function _Phone_onClick() { if (Phone) return Phone.onClick(); }
function Phone_onMouseOver() {
window.status="Sort records by Phone Number";
return true;
 }
function _Phone_onMouseOver() { if (Phone) return Phone.onMouseOver(); }
function Phone_onMouseOut() {
window.status="";
return true;
 }
function _Phone_onMouseOut() { if (Phone) return Phone.onMouseOut(); }
function E_Mail_onClick() {
var addChar = "?" 
var j
var okToSubmit = false;

if ("".length > 1)
{
    Form1.setAction(subAwithBinC(" ", "%20", ""));
}

// execute the onSubmit() event handler and try to 
// determine if it already validated the form
Result = Form1.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 ("0" == "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 = Form1.getAction();
    if (act.indexOf("?") != -1)
    {    
        addChar = "&"
    }

    act += addChar + "E_Mail=1"
    Form1.setAction(act);


    Form1.submit();
}
 }
function _E_Mail_onClick() { if (E_Mail) return E_Mail.onClick(); }
function E_Mail_onMouseOver() {
window.status="Sort records by available eMail";
return true;
 }
function _E_Mail_onMouseOver() { if (E_Mail) return E_Mail.onMouseOver(); }
function E_Mail_onMouseOut() {
window.status="";
return true;
 }
function _E_Mail_onMouseOut() { if (E_Mail) return E_Mail.onMouseOut(); }
function Print_onClick() {
window.print()
 }
function _Print_onClick() { if (Print) return Print.onClick(); }
function Print_onMouseOver() {
window.status="Print this page (Set page margins to .25)";
return true;
 }
function _Print_onMouseOver() { if (Print) return Print.onMouseOver(); }
function Print_onMouseOut() {
window.status="";
return true;
 }
function _Print_onMouseOut() { if (Print) return Print.onMouseOut(); }
function Filter_onClick() {
alert("This feature is currently under development and will be added soon.");
 }
function _Filter_onClick() { if (Filter) return Filter.onClick(); }
function Filter_onMouseOver() {
window.status="Advanced search function";
return true;
 }
function _Filter_onMouseOver() { if (Filter) return Filter.onMouseOver(); }
function Filter_onMouseOut() {
window.status="";
return true;
 }
function _Filter_onMouseOut() { if (Filter) return Filter.onMouseOut(); }
function Add_onClick() {
var options="";
options+="status="+(("1"=="1")?"yes":"no")
options+=",directories="+(("0"=="1")?"yes":"no")
options+=",location="+(("0"=="1")?"yes":"no")
options+=",toolbar="+(("1"=="1")?"yes":"no")
options+=",menubar="+(("0"=="1")?"yes":"no")
options+=",scrollbars="+(("1"=="1")?"yes":"no")
options+=",resizable="+(("1"=="1")?"yes":"no")

if (parseInt("600")  > 0) options+=",width="+"600"
if (parseInt("440") > 0) options+=",height="+"440"

if (parseInt("-1") >= 0)
{
	options+=",top="+"-1"
	options+=",screenY="+"-1"
}
if (parseInt("-1") >= 0)
{
	options+=",left="+"-1"
	options+=",screenX="+"-1"
}

page = "http://www.sandiegoapartments.com/forms/rentals_agreement.htm";
if (page.length == 0) page = "index.asp";

window.open(page,"NewWindow",options);
 }
function _Add_onClick() { if (Add) return Add.onClick(); }
function Add_onMouseOver() {
window.status="Add your Vacancy to our List";
return true;
 }
function _Add_onMouseOver() { if (Add) return Add.onMouseOver(); }
function Add_onMouseOut() {
window.status="";
return true;
 }
function _Add_onMouseOut() { if (Add) return Add.onMouseOut(); }


