var im;$(document).ready(function(){$(".services, .sto_ico, .video_ico, .vip_ico").tooltip({track:true,delay:0,showURL:false});$("input:radio").bind("click",function(){GetQuantAjax(document.getElementById("form_find"))});$(".img_wrapper img").bind("mouseout",function(){Off()});$("input:text").bind("keyup",function(){GetQuantAjax(document.getElementById("form_find"))});$("input:checkbox").bind("click",function(){GetQuantAjax(document.getElementById("form_find"))});$("select").bind("change",function(){GetQuantAjax(document.getElementById("form_find"))});for(var i=18;i<61;i++){$("#age_from").append('<option value="'+i+'">'+i+'</option>');if(i<60)$("#age_to").append('<option value="'+i+'">'+i+'</option>');else $("#age_to").append('<option value="'+i+'" selected>'+i+'</option>')}for(var i=140;i<201;i++){$("#height_from").append('<option value="'+i+'">'+i+'</option>');if(i<200)$("#height_to").append('<option value="'+i+'">'+i+'</option>');else $("#height_to").append('<option value="'+i+'" selected>'+i+'</option>')}});function AdvancedSearch(){$("#advanced_search").toggle()}function Off(){$("#info").hide();$("#photo_div").html("");$(document).unbind()}function ShowImg(){$("#photo_div").html("<img id=\"img\" class=\"border_img\" src=\""+im.src+"\">")}function On(url,name,price,height,age,boobs_size,price2,tel,inew,isto,ivideo,ivip,cm_count,v_t,v_a){$("#photo_div").html("<img class=\"border_img\" src=\"/img/loadersm.gif\">");im=new Image();im.src="/showimg/"+url+"/2";if(!im.complete){im.onload=ShowImg}else{ShowImg()}$("#name").html(name);if(height==0){$("#info_height").hide()}else{$("#info_height").show();$("#height").html(height)}$("#age").html(age);if(boobs_size==0){$("#info_boobs_size").hide()}else{$("#info_boobs_size").show();$("#boobs_size").html(boobs_size)}if(price2==0){$("#info_price2").hide()}else{$("#info_price2").show();$("#price2").html(price2)}if(cm_count>0){$("#cm_count").show();$("#cm_count_inner").html(cm_count)}else{$("#cm_count").hide()}if(inew==1)$("#icon_new").show();else $("#icon_new").hide();if(ivip!=0)$("#icon_vip").show();else $("#icon_vip").hide();if(isto==1)$("#icon_sto").show();else $("#icon_sto").hide();if(ivideo==1)$("#icon_video").show();else $("#icon_video").hide();$("#price").html(price);$("#tel").html(tel);$("#views_t").html(v_t);$("#views_a").html(v_a);$(document).mousemove(function(e){document.getElementById("info").style.left=((e.clientX+395<$(window).width())?e.pageX+15:e.pageX-395-15)+"px";document.getElementById("info").style.top=((e.clientY+240<$(window).height())?e.pageY+15:e.pageY-240-15)+"px"});$("#info").show()}function GetMetroAreaByCity(city){JsHttpRequest.query('/ajax/get_metro_area_by_city.php',{'city':city},function(result,errors){if(result["metro"]==0){$("#metro_tr").hide()}else{$("#near_metro").html(result["metro"])}$("#area").html(result["area"])},false)}function GetQuantAjax(form){$.ajaxUpload({url:"/main/ajax",secureuri:false,uploadform:form,type:'POST',dataType:'json',success:function(data,status){$('#girls_quant').html(data.quant);if(data.quant=="0"){$("#submit_btn").attr("disabled","disabled")}else{$("#submit_btn").removeAttr("disabled")}}});$("form").removeAttr("target").removeAttr("enctype").attr("action","/main/filter")}