var wlme_url = "https://www.waitlist.me/"; var wlme_timer; var wlme_time_expired ='
' + '
' + ' ' + '
' + '
' + '
' + '

' + '
' + ' ' + '
' + '
'; var wlme_inactive='
' + '
' + ' Widget Inactive' + '
' + '
' + ' ' + '
' + '
'; var wlme_html_main='
' + '
' + ' Coast ' + '
' + ' ' + ' ' + ' ' + '
' + ' ' + ' ' + ' Make Reservation' + ' ' + ' ' + '
' + ' ' + ' ' + ' ' + '
'; var wlme_html_add ='
' + '
' + ' Add Yourself' + '
' + '
' + ''+ '
' + ' ' + '
' + '
' + ' ' + '
' + '
' + '
' + '
' + ' '+ '
' + '' + ' ' + '' + '
' + ' '+ '
' + ' ' + '
' + ' ' + '
' + '
' + ''+ '
' + '
' + '
Date :
' + '
'+ '
' + '
' + '
' + '
' + '
'+ ' ' + '
'+ '
'+ ' ' + '
'+ '
'+ ' ' + '
'+ '
' + '
' + '
' + '
' + '
'+ ' '+ '
' + '
' + '
'+ '
' + '
' + ' Waitlist Me' + '
' + '
'; var wlme_html_success=''; var wlme_parentelim=document.getElementById('wlme_inclscript').parentElement; var wlme_div = document.createElement("div"); wlme_div.id="wlme_main" wlme_div.style.lineHeight = "normal" if (document.getElementById("wlme_placeholder")) { document.getElementById('wlme_placeholder').parentElement.removeChild(document.getElementById('wlme_placeholder')); } wlme_div.innerHTML=(wlme_html_add + wlme_html_success); wlme_parentelim.appendChild(wlme_div); var wlme_init_seconds = 0; window.onload = function() { if(document.getElementById('wlme_curr_timestamp')) { if(document.getElementById('wlme_curr_timestamp').value!="") { setInterval(wlme_startCurrentTimer, 1000) } } } function wlme_startCurrentTimer(){ wlme_init_seconds = parseInt(wlme_init_seconds) + 1; } function wlme_showAddYourself(cmdType) { document.getElementById('wlme_container').style.display='none'; document.getElementById('wlme_container2').style.display='none'; document.getElementById('wlme_container1').style.display='block'; if(cmdType == 'reservation'){ document.getElementById('wlme_reservationrow').style.display = 'block'; document.getElementById('txthidecurrentcmd').value='reservation'; }else{ document.getElementById('wlme_reservationrow').style.display = 'none'; document.getElementById('txthidecurrentcmd').value='waitlist'; } if(document.getElementById('wlme_name')) { document.getElementById('wlme_name').focus(); } } var countryCodeStr = ''; if(document.getElementById('wlme_country_code_cont')){ var finalCountryCodeStr = ''; document.getElementById('wlme_country_code_cont').innerHTML = finalCountryCodeStr; } var wlme_today = new Date(); wlme_today.setHours(0); wlme_today.setMinutes(0); wlme_today.setSeconds(0); var wlme_todayYear = wlme_today.getFullYear(); var wlme_todayMonth = wlme_today.getMonth(); wlme_todayMonth = parseInt(wlme_todayMonth)+1; if(wlme_todayMonth < 10 ){ wlme_todayMonth = '0'+wlme_todayMonth; } var wlme_todayDate = wlme_today.getDate(); if(wlme_todayDate < 10 ){ wlme_todayDate = '0'+wlme_todayDate; } var wlme_TodayDateStr = wlme_todayYear+'-'+wlme_todayMonth+'-'+wlme_todayDate; var wlme_currDate = new Date(wlme_todayYear,(wlme_todayMonth-1),wlme_todayDate); var wlme_newdate = new Date(wlme_currDate); wlme_newdate.setDate(wlme_newdate.getDate() + 1); var wlme_nd = new Date(wlme_newdate); var wlme_next_year = wlme_nd.getFullYear(); var wlme_next_month = parseInt(wlme_nd.getMonth()+1); if(wlme_next_month < 10 ){ wlme_next_month = '0'+wlme_next_month; } var wlme_next_date = wlme_nd.getDate(); if(wlme_next_date < 10 ){ wlme_next_date = '0'+wlme_next_date; } var nextDateStr = wlme_next_year+'-'+wlme_next_month+'-'+wlme_next_date; var wlme_currDayArr = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; var m_s_jan = "Jan"; var m_s_feb = "Feb"; var m_s_mar = "Mar"; var m_s_apr = "Apr"; var m_s_may = "May"; var m_s_jun = "Jun"; var m_s_jul = "Jul"; var m_s_aug = "Aug"; var m_s_sep = "Sep"; var m_s_oct = "Oct"; var m_s_nov = "Nov"; var m_s_dec = "Dec"; var wlme_currMonArr = [m_s_jan, m_s_feb, m_s_mar, m_s_apr, m_s_may, m_s_jun, m_s_jul, m_s_aug, m_s_sep, m_s_oct, m_s_nov, m_s_dec]; var wlme_currDAY = wlme_nd.getDay(); var wlme_currMON = wlme_nd.getMonth(); var myDayName = (wlme_currDayArr[wlme_currDAY]); var setDayName = myDayName.toLowerCase(); setDayName = setDayName.replace(/\s+/g,''); if(setDayName == "sun"){ } if(setDayName == "mon"){ } if(setDayName == "tue"){ } if(setDayName == "wed"){ } if(setDayName == "thu"){ } if(setDayName == "fri"){ } if(setDayName == "sat"){ } var wlme_next_day_disp_str = myDayName+' '+wlme_currMonArr[wlme_currMON]+' '+wlme_next_date+', '+wlme_next_year; var makeWLME_Date = ''; if(document.getElementById('wlme_date_section_date')){ document.getElementById('wlme_date_section_date').innerHTML = makeWLME_Date; } function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : evt.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } function wlme_addData() { var continueExecution=1; if(document.getElementById('blackout_data') ){ if( document.getElementById('blackout_data').value.replace(/^\s*|\s*$/g,'') != ''){ var blackOutData = document.getElementById('blackout_data').value; var wlme_time_stamp = document.getElementById('wlme_curr_timestamp').value.replace(/^\s*|\s*$/g,''); var wlme_time_Arr = wlme_time_stamp.split(','); var wlme_currsTimes = new Date(wlme_time_Arr[0],wlme_time_Arr[1],wlme_time_Arr[2],wlme_time_Arr[3],wlme_time_Arr[4],wlme_time_Arr[5],0,0); wlme_currsTimes.setSeconds(parseInt(wlme_currsTimes.getSeconds()) + parseInt(wlme_init_seconds)); var wlme_new_Year = wlme_currsTimes.getFullYear(); var wlme_new_month = wlme_currsTimes.getMonth(); var wlme_new_date = wlme_currsTimes.getDate(); var newDateStr = parseInt( parseInt(wlme_new_month)+1)+'-'+parseInt(wlme_new_date)+'-'+parseInt(wlme_new_Year); var todaySetDate = new Date(newDateStr); var blackOutData = document.getElementById('blackout_data').value; var blackOutArr = blackOutData.split('@#@#@#@'); for(var a = 0; a < blackOutArr.length; a++){ var blackOutD = blackOutArr[a]; var blackOutDArr = blackOutD.split('@@'); var chkDateArr = blackOutDArr[0].split('-'); //Y-m-d var chkDateStr = chkDateArr[1]+'-'+chkDateArr[2]+'-'+chkDateArr[0]; var chkDate = new Date(chkDateStr); if(todaySetDate.getTime() == chkDate.getTime()){ if(blackOutDArr[1] == "closed" || blackOutDArr[1] == "no widget display"){ continueExecution = 0; wlme_reload(); } } } } } if(document.getElementById('specific_hour_struct')) { if(document.getElementById('specific_hour_struct').value.replace(/^\s*|\s*$/g,'') != "") { var wlme_hour_struct = document.getElementById('specific_hour_struct').value.replace(/^\s*|\s*$/g,''); var wlme_time_stamp = document.getElementById('wlme_curr_timestamp').value.replace(/^\s*|\s*$/g,''); var wlme_time_Arr = wlme_time_stamp.split(','); var wlme_currsTimes = new Date(wlme_time_Arr[0],wlme_time_Arr[1],wlme_time_Arr[2],wlme_time_Arr[3],wlme_time_Arr[4],wlme_time_Arr[5],0,0); wlme_currsTimes.setSeconds(parseInt(wlme_currsTimes.getSeconds()) + parseInt(wlme_init_seconds)); var wlme_curr_timestamp = wlme_currsTimes.getTime(); /// EQ MAIN var wlme_new_Year = wlme_currsTimes.getFullYear(); var wlme_new_month = wlme_currsTimes.getMonth(); var wlme_new_date = wlme_currsTimes.getDate(); var wlme_new_hour = wlme_currsTimes.getHours(); var wlme_new_minute = wlme_currsTimes.getMinutes(); var wlme_new_seconds = wlme_currsTimes.getSeconds(); var wlme_weekDays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; var wlme_dayName = wlme_weekDays[wlme_currsTimes.getDay()]; var wlme_hour_Arr = wlme_hour_struct.split(","); var wlme_from_Hour = ''; var wlme_to_Hour = ''; var wlme_match_dayValue = ''; var wlme_match_dayHours = ''; for(var wlme_a = 0; wlme_a < wlme_hour_Arr.length; wlme_a++) { var wlme_day_Arr = wlme_hour_Arr[wlme_a].split('-'); if(wlme_day_Arr[0] == wlme_dayName) { wlme_match_dayValue = wlme_day_Arr[1].replace(/^\s*|\s*$/g,''); if(wlme_match_dayValue == 'Specific_Hours'){ if(wlme_day_Arr[2].replace(/^\s*|\s*$/g,'')!='') { wlme_match_dayHours = wlme_day_Arr[2].replace(/^\s*|\s*$/g,'') //alert(wlme_match_dayHours); } } } } if(wlme_match_dayValue == 'All_Day'){ continueExecution=1; }else if(wlme_match_dayValue == 'Closed'){ continueExecution = 0; wlme_reload(); }else{ if(wlme_match_dayHours == ''){ continueExecution=1; }else{ continueExecution = 0; var dayHourArr = wlme_match_dayHours.split('@@'); for(var dh = 0; dh < dayHourArr.length; dh++){ if(continueExecution == 0){ var hourTimeParts = dayHourArr[dh].split('#'); wlme_from_Hour = hourTimeParts[0].replace(/^\s*|\s*$/g,''); wlme_to_Hour = hourTimeParts[1].replace(/^\s*|\s*$/g,''); var wlme_from_Hour_Arr = wlme_from_Hour.split(' '); var wlme_from_ampm = wlme_from_Hour_Arr[1]; var wlme_from_hourMin = wlme_from_Hour_Arr[0].split(":"); var wlme_from_h = wlme_from_hourMin[0]; var wlme_from_m = wlme_from_hourMin[1]; if(wlme_from_ampm == 'pm' && wlme_from_h!='12') { wlme_from_h = parseInt(wlme_from_h) + 12; } var wlme_from_date_stamp = new Date(wlme_new_Year, wlme_new_month, wlme_new_date, wlme_from_h, wlme_from_m, 0).getTime(); var wlme_to_Hour_Arr = wlme_to_Hour.split(' '); var wlme_to_ampm = wlme_to_Hour_Arr[1]; var wlme_to_hourMin = wlme_to_Hour_Arr[0].split(":"); var wlme_to_h = wlme_to_hourMin[0]; var wlme_to_m = wlme_to_hourMin[1]; if(wlme_to_ampm == 'pm' && wlme_to_h!='12') { wlme_to_h = parseInt(wlme_to_h) + 12; } var wlme_to_date_stamp = new Date(wlme_new_Year, wlme_new_month, wlme_new_date, wlme_to_h, wlme_to_m, 59).getTime(); if(wlme_curr_timestamp >= wlme_from_date_stamp && wlme_curr_timestamp <= wlme_to_date_stamp) { continueExecution = 1; }else{ continueExecution = 0; } } } } } if(continueExecution == 0 ) { if (typeof setupWLMEAutoWidth == 'function' || typeof loadHostedWidgetPage == 'function') { wlme_reload("hosted"); }else{ wlme_reload(); } } } } if(continueExecution==1) { if(document.getElementById('wlme_name').value=="") { var showMsg = 0 if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert('You must enter your name.','OK', function(){ $("#wlme_name").focus(); }); showMsg = 1 return; } } if(showMsg == 0) { alert("You must enter your name."); document.getElementById('wlme_name').focus(); return; } } if(document.getElementById('wlme_size').value!="") { var x=document.getElementById('wlme_size').value var regex=/^[0-9]+$/; if (!x.match(regex)) { var showMsg = 0 if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert('You must input number in party size','OK', function(){ $("#wlme_size").focus(); }); showMsg = 1 return; } } if(showMsg == 0) { alert("You must input number in party size"); document.getElementById('wlme_size').focus(); return; } } else if (x<=0 || x>99) { var showMsg = 0 if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert('Party size must be from 1 to 99','OK', function(){ $("#wlme_size").focus(); }); showMsg = 1 return; } } if(showMsg == 0) { alert("Party size must be from 1 to 99"); document.getElementById('wlme_size').focus(); return; } } } else { var showMsg = 0 if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert('You must enter party size.','OK', function(){ $("#wlme_size").focus(); }); showMsg = 1 return } } if(showMsg == 0) { alert("You must enter party size."); document.getElementById('wlme_size').focus(); return } } if(document.getElementById('wlme_phone').value!="") { var x=document.getElementById('wlme_phone').value x = x.replace(/\D/g,'') var regex=/^[0-9]+$/; if (!x.match(regex)) { var showMsg = 0 if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert('You must input only numbers in phone','OK', function(){ $("#wlme_phone").focus(); }); showMsg = 1 return } } if(showMsg == 0) { alert("You must input only numbers in phone"); document.getElementById('wlme_phone').focus(); return; } } else { if(document.getElementById('wlme_country_code') === null) { if (x.length != 10) { var showMsg = 0 if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert('You must enter 10 digit Phone number','OK', function(){ $("#wlme_phone").focus(); }); showMsg = 1 return } } if(showMsg == 0) { alert("You must enter 10 digit Phone number"); document.getElementById('wlme_phone').focus(); return; } } } } } else { var showMsg = 0 if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert('You must enter a phone number.','OK', function(){ $("#wlme_phone").focus(); }); showMsg = 1 return } } if(showMsg == 0) { alert("You must enter a phone number."); document.getElementById('wlme_phone').focus(); return } } var size = document.getElementById('wlme_size').value if (size=="") size=0; var name = document.getElementById('wlme_name').value var currWaitType = document.getElementById('txthidecurrentcmd').value var allToAddEntry = 1; var frm_hour = ''; var to_hour = ''; var match_dayVal = ''; var match_dayHour = ''; var match_fullDayName = ''; var enteryDayHours = ''; var partySizeIssue = 0; var partyMinSizeIssue = 0; var partyMaxSizeIssue = 0; var partySizeRest = 0; var restrictMinSize = 2; var restrictMaxSize = 15; var resPastDateSelection = 0; var bussResLimit = 0; var selAssignment = ''; if(document.getElementById('txthide_assignmentdisplay')){ if (document.getElementById('txthide_assignmentdisplay').value == 'Optional' || document.getElementById('txthide_assignmentdisplay').value == 'Required' ){ var selAssign = document.getElementById('wlme_sel_resource').value; if(document.getElementById('txthide_assignmentdisplay').value == 'Required'){ if(selAssign == ''){ var showMsg = 0 if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert('Please enter Assignments','OK', function(){ $("#txthide_assignmentdisplay").focus(); }); showMsg = 1 return } } if(showMsg == 0) { alert("Please enter Assignments"); document.getElementById('txthide_assignmentdisplay').focus(); return; } } } if(selAssign == ''){ selAssignment = '' }else{ //var assign_arr = selAssign.split('_'); //selAssignment = '&assignment='+assign_arr[1]; selAssignment = '&assignment='+encodeURIComponent(selAssign); } } } var out_size_hour_msg = 'Please choose a time between [start_time] and [end_time].'; var business_close_msg = 'Closed on [DAY]. Please choose another day'; var business_day_ahead = 30 var dayRangeError = 0; if(currWaitType == "reservation") { partySizeRest = document.getElementById('partysizerestriction').value; if(partySizeRest == 'True'){ partySizeRest = 1; }else{ partySizeRest = 0; } restrictMinSize = document.getElementById('businesshour_min_partysize').value; restrictMaxSize = document.getElementById('businesshour_max_partysize').value; business_res_limit = document.getElementById('business_res_limit').value; if(business_res_limit == 'True'){ business_res_limit = 1; }else{ business_res_limit = 0; } out_size_hour_msg = document.getElementById('outside_hour_msg').value; business_day_ahead = document.getElementById('business_days_ahead').value; if(document.getElementById('business_close_msg') && document.getElementById('business_close_msg').value.replace(/^\s*|\s*$/g,'')!=''){ business_close_msg = document.getElementById('business_close_msg').value; } var eta_hours = parseInt(document.getElementById('wlme_res_hour').value); var eta_minutes = parseInt(document.getElementById('wlme_res_minute').value); if(eta_hours==-1){ var showMsg = 0 if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert('You must select Hours.','OK', function(){ $("#wlme_res_hour").focus(); }); showMsg = 1 return } } if(showMsg == 0) { alert("You must select Hours."); document.getElementById('wlme_res_hour').focus(); return false; } } if(eta_minutes==-1){ var showMsg = 0 if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert('You must select Minutes.','OK', function(){ $("#wlme_res_minute").focus(); }); showMsg = 1 return } } if(showMsg == 0) { alert("You must select Minutes."); document.getElementById('wlme_res_minute').focus(); return false; } } eta_hours = parseInt(document.getElementById('wlme_res_hour').value); eta_minutes = parseInt(document.getElementById('wlme_res_minute').value); var eta_ampm = document.getElementById('wlme_res_ampm').value; if (eta_ampm =="am" && parseInt(eta_hours)==12){ eta_hours = 0; } if (eta_ampm =="pm" && parseInt(eta_hours) < 12 ){ eta_hours = parseInt(eta_hours)+parseInt(12); } if(eta_minutes < 10) { eta_minutes = '0'+eta_minutes } var wlme_sel_date = document.getElementById('wlme_res_date').value; var wlmeResDateArr = wlme_sel_date.split('-'); var sundayVar = 'Sunday'; var mondayVar = 'Monday'; var tuesdayVar = 'Tuesday'; var wednesdayVar = 'Wednesday'; var thursdayVar = 'Thursday'; var fridayVar = 'Friday'; var saturdayVar = 'Saturday'; var moreWeekDays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; var moreFullDays = [sundayVar, mondayVar, tuesdayVar, wednesdayVar, thursdayVar, fridayVar, saturdayVar]; var selResDate = wlmeResDateArr[0]+'/'+wlmeResDateArr[1]+'/'+wlmeResDateArr[2]; var selResHour = parseInt(document.getElementById('wlme_res_hour').value); var selResMinute = parseInt(document.getElementById('wlme_res_minute').value); var selResAMPM = document.getElementById('wlme_res_ampm').value; var mySelectedDate = new Date(Date.parse(selResDate+" "+selResHour+":"+selResMinute+" "+selResAMPM) ); /* ########################################################################## */ var selectedGetTime = mySelectedDate.getTime(); var wlme_time_stamp2 = document.getElementById('wlme_curr_timestamp').value.replace(/^\s*|\s*$/g,''); var wlme_time_Arr2 = wlme_time_stamp2.split(','); var wlme_currsTimes2 = new Date(wlme_time_Arr2[0],wlme_time_Arr2[1],wlme_time_Arr2[2],wlme_time_Arr2[3],wlme_time_Arr2[4],wlme_time_Arr2[5],0,0); wlme_currsTimes2.setSeconds(parseInt(wlme_currsTimes2.getSeconds()) + parseInt(wlme_init_seconds)); var wlme_curr_timestamp2 = wlme_currsTimes2.getTime(); var wlme_new_Year2 = wlme_currsTimes2.getFullYear(); var wlme_new_month2 = wlme_currsTimes2.getMonth(); var wlme_new_date2 = wlme_currsTimes2.getDate(); var wlme_new_hour2 = wlme_currsTimes2.getHours(); var wlme_new_minute2 = wlme_currsTimes2.getMinutes(); var wlme_new_seconds2 = wlme_currsTimes2.getSeconds(); var myServerDateTime = new Date(wlme_new_Year2, wlme_new_month2, wlme_new_date2, wlme_new_hour2, wlme_new_minute2, wlme_new_seconds2); var myServerTime = myServerDateTime.getTime(); if(myServerTime > selectedGetTime){ allToAddEntry = 0; resPastDateSelection = 1; } /* ######################################################################### */ var resDay = moreWeekDays[mySelectedDate.getDay()]; match_fullDayName = moreFullDays[mySelectedDate.getDay()]; var businessStruct = document.getElementById('business_hour_structrue').value; var busi_Arr = businessStruct.split(','); for(var a_h = 0; a_h < busi_Arr.length; a_h++) { var day_Arr = busi_Arr[a_h].split('-'); if(day_Arr[0] == resDay) { match_dayVal = day_Arr[1].replace(/^\s*|\s*$/g,''); if(match_dayVal == 'Specific_Hours'){ if(day_Arr[2].replace(/^\s*|\s*$/g,'')!='') { match_dayHour = day_Arr[2].replace(/^\s*|\s*$/g,''); enteryDayHours = match_dayHour; } } } } if(match_dayVal == 'All_Day'){ allToAddEntry = 1; }else if(match_dayVal == 'Closed'){ allToAddEntry = 0; }else { if(match_dayHour == ''){ allToAddEntry = 1; }else{ allToAddEntry = 0; var dayHourArr = match_dayHour.split('@@'); for(var dh = 0; dh < dayHourArr.length; dh++){ if(allToAddEntry == 0){ var hourTimeParts = dayHourArr[dh].split('#'); frm_hour = hourTimeParts[0].replace(/^\s*|\s*$/g,''); to_hour = hourTimeParts[1].replace(/^\s*|\s*$/g,''); var wlme_from_Hour_Arr = frm_hour.split(' '); var wlme_from_ampm = wlme_from_Hour_Arr[1]; var wlme_from_hourMin = wlme_from_Hour_Arr[0].split(":"); var wlme_from_h = wlme_from_hourMin[0]; var wlme_from_m = wlme_from_hourMin[1]; var wlme_from_date_stamp = new Date(Date.parse(selResDate+" "+wlme_from_h+":"+wlme_from_m+" "+wlme_from_ampm) ); if(to_hour.trim() == '12:00 am'){ to_hour = '12:00 pm'; } var wlme_to_Hour_Arr = to_hour.split(' '); var wlme_to_ampm = wlme_to_Hour_Arr[1]; var wlme_to_hourMin = wlme_to_Hour_Arr[0].split(":"); var wlme_to_h = wlme_to_hourMin[0]; var wlme_to_m = wlme_to_hourMin[1]; var wlme_to_date_stamp = new Date(Date.parse(selResDate+" "+wlme_to_h+":"+wlme_to_m+" "+wlme_to_ampm) ); if(mySelectedDate >= wlme_from_date_stamp && mySelectedDate <= wlme_to_date_stamp) { allToAddEntry = 1; }else{ allToAddEntry = 0; } } } } } var wlme_curr_timezone = document.getElementById('wlme_res_timezone').value; var wlme_eta_time = wlme_sel_date+' '+eta_hours+':'+eta_minutes+':00'; var moreCMDType = "&estimated_arrival_time="+wlme_eta_time+"&currtimezone="+wlme_curr_timezone; if(document.getElementById('wlme_size')) { var currPartySize = document.getElementById('wlme_size').value; currPartySize = parseInt(currPartySize); if(partySizeRest == 1 && currPartySize> 0){ if(currPartySize < parseInt(restrictMinSize) || currPartySize > parseInt(restrictMaxSize) ){ partySizeIssue = 1; allToAddEntry = 0; } if(currPartySize < parseInt(restrictMinSize)){ partyMinSizeIssue = 1; } if(currPartySize > parseInt(restrictMaxSize)){ partyMaxSizeIssue = 1; } } } if(document.getElementById('business_days_ahead') && document.getElementById('business_days_ahead').value.replace(/^\s*|\s*$/g,'')!=''){ if(business_res_limit == 1) { business_day_ahead = parseInt(business_day_ahead); var todayDateObj = new Date(); var todayFullYear = todayDateObj.getFullYear(); var todayCurrMonth = todayDateObj.getMonth(); todayCurrMonth = parseInt(todayCurrMonth) + 1; var todayCurrDate = todayDateObj.getDate(); var todayDateStr = todayFullYear+"/"+todayCurrMonth+"/"+todayCurrDate; var todayD = new Date(Date.parse(todayDateStr)); var dayAfter = new Date(todayD); if(parseInt(business_day_ahead) >0 ){ dayAfter.setDate(dayAfter.getDate() + parseInt(business_day_ahead)); dayAfter.setHours(23); dayAfter.setMinutes(59); dayAfter.setSeconds(59); if( mySelectedDate > dayAfter){ dayRangeError = 1; allToAddEntry = 0; } }else{ if(parseInt(business_day_ahead) == 0 ){ var dayAfter = new Date(); dayAfter.setHours(23); dayAfter.setMinutes(59); dayAfter.setSeconds(59); if( mySelectedDate > dayAfter){ dayRangeError = 1; allToAddEntry = 0; } } } } } if(document.getElementById('blackout_data') ){ if(document.getElementById('blackout_data').value.replace(/^\s*|\s*$/g,'') != ''){ var blackOutData = document.getElementById('blackout_data').value; var blackOutDataArray = blackOutData.split('@#@#@#@'); var selDateArray = wlme_sel_date.split('-'); //Y-m-d var selDateMatch = new Date(selDateArray[1]+'-'+selDateArray[2]+'-'+selDateArray[0]) ; for(var b = 0; b < blackOutDataArray.length; b++){ var bParts = blackOutDataArray[b].split('@@'); var bDateArray = bParts[0].split('-'); //Y-m-d var chkDateStr = bDateArray[1]+'-'+bDateArray[2]+'-'+bDateArray[0]; var chkDate = new Date(chkDateStr); if(selDateMatch.getTime() == chkDate.getTime()){ var bType = bParts[1]; if (bType == "closed" || bType == "no reservations"){ allToAddEntry = 0; var errorDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; var errorDayName = errorDays[chkDate.getDay()]; /*var blackDayErrorMsg = "Sorry, we aren't accepting reservations for "+errorDayName+", "+chkDateStr.replace(/-/gi,'/'); */ var blackDayErrorMsg = "Sorry, we aren't accepting reservations for [DAY_NAME], [party_date]"; blackDayErrorMsg = blackDayErrorMsg.replace('[DAY_NAME]', errorDayName); blackDayErrorMsg = blackDayErrorMsg.replace('[party_date]', chkDateStr.replace(/-/gi,'/')); if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert(blackDayErrorMsg,'OK', function(){ }); }else{ alert(blackDayErrorMsg); } }else{ alert(blackDayErrorMsg); } return; } } } } } }else{ var moreCMDType = "&estimated_arrival_time="; } if(resPastDateSelection == 1){ allToAddEntry = 0; } if(allToAddEntry == 0){ if(resPastDateSelection == 1){ var pastDateSelectionIssue = 'Please select valid future date time'; if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert(pastDateSelectionIssue,'OK', function(){ }); }else{ alert(pastDateSelectionIssue); } }else{ alert(pastDateSelectionIssue); } } else{ if(dayRangeError == 1){ var advanceDayMsg = "You can only make a reservation [number_of_days] days in advance"; advanceDayMsg = advanceDayMsg.replace('[number_of_days]', business_day_ahead); if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert(advanceDayMsg,'OK', function(){ }); }else{ alert(advanceDayMsg); } }else{ alert(advanceDayMsg); } }else { if(partySizeIssue == 1) { var partyMinMsgIssue = 'Reservations are limited to groups of more than [min_partysize] people'; partyMinMsgIssue = partyMinMsgIssue.replace('[min_partysize]', restrictMinSize); var partyMaxMsgIssue = 'Reservations are limited to groups of less than [max_partysize] people'; partyMaxMsgIssue = partyMaxMsgIssue.replace('[max_partysize]', restrictMaxSize); if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { if( partyMinSizeIssue == 1){ jAlert(partyMinMsgIssue,'OK', function(){ }); } if(partyMaxSizeIssue == 1){ jAlert(partyMaxMsgIssue,'OK', function(){ }); } }else{ if( partyMinSizeIssue == 1){ alert(partyMinMsgIssue); } if(partyMaxSizeIssue == 1){ alert(partyMaxMsgIssue); } } }else{ if( partyMinSizeIssue == 1){ alert(partyMinMsgIssue); } if(partyMaxSizeIssue == 1){ alert(partyMaxMsgIssue); } } } else { if(match_dayVal == 'Closed'){ if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { business_close_msg = business_close_msg.replace('[DAY]', match_fullDayName); jAlert(business_close_msg,'OK', function(){ }); }else{ business_close_msg = business_close_msg.replace('[DAY]', match_fullDayName); alert(business_close_msg); } }else{ business_close_msg = business_close_msg.replace('[DAY]', match_fullDayName); alert(business_close_msg); } }else{ var dateObj1 = new Date(); var fullYear1 = dateObj1.getFullYear(); var currMonth1 = dateObj1.getMonth(); currMonth1 = parseInt(currMonth1) + 1; var currDate1 = dateObj1.getDate(); var dateStr1 = fullYear1+"/"+currMonth1+"/"+currDate1; var strArr1 = enteryDayHours.split('@@'); var myHourLists1 = new Array(); for(var s = 0; s < strArr1.length; s++){ var stHourArr1 = strArr1[s].split('#'); var stHour1 = stHourArr1[0].trim(); var setDate1 = new Date(Date.parse(dateStr1+" "+stHour1)); setDate1 = setDate1.getTime(); myHourLists1.push({name: strArr1[s].trim(), val: setDate1}); } myHourLists1.sort(function(a,b) { return a.val - b.val; }); var newFromToHTML = ''; for(var a = 0; a < myHourLists1.length; a++){ if(newFromToHTML == ''){ newFromToHTML = myHourLists1[a].name; }else{ newFromToHTML += '@@'+myHourLists1[a].name; } } enteryDayHours = newFromToHTML; enteryDayHours = enteryDayHours.replace(/#/g, ' and '); enteryDayHours = enteryDayHours.replace(/@@/g, ' or '); enteryDayHours = enteryDayHours.replace(/12:00 am/g, '12:00 pm'); out_size_hour_msg = out_size_hour_msg.replace('[start_time] and [end_time]', enteryDayHours); out_size_hour_msg = out_size_hour_msg.replace('[start_time] [m_and] [end_time]', enteryDayHours); if (typeof jQuery != 'undefined') { if(typeof jAlert != 'undefined') { jAlert(out_size_hour_msg,'OK', function(){ }); }else{ alert(out_size_hour_msg); } }else{ alert(out_size_hour_msg); } } } } } }else { var phone = ''; var phone = document.getElementById('wlme_phone').value; phone = phone.replace(/\D/g,''); if(document.getElementById('wlme_country_code')){ var coutryC = document.getElementById('wlme_country_code').value; coutryC = coutryC.replace(/^\s*|\s*$/g,''); phone = "(%2B"+coutryC+")"+phone; } var notes = '' if(document.getElementById('wlme_notes') ) { notes = document.getElementById('wlme_notes').value } var script = document.createElement('script'); checkAddHosted = 0; script.onload = function() { if (typeof setupWLMEAutoWidth == 'function') { checkAddHosted = 1; } } script.src = wlme_url+'api/add_party_remotely_widget?size='+size+'&name='+encodeURIComponent(name)+'&phone='+phone+'¬es='+encodeURIComponent(notes)+moreCMDType+'&place_id=7334930026'+selAssignment; document.body.appendChild(script); if(document.getElementById('wlme_container')) { document.getElementById('wlme_container').style.display='none'; } document.getElementById('wlme_container2').style.display='block'; document.getElementById('wlme_container1').style.display='none'; if(currWaitType == "reservation") { var eta_msg_ = document.getElementById('waitlist_eta_confirm_msg').value; if(eta_msg_.indexOf('[') > -1 && eta_msg_.indexOf(']') > -1) { eta_msg_ = eta_msg_.replace('[size]', ''+currPartySize+''); var wlme_sel_dateArr = wlme_sel_date.split('-'); var new_wlme_sel_date = wlme_sel_dateArr[1]+'-'+wlme_sel_dateArr[2]+'-'+wlme_sel_dateArr[0]; if(eta_hours > 12){ eta_hours = parseInt(eta_hours) - 12; } eta_msg_ = eta_msg_.replace('[eta]', ''+new_wlme_sel_date+' '+eta_hours+':'+eta_minutes+' '+eta_ampm+''); }else{ } document.getElementById('wlme_req_sent_msg').innerHTML = eta_msg_; }else { if(document.getElementById('set_auto_auto_add_pref') || document.getElementById('set_auto_auto_add_pref').value == 'disabled'){ var myPhone = '(251) 224-3600'; myPhone = myPhone.replace('(',''); myPhone = myPhone.replace(')',''); myPhone = myPhone.replace(' ','-'); var m_here = 'here'; var waitMsg = "You've been added to the waitlist at Coast ("+myPhone+"). Visit here to check your place in line."; if(document.getElementById('txthide_widgetconfirm_msg') && document.getElementById('txthide_widgetconfirm_msg').value != ''){ waitMsg = document.getElementById('txthide_widgetconfirm_msg').value; } waitMsg = waitMsg.replace('[link]', m_here); document.getElementById('wlme_req_sent_msg').innerHTML = waitMsg; if(document.getElementById('hide_auto_refresh_widget')) { if( document.getElementById('hide_auto_refresh_widget').value == "True"){ if (typeof setupWLMEAutoWidth == 'function' || typeof loadHostedWidgetPage == 'function') { wlme_timer=setTimeout('wlme_reload("hosted")', 7000); }else{ wlme_timer=setTimeout('wlme_reload()', 7000); } } } } else { if (typeof setupWLMEAutoWidth == 'function' || typeof loadHostedWidgetPage == 'function') { wlme_timer=setTimeout('wlme_reload("hosted")', 7000); }else{ wlme_timer=setTimeout('wlme_reload()', 7000); } } } } }else { if (typeof setupWLMEAutoWidth == 'function' || typeof loadHostedWidgetPage == 'function') { wlme_reload("hosted"); }else{ wlme_reload(); } } } function wlme_callResponseInfo(results) { if(results.requesttype == null){ var reloadPage = 1; if (results.newpartyid == null){ if(results.partyrequrestid == null){ if (typeof setupWLMEAutoWidth == 'function' || typeof loadHostedWidgetPage == 'function') { wlme_timer=setTimeout('wlme_reload("hosted")', 7000); }else{ wlme_timer=setTimeout('wlme_reload()', 7000); } }else{ var parRequestId = results.partyrequrestid; var linkURL = 'https://www.waitlist.me/n/7334930026?q='+parRequestId; } }else{ var newPartyId = results.newpartyid; var linkURL = 'https://www.waitlist.me/n/7334930026?'+newPartyId; } var myPhone = '(251) 224-3600'; myPhone = myPhone.replace('(',''); myPhone = myPhone.replace(')',''); myPhone = myPhone.replace(' ','-'); var m_here = 'here'; var waitMsg = "You've been added to the waitlist at Coast ("+myPhone+"). Visit here to check your place in line."; if(document.getElementById('txthide_widgetconfirm_msg') && document.getElementById('txthide_widgetconfirm_msg').value != ''){ waitMsg = document.getElementById('txthide_widgetconfirm_msg').value; } waitMsg = waitMsg.replace('[link]', ""+m_here+""); document.getElementById('wlme_req_sent_msg').innerHTML = waitMsg; if(document.getElementById('hide_auto_refresh_widget')) { if( document.getElementById('hide_auto_refresh_widget').value == "True"){ if (typeof setupWLMEAutoWidth == 'function' || typeof loadHostedWidgetPage == 'function') { wlme_timer=setTimeout('wlme_reload("hosted")', 7000); }else{ wlme_timer=setTimeout('wlme_reload()', 7000); } } } if(document.getElementById('widget_html_area')){ document.getElementById('widget_html_area').style.display = 'none'; } if(document.getElementById('confirm_html_area')){ document.getElementById('confirm_html_area').style.display = 'block'; } } } function wlme_reload(chkHosted) { if(document.getElementById('wlme_curr_timestamp')) { if(document.getElementById('wlme_curr_timestamp').value!="") { wlme_init_seconds = 0; } } var chkHosted = (chkHosted == null) ? '' : chkHosted; if(chkHosted == 'hosted') { window.location.reload(); }else { clearTimeout(wlme_timer); var offsetHeight = document.getElementById('wlme_main').offsetHeight; var offsetWidth = document.getElementById('wlme_main').offsetWidth; var parentelim=document.getElementById('wlme_inclscript').parentElement; var div = document.createElement("div"); div.id="wlme_placeholder" div.style.height = offsetHeight + "px"; div.style.width = offsetWidth + "px"; document.getElementById('wlme_inclscript').parentElement.removeChild(document.getElementById('wlme_inclscript')); document.getElementById('wlme_main').parentElement.removeChild(document.getElementById('wlme_main')); parentelim.appendChild(div); var script = document.createElement('script'); script.id= 'wlme_inclscript'; script.onload = function() { if (typeof setupWLMEAutoWidth == 'function') { setupWLMEAutoWidth(); } } script.src = wlme_url+'load_widget/?wg=7586030268'; parentelim.appendChild(script); if(document.getElementById('confirm_html_area')){ document.getElementById('confirm_html_area').style.display = 'none'; } if(document.getElementById('widget_html_area')){ document.getElementById('widget_html_area').style.display = 'block'; } } }