(function($){  $.fn.clearSelect = function() {    return this.each(function(){      if(this.tagName=='SELECT') {        this.options.length = 0;        $(this).attr('disabled','disabled');      }    });  }  $.fn.fillSelect = function(dataArray) {    return this.clearSelect().each(function(){      if(this.tagName=='SELECT') {        var currentSelect = this;        $.each(dataArray,function(index,data){          var option = new Option(data.text, data.value);          if($.support.cssFloat) {            currentSelect.add(option,null);          } else {            currentSelect.add(option);          }        });      }    });  }})(jQuery);jQuery(function($){  $(".phone").mask("8 999 999-99-99");  var value = $('#intext').attr('value') || '';  var initLength = 250 - value.length;  $('#cob').html(initLength.toString());  $('#intext').keyup(function(){    var value = $(this).attr('value') || '';    var lengthToGo =250 - value.length;    $('#cob').html(lengthToGo.toString());    if(lengthToGo < 0)    {      $('#cob').addClass('red');    }    else    {      $('#cob').removeClass();    }  });});$(document).ready(function() { function nrchange(){    var countryValue = $('#scountry').val();    var tmpSelect = $('#sregion');    var tmpSelect2 = $('#splace');    if(countryValue.length == 0) {      tmpSelect.attr('disabled','disabled');      tmpSelect.clearSelect();    } else {      $.getJSON('/aj/getSRegion.php',{        country:countryValue      },function(data) {        tmpSelect.fillSelect(data).removeAttr('disabled');      });      $.getJSON('/aj/getSPlace.php',{        region:0      },function(data) {        tmpSelect2.fillSelect(data).removeAttr('disabled');      });    //nrchange2();    }  };  $('#scountry').change(function(){    nrchange();  });  function nrchange2(){    var regionValue = $('#sregion').val();    var tmpSelect = $('#splace');    $.getJSON('/aj/getSPlace.php',{      region:regionValue    },function(data) {      tmpSelect.fillSelect(data).removeAttr('disabled');    });  };  $('#sregion').change(function(){    nrchange2();  });  $('#form1').rgyValidation();  $('#form2').rgyValidation();  $('#form3').rgyValidation();});$(document).ready(function() {  exfill = function(exobj, exval)  {    exobj    .val(exval)    .css("color", "#aaaaaa")    .focus(function(){      $(this).css("color", "#4c4c4c");      if ($(this).val() == exval) {        $(this).val("");      }    })    .blur(function(){      if ($(this).val() == "") {        $(this).val(exval);        $(this).css("color", "#aaaaaa");      }    });  };  exfill($('input[name=name]'),"Иван Иванович Иванов");  exfill($('input[name=budget]'),"Любая цена");  exfill($('input[name=budget2]'),"Любая цена");  exfill($('input[name=lotid]'),"000000");  exfill($('input[name=phone]'),"8 XXX XXX-XX-XX");  exfill($('input[name=email]'),"XXX@XXX.ru ");  exfill($('input[name=email2]'),"XXX@XXX.ru ");  $("#sncost").change(function() {    mycurr=$("#sncost option:selected").val();    newcurr=$("#curr"+mycurr+"").text();    newcurrpm=$("#curr"+mycurr+"pm").text();    $("#ncost").text(newcurr);    $("#ncostpm").text(newcurrpm);  });});jQuery(document).ready(function() {  jQuery('#mycarousel').jcarousel();  jQuery('#frm1').hide();  jQuery('#frm2').hide();  jQuery('#frm3').hide();  jQuery('#mnutype').hide();  jQuery('#mnucost').hide();  jQuery("#fullgallery a").lightBox();    jQuery("a.lightbox").lightBox();// jQuery("#lba").lightBox();});$(function() { $(".toggler").click(function(){        if($('#cb1').attr('checked')!=1){       $("#cb1").attr("checked", "checked");        $("#frm1").show('blind',{      direction: "vertical"    },300);     $('body').animate({scrollTop: $('#cb1').attr('offsetTop')}, 700);     }    });  $("#cb1").change(function() {    $("#frm1").toggle('blind',{      direction: "vertical"    },300);    $(".formError").remove()  });  $("#cb2").change(function() {    $("#frm2").toggle('blind',{      direction: "vertical"    },300);    $(".formError").remove()  });  $("#cb3").change(function() {    $("#frm3").toggle('blind',{      direction: "vertical"    },300);    $(".formError").remove()  });  $("#type_switch").click(function() {    $("#mnutype").toggle('blind',{      direction: "vertical"    },300);    $("#tpar").toggleClass('active');    return false;  });  $("#cost_switch").click(function() {    $("#mnucost").toggle('blind',{      direction: "vertical"    },300);    $("#cpar").toggleClass('active');    return false;  });  $("#dest_switch").click(function() {    $("#mnudest").toggle('blind',{      direction: "vertical"    },300);    $("#dpar").toggleClass('active');    return false;  });});function showPic (whichpic, placeholder) {  if (document.getElementById) {    document.getElementById(placeholder).src = whichpic.href;    document.getElementById(placeholder).width = 360;    return false;  } else {    return true;  }}$(function() {  $("#fullgallery img").css("opacity","0.6");  $("#fullgallery img:first").css("opacity","1.0");  $("#fullgallery img").hover(function () {    $(this).stop().animate({      opacity: 1.0    }, 100);  },  function () {    $(this).stop().animate({      opacity: 0.6    }, 1000);  });});$(function() {  $("#ficons img").css("opacity","1.0");  $("#ficons img").hover(function () {    $(this).stop().animate({      opacity: 0.6    }, 100);  },  function () {    $(this).stop().animate({      opacity: 1.0    }, 100);  });});
