<!-- navigation JS -->
<!-- Santa Fe Real Estate -->
<!-- Updated: 09/06/2006 CJG -->
<!-- Updated to make references absolute 10/05/2007 DW -->
<!-- Updated with search map link by VP 11/2007 -->
<!-- Updated IDX and Fair Housing footers 02/05/2008 DW -->
<!-- Updated to remove sub-menus 02/12/2008 DW -->
<!-- Updated navigation footer to text and CSS 03/13/2008 DW -->
<!-- Updated with 'english' links and revised file structure 10/19/2009 DW -->
<!-- Updated quick search to have separate address field 05/27/2010 JRT -->

 function validateandsubmit_quick(){
	
	if (document.getElementById('quick_textsearch').value.length > 1 && (document.getElementById('quick_textsearch').value!='Enter Search Terms')){
		document.getElementById('quick_mls_number').value='';
		document.getElementById('quick_streetname').value='';
		return true;
		
	}
	if (document.getElementById('quick_streetname').value.length > 1 && (document.getElementById('quick_streetname').value!='Enter Address')){
		document.getElementById('quick_textsearch').value='';
		document.getElementById('quick_mls_number').value='';
		return true;
		
	}
	if (document.getElementById('quick_mls_number').value.length > 1 && (document.getElementById('quick_mls_number').value!='Enter MLS #')){
		document.getElementById('quick_textsearch').value='';
		document.getElementById('quick_streetname').value='';
		return true;
		
	}
	
	alert('You must enter an MLS Number or Street Name or Search Terms to continue.');
	document.getElementById('quick_mls_number').focus();
	return false;
 
 }
 

function printHeader () {
  var headerFile = "";
  var showQuickSearch = true;
  
  headerFile +=
     "<img src=\"/images/headerNew2011_01.gif\" width=\"140\" height=\"204\" style=\"position: absolute; left: 0px; top: 0px;\">"
+"		<img style=\"left:140px;position:relative\" src=\"/images/headerNew2011_02.gif\" width=\"835\" height=\"133\" usemap='Masthead'>"
+'		<map name="Masthead">'
+'        <area shape="rect" coords="9,10,310,100" href="http://www.SantaFeProperties.com" alt="Santa Fe Real Estate from the source at Santa Fe Properties">'
+'        <area shape="rect" coords="522,32,811,100" href="http://www.LuxuryPortfolio.com" target="_blank" rel="nofollow">'
+'      </map>'
+"		<div id=\"login\"><a href=\"http://santafeproperties.com/my-property-portfolio\">Login / Register</a></div>"
+"		<form id=\"quickform\" action=\"/s_search/Search\" method=\"post\" name=\"QuickForm\" onsubmit=\"return validateandsubmit_quick()\">"
+"    <div class=\"search\" style=\"right:15px;top:122px;width: 1024px;text-align:right\"><span class=\"quickSearchText\">Quick Search:</span>"
+"		<input type=\"hidden\" name=\"ScreenID_Cur\" value=\"SEARCH_LISTING_P\">"
+"		<input type=\"hidden\" name=\"TLATE\" value=\"true\">"
+"		<input type=\"hidden\" name=\"jboss_alt\" value=\"true\">"
+"		<input type=\"hidden\" name=\"searchSQL\" value=\"build\">"
+"		<input type=\"hidden\" name=\"ScreenID\" value=\"ListingSummary_Public\">"
+"		<input type=\"hidden\" name=\"ScreenID_Alt\" value=\"LISTING_DETAIL_P\">"
+"		<input type=\"hidden\" name=\"scoped\" value=\"Y\">"
+"		<input type=\"hidden\" name=\"LOGSEARCH\" value=\"TRUE\">"
+"		<input type=\"hidden\" name=\"sd\" value=\"S\">"
+"		<input type=\"hidden\" name=\"SITE\" value=\"SANTAFE\">"
+"		<input type=\"hidden\" name=\"Search\" value=\"TRUE\">"
+"		<input type=\"hidden\" name=\"fg_SummaryCntl\" value=\"Y\">"
+"		<input type=\"hidden\" name=\"Search_Page\" value=\"SEARCH_LISTING_P\">"

+"		<input type=\"hidden\" name=\"numRecordsToShow\"  value=\"4\"/>"
+"		<input type=\"hidden\" name=\"sortCriteria\" value=\"lp_Listing_Price DESC\">"
+"		<input type=\"hidden\" name=\"EXCEEDLIMIT\" value=\"Y\">"
+"		<input name=\"SPHINX_TEXT_SEARCH\" type=\"text\" class=\"searchText\" id=\"quick_textsearch\" onFocus=\"document.getElementById('quick_textsearch').value='';\" value=\"Enter Search Terms\" size=\"60\" style=\"width:320px\">"
+"		<input name=\"SPHINX_lp_listing_address\" type=\"text\" class=\"searchText\" id=\"quick_streetname\" onFocus=\"document.getElementById('quick_streetname').value='';\" value=\"Enter Address\" size=\"28\">"
+"		<input name=\"SPHINX_mls_number\" type=\"text\" class=\"searchText\" id=\"quick_mls_number\" onFocus=\"document.getElementById('quick_mls_number').value='';\" value=\"Enter MLS #\" size=\"28\">"
+"		<input style=\"top:8px;position:relative\" type=\"image\" name=\"Search2\" value=\"submit\" src=\"/images/gogo.gif\" alt=\"Search\" border=\"0\" height=\"25\" width=\"24\">"
+"    </div>"
+"	</form>";

  document.write(headerFile);
}

