var hotels = new Array(); hotels[0] = 'קלאב הוטל'; hotels[1] = 'קלאב אין'; var room_types = new Array(); room_types[0] = new Array(); room_types[0][0] = 'סטודיו'; room_types[0][1] = 'רגילה'; room_types[0][2] = 'דה-לוקס'; room_types[0][3] = 'קאריבית'; room_types[0][4] = 'נשיאותית'; room_types[1] = new Array(); room_types[1][0] = 'וילה'; room_types[1][1] = 'סוויטה'; function go_nav(url) { document.location.href = url; } function verify_suite_removal() { return confirm('האם אתה בטוח שאתה רוצה למחוק את היחידה ואת כל המודעות הקשורות בה?\nלא ניתן יהיה לשחזר את פרטי היחידה לאחר מכן.'); } function getHotelId(str) { for (var i=0; i < hotels.length; ++i) { if (str == hotels[i]) return i; return -1; } } /////////////////////////////////////////////////// SIGNUP FROM function highlightFields(email, first_name) { var emailObj = document.getElementById('email'); var fnObj = document.getElementById('first_name'); emailObj.className = (email == 1) ? 'inp1' : 'inp0'; fnObj.className = (first_name == 1) ? 'inp1' : 'inp0'; } function setSignupMessage(msg) { document.getElementById('err').innerHTML = msg; } function formClearErr(t) { setSignupMessage(''); t.className = 'inp0'; } function formClearAll() { highlightFields(0, 0); setSignupMessage(''); } function goStepOne() { formClearAll(); document.getElementById("signup_form").submit(); formLoaderToggler(); } function formLoaderToggler() { document.getElementById('loader').style.display = (document.getElementById('loader').style.display == 'none' || document.getElementById('loader').style.display == '') ? 'inline' : 'none'; document.getElementById('submit').style.display = (document.getElementById('submit').style.display == 'none') ? 'block' : 'none'; } //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //////////////// PASS REMIMNDER function do_reminder() { reminder_clear_all(); formLoaderToggler(); document.getElementById("reminder_form").submit(); } function reminder_clear_all() { set_reminder_msg(''); } function reminder_set_loader(msg) { document.getElementById('loader').innerHTML = '' + msg + ''; } function set_reminder_msg(msg) { document.getElementById('err_line').innerHTML = msg; } function reminder_clear_err(t) { set_login_message(''); t.className = 'inp0'; } function reminder_highlightFields(pass1, pass2) { document.getElementById('password1').className = (pass1 == 1) ? 'inp1' : 'inp0'; document.getElementById('password2').className = (pass2 == 1) ? 'inp1' : 'inp0'; } //////////////// LOGIN function do_login() { login_clear_all(); document.getElementById("login_form").submit(); formLoaderToggler(); } function login_clear_all() { login_highlightFields(0, 0); set_login_message(''); } function login_highlightFields(email, password) { document.getElementById('email').className = (email == 1) ? 'inp1' : 'inp0'; document.getElementById('login_password').className = (password == 1) ? 'inp1' : 'inp0'; } function set_login_message(msg) { document.getElementById('err_line').innerHTML = msg; } function login_loader_toggler() { document.getElementById('loader').style.display = (document.getElementById('loader').style.display == 'none' || document.getElementById('loader').style.display == '') ? 'inline' : 'none'; document.getElementById('submit').style.display = (document.getElementById('submit').style.display == 'none') ? 'block' : 'none'; } function login_clear_err(t) { set_login_message(''); t.className = 'inp0'; } ////// STEP2 FORM (השלמת פרטים) function do_step2() { step2_clear_all(); document.getElementById("step2_form").submit(); step2_loader_toggler(); } function step2_clear_err(t) { set_step2_message(''); t.className = 'inp0'; } function set_step2_message(msg) { document.getElementById('err_line').innerHTML = msg; } function step2_clear_all() { step2_highlightFields(0, 0); set_step2_message(''); } function step2_highlightFields(first_name, last_name, phone_number1, phone_number2, pass1, pass2) { document.getElementById('first_name').className = (first_name == 1) ? 'inp1' : 'inp0'; document.getElementById('last_name').className = (last_name == 1) ? 'inp1' : 'inp0'; document.getElementById('phone_number1').className = (phone_number1 == 1) ? 'inp1' : 'inp0'; document.getElementById('phone_number2').className = (phone_number2 == 1) ? 'inp1' : 'inp0'; document.getElementById('password1').className = (pass1 == 1) ? 'inp1' : 'inp0'; document.getElementById('password2').className = (pass2 == 1) ? 'inp1' : 'inp0'; } function step2_loader_toggler() { document.getElementById('loader').style.display = (document.getElementById('loader').style.display == 'none' || document.getElementById('loader').style.display == '') ? 'inline' : 'none'; document.getElementById('submit').style.display = (document.getElementById('submit').style.display == 'none') ? 'block' : 'none'; } ////// SUITES FORM function set_suites_message(msg) { document.getElementById('err_line').innerHTML = msg; } function suites_clear_all() { document.getElementById('contract_id').className = 'inp0'; document.getElementById('contract_id_last').className = 'inp0'; set_suites_message(''); } function do_suites() { //suites_clear_all(); document.getElementById("suites_form").submit(); suites_loader_toggler(); } function suites_highlight() { document.getElementById('contract_id').className = 'inp1'; document.getElementById('contract_id_last').className = 'inp1'; } function suites_loader_toggler() { document.getElementById('loader').style.display = (document.getElementById('loader').style.display == 'none' || document.getElementById('loader').style.display == '') ? 'inline' : 'none'; document.getElementById('submit').style.display = (document.getElementById('submit').style.display == 'none') ? 'block' : 'none'; } // CONTACT FORM function contact_ad_highlight(name, phone, email, message, captcha) { var nameObj = document.getElementById('my_name'); var phoneObj = document.getElementById('my_phone'); var emailObj = document.getElementById('my_email'); var msgObj = document.getElementById('my_message'); var captchaObj = document.getElementById('my_captcha'); emailObj.className = (email == 1) ? 'inp1' : 'inp0'; nameObj.className = (name == 1) ? 'inp1' : 'inp0'; phoneObj.className = (phone == 1) ? 'inp1' : 'inp0'; msgObj.className = (message == 1) ? 'inp1' : 'inp0'; captchaObj.className = (captcha == 1) ? 'inp1' : 'inp0'; } var contact_ad_detailed_lines = new Array() contact_ad_detailed_lines["my_name"] = ''; contact_ad_detailed_lines["my_phone"] = 'אם אתה רוצה שיחזרו אליך בטלפון. סלולרי או נייח, מה שמתאים לך.'; contact_ad_detailed_lines["my_email"] = 'הקלד את כתובתך במדוייק, כדי שיוכלו לחזור אליך.'; contact_ad_detailed_lines["my_message"] = ''; contact_ad_detailed_lines["my_captcha"] = ''; function contact_ad_detailed_reset(id) { document.getElementById(id + '_detailed').innerHTML = contact_ad_detailed_lines[id]; } function contact_ad_clear_err(t) { t.className = 'inp0'; contact_ad_detailed_reset(t.id); } function contact_ad_clear_all() { for (var i in contact_ad_detailed_lines) { contact_ad_detailed_reset(i); } contact_ad_highlight(0, 0, 0, 0, 0); } function do_contact_advertiser() { contact_ad_clear_all(); document.getElementById("email_advertiser_form").submit(); contact_ad_loader_toggler(); } function contact_ad_loader_toggler() { document.getElementById('loader').style.display = (document.getElementById('loader').style.display == 'none' || document.getElementById('loader').style.display == '') ? 'inline' : 'none'; document.getElementById('submit').style.display = (document.getElementById('submit').style.display == 'none') ? 'block' : 'none'; } function contact_reload_captcha() { document.getElementById('human_verification').src = '/images/human_verification.php?' + Math.random(); document.getElementById('my_captcha').value = ''; } function ad_contact_sent(to) { document.getElementById("email_advertiser_form").innerHTML = '

