__AutoComplete=new Array();isIE=document.all?true:false;isGecko=navigator.userAgent.toLowerCase().indexOf("gecko")!=-1;isOpera=navigator.userAgent.toLowerCase().indexOf("opera")!=-1;function AutoComplete_Create(c,b){if(__AutoComplete[c]){AutoComplete_HideAll();if(document.addEventListener){document.removeEventListener("click",a,false)}else{if(document.attachEvent){document.detachEvent("onclick",a,false)}}}__AutoComplete[c]={data:b,isVisible:false,element:document.getElementById(c),dropdown:null,highlighted:null};__AutoComplete[c]["element"].setAttribute("autocomplete","off");__AutoComplete[c]["element"].onkeydown=function(d){return AutoComplete_KeyDown(this.getAttribute("id"),d)};__AutoComplete[c]["element"].onkeyup=function(d){return AutoComplete_KeyUp(this.getAttribute("id"),d)};__AutoComplete[c]["element"].onkeypress=function(d){if(!d){d=window.event}if(d.keyCode==13||isOpera){return false}};__AutoComplete[c]["element"].ondblclick=function(){AutoComplete_ShowDropdown(this.getAttribute("id"))};__AutoComplete[c]["element"].onclick=function(d){if(!d){d=window.event}d.cancelBubble=true;d.returnValue=false};var a=function(){AutoComplete_HideAll()};if(document.addEventListener){document.addEventListener("click",a,false)}else{if(document.attachEvent){document.attachEvent("onclick",a,false)}}__AutoComplete[c]["element"].docClick=a;if(arguments[2]!=null){__AutoComplete[c]["maxitems"]=arguments[2];__AutoComplete[c]["firstItemShowing"]=0;__AutoComplete[c]["lastItemShowing"]=arguments[2]-1}AutoComplete_CreateDropdown(c);if(isIE){__AutoComplete[c]["iframe"]=document.createElement("iframe");__AutoComplete[c]["iframe"].id=c+"_iframe";__AutoComplete[c]["iframe"].style.position="absolute";__AutoComplete[c]["iframe"].style.top="0";__AutoComplete[c]["iframe"].style.left="0";__AutoComplete[c]["iframe"].style.width="0px";__AutoComplete[c]["iframe"].style.height="0px";__AutoComplete[c]["iframe"].style.zIndex="98";__AutoComplete[c]["iframe"].style.visibility="hidden";__AutoComplete[c]["element"].parentNode.insertBefore(__AutoComplete[c]["iframe"],__AutoComplete[c]["element"])}AutoComplete_ShowDropdown(c)}function AutoComplete_Destroy(){for(id in __AutoComplete){if(__AutoComplete[id]){AutoComplete_HideAll();if(document.addEventListener){document.removeEventListener("click",__AutoComplete[id]["element"].docClick,false)}else{if(document.attachEvent){document.detachEvent("onclick",__AutoComplete[id]["element"].docClick,false)}}__AutoComplete.id=null}}}function AutoComplete_CreateDropdown(d){var c=AutoComplete_GetLeft(__AutoComplete[d]["element"]);var b=AutoComplete_GetTop(__AutoComplete[d]["element"])+__AutoComplete[d]["element"].offsetHeight;var a=__AutoComplete[d]["element"].offsetWidth;__AutoComplete[d]["dropdown"]=document.createElement("div");__AutoComplete[d]["dropdown"].className="autocomplete";__AutoComplete[d]["element"].parentNode.insertBefore(__AutoComplete[d]["dropdown"],__AutoComplete[d]["element"]);__AutoComplete[d]["dropdown"].style.left=c+"px";__AutoComplete[d]["dropdown"].style.top=b+"px";__AutoComplete[d]["dropdown"].style.width=a+"px";__AutoComplete[d]["dropdown"].style.zIndex="99";__AutoComplete[d]["dropdown"].style.visibility="hidden"}function AutoComplete_GetLeft(a){var b=a;var c=0;do{c+=b.offsetLeft;b=b.offsetParent}while(b.tagName.toLowerCase()!="body");return c}function AutoComplete_GetTop(a){var b=a;var c=0;do{c+=b.offsetTop;b=b.offsetParent}while(b.tagName.toLowerCase()!="body");return c}function AutoComplete_ShowDropdown(h){AutoComplete_HideAll();var f=__AutoComplete[h]["element"].value;var e=new Array();var b=null;var g=null;var a=__AutoComplete[h]["dropdown"].childNodes.length;while(__AutoComplete[h]["dropdown"].childNodes.length>0){__AutoComplete[h]["dropdown"].removeChild(__AutoComplete[h]["dropdown"].childNodes[0])}var d=f.toLowerCase();var c="";for(i=0;i<__AutoComplete[h]["data"].length;i++){c=__AutoComplete[h]["data"][i].substr(0,f.length);if(c.toLowerCase()==d){e[e.length]=Encoder.htmlDecode(__AutoComplete[h]["data"][i])}}if(e.length==0){AutoComplete_HideDropdown(h);return}for(i=0;i<e.length;++i){b=document.createElement("div");b.className="autocomplete_item";b.setAttribute("id","autocomplete_item_"+i);b.setAttribute("index",i);b.style.zIndex="99";if(e.length>__AutoComplete[h]["maxitems"]&&navigator.userAgent.indexOf("MSIE")==-1){b.style.width=__AutoComplete[h]["element"].offsetWidth-22+"px"}b.onmouseover=function(){AutoComplete_HighlightItem(__AutoComplete[h]["element"].getAttribute("id"),this.getAttribute("index"))};b.onclick=function(){AutoComplete_SetValue(__AutoComplete[h]["element"].getAttribute("id"));AutoComplete_HideDropdown(__AutoComplete[h]["element"].getAttribute("id"))};g=document.createTextNode(e[i]);b.appendChild(g);__AutoComplete[h]["dropdown"].appendChild(b)}if(e.length>__AutoComplete[h]["maxitems"]){__AutoComplete[h]["dropdown"].style.height=(__AutoComplete[h]["maxitems"]*15)+2+"px"}else{__AutoComplete[h]["dropdown"].style.height=""}__AutoComplete[h]["dropdown"].style.left=AutoComplete_GetLeft(__AutoComplete[h]["element"]);__AutoComplete[h]["dropdown"].style.top=AutoComplete_GetTop(__AutoComplete[h]["element"])+__AutoComplete[h]["element"].offsetHeight;if(isIE){__AutoComplete[h]["iframe"].style.top=__AutoComplete[h]["dropdown"].style.top;__AutoComplete[h]["iframe"].style.left=__AutoComplete[h]["dropdown"].style.left;__AutoComplete[h]["iframe"].style.width=__AutoComplete[h]["dropdown"].offsetWidth;__AutoComplete[h]["iframe"].style.height=__AutoComplete[h]["dropdown"].offsetHeight;__AutoComplete[h]["iframe"].style.visibility="visible"}if(!__AutoComplete[h]["isVisible"]){__AutoComplete[h]["dropdown"].style.visibility="visible";__AutoComplete[h]["isVisible"]=true}if(__AutoComplete[h]["dropdown"].childNodes.length!=a){__AutoComplete[h]["highlighted"]=null}}function AutoComplete_HideDropdown(a){if(__AutoComplete[a]){if(__AutoComplete[a]["iframe"]){__AutoComplete[a]["iframe"].style.visibility="hidden"}__AutoComplete[a]["dropdown"].style.visibility="hidden";__AutoComplete[a]["highlighted"]=null;__AutoComplete[a]["isVisible"]=false}}function AutoComplete_HideAll(){for(id in __AutoComplete){AutoComplete_HideDropdown(id)}}function AutoComplete_HighlightItem(c,a){if(__AutoComplete[c]["dropdown"].childNodes[a]){for(var b=0;b<__AutoComplete[c]["dropdown"].childNodes.length;++b){if(__AutoComplete[c]["dropdown"].childNodes[b].className=="autocomplete_item_highlighted"){__AutoComplete[c]["dropdown"].childNodes[b].className="autocomplete_item"}}__AutoComplete[c]["dropdown"].childNodes[a].className="autocomplete_item_highlighted";__AutoComplete[c]["highlighted"]=a}}function AutoComplete_Highlight(c,a){if(a==1&&__AutoComplete[c]["highlighted"]==__AutoComplete[c]["dropdown"].childNodes.length-1){__AutoComplete[c]["dropdown"].childNodes[__AutoComplete[c]["highlighted"]].className="autocomplete_item";__AutoComplete[c]["highlighted"]=null}else{if(a==-1&&__AutoComplete[c]["highlighted"]==0){__AutoComplete[c]["dropdown"].childNodes[0].className="autocomplete_item";__AutoComplete[c]["highlighted"]=__AutoComplete[c]["dropdown"].childNodes.length}}if(__AutoComplete[c]["highlighted"]==null){__AutoComplete[c]["dropdown"].childNodes[0].className="autocomplete_item_highlighted";__AutoComplete[c]["highlighted"]=0}else{if(__AutoComplete[c]["dropdown"].childNodes[__AutoComplete[c]["highlighted"]]){__AutoComplete[c]["dropdown"].childNodes[__AutoComplete[c]["highlighted"]].className="autocomplete_item"}var b=__AutoComplete[c]["highlighted"]+a;if(__AutoComplete[c]["dropdown"].childNodes[b]){__AutoComplete[c]["dropdown"].childNodes[b].className="autocomplete_item_highlighted";__AutoComplete[c]["highlighted"]=b}}}function AutoComplete_SetValue(a){__AutoComplete[a]["element"].value=__AutoComplete[a]["dropdown"].childNodes[__AutoComplete[a]["highlighted"]].innerHTML}function AutoComplete_ScrollCheck(a){if(__AutoComplete[a]["highlighted"]>__AutoComplete[a]["lastItemShowing"]){__AutoComplete[a]["firstItemShowing"]=__AutoComplete[a]["highlighted"]-(__AutoComplete[a]["maxitems"]-1);__AutoComplete[a]["lastItemShowing"]=__AutoComplete[a]["highlighted"]}if(__AutoComplete[a]["highlighted"]<__AutoComplete[a]["firstItemShowing"]){__AutoComplete[a]["firstItemShowing"]=__AutoComplete[a]["highlighted"];__AutoComplete[a]["lastItemShowing"]=__AutoComplete[a]["highlighted"]+(__AutoComplete[a]["maxitems"]-1)}__AutoComplete[a]["dropdown"].scrollTop=__AutoComplete[a]["firstItemShowing"]*15}function AutoComplete_KeyDown(b){if(arguments[1]!=null){event=arguments[1]}var a=event.keyCode;switch(a){case 13:if(__AutoComplete[b]["highlighted"]!=null){AutoComplete_SetValue(b);AutoComplete_HideDropdown(b)}event.returnValue=false;event.cancelBubble=true;break;case 27:AutoComplete_HideDropdown(b);event.returnValue=false;event.cancelBubble=true;break;case 38:if(!__AutoComplete[b]["isVisible"]){AutoComplete_ShowDropdown(b)}AutoComplete_Highlight(b,-1);AutoComplete_ScrollCheck(b,-1);return false;break;case 9:if(__AutoComplete[b]["isVisible"]){AutoComplete_HideDropdown(b)}return;case 40:if(!__AutoComplete[b]["isVisible"]){AutoComplete_ShowDropdown(b)}AutoComplete_Highlight(b,1);AutoComplete_ScrollCheck(b,1);return false;break}}function AutoComplete_KeyUp(b){if(arguments[1]!=null){event=arguments[1]}var a=event.keyCode;switch(a){case 13:event.returnValue=false;event.cancelBubble=true;break;case 27:AutoComplete_HideDropdown(b);event.returnValue=false;event.cancelBubble=true;break;case 38:case 40:return false;break;default:AutoComplete_ShowDropdown(b);break}}function AutoComplete_isVisible(a){return __AutoComplete[a]["dropdown"].style.visibility=="visible"}function simulateClick(c){var a;var b=document.getElementById(c);if(document.createEvent){a=document.createEvent("MouseEvents");if(a.initMouseEvent){a.initMouseEvent("click",true,true,window,0,0,0,0,0,false,false,false,false,0,null)}else{a=false}}(a)?b.dispatchEvent(a):(b.click&&b.click())}var request=false;var fldId="";function sendRequest(a,b){request=false;if(window.XMLHttpRequest){request=new XMLHttpRequest();if(request.overrideMimeType){request.overrideMimeType("text/xml")}}else{if(window.ActiveXObject){try{request=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{request=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}}}if(!request){alert("Cannot create XMLHttp request");return false}request.onreadystatechange=getReply;request.open("POST",a,true);request.setRequestHeader("Content-type","application/x-www-form-urlencoded");request.setRequestHeader("Content-length",b.length);request.setRequestHeader("Connection","close");request.send(b)}function getReply(){if(request.readyState==4){if(request.status==200){var b=request.responseXML;var d=b.getElementsByTagName("results")[0].childNodes;if(d.length){var e=new Array();var a=0;for(var c=0;c<d.length;c++){if(d[c].hasChildNodes()){e[a++]=d[c].childNodes[0].nodeValue}}AutoComplete_Create(fldId,e,maxAutoSuggest)}return}else{alert("There was a problem getting your suggestions. Please try again later.")}}}function ajaxForm(b,c){var a="input="+c+processForm(b,false);fldId=c.substr(c.indexOf(",")+1,4);sendRequest("php/suggest_xml.php",a)}Encoder={EncodeType:"entity",isEmpty:function(a){if(a){return((a===null)||a.length==0||/^\s+$/.test(a))}else{return true}},HTML2Numerical:function(c){var b=new Array("&nbsp;","&iexcl;","&cent;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","&shy;","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&agrave;","&aacute;","&acirc;","&atilde;","&Auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&Ouml;","&times;","&oslash;","&ugrave;","&uacute;","&ucirc;","&Uuml;","&yacute;","&thorn;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&Oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&yacute;","&thorn;","&yuml;","&quot;","&amp;","&lt;","&gt;","&oelig;","&oelig;","&scaron;","&scaron;","&yuml;","&circ;","&tilde;","&ensp;","&emsp;","&thinsp;","&zwnj;","&zwj;","&lrm;","&rlm;","&ndash;","&mdash;","&lsquo;","&rsquo;","&sbquo;","&ldquo;","&rdquo;","&bdquo;","&dagger;","&dagger;","&permil;","&lsaquo;","&rsaquo;","&euro;","&fnof;","&alpha;","&beta;","&gamma;","&delta;","&epsilon;","&zeta;","&eta;","&theta;","&iota;","&kappa;","&lambda;","&mu;","&nu;","&xi;","&omicron;","&pi;","&rho;","&sigma;","&tau;","&upsilon;","&phi;","&chi;","&psi;","&omega;","&alpha;","&beta;","&gamma;","&delta;","&epsilon;","&zeta;","&eta;","&theta;","&iota;","&kappa;","&lambda;","&mu;","&nu;","&xi;","&omicron;","&pi;","&rho;","&sigmaf;","&sigma;","&tau;","&upsilon;","&phi;","&chi;","&psi;","&omega;","&thetasym;","&upsih;","&piv;","&bull;","&hellip;","&prime;","&prime;","&oline;","&frasl;","&weierp;","&image;","&real;","&trade;","&alefsym;","&larr;","&uarr;","&rarr;","&darr;","&harr;","&crarr;","&larr;","&uarr;","&rarr;","&darr;","&harr;","&forall;","&part;","&exist;","&empty;","&nabla;","&isin;","&notin;","&ni;","&prod;","&sum;","&minus;","&lowast;","&radic;","&prop;","&infin;","&ang;","&and;","&or;","&cap;","&cup;","&int;","&there4;","&sim;","&cong;","&asymp;","&ne;","&equiv;","&le;","&ge;","&sub;","&sup;","&nsub;","&sube;","&supe;","&oplus;","&otimes;","&perp;","&sdot;","&lceil;","&rceil;","&lfloor;","&rfloor;","&lang;","&rang;","&loz;","&spades;","&clubs;","&hearts;","&diams;");var a=new Array("&#160;","&#161;","&#162;","&#163;","&#164;","&#165;","&#166;","&#167;","&#168;","&#169;","&#170;","&#171;","&#172;","&#173;","&#174;","&#175;","&#176;","&#177;","&#178;","&#179;","&#180;","&#181;","&#182;","&#183;","&#184;","&#185;","&#186;","&#187;","&#188;","&#189;","&#190;","&#191;","&#192;","&#193;","&#194;","&#195;","&#196;","&#197;","&#198;","&#199;","&#200;","&#201;","&#202;","&#203;","&#204;","&#205;","&#206;","&#207;","&#208;","&#209;","&#210;","&#211;","&#212;","&#213;","&#214;","&#215;","&#216;","&#217;","&#218;","&#219;","&#220;","&#221;","&#222;","&#223;","&#224;","&#225;","&#226;","&#227;","&#228;","&#229;","&#230;","&#231;","&#232;","&#233;","&#234;","&#235;","&#236;","&#237;","&#238;","&#239;","&#240;","&#241;","&#242;","&#243;","&#244;","&#245;","&#246;","&#247;","&#248;","&#249;","&#250;","&#251;","&#252;","&#253;","&#254;","&#255;","&#34;","&#38;","&#60;","&#62;","&#338;","&#339;","&#352;","&#353;","&#376;","&#710;","&#732;","&#8194;","&#8195;","&#8201;","&#8204;","&#8205;","&#8206;","&#8207;","&#8211;","&#8212;","&#8216;","&#8217;","&#8218;","&#8220;","&#8221;","&#8222;","&#8224;","&#8225;","&#8240;","&#8249;","&#8250;","&#8364;","&#402;","&#913;","&#914;","&#915;","&#916;","&#917;","&#918;","&#919;","&#920;","&#921;","&#922;","&#923;","&#924;","&#925;","&#926;","&#927;","&#928;","&#929;","&#931;","&#932;","&#933;","&#934;","&#935;","&#936;","&#937;","&#945;","&#946;","&#947;","&#948;","&#949;","&#950;","&#951;","&#952;","&#953;","&#954;","&#955;","&#956;","&#957;","&#958;","&#959;","&#960;","&#961;","&#962;","&#963;","&#964;","&#965;","&#966;","&#967;","&#968;","&#969;","&#977;","&#978;","&#982;","&#8226;","&#8230;","&#8242;","&#8243;","&#8254;","&#8260;","&#8472;","&#8465;","&#8476;","&#8482;","&#8501;","&#8592;","&#8593;","&#8594;","&#8595;","&#8596;","&#8629;","&#8656;","&#8657;","&#8658;","&#8659;","&#8660;","&#8704;","&#8706;","&#8707;","&#8709;","&#8711;","&#8712;","&#8713;","&#8715;","&#8719;","&#8721;","&#8722;","&#8727;","&#8730;","&#8733;","&#8734;","&#8736;","&#8743;","&#8744;","&#8745;","&#8746;","&#8747;","&#8756;","&#8764;","&#8773;","&#8776;","&#8800;","&#8801;","&#8804;","&#8805;","&#8834;","&#8835;","&#8836;","&#8838;","&#8839;","&#8853;","&#8855;","&#8869;","&#8901;","&#8968;","&#8969;","&#8970;","&#8971;","&#9001;","&#9002;","&#9674;","&#9824;","&#9827;","&#9829;","&#9830;");return this.swapArrayVals(c,b,a)},NumericalToHTML:function(c){var b=new Array("&#160;","&#161;","&#162;","&#163;","&#164;","&#165;","&#166;","&#167;","&#168;","&#169;","&#170;","&#171;","&#172;","&#173;","&#174;","&#175;","&#176;","&#177;","&#178;","&#179;","&#180;","&#181;","&#182;","&#183;","&#184;","&#185;","&#186;","&#187;","&#188;","&#189;","&#190;","&#191;","&#192;","&#193;","&#194;","&#195;","&#196;","&#197;","&#198;","&#199;","&#200;","&#201;","&#202;","&#203;","&#204;","&#205;","&#206;","&#207;","&#208;","&#209;","&#210;","&#211;","&#212;","&#213;","&#214;","&#215;","&#216;","&#217;","&#218;","&#219;","&#220;","&#221;","&#222;","&#223;","&#224;","&#225;","&#226;","&#227;","&#228;","&#229;","&#230;","&#231;","&#232;","&#233;","&#234;","&#235;","&#236;","&#237;","&#238;","&#239;","&#240;","&#241;","&#242;","&#243;","&#244;","&#245;","&#246;","&#247;","&#248;","&#249;","&#250;","&#251;","&#252;","&#253;","&#254;","&#255;","&#34;","&#38;","&#60;","&#62;","&#338;","&#339;","&#352;","&#353;","&#376;","&#710;","&#732;","&#8194;","&#8195;","&#8201;","&#8204;","&#8205;","&#8206;","&#8207;","&#8211;","&#8212;","&#8216;","&#8217;","&#8218;","&#8220;","&#8221;","&#8222;","&#8224;","&#8225;","&#8240;","&#8249;","&#8250;","&#8364;","&#402;","&#913;","&#914;","&#915;","&#916;","&#917;","&#918;","&#919;","&#920;","&#921;","&#922;","&#923;","&#924;","&#925;","&#926;","&#927;","&#928;","&#929;","&#931;","&#932;","&#933;","&#934;","&#935;","&#936;","&#937;","&#945;","&#946;","&#947;","&#948;","&#949;","&#950;","&#951;","&#952;","&#953;","&#954;","&#955;","&#956;","&#957;","&#958;","&#959;","&#960;","&#961;","&#962;","&#963;","&#964;","&#965;","&#966;","&#967;","&#968;","&#969;","&#977;","&#978;","&#982;","&#8226;","&#8230;","&#8242;","&#8243;","&#8254;","&#8260;","&#8472;","&#8465;","&#8476;","&#8482;","&#8501;","&#8592;","&#8593;","&#8594;","&#8595;","&#8596;","&#8629;","&#8656;","&#8657;","&#8658;","&#8659;","&#8660;","&#8704;","&#8706;","&#8707;","&#8709;","&#8711;","&#8712;","&#8713;","&#8715;","&#8719;","&#8721;","&#8722;","&#8727;","&#8730;","&#8733;","&#8734;","&#8736;","&#8743;","&#8744;","&#8745;","&#8746;","&#8747;","&#8756;","&#8764;","&#8773;","&#8776;","&#8800;","&#8801;","&#8804;","&#8805;","&#8834;","&#8835;","&#8836;","&#8838;","&#8839;","&#8853;","&#8855;","&#8869;","&#8901;","&#8968;","&#8969;","&#8970;","&#8971;","&#9001;","&#9002;","&#9674;","&#9824;","&#9827;","&#9829;","&#9830;");var a=new Array("&nbsp;","&iexcl;","&cent;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","&shy;","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&agrave;","&aacute;","&acirc;","&atilde;","&Auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&Ouml;","&times;","&oslash;","&ugrave;","&uacute;","&ucirc;","&Uuml;","&yacute;","&thorn;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&Oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&yacute;","&thorn;","&yuml;","&quot;","&amp;","&lt;","&gt;","&oelig;","&oelig;","&scaron;","&scaron;","&yuml;","&circ;","&tilde;","&ensp;","&emsp;","&thinsp;","&zwnj;","&zwj;","&lrm;","&rlm;","&ndash;","&mdash;","&lsquo;","&rsquo;","&sbquo;","&ldquo;","&rdquo;","&bdquo;","&dagger;","&dagger;","&permil;","&lsaquo;","&rsaquo;","&euro;","&fnof;","&alpha;","&beta;","&gamma;","&delta;","&epsilon;","&zeta;","&eta;","&theta;","&iota;","&kappa;","&lambda;","&mu;","&nu;","&xi;","&omicron;","&pi;","&rho;","&sigma;","&tau;","&upsilon;","&phi;","&chi;","&psi;","&omega;","&alpha;","&beta;","&gamma;","&delta;","&epsilon;","&zeta;","&eta;","&theta;","&iota;","&kappa;","&lambda;","&mu;","&nu;","&xi;","&omicron;","&pi;","&rho;","&sigmaf;","&sigma;","&tau;","&upsilon;","&phi;","&chi;","&psi;","&omega;","&thetasym;","&upsih;","&piv;","&bull;","&hellip;","&prime;","&prime;","&oline;","&frasl;","&weierp;","&image;","&real;","&trade;","&alefsym;","&larr;","&uarr;","&rarr;","&darr;","&harr;","&crarr;","&larr;","&uarr;","&rarr;","&darr;","&harr;","&forall;","&part;","&exist;","&empty;","&nabla;","&isin;","&notin;","&ni;","&prod;","&sum;","&minus;","&lowast;","&radic;","&prop;","&infin;","&ang;","&and;","&or;","&cap;","&cup;","&int;","&there4;","&sim;","&cong;","&asymp;","&ne;","&equiv;","&le;","&ge;","&sub;","&sup;","&nsub;","&sube;","&supe;","&oplus;","&otimes;","&perp;","&sdot;","&lceil;","&rceil;","&lfloor;","&rfloor;","&lang;","&rang;","&loz;","&spades;","&clubs;","&hearts;","&diams;");return this.swapArrayVals(c,b,a)},numEncode:function(b){if(this.isEmpty(b)){return""}var d="";for(var a=0;a<b.length;a++){var f=b.charAt(a);if(f<" "||f>"~"){f="&#"+f.charCodeAt()+";"}d+=f}return d},htmlDecode:function(e){var g,b,f=e;if(this.isEmpty(f)){return""}f=this.HTML2Numerical(f);arr=f.match(/&#[0-9]{1,5};/g);if(arr!=null){for(var a=0;a<arr.length;a++){b=arr[a];g=b.substring(2,b.length-1);if(g>=-32768&&g<=65535){f=f.replace(b,String.fromCharCode(g))}else{f=f.replace(b,"")}}}return f},htmlEncode:function(a,b){if(this.isEmpty(a)){return""}b=b|false;if(b){if(this.EncodeType=="numerical"){a=a.replace(/&/g,"&#38;")}else{a=a.replace(/&/g,"&amp;")}}a=this.XSSEncode(a,false);if(this.EncodeType=="numerical"||!b){a=this.HTML2Numerical(a)}a=this.numEncode(a);if(!b){a=a.replace(/&#/g,"##AMPHASH##");if(this.EncodeType=="numerical"){a=a.replace(/&/g,"&#38;")}else{a=a.replace(/&/g,"&amp;")}a=a.replace(/##AMPHASH##/g,"&#")}a=a.replace(/&#\d*([^\d;]|$)/g,"$1");if(!b){a=this.correctEncoding(a)}if(this.EncodeType=="entity"){a=this.NumericalToHTML(a)}return a},XSSEncode:function(b,a){if(!this.isEmpty(b)){a=a||true;if(a){b=b.replace(/\'/g,"&#39;");b=b.replace(/\"/g,"&quot;");b=b.replace(/</g,"&lt;");b=b.replace(/>/g,"&gt;")}else{b=b.replace(/\'/g,"&#39;");b=b.replace(/\"/g,"&#34;");b=b.replace(/</g,"&#60;");b=b.replace(/>/g,"&#62;")}return b}else{return""}},hasEncoded:function(a){if(/&#[0-9]{1,5};/g.test(a)){return true}else{if(/&[A-Z]{2,6};/gi.test(a)){return true}else{return false}}},stripUnicode:function(a){return a.replace(/[^\x20-\x7E]/g,"")},correctEncoding:function(a){return a.replace(/(&amp;)(amp;)+/,"$1")},swapArrayVals:function(f,c,b){if(this.isEmpty(f)){return""}var e;if(c&&b){if(c.length==b.length){for(var a=0,d=c.length;a<d;a++){e=new RegExp(c[a],"g");f=f.replace(e,b[a])}}}return f},inArray:function(d,b){for(var c=0,a=b.length;c<a;c++){if(b[c]===d){return c}}return -1}};var map;var openInfo;var north=minLat;var south=maxLat;var east=minLng;var west=maxLng;var customIcons=[];customIcons[1]=iconHome;customIcons[2]=iconTownhouse;customIcons[3]=iconCondo;customIcons[4]=iconTimeshare;customIcons[5]=iconResLand;customIcons[6]=iconCommSales;customIcons[7]=iconCommLand;customIcons[8]=iconCommLease;customIcons[9]=iconRental;customIcons[10]=iconAuction;customIcons[11]=iconFarm;customIcons[12]=iconCommSales;customIcons[13]=iconCommLease;var viewedIcons=[];viewedIcons[1]=viewedHome;viewedIcons[2]=viewedTownhouse;viewedIcons[3]=viewedCondo;viewedIcons[4]=viewedTimeshare;viewedIcons[5]=viewedResLand;viewedIcons[6]=viewedCommSales;viewedIcons[7]=viewedCommLand;viewedIcons[8]=viewedCommLease;viewedIcons[9]=viewedRental;viewedIcons[10]=viewedAuction;viewedIcons[11]=viewedFarm;viewedIcons[12]=viewedCommSales;viewedIcons[13]=viewedCommLease;var poiIcons=[];poiIcons[1]=iconBusiness;poiIcons[2]=iconRestaurant;poiIcons[3]=iconPark;poiIcons[4]=iconSchool;poiIcons[5]=iconChurch;poiIcons[6]=iconShopping;poiIcons[7]=iconOther;var poiViewedIcons=[];poiViewedIcons[1]=viewedBusiness;poiViewedIcons[2]=viewedRestaurant;poiViewedIcons[3]=viewedPark;poiViewedIcons[4]=viewedSchool;poiViewedIcons[5]=viewedChurch;poiViewedIcons[6]=viewedShopping;poiViewedIcons[7]=viewedOther;function initialize(d){if(map){if(d!=""){map=null}else{return}}var f=new google.maps.LatLng(defCtrLat,defCtrLng);var a={zoom:defZoom,center:f,navigationControl:true,scrollwheel:wheelZoom,navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL},mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:true,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},streetViewControl:true,size:new google.maps.Size(defWidth,defHeight)};map=new google.maps.Map(document.getElementById("map_canvas"),a);var c=[{featureType:"road.local",elementType:"all",stylers:[]},{featureType:"road.local",elementType:"labels",stylers:[]}];var e={map:map,name:"Styled-Map"};var b=new google.maps.StyledMapType(c,e);map.setZoom(defZoom);north=minLat;south=maxLat;east=minLng;west=maxLng;if(disp_poi&&always_poi){load_poi()}if(d&&d!=""){load(d)}}function load(f){if(f==""){return}if(window.XMLHttpRequest){xhttp=new XMLHttpRequest()}else{xhttp=new ActiveXObject("Microsoft.XMLHTTP")}xhttp.open("GET","php/map_xml.php?"+f,false);xhttp.send("");xmlDoc=xhttp.responseXML;var n=xmlDoc.documentElement.getElementsByTagName("marker");if(!n.length){alert("No matching properties found.  Please refine your search criteria");return}var m=0;var r;var a;if(n.length){r=n[0].getAttribute("total");a=n[0].getAttribute("displayed");if(r&&r!=""&&r>0){m++}}for(;m<n.length;m++){var g=n[m].getAttribute("lat");var q=n[m].getAttribute("lng");if(g==null||g==""||q==null||q==""){continue}g=parseFloat(g);q=parseFloat(q);if(g<minLat||g>maxLat||q<minLng||q>maxLng){continue}var k=new google.maps.LatLng(g,q);var p=Encoder.htmlDecode(n[m].getAttribute("title"));var l=Encoder.htmlDecode(n[m].getAttribute("html"));var c=Encoder.htmlDecode(n[m].getAttribute("type"));var j=new google.maps.Marker({position:k,map:map,title:p,icon:customIcons[c]});createInfo(j,l,c,false);if(g>north){north=g}if(g<south){south=g}if(q>east){east=q}if(q<west){west=q}}if(r&&r!=""&&r>a){alert(r+" listings matched your search criteria.\nOnly the first "+a+" listings will appear on the map.\nYou can narrow your search criteria to get fewer results")}if(disp_poi&&!always_poi){load_poi()}var e=(north+south)/2;var o=(east+west)/2;var d=new google.maps.LatLng(e,o);map.setCenter(d);var s=new google.maps.LatLng(north,east);var b=new google.maps.LatLng(south,west);var h=new google.maps.LatLngBounds(b,s);if(n.length==1&&!bound_poi){map.setZoom(maxZoom);map.panToBounds(h)}else{map.fitBounds(h)}}function createInfo(a,b,c,e){var d=new google.maps.InfoWindow({content:b});google.maps.event.addListener(a,"click",function(){if(openInfo){openInfo.close()}d.open(map,a);if(e){a.setIcon(poiViewedIcons[c])}else{a.setIcon(viewedIcons[c])}openInfo=d;if(document.getElementById("panorama")){var g={position:a.position,pov:{heading:34,pitch:10,zoom:1}};var f=new google.maps.StreetViewPanorama(document.getElementById("panorama"),g);map.setStreetView(f)}})}function load_poi(){if(window.XMLHttpRequest){xhttp=new XMLHttpRequest()}else{xhttp=new ActiveXObject("Microsoft.XMLHTTP")}xhttp.open("GET","php/poi_xml.php",false);xhttp.send("");xmlDoc=xhttp.responseXML;var e=xmlDoc.documentElement.getElementsByTagName("poi");if(!e.length){return}for(i=0;i<e.length;i++){var f=e[i].getAttribute("lat");var b=e[i].getAttribute("lng");if(f==null||f==""||b==null||b==""){continue}f=parseFloat(f);b=parseFloat(b);if(f<minLat||f>maxLat||b<minLng||b>maxLng){continue}var h=new google.maps.LatLng(f,b);var g=Encoder.htmlDecode(e[i].getAttribute("title"));var c=Encoder.htmlDecode(e[i].getAttribute("html"));var d=Encoder.htmlDecode(e[i].getAttribute("type"));var a=new google.maps.Marker({position:h,map:map,title:g,icon:poiIcons[d]});createInfo(a,c,d,true);if(bound_poi){if(f>north){north=f}if(f<south){south=f}if(b>east){east=b}if(b<west){west=b}}}}function processForm(d,e){var b="";var c=false;for(var a=0;a<d.elements.length;a++){field=d.elements[a];if(field.name==""){continue}if(field.type=="radio"||field.type=="checkbox"){var f="";while(d.elements[a].type==field.type&&d.elements[a].name==field.name){if(d.elements[a].checked){f=d.elements[a].value}a++}if(f!=""){c++}b=b+"&"+field.name+"="+escape(f);a--;continue}if(field.value!=""){c++}b=b+"&"+field.name+"="+escape(field.value)}if(!c&&e){alert("Please make one or more selections on the search form");b=""}return(b)}function getExpDate(d,a,c){var b=new Date();if(typeof d=="number"&&typeof a=="number"&&typeof a=="number"){b.setDate(b.getDate()+parseInt(d));b.setHours(b.getHours()+parseInt(a));b.setMinutes(b.getMinutes()+parseInt(c));return b.toGMTString()}}function getCookieVal(b){var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length}return unescape(document.cookie.substring(b,a))}function getCookie(d){var b=d+"=";var f=b.length;var a=document.cookie.length;var e=0;while(e<a){var c=e+f;if(document.cookie.substring(e,c)==b){return getCookieVal(c)}e=document.cookie.indexOf(" ",e)+1;if(e==0){break}}return""}function setCookie(b,d,a,f,c,e){document.cookie=b+"="+escape(d)+((a)?"; expires="+a:"")+((f)?"; path="+f:"")+((c)?"; domain="+c:"")+((e)?"; secure":"")}function deleteCookie(a,c,b){window.status="All properties have been removed from your favorites list.";if(getCookie(a)){document.cookie=a+"="+((c)?"; path="+c:"")+((b)?"; domain="+b:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}}function cookiesDisabled(){var a=true;if(navigator.cookiesEnabled){return false}document.cookie="testcookie=yes;";var b=document.cookie;if(b.indexOf("testcookie=yes")>-1){a=false}document.cookie="testcookie=;expires=;";return a}var today=new Date();var monthlater=new Date();monthlater.setTime(today.getTime()+60*60*24*30*1000);var expireTime=monthlater;var cookieName="favIds";function addFavorite(b){var a=getCookie(cookieName);window.status="This property has been added to your favorites list.";window.alert("This property has been added to your favorites list.");if(a!=""){if(a.indexOf(b)==-1){a=a+"|"+b}}else{a=b}setCookie(cookieName,a,expireTime,"/")}function deleteFavorite(e){var b=getCookie(cookieName);if(b&&b.indexOf(e)!=-1){window.status="This property has been removed from your favorites list.";window.alert("This property has been removed from your favorites list.");var d=b.split("|");var c="";for(var a=0;a<d.length;a++){if(e!=d[a]){c=c+d[a];if(a<d.length-1){c=c+"|"}}}if(c.charAt(c.length-1)=="|"){c=c.substr(0,c.length-1)}setCookie(cookieName,c,expireTime,"/")}}function showFavorites(){var c=getCookie(cookieName);if(c==""){window.status="You haven't added any properties to your favorites yet.";window.alert("You haven't added any properties to your favorites yet.")}if(c!=""){var d=c.split("|");var e="";for(var b=0;b<d.length;b++){e=e+d[b];if(b<d.length-1){e=e+","}}var a="http://www.sandestinrealestate.com/property_search_results.php?favs="+e;top.location=a}}function listFavorites(){var b=getCookie(cookieName);if(b!=""){var c=b.split("|");var d="";for(var a=0;a<c.length;a++){d=d+c[a];if(a<c.length-1){d=d+","}}return("&favs="+d)}window.status="You haven't added any properties to your favorites yet.";window.alert("You haven't added any properties to your favorites yet.");return("")}function printFavorites(){var c=getCookie(cookieName);if(c!=""){var d=c.split("|");var e="";for(var a=0;a<d.length;a++){e=e+d[a];if(a<d.length-1){e=e+", "}}var b=e;document.write(e)}};