function printFooter (printIDX,printFairHousing) {
  document.write("<table width=\"98%\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\" class=\"nav_footer\" align=\"center\">"
  +"       			<tr>"
  +"            		<td><a href=\"/index.html\">Home</a></td>"
  +"            		<td><img src=\"/images/sub_navi_r1_c2.gif\" width=\"3\" height=\"27\" border=\"0\" alt=\"\"></td>"
  +"            		<td><a href=\"/listing-search\">Search Properties</a></td>"
  +"            		<td><img src=\"/images/sub_navi_r1_c2.gif\" width=\"3\" height=\"27\" border=\"0\" alt=\"\"></td>"
  +"            		<td><a href=\"/buying/buying_a_home.html\">Purchasing</a></td>"
  +"            		<td><img src=\"/images/sub_navi_r1_c2.gif\" width=\"3\" height=\"27\" border=\"0\" alt=\"\"></td>"
  +"            		<td><a href=\"/selling/selling_a_home.html\">Selling</a></td>"
  +"            		<td><img src=\"/images/sub_navi_r1_c2.gif\" width=\"3\" height=\"27\" border=\"0\" alt=\"\"></td>"
  +"            		<td><a href=\"/relocation-services\">Relocation</a></td>"
  +"            		<td><img src=\"/images/sub_navi_r1_c2.gif\" width=\"3\" height=\"27\" border=\"0\" alt=\"\"></td>"
  +"            		<td><a href=\"/SantaFe/aboutsantafe.html\">About Santa Fe</a></td>"
  +"            		<td><img src=\"/images/sub_navi_r1_c2.gif\" width=\"3\" height=\"27\" border=\"0\" alt=\"\"></td>"
  +"            		<td><a href=\"/company/company.html\">Company &amp; Brokers</a></td>"
  +"            		<td><img src=\"/images/sub_navi_r1_c2.gif\" width=\"3\" height=\"27\" border=\"0\" alt=\"\"></td>"
  +"            		<td><a href=\"/OnlineMagazines/\">On-line Magazines</a></td>"
  +"            		<td><img src=\"/images/sub_navi_r1_c2.gif\" width=\"3\" height=\"27\" border=\"0\" alt=\"\"></td>"
  +"            		<td><a href=\"/MarketReports/\">Market Reports</a></td>"
  +"            		<td><img src=\"/images/sub_navi_r1_c2.gif\" width=\"3\" height=\"27\" border=\"0\" alt=\"\"></td>"
  +"            		<td><a href=\"/contact_us\">Contact Us</a></td>"
  +"            		<td><img src=\"/images/sub_navi_r1_c2.gif\" width=\"3\" height=\"27\" border=\"0\" alt=\"\"></td>"
  +"            		<td><a href=\"/my-property-portfolio\">My Portfolio</a></td>"
  +"            		<td><img src=\"/images/sub_navi_r1_c2.gif\" width=\"3\" height=\"27\" border=\"0\" alt=\"\"></td>"
  +"            		<td><a href=\"/sitemap.html\">Sitemap</a></td>"
  +"          		</tr>"
  +"        	</table>");
   /* document.write("<p>&nbsp;</p>"); * temporarily disabled 2008.02.06 DW */
  if (printFairHousing) {
    document.write("<p class=\"info\"><img src=\"/images/equal_housing_logo.jpg\" width=\"43\" height=\"31\" alt=\"Equal Housing Logo\">"
  +"	We are pledged to the letter and spirit of U.S. policy for the achievement of equal housing opportunity throughout the Nation. We encourage and support an affirmative advertising and marketing program in which there are no barriers to obtaining housing because of race, color, religion, sex, handicap, familial status, or national origin.</p>");
  }
  if (printIDX) {
    document.write("<p class=\"info\"><img src=\"/images/idx_logo.jpg\" width=\"48\" height=\"26\" alt=\"IDX logo\">"
  +"	The data relating to real estate for sale in this web site comes in part from the Internet Data exchange (\"IDX\") program of SFAR MLS, Inc. Real estate listings held by brokers other than Santa Fe Properties are marked with the IDX logo. All data in this web site is deemed reliable but is not guaranteed.</p>");
  }
}

