var activeElement=0;var activeMenuElementIndex=0;var data;var dataL;var backPhotosFlag=0;var mapLoadedFlag=0;var imgIndexOffset=0;var iStart=0;var iEnd=0;var tempTitle;var activeThumb=0;var activePhoto="";var mapIsOpen=0;var map;var container;var zoom=16;var requestSent=false;var pixelThreshold=256;var centerBeforeMove;var timeout;var markerType=1;var mOpacity=100;var imgMaxStart=9;function dataCheck(a){if(!a||a==""||a==null){return""}else{return a}}function formatCurrency(b){b=b.toString().replace(/\$|\,/g,"");dblValue=parseFloat(b);blnSign=(dblValue==(dblValue=Math.abs(dblValue)));dblValue=Math.floor(dblValue*100+0.50000000001);intCents=dblValue%100;strCents=intCents.toString();dblValue=Math.floor(dblValue/100).toString();if(intCents<10){strCents="0"+strCents}for(var a=0;a<Math.floor((dblValue.length-(1+a))/3);a++){dblValue=dblValue.substring(0,dblValue.length-(4*a+3))+","+dblValue.substring(dblValue.length-(4*a+3))}return(((blnSign)?"":"-")+"$"+dblValue)}function importPropertyData(c){var b="/scripts/propertyInfoPicXMLS3.php?propertyID="+c;var a=new JKL.ParseXML(b);data=a.parse()}function importPropertyList(c){var b="/scripts/propertyInfoListS3.php?statusID="+c;var a=new JKL.ParseXML(b);dataL=a.parse()}function morePhotos(){imgIndexOffset+=9;clickThumb(document.getElementById("thumbBox_0"),0);getImages();closeMap()}function backPhotos(){backPhotosFlag=1;imgIndexOffset-=9;clickThumb(document.getElementById("thumbBox_8"),8);getImages();closeMap()}function getImages(){imgMax=imgMaxStart;iStart=0;document.getElementById("processingDisplay").style.display="block";document.getElementById("thumbProcessingDisplay").style.display="block";if(data.propertySet.property.photoSet&&data.propertySet.property.photoSet.photo[0]){if((data.propertySet.property.photoSet.photo.length-imgIndexOffset)>9){document.getElementById("thumbMorePhotos").style.display="block"}else{document.getElementById("thumbMorePhotos").style.display="none"}if(imgIndexOffset>0){document.getElementById("thumbBack").style.display="block"}else{document.getElementById("thumbBack").style.display="none"}for(i=0;i<9;i++){document.getElementById("thumbBox_"+i).style.visibility="hidden"}if((data.propertySet.property.photoSet.photo.length-imgIndexOffset)<9){imgMax=data.propertySet.property.photoSet.photo.length-imgIndexOffset}if(backPhotosFlag==0){iStart=0;iEnd=imgMax;document.images.photoDisplayImg_0.onload=function(){document.getElementById("processingDisplay").style.display="none";document.getElementById("thumbProcessingDisplay").style.display="none";backPhotosFlag=0};setThumbOnLoadFunctions();for(z=iStart;z<iEnd;z++){getImageSet(z)}}if(backPhotosFlag==1){iStart=8;iEnd=0;document.images.photoDisplayImg_8.onload=function(){document.getElementById("processingDisplay").style.display="none";document.getElementById("thumbProcessingDisplay").style.display="none";backPhotosFlag=0};setThumbOnLoadFunctions();for(z=iStart;z>iEnd-1;z--){getImageSet(z)}}}else{document.getElementById("thumbProcessingDisplay").style.display="block"}}function setThumbOnLoadFunctions(){document.getElementById("thumbBoxImg_0").onload=function(){document.getElementById("thumbBox_0").style.visibility="visible"};document.getElementById("thumbBoxImg_1").onload=function(){document.getElementById("thumbBox_1").style.visibility="visible"};document.getElementById("thumbBoxImg_2").onload=function(){document.getElementById("thumbBox_2").style.visibility="visible"};document.getElementById("thumbBoxImg_3").onload=function(){document.getElementById("thumbBox_3").style.visibility="visible"};document.getElementById("thumbBoxImg_4").onload=function(){document.getElementById("thumbBox_4").style.visibility="visible"};document.getElementById("thumbBoxImg_5").onload=function(){document.getElementById("thumbBox_5").style.visibility="visible"};document.getElementById("thumbBoxImg_6").onload=function(){document.getElementById("thumbBox_6").style.visibility="visible"};document.getElementById("thumbBoxImg_7").onload=function(){document.getElementById("thumbBox_7").style.visibility="visible"};document.getElementById("thumbBoxImg_8").onload=function(){document.getElementById("thumbBox_8").style.visibility="visible"}}function getImageSet(a){document.getElementById("photoDisplayImg_"+a).src="http://"+a+"s.cdnoccp.us/images/"+data.propertySet.property.propertyID+"/"+data.propertySet.property.photoSet.photo[a+imgIndexOffset].toString();document.getElementById("photoDisplayImg_"+a).alt="Photograph of "+data.propertySet.property.address+", "+data.propertySet.property.city+" CA".toString();document.getElementById("thumbBoxImg_"+a).src="http://"+a+"s.cdnoccp.us/images/"+data.propertySet.property.propertyID+"/"+data.propertySet.property.photoSet.photo[a+imgIndexOffset].replace(/.jpg/,"Thumb.jpg")}function displayPropertyData(){imgIndexOffset=0;getImages();if(data.propertySet.property.floorPlans){document.getElementById("floorPlans").style.display="block"}else{document.getElementById("floorPlans").style.display="none"}if(data.propertySet.property.videoTour){document.getElementById("videoTour").style.display="block"}else{document.getElementById("videoTour").style.display="none"}document.getElementById("activeStatusText").innerHTML=dataCheck(data.propertySet.property.statusText).toString();document.getElementById("addressBox").innerHTML=dataCheck(data.propertySet.property.city.toUpperCase())+" : "+dataCheck(data.propertySet.property.community)+" : "+dataCheck(data.propertySet.property.address).toString();document.getElementById("descriptiveTextBox").innerHTML=dataCheck(data.propertySet.property.text).toString();var c="";var a=dataCheck(data.propertySet.property.lowPrice);var b=dataCheck(data.propertySet.property.highPrice);if((a>0)&&(b>a)){c="Offered Value Range from "+formatCurrency(a)+" to "+formatCurrency(b)}else{if(a>0){c="Offered at "+formatCurrency(a)}}document.getElementById("priceBox").innerHTML=c;if(data.propertySet.property.coopAgent){document.getElementById("coopAgentBox").innerHTML="This&nbsp;property&nbsp;marketed<br />in&nbsp;association&nbsp;with<br />"+data.propertySet.property.coopAgent.toUpperCase().toString()}else{document.getElementById("coopAgentBox").innerHTML=""}displayPropertyFeatures()}function displayPropertyFeatures(){var c=0;var a=dataCheck(data.propertySet.property.features);var b='<ul class="featuresListBox">';while(c>=0){c=a.indexOf(",",0);if(c==-1){b+="<li>"+a+"</li>"}else{b+="<li>"+a.slice(0,c)+"</li>";a=a.substring(c+1)}}b+="</ul>";document.getElementById("featuresListBox").innerHTML=b.toString()}function featuresOver(){document.getElementById("propertyListBox").style.display="none";document.getElementById("featuresListBox").style.display="block";tempTitle=document.getElementById("propertyListBoxTitle").innerHTML;document.getElementById("propertyListBoxTitle").innerHTML="Property<br  />Features";document.getElementById("featuresIndicatorBottom").style.display="block";document.getElementById("featuresIndicatorTop").style.display="block";document.getElementById("propertyFeatures").style.borderBottom="solid 1px #00ff00";updatePageCount("features")}function featuresOut(){document.getElementById("propertyListBox").style.display="block";document.getElementById("featuresListBox").style.display="none";document.getElementById("propertyListBoxTitle").innerHTML=tempTitle;document.getElementById("featuresIndicatorBottom").style.display="none";document.getElementById("featuresIndicatorTop").style.display="none";document.getElementById("propertyFeatures").style.borderBottom="none"}function breakout_of_frame(){if(top.location!=location){top.location.href=document.location.href}}function clickThumb(b,a){activeThumb.className="thumbBoxOut";activeThumb=b;b.className="thumbBoxActive";activePhoto.style.visibility="hidden";activePhoto=document.getElementById("photoDisplay_"+a);activePhoto.style.visibility="visible"}function overMenuBorder(a){if(a.id.substring(a.id.indexOf("_")+1)!=activeMenuElementIndex){document.getElementById("mask_"+(a.id.substring(a.id.indexOf("_")+1))).className="menuInfoContainerBorderOver"}}function outMenuBorder(a){if(a.id.substring(a.id.indexOf("_")+1)!=activeMenuElementIndex){document.getElementById("mask_"+(a.id.substring(a.id.indexOf("_")+1))).className="menuInfoContainerBorderOut"}}function openwindow(b,d){var a="scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no";a+=",width="+(screen.availWidth-10)*0.96+",height="+(screen.availHeight)*0.96;a+=",screenX=0,screenY=0,top=0,left=0";var c=window.open(b,d,a);c.focus();c.moveTo((screen.availWidth-10)*0.02,0)}function returnDocument(){var b=document.location.href;var a=(b.indexOf("?")==-1)?b.length:b.indexOf("?");return b.substring(b.indexOf("//")+2,a)}function clickMenuActive(a){document.getElementById("mask_"+activeMenuElementIndex).className="menuInfoContainerBorderOut";activeMenuElementIndex=a.id.substring(a.id.indexOf("_")+1);document.getElementById("mask_"+activeMenuElementIndex).className="menuInfoContainerBorderActive";switch(activeMenuElementIndex){case"0":updatePageCount("contactUs");openwindow("/contactus.php");break;case"2":window.location="/propertySearch.php";break;case"3":updatePageCount("MarketingYourProperty");window.location="/marketing.php";break;case"4":window.location="/aboutallan.php";break;case"5":window.location="/clientFeedback.php";break;case"6":window.location="/analysis.php";break;case"7":updatePageCount("areaInfo");window.location="/#areaInfo";break;case"8":window.location="/coastalAreaMarketHistory.php";break;case"9":if(returnDocument()=="oc-coastalproperties.com/"||returnDocument()=="oc-coastalproperties.com/index.php"||returnDocument()=="oc-coastalproperties.com/#"||returnDocument()=="oc-coastalproperties.com/#pageTop"||returnDocument()=="oc-coastalproperties.com/#areaInfo"){updatePageCount("sold");importPropertyList("Sold");generatePropertyListFromSelection("sold");displayPropertyData();if(mapLoadedFlag==1){changeMapPosition()}clickThumb(document.getElementById("thumbBox_0"),0)}else{updatePageCount("sold");window.location="/?statusID=Sold"}break;case"10":window.location="/theSource.php";break;case"11":window.location="/weblog/";break;default:if(returnDocument()=="oc-coastalproperties.com/"||returnDocument()=="oc-coastalproperties.com/index.php"||returnDocument()=="oc-coastalproperties.com/#"||returnDocument()=="oc-coastalproperties.com/#pageTop"||returnDocument()=="oc-coastalproperties.com/#areaInfo"){updatePageCount("featured");importPropertyList("Active");generatePropertyListFromSelection("active");displayPropertyData();if(mapLoadedFlag==1){changeMapPosition()}clickThumb(document.getElementById("thumbBox_0"),0)}else{updatePageCount("featured");window.location="/"}}}function overBorder(a){if(a!=activeElement){document.getElementById("PLmask_"+a.id.substring(a.id.indexOf("PL_")+3,a.id.lastIndexOf("_"))).className="propertyInfoBorderOver"}}function outBorder(a){if(a!=activeElement){document.getElementById("PLmask_"+a.id.substring(a.id.indexOf("PL_")+3,a.id.lastIndexOf("_"))).className="propertyInfoBorderOut"}}function changeMapPosition(){point=new GLatLng(data.propertySet.property.pLat,data.propertySet.property.pLng);map.clearOverlays();pointMarker=new GMarker(point,{title:data.propertySet.property.address,clickable:false,autoPan:false});map.addOverlay(pointMarker);map.panTo(point)}function clickActive(a){document.getElementById("processingDisplay").style.display="block";document.getElementById("thumbProcessingDisplay").style.display="block";document.getElementById("PLmask_"+a.id.substring(a.id.indexOf("PL_")+3,a.id.lastIndexOf("_"))).className="propertyInfoBorderActive";if(activeElement!=""&&activeElement!=a){document.getElementById("PLmask_"+activeElement.id.substring(activeElement.id.indexOf("PL_")+3,activeElement.id.lastIndexOf("_"))).className="propertyInfoBorderOut"}activeElement=a;selectedPropertyID=a.id.substring(a.id.indexOf("/")+1);updatePageCount(selectedPropertyID);importPropertyData(selectedPropertyID);displayPropertyData();clickThumb(document.getElementById("thumbBox_0"),0);if(map&&mapIsOpen==1){setTimeout("changeMapPosition()",10)}}function clickLocationMap(){updatePageCount("map");document.getElementById("locationMapPanel").style.visibility="visible";document.getElementById("callToday").style.display="none";document.getElementById("activeStatusText").style.display="none";if(mapLoadedFlag==0){mapLoadedFlag=1;setTimeout("doLoad()",10)}else{setTimeout("changeMapPosition()",10)}mapIsOpen=1}function doLoad(){if(GBrowserIsCompatible()){container=document.getElementById("mapDiv");map=new GMap2(container,{draggableCursor:"crosshair"});map.addMapType(G_PHYSICAL_MAP);map.setMapType(G_HYBRID_MAP);map.addControl(new GScaleControl());map.addControl(new GLargeMapControl());map.addControl(new GMapTypeControl());point=new GLatLng(data.propertySet.property.pLat,data.propertySet.property.pLng);map.setCenter(point,zoom);pointMarker=new GMarker(point,{title:data.propertySet.property.address,clickable:false,autoPan:false});map.addOverlay(pointMarker);changeMapPosition()}}function closeMap(){document.getElementById("locationMapPanel").style.visibility="hidden";document.getElementById("callToday").style.display="block";document.getElementById("activeStatusText").style.display="block";mapIsOpen=0}function printMap(){var b=map.getCenter();var d=b.lat();var a=b.lng();var c=map.getZoom();newWindowHTML='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';newWindowHTML+="undefined";newWindowHTML+="<head>";newWindowHTML+="<title>Location Map</title>";newWindowHTML+='<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />';newWindowHTML=="</head><body>";newWindowHTML+='<div style="text-align:center">';newWindowHTML+='<img name="staticMap" style="border:solid 1px #aaaaaa" src="http://maps.google.com/staticmap?center='+d+","+a+"&amp;zoom="+c+"&amp;size=640x400&amp;markers="+data.propertySet.property.pLat+","+data.propertySet.property.pLng+"&amp;sensor=false&amp;key="+myKey+'" alt="Location map for '+data.propertySet.property.address+", "+data.propertySet.property.city+' CA" />';newWindowHTML+='<br /><br /><div style="width:70%;text-align:center;border:solid 1px #aaaaaa;font-family:sans-serif;font-size:14px">Location map for '+data.propertySet.property.address+", "+data.propertySet.property.city+" CA</div>";newWindowHTML+="</div>";newWindowHTML+="</body></html>";mapWindow=window.open("","mapWindow","width=700,directories=no,resizeable=no,location=no,toolbar=1,menubar=1,scrollbars=no,status=no");mapWindow.document.open();mapWindow.document.write(newWindowHTML);mapWindow.document.close();mapWindow.print();mapWindow.close()}function printFlyer(){updatePageCount("printFlyer");mapWindow=openwindow("/scripts/printFlyer.php?propertyID="+data.propertySet.property.propertyID+"&propertyImg="+data.propertySet.property.photoSet.photo[0])}function generatePropertyListFromSelection(a){newContent="";startElementId="";startElementMaskId="";document.getElementById("content").innerHTML="";for(p=0;p<dataL.propertySet.property.length;p++){document.getElementById("content").innerHTML+="<div id='PL_"+p+"_/"+dataL.propertySet.property[p].propertyID+"' class='propertyInfoContainer' onmouseover='overBorder(this)' onmouseout='outBorder(this)' onclick='clickActive(this)'><div id='PLmask_"+p+"' class='propertyInfoBorderOut'></div>"+dataCheck(dataL.propertySet.property[p].city).toUpperCase()+" <br />"+dataCheck(dataL.propertySet.property[p].community)+" <br />"+dataCheck(dataL.propertySet.property[p].address)+" <br />"+formatCurrency(dataCheck(dataL.propertySet.property[p].lowPrice))+" </div>",toString();document.getElementById("PLmask_"+p).style.top=(document.getElementById("PL_"+p+"_/"+dataL.propertySet.property[p].propertyID).offsetHeight-15)+"px";if(dataL.propertySet.property[p].propertyID.toLowerCase()==dataL.propertySet.startID.toLowerCase()){startElementId="PL_"+p+"_/"+dataL.propertySet.property[p].propertyID;startElementMaskId="PLmask_"+p;startIndex=p;importPropertyData(dataL.propertySet.property[p].propertyID)}}document.getElementById("propertyListBox").scrollTop=(startIndex*70)-180;document.getElementById(startElementMaskId).className="propertyInfoBorderActive";activeElement=document.getElementById(startElementId);switch(a.toLowerCase()){case"inactive":document.getElementById("propertyListBoxTitle").innerHTML="Inactive <br />Properties ".toString();break;case"sold":document.getElementById("propertyListBoxTitle").innerHTML="Sold <br />Gallery ".toString();break;default:document.getElementById("propertyListBoxTitle").innerHTML="Featured <br />Properties ".toString()}}function logoShadowDisplay(){document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="138" height="138">');document.write('<param name="movie" value="http://occp.us/images/logoShadow.swf" />');document.write('<param name="quality" value="high" />');document.write('<param name="wmode" value="transparent" />');document.write('<embed src="http://s.cdnoccp.us/images/logoShadow.swf" width="138" height="138" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');document.write("</object>")}function callTodayDisplay(){document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="496" height="33">');document.write('<param name="movie" value="http://s.cdnoccp.us/images/callToday2.swf" />');document.write('<param name="quality" value="high" />');document.write('<param name="wmode" value="transparent" />');document.write('<embed src="http://s.cdnoccp.us/images/callToday2.swf" width="496" height="33" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');document.write("</object>")}function menuBoxShadowDisplay(){document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="160" height="610">');document.write('<param name="movie" value="http://s.cdnoccp.us/images/menuShadow.swf" />');document.write('<param name="quality" value="high" />');document.write('<param name="wmode" value="transparent" />');document.write('<embed src="http://s.cdnoccp.us/images/menuShadow.swf" width="160" height="610" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');document.write("</object>")}function mainDisplayShadowDisplay(){document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="808" height="608">');document.write('<param name="movie" value="http://s.cdnoccp.us/images/mainDisplayShadow.swf" />');document.write('<param name="quality" value="high" />');document.write('<param name="wmode" value="transparent" />');document.write('<embed src="http://s.cdnoccp.us/images/mainDisplayShadow.swf" width="808" height="608" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');document.write("</object>")}function scheduleTourDisplay(){updatePageCount("moreInfo");openwindow("/inquiry.php?address="+data.propertySet.property.address+"&city="+data.propertySet.property.city)}function targetOpen(a,b){targetWindow=window.open(a,b,"")}function floorPlansDisplay(){updatePageCount("floorPlans");openwindow(data.propertySet.property.floorPlans,"_blank")}function videoTourDisplay(){updatePageCount("videoTour");openwindow(data.propertySet.property.videoTour,"_blank")}function updatePageCount(a){if(data&&data.propertySet&&data.propertySet.property){document.getElementById("pageName").setAttribute("src","/scripts/pageCntUpdate.php?page="+a+"&propertyID="+data.propertySet.property.propertyID)}else{document.getElementById("pageName").setAttribute("src","/scripts/pageCntUpdate.php?page="+a)}}function closeWindow(){if(refPage=="home"){window.close()}else{window.open("/","_self")}};
