function moderate_review(a){var a=a;a=a.replace(/&/g,"^");a=a.replace(/'/g,"_");a=a.replace(/"/g,"~");return a}function setMozHeader(){var a=SITE_ABSOLUTE_URL+"ajax.php?do=setMozHeader&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(b){$j("#browser_support_msg").slideUp("slow")},onSuccess:function(c){var b=c.responseText;$("ctlist").style.top="139px"},onFailure:function(b){alert("The request failed..")},onException:function(b){alert("Exception")}})}function display_restaurant_review_rating_div(a){if($(a).style.display=="none"){$(a).style.display="block"}else{$(a).style.display="none"}}function refreshRestaurantReviewInputBox(b){var a=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=refreshRestaurantReviewInputBox&resId="+b+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(c){$("review_input_div").show().update("<div align='center'><div style='height:30px;'></div><div><img src='"+SITE_ABSOLUTE_URL+"images/ajax-loader.gif' /><div><div style='height:30px;'></div></div>")},onSuccess:function(d){var c=d.responseText;$("review_input_div").innerHTML=c},onFailure:function(c){alert("The request failed..")},onException:function(c){alert("Exception")}})}function display_all_restaurant_reviews(b){var a=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=display_all_restaurant_reviews&resId="+b+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(c){$("res_rev_update_msg").show().update("<div align='center'><div style='height:30px;'></div><div><img src='"+SITE_ABSOLUTE_URL+"images/ajax-loader.gif' /><div></div>")},onSuccess:function(e){$("res_rev_update_msg").style.display="none";$("res_rev_update_msg").innerHTML="";var d=e.responseText;var c=d.split("##!##");if(c[1]>0){$("restaurant_noreviews_msg").style.display="none";$("restaurant_allreviews").style.display="block";$("restaurant_allreviews").innerHTML=c[0]}else{$("restaurant_noreviews_msg").style.display="block"}},onFailure:function(c){alert("The request failed..")},onException:function(c){alert("Exception")}})}function postRestaurantReview(b){var a=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=postRestaurantReview&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(c){$("review_input_div").show().update("<div align='center'><div style='height:30px;'></div><div><img src='"+SITE_ABSOLUTE_URL+"images/ajax-loader.gif' /><div></div>")},onSuccess:function(d){var c=d.responseText;ret_arr=c.split("#");if(ret_arr[0]=="comment_inserted"&&ret_arr[1]=="rate_inserted"){$("review_input_div").innerHTML='<p><span style="font-size:18px; color:#3EBD3E;">Your review for this Restaurant has been posted successfully</span></p>';setTimeout("refreshRestaurantReviewInputBox("+b+");",3000);display_all_restaurant_reviews(b)}else{if(ret_arr[0]=="comment_already_done"&&ret_arr[1]=="rate_inserted"){$("review_input_div").style.display="block";$("review_input_div").innerHTML='<p><span style="font-size:18px; color:#FF9900;">You have already reviewed this Restaurant</span></p>'}}},onFailure:function(c){alert("The request failed..")},onException:function(c){alert("Exception")}})}function postRestaurantReviewOnLogin(f){var e=$("txtrestaurant_review_title").value;var d=$("txtrestaurant_review_text").value;e=moderate_review(e);d=moderate_review(d);var a=true;if(e==""){alert("Please enter title.");$("txtrestaurant_review_title").focus;a=false}else{if(d==""){alert("Review Text cannot be left blank");$("txtrestaurant_review_text").focus;a=false}else{if(d.length<10){alert("Min. 10 characters for Review Text.");$("txtrestaurant_review_text").focus;a=false}else{if($("hidden_restaurant_rate_val")){var c=$("hidden_restaurant_rate_val").value;if(c==0){alert("Please rate this restaurant.");a=false}}}}}if(a){if(c>0){var b=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=postRestaurantReviewOnLogin&reviewTitle="+e+"&reviewText="+d+"&rateValue="+c+"&resId="+f+"&rnd="+Math.random()}else{var b=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=postRestaurantReviewOnLogin&reviewTitle="+e+"&reviewText="+d+"&resId="+f+"&rnd="+Math.random()}new Ajax.Request(b,{method:"get",onSuccess:function(h){var g=h.responseText;if(g=="not_logged_in"){showDiv("div_signin")}else{postRestaurantReview(f)}},onFailure:function(g){alert("The request failed..")},onException:function(g){alert("Exception")}})}}function rateRestaurant1(c,b){$("rating"+b).style.display="none";var a=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=rateRestaurant1&value="+c+"&restId="+b+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onSuccess:function(h){var g=h.responseText;if(g=="not_loggedin"){showDiv("div_signin")}else{g=g.split(",");var d=g[0];var f=g[1];var e=g[2];$("rate"+b).innerHTML="Thanks, you rated "+e;$("rate"+b).show()}},onFailure:function(d){alert("The request failed..")},onException:function(d){alert("Exception")}})}var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);function fixPNG(e){var b=(e.id)?"id='"+e.id+"' ":"";var d=(e.className)?"class='"+e.className+"' ":"";var f=(e.title)?"title='"+e.title+"' ":"title='"+e.alt+"' ";var c="display:inline-block;"+e.style.cssText;var a="<span "+b+d+f+' style="width:'+e.width+"px; height:"+e.height+"px;"+c+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+e.src+"', sizingMethod='scale');\"></span>";e.outerHTML=a}function open_header_planner(c){var a=Array();a[0]="plan";a[1]="book";a[2]="explore";$("planner_container").style.display="block";for(var b=0;b<a.length;b++){if(c==a[b]){$(a[b]).style.display="block"}else{$(a[b]).style.display="none"}}}function close_open_divs(){$("SuggestResults").style.display="none";$("LocalitySuggestResults").style.display="none";$("ctlist").style.display="none"}var restaurant_name=new Array();var locality_name=new Array();function fetch_restaurant_data_for_autosuggest(){var a=SITE_ABSOLUTE_URL+"ajax.php?do=fetch_restaurant_data_for_autosuggest&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(b){},onSuccess:function(c){var b=c.responseText;restaurant_name=b.split("^")},onFailure:function(b){alert("The request failed..")},onException:function(b){alert("Exception")}})}function GetResults(e){$("SuggestResults").style.display="block";var c;var b=new Array(restaurant_name.length);var a;var f;var d=0;for(c=0;c<restaurant_name.length;c++){a=restaurant_name[c].split("=");if(a.length>1){if(a[1].toLowerCase().indexOf(e.toLowerCase())!=-1){f={};f.id=a[0];f.text=a[1];b[d]=f;d++}}}return b}function HandleChoice(a,b,c){$("cuisine").value=b;$("SuggestResults").style.display="none";$("cuisine").focus()}function fetch_locality_data_for_autosuggest(){var a=SITE_ABSOLUTE_URL+"ajax.php?do=fetch_locality_data_for_autosuggest&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(b){},onSuccess:function(c){var b=c.responseText;locality_name=b.split("^")},onFailure:function(b){alert("The request failed..")},onException:function(b){alert("Exception")}})}function GetResultsForLocalityAutosuggest(e){$("LocalitySuggestResults").style.display="block";var c;var b=new Array(locality_name.length);var a;var f;var d=0;for(c=0;c<locality_name.length;c++){a=locality_name[c].split("=");if(a.length>1){if(a[1].toLowerCase().indexOf(e.toLowerCase())!=-1){f={};f.id=a[0];f.text=a[1];b[d]=f;d++}}}return b}function HandleChoiceForLocalityAutosuggest(a,b,c){$("area").value=b;$("LocalitySuggestResults").style.display="none";$("area").focus()}function display_mostsearched_restaurants_ajax(){var a=SITE_ABSOLUTE_URL+"ajax.php?do=display_mostsearched_restaurants_ajax&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(b){},onSuccess:function(c){var b=c.responseText},onFailure:function(b){},onException:function(b){}})}function showDiv(b){var a=b.split("_");if(a[1]=="signin"){$("div_signin").style.display="block";$("div_moviesynopsisdetails").style.display="none";$("div_signup").style.display="none";$("div_sendemail").style.display="none";$("div_sendsms").style.display="none";$("div_addtoplanner").style.display="none";$("div_recommenditrestaurant").style.display="none"}if(a[1]=="signup"){$("div_signup").style.display="block";$("div_moviesynopsisdetails").style.display="none";$("div_signin").style.display="none";$("div_sendemail").style.display="none";$("div_sendsms").style.display="none";$("div_addtoplanner").style.display="none";$("div_recommenditrestaurant").style.display="none"}if(a[1]=="sendemail"){$("div_sendemail").style.display="block";$("div_moviesynopsisdetails").style.display="none";$("div_signup").style.display="none";$("div_signin").style.display="none";$("div_sendsms").style.display="none";$("div_addtoplanner").style.display="none";$("div_recommenditrestaurant").style.display="none"}if(a[1]=="sendsms"){$("div_sendsms").style.display="block";$("div_moviesynopsisdetails").style.display="none";$("div_sendemail").style.display="none";$("div_signup").style.display="none";$("div_signin").style.display="none";$("div_addtoplanner").style.display="none";$("div_recommenditrestaurant").style.display="none"}if(a[1]=="addtoplanner"){$("div_addtoplanner").style.display="block";$("div_moviesynopsisdetails").style.display="none";$("div_sendsms").style.display="none";$("div_sendemail").style.display="none";$("div_signup").style.display="none";$("div_signin").style.display="none";$("div_recommenditrestaurant").style.display="none"}if(a[1]=="recommenditrestaurant"){$("div_recommenditrestaurant").style.display="block";$("div_moviesynopsisdetails").style.display="none";$("div_addtoplanner").style.display="none";$("div_sendsms").style.display="none";$("div_sendemail").style.display="none";$("div_signup").style.display="none";$("div_signin").style.display="none"}if(a[1]=="moviesynopsisdetails"){$("div_moviesynopsisdetails").style.display="block";$("div_recommenditrestaurant").style.display="none";$("div_addtoplanner").style.display="none";$("div_sendsms").style.display="none";$("div_sendemail").style.display="none";$("div_signup").style.display="none";$("div_signin").style.display="none"}$("fade").style.display="block"}function closeDiv(b){var a=b.split("_");if(a[1]=="signin"){$("div_signin").style.display="none"}if(a[1]=="signup"){$("div_signup").style.display="none"}if(a[1]=="sendemail"){$("div_sendemail").style.display="none"}if(a[1]=="sendsms"){$("div_sendsms").style.display="none"}if(a[1]=="addtoplanner"){$("div_addtoplanner").style.display="none"}if(a[1]=="recommenditrestaurant"){$("div_recommenditrestaurant").style.display="none"}if(a[1]=="moviesynopsisdetails"){$("div_moviesynopsisdetails").style.display="none"}$("fade").style.display="none"}function hideLightBox(a){a.style.display="none";$("div_signin").style.display="none";$("div_signup").style.display="none";$("div_sendemail").style.display="none";$("div_sendsms").style.display="none";$("div_addtoplanner").style.display="none";$("div_recommenditrestaurant").style.display="none";$("div_moviesynopsisdetails").style.display="none"}function add_to_planner(d,b,c){showDiv(b);var d=d;var c=c;var a=SITE_ABSOLUTE_URL+"ajax.php?do=add_to_planner&id="+d+"&module_name="+c+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(e){$("addtoplanner_msg").show().update("<img src='"+SITE_ABSOLUTE_URL+"images/ajax-loader4.gif' />")},onSuccess:function(f){var e=f.responseText;$("dropcontent").innerHTML=e;$("addtoplanner_msg").innerHTML="Added To Plan List";setTimeout("closeDiv(div_element);",2000)},onFailure:function(e){},onException:function(e){}})}function delete_from_planner(c,b){var a=SITE_ABSOLUTE_URL+"ajax.php?do=delete_from_planner&id="+c+"&action="+b+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(d){},onSuccess:function(f){var e=f.responseText;var d=document.getElementById("dropcontent").innerHTML;if(d.length>0){d=d+"<br>"}d=d+e;document.getElementById("dropcontent").innerHTML=e},onFailure:function(d){},onException:function(d){}})}function addmore_emailfields(){}function open_email_lightbox(d,c,b){showDiv(c);var d=d;var b=b;var a=SITE_ABSOLUTE_URL+"ajax.php?do=open_email_lightbox&id="+d+"&module_name="+b+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(e){$("send_email_icon_msg").show().update("generating email content...please wait.")},onSuccess:function(f){var e=f.responseText;$("send_email_icon_msg").innerHTML=e;$j("#send_email_icon_emailpanel").slideDown("slow")},onFailure:function(e){},onException:function(e){}})}function open_sms_lightbox(d,c,b){showDiv(c);var d=d;var b=b;var a=SITE_ABSOLUTE_URL+"ajax.php?do=open_sms_lightbox&id="+d+"&module_name="+b+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(e){$("send_sms_icon_msg").hide()},onSuccess:function(f){var e=f.responseText;$("sms_message").value=e;$j("#send_sms_icon_smspanel").slideDown("slow")},onFailure:function(e){},onException:function(e){}})}function open_recommenditrestaurant_lightbox(d,c,b){showDiv(c);var d=d;var b=b;var a=SITE_ABSOLUTE_URL+"ajax.php?do=open_recommenditrestaurant_lightbox&id="+d+"&module_name="+b+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(e){},onSuccess:function(f){var e=f.responseText;$("res_name").innerHTML="<b>"+e+"</b>";$("res_id").innerHTML=d},onFailure:function(e){},onException:function(e){}})}function showOtherResRecommendBox(){if($("recommendit_restaurant_5").checked){$j("#showAllResRecommendBox").slideUp("slow");$j("#otheResRecommendbox").slideDown("slow")}else{$j("#showAllResRecommendBox").slideDown("slow");$j("#otheResRecommendbox").slideUp("slow")}}function recommendit_restaurant_recommend(c){var a="";if(!$("recommendit_restaurant_5").checked){if($("recommendit_restaurant_1").checked){a+=$("recommendit_restaurant_1").value+","}if($("recommendit_restaurant_2").checked){a+=$("recommendit_restaurant_2").value+","}if($("recommendit_restaurant_3").checked){a+=$("recommendit_restaurant_3").value+","}if($("recommendit_restaurant_4").checked){a+=$("recommendit_restaurant_4").value+","}a=a.substring(0,a.length-1)}else{a+=$("recommendit_restaurant_6").value}var b=SITE_ABSOLUTE_URL+"ajax.php?do=recommendit_restaurant_recommend&resid="+c+"&recommended_values="+a+"&rnd="+Math.random();new Ajax.Request(b,{method:"get",onLoading:function(d){$("update_msg_for_resrecomendedvalues").show().update("please wait...")},onSuccess:function(e){var d=e.responseText;if(d=="recommended_values_updated"){$("update_msg_for_resrecomendedvalues").show().update("You have recommended this restaurant for: <b>"+a+"</b>");setTimeout("window.location.reload();",2000)}else{}},onFailure:function(d){},onException:function(d){}})}function send_sms(d,a,b){var d=d;var a=a;var b=b;var c=SITE_ABSOLUTE_URL+"ajax.php?do=send_sms&sms_name="+d+"&sms_message="+a+"&sms_to="+b+"&rnd="+Math.random();new Ajax.Request(c,{method:"get",onLoading:function(e){$("send_sms_icon_msg").show().update("sending sms...please wait.");$j("#send_sms_icon_smspanel").slideUp("slow")},onSuccess:function(f){var e=f.responseText;$("send_sms_icon_msg").innerHTML="SMS sent successfully"},onFailure:function(e){},onException:function(e){}})}function send_email(c,e,b,d){var c=c;var e=e;var b=b;var d=d.replace(/&nbsp;/g,"^");var a=SITE_ABSOLUTE_URL+"ajax.php?do=send_email_icon&mail_to="+c+"&mail_from="+e+"&mail_name="+b+"&msg="+d+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(f){$("send_email_icon_msg").show().update("sending email...please wait.");$j("#send_email_icon_emailpanel").slideUp("slow")},onSuccess:function(h){var g=h.responseText;var f=g.split("###");if(f[0]=="mailsend_error"){$("send_email_icon_msg").innerHTML=f[1];$j("#send_email_icon_emailpanel").slideDown("slow")}if(f[0]=="mailsend_success"){$("send_email_icon_msg").innerHTML=f[1]}},onFailure:function(f){},onException:function(f){}})}function signup(c,b,e,d){var c=c;var b=b;var e=e;var d=d;var a=SITE_ABSOLUTE_URL+"ajax.php?do=signup&first_name="+c+"&email="+b+"&pass_word="+e+"&zip="+d+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(f){$j("#register_outer").slideDown("slow");$("register_outer").show().update("processing...please wait.")},onSuccess:function(h){var f=h.responseText;var g=f.split("###");if(g[0]=="success"){$("register_outer").innerHTML=g[1];$j("#register_inner").slideUp("slow")}if(g[0]=="error"){$j("#register_outer").slideDown("slow");$("register_outer").innerHTML=g[1]}},onFailure:function(f){},onException:function(f){}})}function logout(){var a=SITE_ABSOLUTE_URL+"ajax.php?do=logout&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(b){},onSuccess:function(c){var b=c.responseText;if(b=="successfully_loggedout"){location.reload()}},onFailure:function(b){},onException:function(b){}})}function signin_signout(c,d,a,f,e){var f=f;if(f=="signin"){var c=c;var d=d;var g=0;if(a.checked){g=1}else{g=0}var b=SITE_ABSOLUTE_URL+"ajax.php?do=signin_signout&email="+c+"&pass_word="+d+"&remember_me="+g+"&action="+f+"&rnd="+Math.random();new Ajax.Request(b,{method:"get",onLoading:function(h){$("login_outer").show().update("please wait...")},onSuccess:function(j){var h=j.responseText;responsearray=h.split("###");dr1=responsearray[0];dr2=responsearray[1];if(dr1=="Login_Successfull"){$("login_outer").show().update('<span style="color:#6CC142;"><b>successfully loggedin. Redirecting...</b></span>');setTimeout("$('div_signin').style.display='none';$('span_loginmsg').innerHTML = 'Welcome '+dr2+'&nbsp;&nbsp;';$('header_span_create_acc').style.display = 'none';$('fade').style.display = 'none';$('header_login_msg').innerHTML = 'Welcome '+dr2+'&nbsp;&nbsp;|&nbsp;&nbsp;'+'<a href=\"javascript:void(0);\"   onclick=\"javascript:logout();\" style=\"color:#0033CC; font-weight:bold;\">LOGOUT</a>';",2000);var i=e.split("?");if(i[0]=="movies.php"){postMovieReview()}}if(dr1=="User_Not_Verified"){$("login_outer").show().update('<span style="color:#FF7F7F;"><b>your account is not yet verified. please verify your account by clicking on the link send to your email address: '+dr2+"</b></span>")}if(dr1=="Invalid_Username_Password"){$("login_outer").show().update('<span style="color:#FF7F7F;"><b>Invalid username / password</b></span>')}},onFailure:function(h){},onException:function(h){}})}if(f=="signout"){var b=SITE_ABSOLUTE_URL+"ajax.php?do=signin_signout&action="+f+"&rnd="+Math.random();new Ajax.Request(b,{method:"get",onLoading:function(h){},onSuccess:function(i){var h=i.responseText;if(h=="successfully_loggedout"){$("logout_div").show().update("you are logged out!");$("login_div").style.display="block";if($("login_div_loginmsg")){$("login_div_loginmsg").style.display="none"}if($("login_div_login")){$("login_div_login").style.display="block"}if($("login_div_loginmsg")){$("login_div_loginmsg").innerHTML="<span id=\"login_div_loginmsg_logout\"><a style=\"color:#FFFFFF;\" href=\"javascript:void(0);\" onclick=\"javascript:signin_signout('', '', '', 'signout');\">logout</a></span>"}}},onFailure:function(h){},onException:function(h){}})}}var map=null;var geocoder=null;function character_limit(a){if(a.value.length>100){a.style.backgroundColor="#F06333"}if(a.value.length<=110){a.style.backgroundColor="#ffffff";document.getElementById("char_count").innerHTML=110-a.value.length}}function change_mood(a){if(a=="blue_selected"){$("inn_whole").style.backgroundImage="url('images/new_images/blue_bg_inner.jpg')";$("inn_whole").style.backgroundRepeat="repeat-x";$("white_grad").style.backgroundColor="#b9e5fd";$("header_top_right").style.backgroundColor="#b9e5fd";$("cityleisure_div").style.backgroundColor="#b9e5fd";$("travellingfor_div").style.backgroundColor="#b9e5fd";$("inn_curve_bg").style.backgroundImage="url('images/new_images/curve_inner_blue.jpg')"}if(a=="green_dis"){$("inn_whole").style.backgroundImage="url('images/new_images/green_bg_inner.jpg')";$("inn_whole").style.backgroundRepeat="repeat-x";$("white_grad").style.backgroundColor="#aace8d";$("header_top_right").style.backgroundColor="#aace8d";$("cityleisure_div").style.backgroundColor="#aace8d";$("travellingfor_div").style.backgroundColor="#aace8d";$("inn_curve_bg").style.backgroundImage="url('images/new_images/curve_inner_green.jpg')"}if(a=="red_dis"){$("inn_whole").style.backgroundImage="url('images/new_images/red_bg_inner.jpg')";$("inn_whole").style.backgroundRepeat="repeat-x";$("white_grad").style.backgroundColor="#e3a7a8";$("header_top_right").style.backgroundColor="#e3a7a8";$("cityleisure_div").style.backgroundColor="#e3a7a8";$("travellingfor_div").style.backgroundColor="#e3a7a8";$("inn_curve_bg").style.backgroundImage="url('images/new_images/curve_inner_red.jpg')"}if(a=="black_dis"){$("inn_whole").style.backgroundImage="url('images/new_images/black_bg_inner.jpg')";$("inn_whole").style.backgroundRepeat="repeat-x";$("white_grad").style.backgroundColor="#767070";$("header_top_right").style.backgroundColor="#767070";$("cityleisure_div").style.backgroundColor="#767070";$("travellingfor_div").style.backgroundColor="#767070";$("inn_curve_bg").style.backgroundImage="url('images/new_images/curve_inner.jpg')"}}function send_free_sms(){var a=$("to_phone_no").value;var c=$("sms_text").value;var b=SITE_ABSOLUTE_URL+"ajax.php?do=send_free_sms&to_phone_no="+a+"&sms_text="+c+"&rnd="+Math.random();new Ajax.Request(b,{method:"get",onLoading:function(d){$("sms_send_msg").show().update("<img src='"+SITE_ABSOLUTE_URL+"images/ajax-loader.gif' />")},onSuccess:function(e){var d=e.responseText;if(d=="invalid_mob_no"){$("sms_send_msg").innerHTML="Invalid Mobile No Entry"}else{if(d=="max_110_characters_are_allowed"){$("sms_send_msg").innerHTML="Max. 110 characters are allowed"}else{if(d=="not_logged_in"){$("sms_send_msg").innerHTML='Please <a href="login.php" style="color:#CC0000">Login</a> to send SMS'}else{if(d=="max_limit_overflow"){$("sms_send_msg").innerHTML="You have already sent max allowable SMS. Please try again later."}else{$("sms_send_msg").innerHTML="SMS sent successfully";$("to_phone_no").value="";$("sms_text").value="";setTimeout("$('sms_send_msg').innerHTML = 'Send Another SMS';$('char_count').innerHTML = '110';",3000)}}}}},onFailure:function(d){},onException:function(d){}})}function date_month_change(d,b,c){if($(d).value>-1){if($(d).value==2){var a=false;a=($(c).value%4==0)?true:false;if(a){if(!$(b).options[29]){var e=document.createElement("option");e.text=29;e.value=29;$(b).add(e,null)}if($(b).options[31]){$(b).remove(31)}if($(b).options[30]){$(b).remove(30)}}else{$(b).remove(31);$(b).remove(30);$(b).remove(29)}}else{if($(d).value%2==0&&$(d).value!=2){if($(d).value==8||$(d).value==10||$(d).value==12){if(!$(b).options[29]){var e=document.createElement("option");e.text=29;e.value=29;$(b).add(e,null)}if(!$(b).options[30]){var e=document.createElement("option");e.text=30;e.value=30;$(b).add(e,null)}if(!$(b).options[31]){var e=document.createElement("option");e.text=31;e.value=31;$(b).add(e,null)}}else{$(b).remove(31)}}else{if(($(d).value%2==1&&$(d).value!=2)){if($(d).value==9||$(d).value==11){if($(b).options[31]){$(b).remove(31)}}else{if(!$(b).options[29]){var e=document.createElement("option");e.text=29;e.value=29;$(b).add(e,null)}if(!$(b).options[30]){var e=document.createElement("option");e.text=30;e.value=30;$(b).add(e,null)}if(!$(b).options[31]){var e=document.createElement("option");e.text=31;e.value=31;$(b).add(e,null)}}}}}}else{alert("please select a month")}}function date_year_change(d,b,c){if($(c).value>-1){if($(d).value==2){var a=false;a=($(c).value%4==0)?true:false;if(a){if(!$(b).options[29]){var e=document.createElement("option");e.text=29;e.value=29;$(b).add(e,null)}if($(b).options[31]){$(b).remove(31)}if($(b).options[30]){$(b).remove(30)}}else{$(b).remove(31);$(b).remove(30);$(b).remove(29)}}else{}}else{alert("please select a year")}}function check_availability(b,a){if($(b).value.length>0){var c=SITE_ABSOLUTE_URL+"ajax.php?do=check_availability&email="+$(b).value+"&rnd="+Math.random();new Ajax.Request(c,{method:"get",onLoading:function(d){$("loadarea").innerHTML="<img src='"+SITE_ABSOLUTE_URL+"images/ajax-loader.gif' border='0'>"},onSuccess:function(e){var d=e.responseText;$(a).innerHTML=d}})}else{alert("select an Email")}}function showMovieSubMenu(){if($("movieSubMenu").style.display=="none"){$("movieSubMenu").style.display="block"}setTimeout("$('movieSubMenu').style.display = 'none';",5000);$("movieSubMenu").style.position="absolute";$("movieSubMenu").style.top="160px";$("movieSubMenu").style.left="5px"}function onEnterKeyPress(b){var a;b=b||window.event;if(window.event){a=window.event.keyCode}else{if(b){a=b.which}else{return true}}if(a==13){return true}else{return false}}function newViralPhone(a){var b=SITE_ABSOLUTE_URL+"moviefunctionsajax.php?do=newViralPhone&newPhone="+a+"&rnd="+Math.random();new Ajax.Request(b,{method:"get",onLoading:function(c){$("newparticipants").innerHTML="<img src='"+SITE_ABSOLUTE_URL+"images/ajax-loader.gif' border='0'>"},onSuccess:function(e){var d=e.responseText;var c=d.split("#");if(c[1]=="successfullyreferenced"){$("newparticipants").innerHTML="Thank You For Participating. You'll Receive a SMS With The Code. Enter Your Unique Code Above To Win Cash Prizes Upto Rs. 1,00,000"}if(c[1]=="alreadyentered"){$("newparticipants").innerHTML="Sorry, You Have Already Participated. Check Your Inbox For The Unique Code and Enter Your Unique Code Above To Win Cash Prizes Upto Rs. 1,00,000"}},onFailure:function(c){alert("The request failed..")},onException:function(c){alert("Exception")}})}function code_entry_validate(b){var a=SITE_ABSOLUTE_URL+"moviefunctionsajax.php?do=viralmarketing&viral_code="+b+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(c){},onSuccess:function(f){var e=f.responseText;var p=e.split("#");if(p[0]=="CodeSuccess"){var o=p[1].split("=");var d=o[1];var l=p[2].split("=");var k=l[1];var g=p[3].split("=");var j=p[4].split("=");var c=p[5].split("=");var n=c[1];if(j[1]=="win"){$("winner_msg").style.display="block"}else{$("winner_msg").style.display="block";$("winner_msg").innerHTML="Sorry, Bad Luck this time. But refer to your friends and win as much as they win."}setTimeout("$('mktg_msg1').innerHTML = 'Your Entry has been <b>successful</b>.';$('mktg_msg1').style.display = 'block';",1000);var m="<br /><b>Refer your friends. You win in-case your reference wins.</b><br />";for(var h=1;h<=g[1];h++){m+="["+h+"]<br /><input type='text' maxlength='10' width='100px' name='credit"+h+"' id='credit"+h+"'><br />"}$("mktg_msg4").style.display="block";$("mktg_msg4").innerHTML=m+"<input type='button' value='SMS To Friends' onclick='javascript:sms_to_reference("+g[1]+","+d+","+k+","+n+");'>"}if(p[0]=="alreadyentered"){var g=p[1];var d=p[2];var k=p[3];var c=p[4];setTimeout("$('mktg_msg1').innerHTML = 'You Have Already Entered Your Code Before.<br />Refer your friends to stand a chance to win cash prize upto Rs. 100,000.';$('mktg_msg1').style.display = 'block';",1000);var m="<br /><b>Refer your friends. You win in-case your reference wins.</b><br />";for(var h=1;h<=p[1];h++){m+="["+h+"]<br /><input type='text' maxlength='10' width='100px' name='credit"+h+"' id='credit"+h+"'><br />"}$("mktg_msg4").style.display="block";$("mktg_msg4").innerHTML=m+"<input type='button' value='SMS To Friends' onclick='javascript:sms_to_reference("+g+","+d+","+k+","+c+");'>"}if(e=="CodeError"){setTimeout("$('mktg_msg1').style.display = 'none';$('mktg_msg2').style.display = 'block';$('mktg_msg3').innerHTML = '<b>Invalid Code</b> Entry';",3000)}if(p[0]=="invalid_code_entry"){setTimeout("$('mktg_msg1').style.display = 'none';$('mktg_msg2').style.display = 'block';$('mktg_msg3').innerHTML = '<b>Invalid Code</b> Entry';",1000)}},onFailure:function(c){alert("The request failed..")},onException:function(c){alert("Exception")}})}function sms_to_reference(a,g,b,f){var d="";for(var e=1;e<=a;e++){if($("credit"+e).value!=""){d+=$("credit"+e).value+","}}if(d.length!=""){var c=SITE_ABSOLUTE_URL+"moviefunctionsajax.php?do=store_referral_contacts&referral_contacts="+d+"&id="+g+"&pid="+b+"&code="+f;new Ajax.Request(c,{method:"get",onLoading:function(h){$("mktg_msg4").innerHTML="<img src='"+SITE_ABSOLUTE_URL+"images/ajax_loader.gif' border='0'>"},onSuccess:function(j){var i=j.responseText;var h=i.split("#");if(h[1]=="referencesuccess"){$("mktg_msg4").innerHTML="<div style='border:0px solid #de0002;'>Your reference(&nbsp;"+h[2]+" out of "+h[3]+"&nbsp;) is successfull. <br />For every successfull login by your reference 5 SMS credit <br />would be available to you.</div><div><a href='index.php' style='color:#de0002;'>refer again</a></div>"}},onFailure:function(h){alert("The request failed..")},onException:function(h){alert("2")}})}else{alert("Atleast Send One SMS")}}function show_stuff(a){if(a=="home"){document.getElementById("display_home").style.display="block";document.getElementById("display_movie").style.display="none";document.getElementById("display_health").style.display="none";document.getElementById("display_restaurant").style.display="none";document.getElementById("display_events").style.display="none";document.getElementById("display_hotel").style.display="none"}if(a=="movie"){document.getElementById("display_home").style.display="none";document.getElementById("display_movie").style.display="block";document.getElementById("display_health").style.display="none";document.getElementById("display_restaurant").style.display="none";document.getElementById("display_events").style.display="none";document.getElementById("display_hotel").style.display="none"}if(a=="health"){document.getElementById("display_home").style.display="none";document.getElementById("display_movie").style.display="none";document.getElementById("display_health").style.display="block";document.getElementById("display_restaurant").style.display="none";document.getElementById("display_events").style.display="none";document.getElementById("display_hotel").style.display="none"}if(a=="restaurant"){document.getElementById("display_home").style.display="none";document.getElementById("display_movie").style.display="none";document.getElementById("display_health").style.display="none";document.getElementById("display_restaurant").style.display="block";document.getElementById("display_events").style.display="none";document.getElementById("display_hotel").style.display="none"}if(a=="events"){document.getElementById("display_home").style.display="none";document.getElementById("display_movie").style.display="none";document.getElementById("display_health").style.display="none";document.getElementById("display_restaurant").style.display="none";document.getElementById("display_events").style.display="block";document.getElementById("display_hotel").style.display="none"}if(a=="hotel"){document.getElementById("display_home").style.display="none";document.getElementById("display_movie").style.display="none";document.getElementById("display_health").style.display="none";document.getElementById("display_restaurant").style.display="none";document.getElementById("display_events").style.display="none";document.getElementById("display_hotel").style.display="block"}}function MM_swapImgRestore(){var d,b,c=document.MM_sr;for(d=0;c&&d<c.length&&(b=c[d])&&b.oSrc;d++){b.src=b.oSrc}}function MM_preloadImages(){var f=document;if(f.images){if(!f.MM_p){f.MM_p=new Array()}var e,c=f.MM_p.length,b=MM_preloadImages.arguments;for(e=0;e<b.length;e++){if(b[e].indexOf("#")!=0){f.MM_p[c]=new Image;f.MM_p[c++].src=b[e]}}}}function MM_findObj(f,e){var c,b,a;if(!e){e=document}if((c=f.indexOf("?"))>0&&parent.frames.length){e=parent.frames[f.substring(c+1)].document;f=f.substring(0,c)}if(!(a=e[f])&&e.all){a=e.all[f]}for(b=0;!a&&b<e.forms.length;b++){a=e.forms[b][f]}for(b=0;!a&&e.layers&&b<e.layers.length;b++){a=MM_findObj(f,e.layers[b].document)}if(!a&&e.getElementById){a=e.getElementById(f)}return a}function MM_swapImage(){var e,d=0,b,c=MM_swapImage.arguments;document.MM_sr=new Array;for(e=0;e<(c.length-2);e+=3){if((b=MM_findObj(c[e]))!=null){document.MM_sr[d++]=b;if(!b.oSrc){b.oSrc=b.src}b.src=c[e+2]}}}function leftTrim(a){while(a.substring(0,1)==" "){a=a.substring(1,a.length)}return a}function rightTrim(a){while(a.substring(a.length-2,1)==" "){a=a.substring(0,a.length-2)}return a}function trim(a){a=leftTrim(a);a=rightTrim(a);return a}function login_check(){if(document.login_form.username.value==""){alert("Please insert a valid username");document.login_form.username.focus();return false}else{if(document.login_form.password.value==""){alert("Please insert your password");document.login_form.password.focus();return false}else{return true}}}function disp_div(a){if(document.getElementById(a).style.display=="none"){document.getElementById(a).style.display=""}else{document.getElementById(a).style.display="none"}}function scrollObject(b,d,a,g,f,e){var c=this;this.main=b;this.width=d;this.height=a;this.direct=g;this.pause=f;this.speed=Math.max(1.001,Math.min((g=="up"||g=="down")?a:d,e));this.block=new Array();this.blockprev=this.offset=0;this.blockcurr=1;this.mouse=false;this.scroll=function(){if(!document.getElementById){return false}this.main=document.getElementById(this.main);while(this.main.firstChild){this.main.removeChild(this.main.firstChild)}this.main.style.overflow="hidden";this.main.style.position="relative";this.main.style.width=this.width+"px";this.main.style.height=this.height+"px";for(var h=0;h<this.block.length;h++){var j=document.createElement("table");j.cellPadding=j.cellSpacing=j.border="0";j.style.position="absolute";j.style.left=j.style.top="0px";j.style.width=this.width+"px";j.style.height=this.height+"px";j.style.overflow=j.style.visibility="hidden";var i=document.createElement("tbody");var k=document.createElement("tr");var l=document.createElement("td");l.innerHTML=this.block[h];k.appendChild(l);i.appendChild(k);j.appendChild(i);this.main.appendChild(this.block[h]=j)}if(this.block.length>1){this.main.onmouseover=function(){c.mouse=true};this.main.onmouseout=function(){c.mouse=false};setInterval(function(){if(!c.offset&&c.scrollLoop()){c.block[c.blockcurr].style.visibility="visible"}},this.pause)}this.block[this.blockprev].style.visibility="visible"};this.scrollLoop=function(){if(!this.offset){if(this.mouse){return false}this.offset=(this.direct=="up"||this.direct=="down")?this.height:this.width}else{this.offset=Math.floor(this.offset/this.speed)}if(this.direct=="up"||this.direct=="down"){this.block[this.blockcurr].style.top=((this.direct=="up")?this.offset:-this.offset)+"px";this.block[this.blockprev].style.top=((this.direct=="up")?this.offset-this.height:this.height-this.offset)+"px"}else{this.block[this.blockcurr].style.left=((this.direct=="left")?this.offset:-this.offset)+"px";this.block[this.blockprev].style.left=((this.direct=="left")?this.offset-this.width:this.width-this.offset)+"px"}if(!this.offset){this.block[this.blockprev].style.visibility="hidden";this.blockprev=this.blockcurr;if(++this.blockcurr>=this.block.length){this.blockcurr=0}}else{setTimeout(function(){c.scrollLoop()},30)}return true}}function freshSearch(a){a.mode.value="new";if(a.id=="frmDetailed"){a.action="restaurants.php?md=res"}else{if(a.id=="frmQuick"){a.action=SITE_ABSOLUTE_URL+"restaurants"}}}function showhideDivs(b,a){if(b=="openpostcomment"){document.getElementById("postcomment"+a).style.display="block";document.getElementById("invalidloginmsg"+a).style.display="none";document.getElementById("loginscreen"+a).style.display="none";$("comment"+a).value=""}if(b=="discard"){document.getElementById("postcomment"+a).style.display="none";document.getElementById("invalidloginmsg"+a).style.display="none";document.getElementById("loginscreen"+a).style.display="none";$("comment"+a).value=""}if(b=="discardlogin"){document.getElementById("postcomment"+a).style.display="none";document.getElementById("invalidloginmsg"+a).style.display="none";document.getElementById("loginscreen"+a).style.display="none"}}function showhideComment(a,b){if(document.getElementById("commentHolder"+a).style.display=="block"){document.getElementById("commentHolder"+a).style.display="none"}else{showComments(a,b)}}function showComments(a,c){var b=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=showComments&restID="+a+"&cnt="+c+"&rnd="+Math.random();new Ajax.Request(b,{method:"get",onSuccess:function(e){var d=e.responseText;document.getElementById("comments"+a).innerHTML=d;document.getElementById("comments"+a).style.display="block";document.getElementById("commentHolder"+a).style.display="block"},onFailure:function(d){alert("The request failed..")},onException:function(d){alert("Exception")}})}function postCommentOnLogIn(c,a){document.getElementById("postcomment"+a).style.display="none";document.getElementById("loginscreen"+a).style.display="none";var b=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=postCommentOnLogIn&commentText="+c+"&restID="+a+"&rnd="+Math.random();new Ajax.Request(b,{method:"get",onLoading:function(d){$("allComments"+a).show().update("<div style='padding-top:30px;background-color:#fbfbfb;' align='center'><img src='"+SITE_ABSOLUTE_URL+"images/ajax-loader.gif'</div>")},onSuccess:function(f){var e=f.responseText;var d=e.split("^");if(d[0]=="displayComments"){$("allComments"+a).innerHTML=d[1]}else{$("postcomment"+a).style.display="none"}},onFailure:function(d){alert("The request failed..")},onException:function(d){alert("Exception")}})}function loginToPostComment(e,b,d,c){var a=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=loginToPostComment&username="+e+"&password="+b+"&commentText="+d+"&restId="+c+"&rnd="+Math.random();alert(a);new Ajax.Request(a,{method:"get",onSuccess:function(g){var f=g.responseText;if(f=="ok"){postCommentOnLogIn(d,c)}else{document.getElementById("invalidloginmsg"+c).style.display="block";document.getElementById("invalidloginmsg"+c).innerHTML="<font color='#FF0000'><b>Invalid username / password1</b></font>"}},onFailure:function(f){alert("The request failed..")},onException:function(f){alert("Exception")}})}function hideAndUpdateVoteDisplayPanel(a){$("rate"+a).hide();$("rate"+a).innerHTML=$("totalVoters"+a).innerHTML+" votes casted"}function validate(a){if(a.id=="frmDetailed"){if(a.dt.value.blank()){alert("Please select an approximate date of restaurant table reservation.");return false}if(a.name.value=="Restuarant name"){a.name.value=""}if(a.area.value=="Locality"){a.area.value=""}}if(a.id=="frmQuick"){if(a.name.value=="Restuarant name"){a.name.value=""}if(a.area.value=="Locality"){a.area.value=""}}}function sendMail(){if(document.getElementById("mailfromlist").value.blank()){$("mailmsg").update("please input your email ID in from field");$("mailmsg").show();return}if(!eMailCheck(trim(document.getElementById("mailfromlist").value))){$("mailmsg").update("Please input a valid email in from field");$("mailmsg").show();return}if(document.getElementById("mailtolist").value.blank()){$("mailmsg").update("please input your friends email ID in to field");$("mailmsg").show();return}if(trim(document.getElementById("mailtolist").value)!=""){var e=trim(document.getElementById("mailtolist").value);var h=e.split(",");for(var d=0;d<h.length;d++){if(!eMailCheck(h[d])){$("mailmsg").update("Please input a valid email in from field");$("mailmsg").show();return}}}if(document.getElementById("mailsubject").value.blank()){$("mailmsg").update("please input a subject of the mail");$("mailmsg").show();return}if(document.getElementById("mailmessage").value.blank()){$("mailmsg").update("please provide a message.");$("mailmsg").show();return}$("mailmsg").hide();var a=trim($("mailfromlist").value);var g=trim($("mailtolist").value);var b=trim($("mailsubject").value);var f=trim($("mailmessage").value)+"<br><br>This link has been sent by your friend "+a+" to view the site <a href='http://www.kitnebaje.com/'>www.kitnebaje.com</a><br><br>mail sent from kitnebaje.com";var c=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=sendMail&from="+a+"&to="+g+"&subject="+b+"&mailBody="+f+"&rnd="+Math.random();new Ajax.Request(c,{method:"get",onLoading:function(i){$("mailmsg").update("sending mail...");$("mailmsg").show()},onSuccess:function(j){var i=j.responseText;if(i=="0"){i="sorry, mail could not be sent"}else{i="mail sent successfully"}$("mailmsg").update(i);$("mailmsg").show()},onFailure:function(i){alert("The request failed..")},onException:function(i){alert("Exception")}})}function toggleSearchDisplay(){$("quick").toggle();$("detailed").toggle();if($("detailed").style.display==""){var b="withTiming"}else{var b="withoutTiming"}if(document.getElementById("detailed").style.display==""){document.getElementById("res_menu").style.background="url(images/new_images/menu_active.gif)  bottom no-repeat";document.getElementById("res_menu").style.width="95px";document.getElementById("src_menu").style.background="";document.getElementById("src_menu").style.width="85px";document.getElementById("res_menu_a").style.color="#277097";document.getElementById("src_menu_a").style.color="#fff"}else{if(document.getElementById("quick").style.display==""){document.getElementById("src_menu").style.background="url(images/new_images/menu_active.gif)  bottom no-repeat";document.getElementById("src_menu").style.width="95px";document.getElementById("res_menu").style.background="";document.getElementById("res_menu").style.width="85px";document.getElementById("src_menu_a").style.color="#277097";document.getElementById("res_menu_a").style.color="#fff"}}var a=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=getCityList&type="+b;new Ajax.Request(a,{method:"get",onLoading:function(c){},onSuccess:function(d){var c=d.responseText},onFailure:function(c){alert("The request failed..")},onException:function(c){alert("Exception")}})}function eMailCheck(f){var a="@";var b=".";var e=f.indexOf(a);var c=f.length;var d=f.indexOf(b);if(f.indexOf(a)==-1){return false}if(f.indexOf(a)==-1||f.indexOf(a)==0||f.indexOf(a)==c){return false}if(f.indexOf(b)==-1||f.indexOf(b)==0||f.indexOf(b)==c){return false}if(f.indexOf(a,(e+1))!=-1){return false}if(f.substring(e-1,e)==b||f.substring(e+1,e+2)==b){return false}if(f.indexOf(b,(e+2))==-1){return false}if(f.indexOf(" ")!=-1){return false}return true}function swapClassOnInput(a){var b=document.getElementById(a);if(b.value.blank()||b.value=="your friends email id"){b.className="mailAddressWithText";b.value=""}}function swapClassOnBlur(a){var b=document.getElementById(a);if(b.value.blank()){b.className="mailAddressBlank";b.value="your friends email id"}}function validateInfo(f){if(f.actionButton.value=="Proceed"){if(f.dt.value.blank()){document.getElementById("msg").innerHTML="!! Please fill in the highlighted fields";document.getElementById("date").style.color="#FF0000";document.getElementById("msg").style.display="block";return false}if(document.getElementById("tm")==null){document.getElementById("date").style.color="#666666";document.getElementById("msg").style.display="block";document.getElementById("msg").innerHTML="Click on 'Available slots' button to select time";return false}if(f.tm[0]){for(var c=0;c<f.tm.length;c++){if(f.tm[c].checked){var g=f.tm[c].value+"time";var d=document.getElementById(g).value;var e=document.getElementById(g).options[document.getElementById(g).selectedIndex].text}}}else{var g=document.getElementById("tm").value+"time";var d=document.getElementById(g).value;var e=document.getElementById(g).options[document.getElementById(g).selectedIndex].text}if(f.email){if(f.email.value.blank()){document.getElementById("msg").innerHTML="!! Please fill in your emailID";document.getElementById("emailID").style.color="#FF0000";document.getElementById("msg").style.display="block";return false}else{if(!eMailCheck(f.email.value)){document.getElementById("msg").innerHTML="!! Please fill in a valid email";document.getElementById("emailID").style.color="#FF0000";document.getElementById("msg").style.display="block";return false}}}if(f.mobile){if(f.mobile.value.blank()){document.getElementById("msg").innerHTML="!! Please fill in your mobile number";document.getElementById("mobile").style.color="#FF0000";document.getElementById("msg").style.display="block";return false}else{if(isNaN(f.mobile.value)){document.getElementById("msg").innerHTML="!! Numerics only in phone number";document.getElementById("mobile").style.color="#FF0000";document.getElementById("msg").style.display="block";return false}}}if(f.street){if(f.street.value.blank()){document.getElementById("msg").innerHTML="!! Please fill in your address";document.getElementById("address").style.color="#FF0000";document.getElementById("msg").style.display="block";return false}}var h="You have opted for a table reservation for <b>"+f.pax.value+"</b> people on <b>"+formatDate(new Date(getDateFromFormat(f.dt.value,"y/MM/dd")),"MMM d,y")+"</b> at <b>"+e+"</b>. Click <b>'Reserve'</b> to reserve a table. Note that this reservation will be finally confirmed by the authorized restaurant. The confirmation will be sent on your mobile.<br>To select new timing click <b>'Cancel'</b>.&nbsp;&nbsp;&nbsp;<input type='image' onclick='selectNewTime();' src='images/cancel.gif' border='0' />";$("msg").hide();$("timeSelection").hide();if($("profileInfo")){$("profileInfo").hide()}$("brief").show().update(h);f.dtSelected.value=f.dt.value;document.getElementById("tmSelected").value=d;document.getElementById("paxSelected").value=document.getElementById("pax").value;document.getElementById("actionImage").src="images/reserve.gif";document.getElementById("actionButton").value="Reserve";return false}else{if(f.actionButton.value=="Reserve"){if(f.tm[0]){for(var c=0;c<f.tm.length;c++){if(f.tm[c].checked){var a=f.tm[c].value+"time";var b=document.getElementById(a).value}}}else{var b=document.getElementById("tm").value}if(f.dtSelected.value!=f.dt.value){f.actionButton.value="Proceed";document.getElementById("timing").innerHTML="";document.getElementById("timing").style.display="block";document.getElementById("msg").innerHTML="You have changed the date. Please select time from available slots on this day";$("timeSelection").show();$("brief").hide()}else{if(document.getElementById("tmSelected").value!=b){document.getElementById("timing").style.display="block";document.getElementById("msg").innerHTML="You have changed the time. Please click on 'Proceed' to view your reservation brief";document.getElementById("actionButton").value="Proceed";$("timeSelection").show();$("brief").hide()}else{if(document.getElementById("paxSelected").value!=document.getElementById("pax").value){document.getElementById("timing").style.display="block";document.getElementById("msg").innerHTML="You have changed the number of people. Please click on 'Proceed' to view your reservation brief";document.getElementById("actionButton").value="Proceed";$("timeSelection").show();$("brief").hide()}else{f.submit()}}}}}}function selectNewTime(){$("brief").update();$("brief").hide();if($("profileInfo")){$("profileInfo").show()}$("timeSelection").show();$("actionButton").value="Proceed";$("actionImage").src="images/proceed.gif"}function getTimeOfRestaurant(restID,selDate,time,frm){if(selDate==""){validateInfo(frm);return}else{document.getElementById("date").style.color="#000000";document.getElementById("msg").style.display="none"}if(time!=""){var url=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=getRestaurantTime&dt="+selDate+"&restId="+restID+"&tm="+time+"&rnd="+Math.random()}else{var url=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=getRestaurantTime&dt="+selDate+"&restId="+restID+"&rnd="+Math.random()}new Ajax.Request(url,{method:"get",onLoading:function(transport){$("timing").show().update('Please wait....<img src="'+SITE_ABSOLUTE_URL+'images/ajax-loader.gif" alt="loading..."  />')},onSuccess:function(transport){var dr=transport.responseText;if(dr!="`"){var showtiming="<table border=1 bordercolor='#CCCCCC' cellspacing=0 cellpadding=6>";var x=dr.split("`");var y="";var z="";y=x[0].split("^");z=x[1].split("^");document.getElementById("timing").style.display="block";if(time!=""){var hr=time.split(":");if(eval(hr[0])>5){var dinnerCheckValue="checked='checked'";var lunchCheckValue=""}else{var dinnerCheckValue="";var lunchCheckValue="checked='checked'"}}else{if(y[0]=="lunch"&&z[0]=="dinner"){var dinnerCheckValue="";var lunchCheckValue="checked='checked'"}else{if(y[0]=="lunch"&&z[0]==""){var dinnerCheckValue="";var lunchCheckValue="checked='checked'"}else{if(y[0]==""&&z[0]=="dinner"){var dinnerCheckValue="checked='checked'";var lunchCheckValue=""}}}}if(y[0]=="lunch"&&z[0]=="dinner"){showtiming+="<tr><td width='30' align='center'><input type='radio' name='tm' id='tm' value='lunch' "+lunchCheckValue+" onSelect='valueChanged();'></input></td><td width='90'>Lunch</td><td width='80'>"+y[1]+"</td></tr>";showtiming+="<tr><td align='center'><input type='radio' name='tm' id='tm' value='dinner' "+dinnerCheckValue+" onSelect='valueChanged();'></input></td><td width='90'>Dinner</td><td width='80'>"+z[1]+"</td></tr>";showtiming+="</table>"}else{if(y[0]=="lunch"&&z[0]==""){showtiming+="<tr><td width='30' align='center'><input type='radio' name='tm' id='tm' value='lunch' "+lunchCheckValue+"></input></td><td width='90'>Lunch</td><td width='80'>"+y[1]+"</td></tr>";showtiming+="</table>"}else{if(y[0]==""&&z[0]=="dinner"){showtiming+="<tr><td width='30' align='center'><input type='radio' name='tm' id='tm' value='dinner' "+dinnerCheckValue+"></input></td><td width='90'>Dinner</td><td width='80'>"+z[1]+"</td></tr>";showtiming+="</table>"}}}}else{showtiming="sorry, no timing found. Select another date."}document.getElementById("timing").innerHTML=showtiming},onFailure:function(transport){alert("The request failed..")},onException:function(err){alert("Exception")}})}function setDefaultCity(d,c){$("cityName").value=$("city").options[$("city").selectedIndex].text;$("selected_city_name").innerHTML=$("city").options[$("city").selectedIndex].text;var b=$("city").options[$("city").selectedIndex].text;var a=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=setDefaultCity&cityId="+d+"&cityName="+b+"&rnd="+Math.random();if(c=="do"){document.forms.frmQuick.name.value="";document.forms.frmQuick.area.value=""}new Ajax.Request(a,{method:"get",onLoading:function(e){},onSuccess:function(e){$("restaurantExample1").hide();$("placeExample1").hide();$("restaurantExample2").hide();$("placeExample2").hide();$("restaurantExample3").hide();$("placeExample3").hide();$("restaurantExample4").hide();$("placeExample4").hide();$("restaurantExample6").hide();$("placeExample6").hide();$("restaurantExample9").hide();$("placeExample9").hide();$("restaurantExample10").hide();$("placeExample10").hide();$("restaurantExample13").hide();$("placeExample13").hide();$("restaurantExample15").hide();$("placeExample15").hide();$("restaurantExample"+d).show();$("placeExample"+d).show()},onFailure:function(e){alert("The request failed..")},onException:function(e){alert("Exception")}})}function checkRadioButton(a,b){if(b=="lunch"){if(a.tm[0]){a.tm[0].checked=true}else{a.tm.checked=true}}else{if(b=="dinner"){if(a.tm[0]){a.tm[1].checked=true}else{a.tm.checked=true}}}}function setsearchboxtext(a,b){if(document.getElementById(a).value==""){document.getElementById(a).value=b}}function cleartext(a){document.getElementById(a).value=""}function quickregvalidate(){var a=document.quickreg_form;if(a.salutation.value==""){alert("Please select a salutation!");a.salutation.focus();return false}if(a.firstname.value==""){alert("Please give your first name!");a.firstname.focus();return false}if(a.lastname.value==""){alert("Please give your last name!");a.lastname.focus();return false}if(a.username.value==""){alert("Please give your user name!");a.username.focus();return false}if(a.password.value==""){alert("Password cannot be blank!");a.password.focus();return false}if(a.email.value==""){alert("Please give your E-Mail id!");a.email.focus();return false}if(!a.email.value==""&&!eMailCheck(a.email.value)){alert("Please give a valid E-Mail id.");a.email.focus();return false}}function updateStatus(c,a){var b=SITE_ABSOLUTE_URL+"../restaurantfunctionsajax.php?do=updateBookingStatus&bookingId="+c+"&status="+a+"&rnd="+Math.random();new Ajax.Request(b,{method:"get",onLoading:function(d){},onSuccess:function(d){$("curstatus"+c).innerHTML=d.responseText},onFailure:function(d){alert("The request failed..")},onException:function(d){alert("Exception")}})}function clear1(){form=document.quicksearch;if(form.doctorname.value=="Quick search...."){form.doctorname.value=""}}function toggleStar(a){$(a+"staron").toggle();$(a+"staroff").toggle()}function narrowDown(minimum,maximum){if(eval(maximum)<eval(minimum)){alert("Invalid query. \nYour minimum meal price is higher than maximum meal price. \nPlease keep minimum amount lower.");return}var ckdStar="";if($("12star").checked){ckdStar+="1,2,"}if($("34star").checked){ckdStar+="3,4,"}if($("5star").checked){ckdStar+="5,"}ckdStar=ckdStar.substring(0,ckdStar.length-1);if(ckdStar.length==0){alert("No stars selected. Thus it will hide all restaurants. Please select atleast one category to narrow down");return}if(document.getElementById("hiddenRestaurants").style.display=="none"){var hiddenRestaurants="hidden"}else{var hiddenRestaurants="blocked"}var url=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=narrowDown&min="+minimum+"&max="+maximum+"&stars="+ckdStar+"&hiddenRest="+hiddenRestaurants+"&rnd="+Math.random();new Ajax.Request(url,{method:"get",onLoading:function(transport){},onSuccess:function(transport){dr=transport.responseText;x=dr.split("^");if(x[0]=="found"){if($("partialMatchResults")){$("partialMatchResults").update(x[1])}else{if($("allMatchResults")){$("allMatchResults").update(x[1])}}}else{if($("partialMatchResults")){$("partialMatchResults").update("")}else{if($("allMatchResults")){$("allMatchResults").update("")}}$("notFoundMsgAndAddRest").show()}},onFailure:function(transport){alert("The request failed..")},onException:function(err){alert("Exception")}})}function collapseRestDetail(a){$("expandCollapse"+a).update('<a href="Javascript:void(0);"><img src="'+SITE_ABSOLUTE_URL+'images/new_images/plus.jpg" border="0" onclick="expandRestDetail('+a+');" /></a>');$j("#detail"+a).slideUp("slow")}function expandRestDetail(b){$("expandCollapse"+b).update('<a href="Javascript:void(0);"><img src="'+SITE_ABSOLUTE_URL+'images/new_images/minus.gif" border="0" onclick="collapseRestDetail('+b+');" /></a>');var a=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=getRestDetails&restid="+b+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(c){},onSuccess:function(c){$("detail"+b).update(c.responseText);$j("#detail"+b).slideDown("slow")},onFailure:function(c){alert("The request failed..")},onException:function(c){alert("Exception")}})}function validateNewRestInfo(){if($("rname").value.blank()){$("errMsg").update("Please input the name");$("showErrMsg").show();$("rname").focus();window.location.href="restaurants.php#displayhere";return false}var b=getMultiple($("addcuisine"));if(b==""){$("errMsg").update("Please select available cuisines");$("showErrMsg").show();window.location.href="restaurants.php#displayhere";return false}if($("pureveg").value=="-1"){$("errMsg").update("Please mention whether pure vegetarian or not");$("showErrMsg").show();window.location.href="restaurants.php#displayhere";return false}if($("mealfor2").value=="0"){$("errMsg").update("Please mention average price for meal for 2");$("showErrMsg").show();window.location.href="restaurants.php#displayhere";return false}if($("isAc").value=="-1"){$("errMsg").update("Please mention AC available or not");$("showErrMsg").show();window.location.href="restaurants.php#displayhere";return false}var a=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=addRestaurant&restname="+$("rname").value+"&cuisines="+b+"&veg="+$("pureveg").value+"&liquor="+$("liquor").value+"&meal="+$("mealfor2").value+"&addr="+$("address").value+"&pin="+$("pin").value+"&phone="+$("phone").value+"&cards="+$("ccard").value+"&stars="+$("stars").value+"&isac="+$("isAc").value+"&details="+$("details").value+"&source="+$("source").value+"&city="+$("cityid").value+"&url="+$("website").value+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(c){$("msgAfterAddition").show().update('Adding restaurant...please wait"  />')},onSuccess:function(d){dr=d.responseText;var c=dr.split("^");if(c[0]=="0"){alert("Sorry, problem adding restaurant. Please try again.")}else{if(c[0]=="1"){$("msgAfterAddition").show().update("New restaurant added successfully. It will be available within 7 days.");$("addrestdiv").style.display="none"}else{if(c[0]=="2"){$("msgAfterAddition").show().update("This restaurant is already present. <a href='restaurantsdetail.php?id="+c[1]+'\' style="color:#000000">'+c[2]+"</a>");$("addrestdiv").style.display="none"}}}},onFailure:function(c){alert("The request failed..")},onException:function(c){alert("Exception")}});return false}function getMultiple(b){var a=b.length;var c=0;var d=new Array();for(c=0;c<a;c++){if(b[c].selected){d.push(b[c].value)}}return d}function checkLogin(){var a=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=isLoggedIn&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(b){},onSuccess:function(b){if(b.responseText=="0"){showDiv("div_signin")}else{$j("#addrestdiv").slideDown("slow")}},onFailure:function(b){alert("The request failed..")},onException:function(b){alert("Exception")}})}function loginMe(c,b){var a=SITE_ABSOLUTE_URL+"restaurantfunctionsajax.php?do=loginMe&username="+c+"&pass="+b+"&rnd="+Math.random();new Ajax.Request(a,{method:"get",onLoading:function(d){},onSuccess:function(d){if(d.responseText=="1"){$j("#invalidloginmsg").slideUp("slow");$j("#loginscreen").slideUp("slow");$j("#addrestdiv").slideDown("slow")}else{$("invalidloginmsg").update("<b>invalid username/password</b>");$j("#invalidloginmsg").slideDown("slow")}},onFailure:function(d){alert("The request failed..")},onException:function(d){alert("Exception")}})}function showCommentsToggle(a){if($("action"+a).innerHTML=="... more"){$("moreText"+a).show();$("action"+a).innerHTML="less"}else{$("moreText"+a).hide();$("action"+a).innerHTML="... more"}}function popUpReportBug(a){window.open("reportbug.php?id="+a,"winOne","height=200, width=300, top=300, left=300")}function validateBugReportForm(){if($("myemailid").value.blank()){alert("Please input your email id");return false}if(!eMailCheck($("myemailid").value)){alert("Please input a valid email id");return false}if($("errorText").value.blank()){alert("Please write about the error found");return false}return true}function chkaddevent(){var a=document.addevent;if(a.title.value==""){alert("Event Title can not be blank!");a.title.focus();return false}else{if(a.description.value==""){alert("Event descriptoon can not be blamk!");a.description.focus();return false}else{if(a.st_date.value==""){alert("Atleast give event start date!");a.st_date.focus();return false}else{if(a.city.value==""){alert("Please choose event city!");a.city.focus();return false}}}}}function show_div(a,b){if(b=="show"){$(a).style.display="block"}if(b=="close"){$(a).style.display="none"}}function showAddress(a,b){if(GBrowserIsCompatible()){map=new GMap2($("map_canvas"+b));geocoder=new GClientGeocoder();if(geocoder){$("mapLoading"+b).show();geocoder.getLatLng(a,function(c){if(!c){$("mapLoading"+b).hide();$("locate"+b).show().update("<span style='font-size:10px'>not located on google map</span>")}else{$("mapLoading"+b).hide();$("map_container"+b).show();$("map_canvas"+b).show();map.setCenter(c,13);var d=new GMarker(c);map.addOverlay(d);d.openInfoWindowHtml(a)}})}}}function clearText(a,c){var d=a;var b=document.forms[c];if(a=="cuisine"){b.cuisine.value=""}else{if(a=="area"){b.area.value=""}}}function setText(b,d,f){var e=b;var c=document.forms[d];var a=f;if(b=="name"){c.name.value=f}else{if(b=="area"){c.area.value=f}}};