﻿var newwindow="";function openNewWindow(a,b,c,d){d=1;if(!newwindow.closed&&newwindow.location)newwindow.location.href=a;else{newwindow=window.open(a,"name","width="+b+",height="+c+",toolbar=0,scrollbars="+d+",location=0,statusbar=0,menubar=0,resizable=1");if(!newwindow.opener)newwindow.opener=self}window.focus&&newwindow.focus()}
function changeColor(a,b,c){element=document.getElementById(a);event.cancelBubble=false;element.style.background=b;element.style.borderwidth="10px";element.style.bordercolor="#white"}function testForObject(a,b){if(a=document.getElementById(a))if(b){if(a.tagName.toLowerCase()==b.toLowerCase())return a}else return a;return null}function flashDelay(){if(testForObject("RentboyEntertainmentBody"))document.getElementById("RentboyEntertainmentBody").style.display="block"}
function MM_swapImgRestore(){var a,b,c=document.MM_sr;for(a=0;c&&a<c.length&&(b=c[a])&&b.oSrc;a++)b.src=b.oSrc}function MM_preloadImages(){var a=document;if(a.images){if(!a.MM_p)a.MM_p=[];var b,c=a.MM_p.length,d=MM_preloadImages.arguments;for(b=0;b<d.length;b++)if(d[b].indexOf("#")!=0){a.MM_p[c]=new Image;a.MM_p[c++].src=d[b]}}}
function MM_findObj(a,b){var c,d;b||(b=document);if((c=a.indexOf("?"))>0&&parent.frames.length){b=parent.frames[a.substring(c+1)].document;a=a.substring(0,c)}if(!(d=b[a])&&b.all)d=b.all[a];for(c=0;!d&&c<b.forms.length;c++)d=b.forms[c][a];for(c=0;!d&&b.layers&&c<b.layers.length;c++)d=MM_findObj(a,b.layers[c].document);if(!d&&b.getElementById)d=b.getElementById(a);return d}
function MM_swapImage(){var a,b=0,c,d=MM_swapImage.arguments;document.MM_sr=[];for(a=0;a<d.length-2;a+=3)if((c=MM_findObj(d[a]))!=null){document.MM_sr[b++]=c;if(!c.oSrc)c.oSrc=c.src;c.src=d[a+2]}}
sfHover=function(){if(document.getElementById("LangNavDiv")!=null){for(var a=document.getElementById("LangNavDiv").getElementsByTagName("LI"),b=0;b<a.length;b++){a[b].onmouseover=function(){this.className+=" sfhover"};a[b].onmouseout=function(){this.className=this.className.replace(/ sfhover\b/,"")}}a=document.getElementById("SignUpNavDiv").getElementsByTagName("LI");for(b=0;b<a.length;b++){a[b].onmouseover=function(){this.className+=" sfhover"};a[b].onmouseout=function(){this.className=this.className.replace(/ sfhover\b/,
"")}}}};window.attachEvent&&window.attachEvent("onload",sfHover);function openListing(a,b){a=$get(a);if(a!=undefined&a.checked==true)popUpUndocked(b.toString().replace("Listing","ListingPopup"));else window.location.href=b}
function popUpUndocked(a){window.open(a+"&undock=1","adWnd","width=600,height=600,resizable=yes,scrollbars=yes,toolbar=yes").focus()}function popUpRecentAds(a){window.open(a,"recentWnd","width=520,height=225,resizable=yes,scrollbars=no,toolbar=yes,status=yes").focus()}
function testpopUpUndocked(){var a=window.open("about:blank","","directories=no,height=100,width=100,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,top=0,location=no");a?a.close():alert("A popup blocker was detected. Please disable your browsers popup blocker to use this feature.")};

function parseRepsonse(a,b){a=a.split(":");if(a[0]=="citydata"){$get(ctrlId+"CityDropDown").disabled=false;$get(ctrlId+"SubmitLocationButton").disabled=false;try{$get(ctrlId+"SubmitMapButton").disabled=false;$get(ctrlId+"SubmitScanAvailableButton").disabled=false}catch(e){}var d=a[1].split("|");for(a=0;a<d.length;a++){b=document.createElement("option");var c=d[a].split(",");b.text=(c[2]!=""?c[2]+", ":"")+c[0]+" "+c[4];b.value=c[1];$get(ctrlId+"CityDropDown").options.add(b)}}else if(a[0]=="countrydata"){d=
a[1].split("|");for(a=0;a<d.length;a++){c=d[a].split(",");b=document.createElement("option");b.text=c[0]+" "+c[2];b.value=c[1];$get(ctrlId+"CountryDropDown").options.add(b)}}}
function categorySelected(a){$get(ctrlId+"CountryDropDown").options.length=0;$get(ctrlId+"CityDropDown").options.length=0;$get(ctrlId+"CityDropDown").disabled=true;$get(ctrlId+"SubmitLocationButton").disabled=true;try{$get(ctrlId+"SubmitMapButton").disabled=true;$get(ctrlId+"SubmitScanAvailableButton").disabled=true}catch(b){}$get(ctrlId+"SelectedCategoryField").value=$get(ctrlId+"ListingCategory").options[$get(ctrlId+"ListingCategory").selectedIndex].value;$get(ctrlId+"SelectedLocationField").value=
"";callback("categoryselected:"+a,"")}function countrySelected(a){$get(ctrlId+"CityDropDown").options.length=0;$get(ctrlId+"SelectedLocationField").value=a;$get(ctrlId+"SelectedCategoryField").value=$get(ctrlId+"ListingCategory").options[$get(ctrlId+"ListingCategory").selectedIndex].value;callback("countryselected:"+a+","+$get(ctrlId+"ListingCategory").options[$get(ctrlId+"ListingCategory").selectedIndex].value,"")}
    function citySelected() { var a = $get(ctrlId + "CityDropDown").options[$get(ctrlId + "CityDropDown").selectedIndex].value; $get(ctrlId + "SelectedCategoryField").value = $get(ctrlId + "ListingCategory").options[$get(ctrlId + "ListingCategory").selectedIndex].value; if (a != 0) $get(ctrlId + "SelectedLocationField").value = a; else $get(ctrlId + "SelectedLocationField").value = $get(ctrlId + "CountryDropDown").options[$get(ctrlId + "CountryDropDown").selectedIndex].value };

    function openListing2(p, a, b) {
        a = $get(a);
        if (p) {
            window.open(b, '_newtab');
        }
        else {
            if (a != undefined & a.checked == true & p == false)
                popUpUndocked(b.toString().replace("Listing", "ListingPopup"));
            else
                window.location.href = b
            }
        }