function printSubNav () {
  document.write("<div id=\"subNav\">"
	+"<ul class=\"subNav\">"
	+"	<li><a href=\"/index.html\">Home</a></li>"
	+"	<li class=\"space\"><a href=\"/listing-search\">Search Properties</a></li>"
	+"	<li><a href=\"/my-property-portfolio\">My Property Portfolio</a></li>"
	+"	<li><a href=\"/buying/buying_a_home.html\">Purchasing a Home</a></li>"
	+"	<li><a href=\"/selling/selling_a_home.html\">Selling a Home</a></li>"
	+"	<li><a href=\"/relocation-services\">Relocation services</a></li>"
	+"	<li class=\"space\"><a href=\"/SantaFe/aboutsantafe.html\">About Santa Fe</a></li>"
	+"	<li><a href=\"/company/company.html\">Company & Brokers</a></li>"
	+"	<li><a href=\"/OnlineMagazines/\">On-line Magazines</a></li>"
	+"	<li><a href=\"/MarketReports/\">Market Reports</a></li>"
	+"	<li class=\"space\"><a href=\"/contact_us\">Contact Us</a></li>"
	+"</ul>"
	+"</div>"
	+"<br><br clear=\"all\">"
	+"<div align=\"right\">"
//+"	<a href=\"http://viewer.zmags.com/publication/d9beceeb\"><img src=\"/images/SFL_teaser.jpg\" alt=\"Santa Fe Living Online Magazine\" width=\"120\" height=\"140\" class=\"float_right\"></a>"
	+"	<a href=\"/OnlineMagazines/\"><img src=\"/images/SFL_teaser.jpg\" alt=\"Santa Fe Living Online Magazine\" width=\"120\" height=\"140\" class=\"float_right\"></a>"
//+"	<a href=\"http://www.christiesrealestate.com/Magazine\" target=\"_blank\" rel=\"nofollow\"><img src=\"/images/Christies-teaser.jpg\" alt=\"Christie's Great Estates Online Magazine\" width=\"120\" height=\"144\" class=\"float_right\"></a>"
	+"	<br clear=\"all\">&nbsp;<br>&nbsp;<br>"
//+"	<a href=\"http://www.christiesrealestate.com\" target=\"_blank\" rel=\"nofollow\"><img src=\"/images/CGElogoplain.gif\" alt=\"Christie's Great Estates logo\" width=\"150\" height=\"75\" class=\"float_right\"></a>"
	+"	<a href=\"http://www.luxuryportfolio.com\" target=\"_blank\" rel=\"nofollow\"><img src=\"/images/LuxuryPortfolio_click_here.gif\" alt=\"Luxury Portfolio logo\" class=\"float_right\"></a>"
	+"	<br clear=\"all\">&nbsp;<br>"
	+"	<a href=\"http://www.centurynetbank.com\" target=\"_blank\" rel=\"nofollow\"><img src=\"/images/centuryBankLogo.gif\" alt=\"Century Bank\" class=\"float_right\"></a>"
	+"	<br clear=\"all\">&nbsp;<br>"
	+"</div>");
}

function printListingSubNav () { // used for search pages collapsible panel navigation
document.write("<ul>"
+"<li id=\"searchMap\"><a href=\"/search-properties\">Search Map</a></li>"
+"<li id=\"searchListings\"><a href=\"/listing-search\">Detailed Search Listings</a></li>"
+"<li id=\"newListings\"><a href=\"/new-listings\">New Listings</a></li>"
+"<li id=\"priceReductions\"><a href=\"/price-reductions\">Price Reductions</a></li>"
+"<li id=\"openHouses\"><a href=\"/OpenHouses\">Open Houses</a></li>"
+"<li id=\"newDevelopments\"><a href=\"/communities\">Communities</a></li>"
+"<li id=\"buildersShowcase\"><a href=\"/builders-showcase\">Builders Showcase</a></li>"
+"<li id=\"internationalLuxuryProperties\"><a href=\"/internationalLuxuryProperties.html\">International Luxury Listings</a></li>"
+"</ul>");
}

function printCompanyBrokersSubNav () {  // used for Company/Brokers pages collapsible panel navigation
document.write("<ul>"
+"<li id=\"company\"><a href=\"/company/company.html\">Company</a></li>"
+"<li id=\"brokers\"><a href=\"/company-and-brokers\">Brokers</a></li>"
+"<li id=\"brokerWebsites\"><a href=\"/broker-websites\">Broker Websites</a></li>"
+"<li id=\"affiliations\"><a href=\"/company/affiliations.html\">Luxury Portfolio International</a></li>"
+"<li id=\"leading\"><a href=\"/company/leadingRE.html\">Leading Real Estate Companies<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;of the World</a></li>"
+"</ul>");
}

function appendMLSHiddenFields (mls_numbers_id) {
  var fieldvalues = (mls_numbers_id.value);
  var fieldvaluesarray = fieldvalues.split(',');
  var myform = document.getElementById('quickform');
  for (var i=0; i<fieldvaluesarray.length; i++) {
    myhidden = document.createElement("input");
    myhidden.setAttribute("type", "hidden");
    myhidden.setAttribute("name", "MLS_Number_StreetName");
    myhidden.setAttribute("value", fieldvaluesarray[i]);
    myform.appendChild(myhidden);
    //alert('Creating: '+fieldvaluesarray[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 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];
        }
   }
}

