function tracks() { $('#detailSearchViezd').click( function() { var inp = $(this).find("input").eq(0); if(inp.val()==0) { $(this).css("background-position","0 -16px"); inp.val("1"); } else { $(this).css("background-position","0 0"); inp.val("0"); } $("#formDetailSearch").attr("name","1"); return true; }); $('#detailSearchAppartament').mousedown( function() { var inp = $(this).find("input").eq(0); if(inp.val()==0) { $(this).css("background-position","0 -16px"); inp.val("1"); } else { $(this).css("background-position","0 0"); inp.val("0"); } $("#formDetailSearch").attr("name","1"); return true; }); $('#detailSearchAnal').mousedown( function() { var inp = $(this).find("input").eq(0); if(inp.val()==0) { $(this).css("background-position","0 -16px"); inp.val("1"); } else { $(this).css("background-position","0 0"); inp.val("0"); } $("#formDetailSearch").attr("name","1"); return true; }); $('div.detailSearchHair').mousedown( function() { var inp = $(this).find("input").eq(0); if(inp.val()==0) { $(this).css("background-position","0 -21px"); inp.val("1"); } else { $(this).css("background-position","0 0"); inp.val("0"); } $("#formDetailSearch").attr("name","1"); return true; }); $('div.detailSearchEye').mousedown( function() { var inp = $(this).find("input").eq(0); if(inp.val()==0) { $(this).css("background-position","0 -21px"); inp.val("1"); } else { $(this).css("background-position","0 0"); inp.val("0"); } $("#formDetailSearch").attr("name","1"); return true; }); $('#textPole').keyup( function() { $("#formDetailSearch").attr("name","1"); return true; }); //reset $('#detailSearchReset').mousedown( function() { $("#textPole").val(""); $("#anal").val("0"); $("#detailSearchAnal").css("background-position","0 0"); $("#appart").val("1"); $("#detailSearchAppartament").css("background-position","0 -16px"); $("#viezd").val("1"); $("#detailSearchViezd").css("background-position","0 -16px"); $("div.detailSearchEye").css("background-position","0 -21px"); $("div.detailSearchEye > input").val("1"); $("div.detailSearchHair").css("background-position","0 -21px"); $("div.detailSearchHair > input").val("1"); $("#breast1").val("0"); $("#breast2").val("6"); $("#weight1").val("40"); $("#weight2").val("90"); $("#growth1").val("140"); $("#growth2").val("200"); $("#price1").val("30"); $("#price2").val("500"); $("#age1").val("18"); $("#age2").val("60"); trackInit(); findAnket(); return false; }); var timer = window.setInterval("findAnket();", 2000); trackbar.getObject('age').nodeInit = 1; trackbar.getObject('age').init({ onMove : function() { $("#age1").val(this.leftValue); $("#age2").val(this.rightValue); if(this.leftValue==18 && this.rightValue==60) $("#ageAny").css("display","block"); else $("#ageAny").css("display","none"); $("#formDetailSearch").attr("name","1"); }, width : 225, // px leftLimit : 18, // unit of value leftValue : 18, // unit of value rightLimit : 60, // unit of value rightValue : 60, // unit of value roundUp : 1 // unit of value }, "ageBar" ); trackbar.getObject('price').nodeInit = 1; trackbar.getObject('price').init({ onMove : function() { $("#price1").val(this.leftValue); $("#price2").val(this.rightValue); if(this.leftValue==30 && this.rightValue==500) $("#priceAny").css("display","block"); else $("#priceAny").css("display","none"); $("#formDetailSearch").attr("name","1"); }, width : 225, // px leftLimit : 30, // unit of value leftValue : 30, // unit of value rightLimit : 500, // unit of value rightValue : 500, // unit of value roundUp : 10 // unit of value }, "priceBar" ); trackbar.getObject('growth').nodeInit = 1; trackbar.getObject('growth').init({ onMove : function() { $("#growth1").val(this.leftValue); $("#growth2").val(this.rightValue); if(this.leftValue==140 && this.rightValue==200) $("#growthAny").css("display","block"); else $("#growthAny").css("display","none"); $("#formDetailSearch").attr("name","1"); }, width : 225, // px leftLimit : 140, // unit of value leftValue : 140, // unit of value rightLimit : 200, // unit of value rightValue : 200, // unit of value roundUp : 1 // unit of value }, "growthBar" ); trackbar.getObject('weight').nodeInit = 1; trackbar.getObject('weight').init({ onMove : function() { $("#weight1").val(this.leftValue); $("#weight2").val(this.rightValue); if(this.leftValue==40 && this.rightValue==90) $("#weightAny").css("display","block"); else $("#weightAny").css("display","none"); $("#formDetailSearch").attr("name","1"); }, width : 225, // px leftLimit : 40, // unit of value leftValue : 40, // unit of value rightLimit : 90, // unit of value rightValue : 90, // unit of value roundUp : 1 // unit of value }, "weightBar" ); trackbar.getObject('breast').nodeInit = 1; trackbar.getObject('breast').init({ onMove : function() { $("#breast1").val(this.leftValue); $("#breast2").val(this.rightValue); if(this.leftValue==0 && this.rightValue==6) $("#breastAny").css("display","block"); else $("#breastAny").css("display","none"); $("#formDetailSearch").attr("name","1"); }, width : 225, // px leftLimit : 0, // unit of value leftValue : 0, // unit of value rightLimit : 6, // unit of value rightValue : 6, // unit of value roundUp : 1 // unit of value }, "breastBar" ); } function findAnket() { if($("#formDetailSearch").attr("name")=="1") { $("#formDetailSearch").attr("name","0"); $("#findAnket").empty().append(""); try { $.ajax({ type: "get", url: "/php/getColAnket.php", data: "namephoneid="+$("#textPole").val()+ "&agefrom="+$("#age1").val()+ "&ageto="+$("#age2").val()+ "&pricefrom="+$("#price1").val()+ "&priceto="+$("#price2").val()+ "&heightfrom="+$("#growth1").val()+ "&heightto="+$("#growth2").val()+ "&weightfrom="+$("#weight1").val()+ "&weightto="+$("#weight2").val()+ "&breastfrom="+$("#breast1").val()+ "&breastto="+$("#breast2").val()+ "&eyecolor1="+$("#eye1").val()+ "&eyecolor2="+$("#eye2").val()+ "&eyecolor3="+$("#eye3").val()+ "&eyecolor4="+$("#eye4").val()+ "&eyecolor5="+$("#eye5").val()+ "&haircolor1="+$("#hair1").val()+ "&haircolor2="+$("#hair2").val()+ "&haircolor3="+$("#hair3").val()+ "&haircolor4="+$("#hair4").val()+ "&haircolor5="+$("#hair5").val()+ "&haircolor6="+$("#hair6").val()+ "&haircolor7="+$("#hair7").val()+ "&inoutcallout="+$("#viezd").val()+ "&inoutcallin="+$("#appart").val()+ "&anal="+$("#anal").val(), timeout: 5000, success: function(data) { $("#findAnket").empty().text(data); } }); } catch(e) { alert("Ошибка метода XMLHTTPRequest. Попробуйте еще раз."); return false; } } }