פנייתך נשלחה בהצלחה ל'+ to +'!
תודה.

'; } function set_contact_ad_field_err(id, msg) { document.getElementById(id + "_detailed").innerHTML = '

' + msg + '

'; } ///////////////////////////////////////////////// Add Ad form function toggle_ad_price(t) { var this_name = t.id; this_name = this_name.split('_'); var box_id = this_name[1] + '_price_box'; if (t.checked) { $("#" + box_id).show("slow"); $("#" + box_id + ' input').focus(); } else { $("#" + box_id).hide("slow"); $("#" + box_id + ' input').val(''); } } function toggle_rent() { if (document.getElementById("for_rent").checked) { $("#rent_fields").show("slow"); } else { $("#rent_fields").hide("slow"); } } function toggle_sell() { if (document.getElementById("for_sell").checked) { $("#sell_fields").show("slow"); } else { $("#sell_fields").hide("slow"); } } //// function do_ads() { ads_clear_all(); document.getElementById("ad_form").submit(); ads_loader_toggler(); } function ads_clear_err(t) { set_ads_message(''); t.className = 'inp0'; } function set_ads_message(msg) { document.getElementById('err_line').innerHTML = msg; } function ads_clear_all() { ads_highlightFields(0,0,0); set_ads_message(''); } function ads_loader_toggler() { document.getElementById('loader').style.display = (document.getElementById('loader').style.display == 'none' || document.getElementById('loader').style.display == '') ? 'inline' : 'none'; document.getElementById('submit').style.display = (document.getElementById('submit').style.display == 'none') ? 'block' : 'none'; } function ads_highlightFields(week, half1, half2) { document.getElementById('rent_price').className = (week == 1) ? 'inp1' : 'inp0'; document.getElementById('half1_price').className = (half1 == 1) ? 'inp1' : 'inp0'; document.getElementById('half2_price').className = (half2 == 1) ? 'inp1' : 'inp0'; } ///room_types functions (add suite form) function update_room_types_select(t){ var hotel_id = t.value; //first remove all that we have there clear_options_in_select('room_type'); //add new ones! for (var i=0; i=0; i--) { elSel.remove(i); } } function append_option_to_select(select_id, text, value) { var elOptNew = document.createElement('option'); elOptNew.text = text; elOptNew.value = value; var elSel = document.getElementById(select_id); try { elSel.add(elOptNew, null); // standards compliant; doesn't work in IE } catch(ex) { elSel.add(elOptNew); // IE only } } //Load numbers functions function getHTTPObject() { var http = false; //Use IE's ActiveX items to load the file. if(typeof ActiveXObject != 'undefined') { try {http = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) { try {http = new ActiveXObject("Microsoft.XMLHTTP");} catch (E) {http = false;} } //If ActiveX is not available, use the XMLHttpRequest of Firefox/Mozilla etc. to load the document. } else if (XMLHttpRequest) { try {http = new XMLHttpRequest();} catch (e) {http = false;} } return http; } function removeElement(id) { var element = document.getElementById(id); element.parentNode.removeChild(element); } function reveal_numbers(listing_id) { removeElement('phone_loader_' + listing_id); document.getElementById('numbers__' + listing_id).style.display='inline'; } function load_phone_numbers(listing_id) {//hides the loader gif and loads the phone_numbers var loader_obj = document.getElementById('phone_loader_' + listing_id); if (loader_obj) { $.post('/get_phones_str.exe.php', { id : listing_id }, function(data){ document.getElementById('numbers__' + listing_id).innerHTML=data; setTimeout('reveal_numbers(' + listing_id + ')', 750); }); } //no loader there, so no need to reload... } function externalLinks() { if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName("a"); for (var i=0; idiv").hover( function(){ $(this).find("span").animate({color:'#bb0009'}, 300); $(this).animate({backgroundColor:'#ffff7e'}, 300); }, function() { $(this).find("span").animate({color:'#000000'}, 300); $(this).animate({backgroundColor:'#d4effc'}, 300); }); });//ready $(document).ready(function() { ///left side content var pos = $('#stage').offset(); $('#left_side_floating_content').css( {"left": (pos.left-$('#left_side_floating_content').width() - 10) + "px", "top" : (pos.top + 30) + "px" }).slideDown(function() { var init_space_from_top = $(this).offset().top; $(window).scroll( function() { var offset_from_top = Math.max(init_space_from_top, $(window).scrollTop()+10); $('#left_side_floating_content').stop().animate({top:offset_from_top}, "fast"); });//scroll });//slideDown /////////////////////////////////////////////////////////////deleta an add! $("#del_ad_reason").change(function(){ var value = $(this).val(); if (value==100) { $("#reason_other").slideDown(); $("#reason_other").focus(); } else { $("#reason_other").slideUp(); } }); /////////////////////////////////////////////////////////////add suite JS $('form#suites_form input[name=hotel_id]').change( function(){ var id = $(this).val(); $('#fs_'+id).slideDown().siblings().slideUp(); }); //hotelid change $('form#suites_form .line *').click( function(){ $(this).parents().removeClass('err'); }).focus( function(){ $(this).parents().removeClass('err'); }); $('#suites_form #submit').click( function() { $(this).attr('disabled','disabled'); $('.line').removeClass('err'); var hotel = $('input[name=hotel_id]:checked').val(); var room = $('input[name=room_type]:checked').val(); var guests = $('input[name=guests_allowed]:checked').val(); var week = $('#week_number').val(); $.post('/suite_new_aj.php', {hotel:hotel, room:room, guests:guests, week:week}, function(data) { if (data.result > 0){//success location.href = '/my/'+ data.result; } else {//failed for (var key in data){ $('.line.'+ key).addClass('err'); } }//result }, "json");//post $(this).removeAttr('disabled'); });//submit button click ///////////////////////////////////////////////////////////// Dialog of delete $("#dialog-form").dialog({ autoOpen: false, resizable: false, height: 300, width: 350, modal: true, buttons: { ' המשך ומחק את המודעה ': function() { $.ajax ({ type: 'POST', url:'/ad.exe.php', data: 'id='+ $("#del_ad_id").val() +'&del_ad_reason='+ $("#del_ad_reason").val() +'&del_reason_other='+ $("#reason_other").val(), success: function() { location.href = '/my/?flag=ad_deleted'; } }); $(this).dialog('close');}, 'ביטול': function() {$(this).dialog('close');}} }); ///////////////////////////////////////////////////////////// Some buttons $('table.suites button.remove').click(function() { $("#del_ad_id").val( $(this).attr("id") ); $('#dialog-form').dialog('open'); }); $('table.suites button.edit').click(function() { location.href = '/my/' + $(this).attr("id"); });//edit $("div.week_number span").tooltip({ delay:10, predelay:200, tip: '#week_num_tooltip', onBeforeShow: function() { var w = this.getTrigger().attr("rel"); $('#week_num_tooltip').html('
סנן לפי מספר שבוע
'); } }); $.localScroll.hash(); $.localScroll(); $(".listing_row.rent .contact_owner a").click(function () { if ( $(this).parents(".listing_row").hasClass('on') ) {//close this $(this).children("span").html('לפרטים'); $(this).parents('.listing_row').removeClass('on').animate({height: '50px'}); $(this).parent().siblings('.contact_info_row').slideUp(); } else {//close other var listing_id= $(this).parents(".listing_row").attr("id").replace('listing_row_',''); //first - take care of others //hide all but this one $('.listing_row.on .contact_owner a>span').html('לפרטים'); $('.listing_row.on').animate({height: '50px'}).removeClass('on').children('.contact_info_row').slideUp(); //Now take care of THIS $(this).children("span").html('סגור'); $(this).parents('.listing_row').addClass('on').animate({height: '80px'}); $(this).parent().siblings('.contact_info_row').slideDown(); load_phone_numbers(listing_id); }//is closing myself? return false; });//rent listing $(".sell.listing_row").click(function () { var $this = $(this); if ( $(this).hasClass('on') ) {//close it $(this).animate({height:'30px'}).removeClass('on').find(".contact_owner>a").html("לפרטים »"); return; } var id = $this.attr('id'); id = id.replace("listing_row_", "", id); if ( !$this.find(".more").length ) {// never loaded before $.post('/sell_aj.php', {id:id}, function(data){ $this.append(data); }); } $(".sell.listing_row").animate({height:'30px'}).removeClass('on').find(".contact_owner>a").html("לפרטים »"); $(this).animate({height:'150px'}).addClass('on').find(".contact_owner>a").html("סגור"); }); //sell listing }); //ready