var PAGE="",PWOBJ=null,_last_locator=null;function defaultFocus(){if(document.forms.length>0){var b=document.forms[0],a=0;for(a=0;a<b.length;a++){if((b.elements[a].type=="text")||(b.elements[a].type=="textarea")||(b.elements[a].type.toString().charAt(0)=="s")){document.forms[0].elements[a].focus();break}}}}function showfavcont(c){var b=document.getElementById("favcont");if(b!=null){if(c.checked){b.style.display="inline"}else{b.style.display="none"}}}function getIframe(){if((parent.countyFrame!=undefined)&&(parent.countyFrame.document.formCounty!=null)){if(parent.countyFrame.document.formCounty.elements[0]!=null){var a=document.quickform,b=parent.countyFrame;if((a!=null)&&(b!=null)){a.county.value=b.document.formCounty.elements[0].value}}}return true}function escapeHtml(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function doCar(){alert("This image means the user is willing to travel")}function doHome(){alert("This image means the user is willing to accommodate")}function doOn(){alert("This image means the user is online in tvChix right now!")}function doUpd(){alert("This image means the user has recently updated his/her profile.")}function doNew(){alert("This image means the user just recently created a profile on tvChix.\nWhy not be one of the first to send them a welcome message!")}function doChat(a){alert("'This user is currently in the chat room:\n"+escapeHtml(a))}function confirmCheckpoint(){var a=confirm("Setting a checkpoint will tell tvChix to remember the current date and time for you.\nYou can then come back later and choose to show all new or updated profiles since this \n point in time, by ticking the 'New/Updated Since Last Checkpoint' box.\n\n Set a Checkpoint Now?");return a}function dosubmit(b){getIframe();var a=document.getElementById("submitbutton");if(a!=null){a.disabled=true}return true}function deleteFolder(a){if(confirm("You are about to delete a mail folder.\nAny emails in this folder will be deleted also.\n\nAre you sure you want to continue?")){location.href="mailfolders.php?task=delete&folderid="+a}}function emptyFolder(a){if(confirm("You are about to empty a mail folder.\nAny emails in this folder will be deleted.\n\nAre you sure you want to continue?")){location.href="mailfolders.php?task=empty&folderid="+a}}function disableform(b){if(document.all||document.getElementById){for(i=0;i<b.elements.length;i++){var a=b.elements[i];if(a.type.toLowerCase()=="submit"||a.type.toLowerCase()=="reset"){a.disabled=true}}}return true}function openHelp(a){window.open("http://tvchix.com/help.php?topic="+a,"helptext","left=50,top=50,screenX=50,screenY=50,scrollbars=no,menubar=no,height=250,width=300,resizable=yes,toolbar=no,location=no,status=no")}function doviewemailsubmit(e,d,c){var a=document.getElementById(d);if(a!=null){a.disabled=true;if(c==1){e.delbuttonstatus.value=1}else{e.delbuttonstatus.value=0}}return true}function disableSubmitBtn(c,b){var a=document.getElementById(b);if(a!=null){a.disabled=true}return true}function doSmiley(g){var a=g,f=null,d=document.mailform,b=0,c=0;if(d!=null){f=d.message}if(f!=null){if(document.selection){f.focus();document.selection.createRange().text=a}else{if(f.selectionStart!=null){b=f.selectionStart;c=f.selectionEnd;f.value=f.value.substring(0,b)+a+f.value.substring(c);f.focus();f.selectionStart=f.selectionEnd=(b+a.length)}else{f.value+=a}}}}function doDownload(){document.getElementById("downloader").src="download_emails.php"}function get_overlay(){return document.getElementById("overlay")}function hide_overlay(){$("#overlay").fadeOut(100);_last_locator=null}function show_overlay(a){$("#overlay").css("display","block").css("visibility","visible");_last_locator=a}function is_open_already(a){return _last_locator==a}function get_offset_top(b){var c=0,a=b;while(a!=document.body){c+=a.offsetTop;a=a.offsetParent}return c}function get_offset_left(b){var c=0,a=b;while(a!=document.body){c+=a.offsetLeft;a=a.offsetParent}return c}function popup_overlay(c,b){var a=get_overlay();if(is_open_already(c)){return hide_overlay()}a.innerHTML=get_code(b);a.style.top=get_offset_top(c)+"px";a.style.left=get_offset_left(c)+"px";show_overlay(c)}function get_code(d){var b="",c=0,a="";for(c=0;c<5;c++){a="http://"+document.domain+"/ajaxhandler.php?mailstar="+c.toString()+"&id="+d.toString();b=b+'<img onclick="javascript:setMailStar('+c+","+d+'); hide_overlay();" name="mailstar_'+c.toString()+'" ID="mailstar_'+c.toString()+'" SRC="http://t2.tvchix.com/images/sta_'+c.toString()+'.gif" border="0">&nbsp;'}return b}function hide_blanker(){var a=document.getElementById("blanker");if(a!=null){a.style.visibility="hidden"}}function show_blanker(f){var a=document.getElementById("blanker");if(a!=null){var g=getPageDims();a.style.width="100%";a.style.height=g.y+"px";a.style.left=0;a.style.top=0;a.style.visibility="visible"}var e=getScrollDims(),c=getScrollPos(),b=Math.round((e.x-300)/2)+c.x,d=Math.round((e.y-300)/2)+c.y;if(f!=null){f.style.top=d+"px";f.style.left=b+"px"}}function hide_popup(a){document.getElementById(a).style.visibility="hidden";hide_blanker()}function show_popup(a){document.getElementById(a).style.visibility="visible"}function center_popup(c){var f=getScrollDims();var b=getScrollPos();var g=Math.round(f.x*0.6);var e=Math.round(f.y*0.6);var a=Math.round((f.x-g)/2)+b.x;var d=Math.round((f.y-e)/2)+b.y;if(c!=null){c.style.width=g.toString()+"px";if(c.clientHeight>e){c.style.height=e.toString()+"px"}if(c.style.height>e){c.style.height=e.toString()+"px"}c.style.left=a+"px";c.style.top=d+"px"}}var _last_notepopup=null;function hide_notepopup(){hide_popup("notepopup");_last_notepopup=null}function get_notepopup_code(a,c){var b='<div name="popupnotes" ID="popupnotes"></div>';getUserNotes(c);return b}function popup_notepopup(d,a,c){var b=document.getElementById("notepopup");if(_last_notepopup==d){return hide_notepopup()}b.innerHTML=get_notepopup_code(a,c);show_blanker(b);show_popup("notepopup");_last_notepopup=d}function hide_escortpopup(){hide_popup("escortpopup");_last_notepopup=null}function get_escortpopup_code(c,b){var a='<div name="popupescort" ID="popupescort"></div>';makeRequest("getescortpopup","http://"+document.domain+"/ajaxhandler.php?getescortpopup=1&destid="+c+"&detail="+b);return a}function popup_escortpopup(d,b,a){var c=document.getElementById("escortpopup");if(_last_notepopup==d){return hide_escortpopup()}c.innerHTML=get_escortpopup_code(b,a);show_blanker(c);show_popup("escortpopup");center_popup(c);_last_notepopup=d}function addFavFromPopup(c,b,a){hide_favpopup();addFavByUsernameToCat(b,a,c+"&cat="+a)}function hide_favpopup(){hide_popup("favpopup");_last_notepopup=null}function get_favpopup_code(f,e){var a=new Array(),c='<div style="padding: 10px; border: 1px solid #666; background-color: white;">';a[0]="Friends";a[1]="Aquaintances";a[2]="Lovers";a[3]="Chat Buddies";a[4]="Potential Dates";a[5]="Clients";c=c+"You can now categorise your favourites with different colored hearts.<br><br>Click on the category you wish to add <b>"+e+"</b> to<br><br>";c=c+'<div style="margin-left: 40px;">';for(i=0;i<a.length;i++){if(i%2==0){c=c+'<div style="float: left; vertical-align: middle;">'}var d="";if(i>0){d="_"+i.toString()}c=c+'<div style="float: left; width: 150px; margin-right: 30px;">';var b='javascript:addFavFromPopup("'+f+'", "'+e+'", '+i.toString()+")";c=c+"<a class='blue' href='"+b+"'>";c=c+"<img style='margin-bottom: 15px; padding-right: 10px; border: 0px; vertical-align: middle' src='http://t2.tvchix.com/images/heart_big"+d+".gif'>"+a[i]+"</a><br>";c=c+'</div><br clear="left">';if(i%2==0){c=c+"</div>"}}c=c+"</div><br>";c=c+'<div class="smalltext">Your category selection is visible only to you, not the person you are adding.<br></div><br>';c=c+"</div>";return c}function strpos(b,c){var a=(b+"").indexOf(c);return a===-1?false:a}function popup_favpopup(f,a,d,c){var b=navigator.userAgent;if((b.indexOf("PPC")!==-1)&&(b.indexOf("Windows CE")!==-1)&&(b.indexOf("Mozilla/4.0")!==-1)){a=false}if(a){var e=document.getElementById("favpopup");if(_last_notepopup==f){return hide_favpopup()}e.innerHTML=get_favpopup_code(d,c);show_blanker(e);show_popup("favpopup");center_popup(e);_last_notepopup=f}else{addFavFromPopup(d,c,0)}}function hide_jotterpopup(){hide_popup("jotterpopup");_last_notepopup=null}function get_jotterpopup_code(){var a='<div name="popupjotter" ID="popupjotter"></div>';a='<textarea cols="20" rows="10"></textarea><script language="javascript" type="text/javascript" src="richedit/tiny_mce_popup.js"><\/script><script language="javascript" type="text/javascript">tinyMCE.init({	mode : "textareas"}); TinyMCE_Popup(); <\/script>';return a}function popup_jotterpopup(b){var a=document.getElementById("jotterpopup");if(_last_notepopup==b){return hide_jotterpopup()}a.innerHTML=get_jotterpopup_code();show_blanker(a);center_popup(a);show_popup("jotterpopup");_last_notepopup=b}function getScrollPos(){var a,b;if(self.pageYOffset){a=self.pageXOffset;b=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollLeft;b=document.documentElement.scrollTop}else{if(document.body){a=document.body.scrollLeft;b=document.body.scrollTop}}}return{x:a,y:b}}function getScrollDims(){var a,b;if(self.innerHeight){a=self.innerWidth;b=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientWidth;b=document.documentElement.clientHeight}else{if(document.body){a=document.body.clientWidth;b=document.body.clientHeight}}}return{x:a,y:b}}function getPageDims(){var a,d;var c=document.body.scrollHeight;var b=document.body.offsetHeight;if(c>b){a=document.body.scrollWidth;d=document.body.scrollHeight}else{a=document.body.offsetWidth;d=document.body.offsetHeight}return{x:a,y:d}}function postUserNotes(b){var a=document.getElementById("usernotestextarea");if(a!=null){var c=a.value;saveUserNotes(b,c)}}function deleteUserNotes(a){saveUserNotes(a,"")}function confirmpost(c,b){var a=false;if(c==3){a=true}else{a=confirm(b)}if(a){if(c==1){document.bulkform.bulkdelete.value=1}else{if(c==2){document.bulkform.bulkunread.value=1}else{if(c==3){document.bulkform.bulkmove.value=1}}}return true}else{document.bulkform.bulkdelete.value=0;document.bulkform.bulkunread.value=0;document.bulkform.bulkmove.value=0}return false}function checkCheckboxes(a,c){for(var b=0;b<a.length;b++){if(a[b].type=="checkbox"){a[b].checked=c}}}function qsOpenAddCity(b){$("#citylist").hide();document.getElementById("addCityFrame").height=129;var a=$("#countylist").val();if(a>0){document.getElementById("addCityFrame").src="addcity.php?country="+document.locationform.country.value+"&county="+a}else{document.getElementById("addCityFrame").src="addcity.php?country="+document.locationform.country.value}}function qsCloseAddCity(){$("#citylist").show();document.getElementById("addCityFrame").height=0}function qsDoSomething(c,b,a){document.getElementById("addCityFrame").height=0;if(a==1){_reload_location_data($("#countrylist").val(),$("#countylist").val(),b)}$("#citylist").show()}function fadeUserNotes(){opacity("profilenotediv","profilenotesdiv",100,0,500)}function opacity(g,e,d,b,a){var c=Math.round(a/100);var f=0;if(d>b){for(i=d;i>=b;i--){setTimeout("changeOpac("+i+",'"+g+"', '"+e+"')",(f*c));f++}}else{if(d<b){for(i=d;i<=b;i++){setTimeout("changeOpac("+i+",'"+g+"', '"+e+"')",(f*c));f++}}}}function changeOpac(b,f,e){var d=document.getElementById(f);if(d!=null){var a=d.style;a.opacity=(b/100);a.MozOpacity=(b/100);a.KhtmlOpacity=(b/100);a.filter="alpha(opacity="+b+")";if((b<=0)&&(e!="")){var c=document.getElementById(e);c.style.display="none";changeOpac(100,f,"")}}}function setClassLegendStyle(b,c){var a=document.getElementById(b);if(a!=null){a.className="classifieds "+c;if(document.classthemeform!=null){document.classthemeform.stylename.value=c}}}function reshowGuestbook(){var a=document.getElementById("guestbookentry");var b=document.getElementById("guestbookerror");if(a!=null){b.style.display="none";a.style.display="inline"}}function toggleMail(c){var a=document.getElementById("replybox_"+c.toString());if(a!=null){if(a.style.display!="none"){a.style.display="none"}else{if(a.innerHTML==""){var b="http://"+document.domain+"/ajaxhandler.php?getmailid="+c.toString();makeRequest("getmail",b)}else{a.style.display="inline"}}}}function confirmDeleteImg(c){var b=null,a=confirm("Delete Image?");if(a){b=document.forms[c];if(b!=null){b.submit()}}}function toggleRatings(f){var b=document.getElementsByTagName("table"),c=null,e=0;for(e=0;e<b.length;e++){if((b[e].id!=null)&&(b[e].id!="")){var g=b[e],h=g.id.substr(0,6);if((h=="imgdet")||(h=="imggfx")){if(((g.id.substr(0,7)=="imgdet_")&&(f==0))||((g.id.substr(0,7)=="imggfx_")&&(f==1))||((g.id.substr(0,8)=="imggfxf_")&&(f==2))){g.style.display="block"}else{g.style.display="none"}}}}c=getElementsByClass("ratingtabsel");for(e=0;e<c.length;e++){c[e].className="ratingtab"}c=getElementsByClass("ratingtab");for(var d=0;d<c.length;d++){var a=c[d].id.substr(3,1);if(parseInt(a)==(f+1)){c[d].className="ratingtabsel"}}}function getElementsByClass(c){function a(e,d,g){while(d){if(d.nodeType==1){if(d.className){var f=" "+d.className+" ";if(f.indexOf(" "+g+" ")!=-1){e.push(d)}}a(e,d.firstChild,g)}d=d.nextSibling}}var b=new Array();a(b,document.documentElement,c);return b};
