$(function(){bindCalIntervalChangeFunction("from_v","from_v","from_h","to_v","to_h",false,false);bindCalIntervalChangeFunction("to_v","from_v","from_h","to_v","to_h",false,false);$("select[name='city']").change(function(){var selectedCity=$("select[name='city']").val();var exists=0;for(var i in cities){if(cities[i]===selectedCity){exists++;break;}}if(exists==0){triggerStatusMsgWithDisable("wrong_city");}});var form=$("#searchForm");var validator=form.validate({errorClass : "error",errorElement: null,errorLabelContainer: null,highlight : function(element,errorClass){$(element).addClass(errorClass);var name=$(element).attr("name");$.each(validator.errorMap,function(key,val){if(name==key){$(element).next(".err_msg").remove();$(element).after("<div class='err_msg' style='display: none;'>"+val+"</div>");}});$(element).tooltip({bodyHandler: function(){return $(this).next(".err_msg").text();},showURL: false,track: true,delay: 0,extraClass: "hover_popup_box",fixPNG: true,opacity: 0.95});},unhighlight : function(element,errorClass){var elemId=$(element).attr("id");if(elemId=="from_v"||elemId=="to_v"){return;}$(element).next(".err_msg").remove();$(".hover_popup_box").css("display","none");$(element).removeClass(errorClass);$(element).unbind();},errorPlacement: function(error,element){},rules :{maxprice :{number : true}},messages :{maxprice :{number : fieldNumber}}});});
