﻿
var mapOrder=null;var cGpsX;var cGpsY;var rGpsX;var rGpsY;var tGpsX;var tGpsY;var iCour;var iRest;var iTarg;function bo_setupMap(show,docId,iconCourier,iconRest,iconTarget){try{var d=$get('dOrderMapPopup');if(show=='true'&&GBrowserIsCompatible()){iCour=iconCourier;iRest=iconRest;iTarg=iconTarget;d.style.display="block";var pos=getCenterPosition();d.style.left=(pos[0]-320)+'px';d.style.top=(pos[1]-240)+'px';mapOrder=new GMap2($get("dOrderMap"));mapOrder.addControl(new GLargeMapControl());mapOrder.enableDoubleClickZoom();bo_CallServer(docId,'');interval=window.setInterval("bo_CallServer("+docId+",'')",300000);}
else
{d.style.display="none";window.clearInterval(interval);}}
catch(everything){alert('Map was not refreshed properly. Refresh page.');}}
function bo_refreshMap()
{mapOrder.setCenter(bo_getMapCenter(),14);bo_zoomOutMap();mapOrder.clearOverlays();mapOrder.addOverlay(createMarker(rGpsY,rGpsX,iRest,23));var lbl=$get('dOrderMapPopup').getElementsByTagName('span')[0];if(cGpsX!=0&&cGpsY!=0){mapOrder.addOverlay(createMarker(cGpsY,cGpsX,iCour,16))
lbl.style.display="none";}
else{lbl.style.display="block";}
mapOrder.addOverlay(createMarker(tGpsY,tGpsX,iTarg,23));}
function bo_getMapCenter(){var x=0;var y=0;if(cGpsX!=0&&cGpsY!=0){x=(eval(rGpsX)+eval(tGpsX)+eval(cGpsX))/3
y=(eval(rGpsY)+eval(tGpsY)+eval(cGpsY))/3}
else{x=(eval(rGpsX)+eval(tGpsX))/2
y=(eval(rGpsY)+eval(tGpsY))/2}
return new GLatLng(y,x);}
function bo_zoomOutMap(){i=14;while
(!mapOrder.getBounds().contains(new GLatLng(tGpsY,tGpsX))||!mapOrder.getBounds().contains(new GLatLng(rGpsY,rGpsX))||(cGpsX!=0&&cGpsY!=0&&!mapOrder.getBounds().contains(new GLatLng(cGpsY,cGpsX)))||(i==0))
{mapOrder.zoomOut();i--;}}
function GetServerData(){}
function bo_ReceiveServerData(rValue){var rArray=rValue.split('_');cGpsX=rArray[0];cGpsY=rArray[1];tGpsX=rArray[2];tGpsY=rArray[3];rGpsX=rArray[4];rGpsY=rArray[5];bo_refreshMap('true');}
function bUP(id,flg,id2)
{var obj=$get(id);var obj2=$get(id2);if(flg=='1')
{obj.style.display='block';}
else if(flg=='0')
{obj.style.display='none';}
var elementBounds=Sys.UI.DomElement.getBounds(obj);var elementBounds2=Sys.UI.DomElement.getBounds(obj2);obj.style.left=elementBounds2.x-300;obj.style.top=elementBounds2.y+20;}
function bbEndCallback(hfExcId,hfBCId,divToHide)
{if($get(hfExcId).value!='')
{cIDcpErrors.PerformCallback('TXT_'+$get(hfExcId).value);$get(hfExcId).value='';}
if($get(hfBCId).value==''||$get(hfBCId).value=='0')
{$get(divToHide).style.display="none";if($get('dOverBoxes')!=null&&$get('ctl00_hcBO_cpnlBO_hfAll').value=='0')
{$get('dOverBoxes').style.display="";}}
else
{$get(divToHide).style.display="block";$get('dOverBoxes').style.display="none";}}
function ddlChangeFromMouse(param)
{if(param.keyCode!=Sys.UI.Key.tab)
return false;}
function uplEndCallback(s,e,resultHfId,cplCIN,popupExtenderId){if($get(resultHfId)!=null){var result=$get(resultHfId).value;var tabResultPars=result.split('Ç')[0].split('_');if(tabResultPars.length<5)
return;var callbackPanel=eval(cplCIN);var popupExtender=$find(popupExtenderId);if(tabResultPars[3]=="3")
ccIDcpnlBasketBookings.PerformCallback('REFRESH');if(result.split('Ç')[1]!="false"){if(popupExtender!=null)
popupExtender.hide();cIDcpErrors.PerformCallback(result.split('Ç')[1]);return false;}
if(tabResultPars[2]=="true"&&(tabResultPars[3]=="1"||tabResultPars[3]=="2")&&popupExtender!=null)
popupExtender.show();if(tabResultPars[4]=="true"&&popupExtender!=null){popupExtender.hide();ccIDcpnlBasketBookings.PerformCallback('REFRESH');}}}
function addToOutlook(subject,location,datetime,wrongBrowserMessage,errorMessage)
{var browserName=navigator.appName;if(browserName!="Microsoft Internet Explorer")
{cIDcpErrors.PerformCallback('TXT_'+wrongBrowserMessage);}
var app;var item;try{app=new ActiveXObject("Outlook.Application");item=app.CreateItem(1);item.Subject=subject;item.Location=location;item.Start=datetime;item.ReminderMinutesBeforeStart=60;item.Duration=60;item.Save();}
catch(e)
{cIDcpErrors.PerformCallback('TXT_'+errorMessage);}}
var panel=0;function basketOps(id1,id2,id3,id4,idA,idW,valA,valW)
{if($get(id1)!=null&&$get(idA)!=null){$get(id1).innerHTML=valA+' ('+$get(idA).value+')';}
if($get(id2)!=null&&$get(idA)!=null){$get(id2).innerHTML=valA+' ('+$get(idA).value+')';}
if($get(id3)!=null&&$get(idW)!=null){$get(id3).innerHTML=valW+' ('+$get(idW).value+')';}
if($get(id4)!=null&&$get(idW)!=null){$get(id4).innerHTML=valW+' ('+$get(idW).value+')';}}
function fillMove()
{window.location.href='/HorecaPortal/pageFillData.aspx';}
var timerID=0;var txtObj;var divObj;var txtVal="";var selLst=0;function setValues(id,id1,id2)
{txtObj=$get(id);divObj=$get(id1);cityObj=$get(id2);txtVal="";selLst=0;}
function SendRequest()
{Cities.GetCompletionListStr(txtObj.value,1000,cityObj.options[cityObj.selectedIndex].value,OnComplete,OnError,OnTimeOut);}
function OnComplete(arg)
{divObj.innerHTML="<ul id=\"aa\">";var tempArr=arg.split(',');for(var i=1;i<tempArr.length-1;i++)
divObj.innerHTML+="<li onmouseover=\"this.style.backgroundColor='red';\" onmouseout=\"this.style.backgroundColor='transparent';\" onclick=\"txtObj.value=this.innerHTML;txtObj.focus();divObj.style.display='none';\">"+tempArr[i]+"</li>";divObj.innerHTML+="</ul>";}
function OnTimeOut(arg)
{}
function OnError(arg)
{}
function streetsStart()
{if(txtObj.value.length>=2)
{if(txtVal!=txtObj.value)
{SendRequest();divObj.style.position='absolute';divObj.style.width='200px';divObj.style.zIndex=10000;divObj.style.display='block';divObj.style.backgroundColor='white';divObj.style.borderColor='black';divObj.style.borderWidth='1px';divObj.style.cursor='default';}
else
streetsStop();}}
function streetsStop()
{divObj.style.display='none';}
function tabsChange(id0,id1,id2,id3,id4,id5,u1,u2)
{if($get(id4)!=null)
{$get(id4).style.backgroundImage='url(./'+u1+')';}
if($get(id5)!=null)
{$get(id5).style.backgroundImage='url(./'+u2+')';}
if($get(id0).style.display=='block')
{if($get(id0)!=null)
{$get(id0).style.display='none';$get(id0).style.fontWeight='bold';}
if($get(id1)!=null)
{$get(id1).style.display='block';$get(id1).style.fontWeight='bold';}
if($get(id2)!=null)
{$get(id2).style.display='block';$get(id2).style.fontWeight='normal';}
if($get(id3)!=null)
{$get(id3).style.display='none';$get(id3).style.fontWeight='normal';}}}
function predAddPopUp(ind)
{if($get('ctl00_hcBO_hcPU_cplPU_IDcmbAddr').selectedIndex==0)
{$get('ctl00_hcBO_hcPU_cplPU_IDcmbCities').selectedIndex=ind;$get('ctl00_hcBO_hcPU_cplPU_IDtxtStreet').value='';$get('ctl00_hcBO_hcPU_cplPU_IDtxtStreet').focus();$get('ctl00_hcBO_hcPU_cplPU_IDtxtHouseNo').value='';$get('ctl00_hcBO_hcPU_cplPU_IDtxtHouseNo').focus();$get('ctl00_hcBO_hcPU_cplPU_IDtxtHouseNo').blur();}
else
{var obj=$get('ctl00_hcBO_hcPU_cplPU_IDcmbAddr');var vals=obj.options[obj.selectedIndex].value.split('_');$get('ctl00_hcBO_hcPU_cplPU_IDcmbCities').selectedIndex=eval(vals[2]);$get('ctl00_hcBO_hcPU_cplPU_IDtxtStreet').value=vals[1];$get('ctl00_hcBO_hcPU_cplPU_IDtxtHouseNo').value=vals[3];}}
function hideControl(id,d){var obj=$get(id);if(d==0){if(obj!=null){obj.style.display='none';}}
else if(d==1){obj.style.display='block';}}
function hCtrl(id){var obj=cF(id);if(obj!=null){if(obj.style.display=='none'){obj.style.display='';}
else if(obj.style.display==''){obj.style.display='none';}}}
function ShowMeNow(id){var obj=$get(id);if(obj!=null){obj.style.height="250px";}}
function HideMeNow(id){var obj=$get(id);if(obj!=null){obj.style.height="0px";}}
function HideShowMe(id1,id2,id3){var obj1=$get(id1);var obj2=$get(id2);if(obj1.style.display=='none'){var obj=$get(id3);if(obj!=null){obj.style.height="0px";}}
else if(obj2.style.display=='none'){var obj=$get(id3);if(obj!=null){obj.style.height="250px";}}}
function clearCityChange(id1,id2,id3,val1,val2,val3,id4){if($get(id1)!=null){$get(id1).value=val1;};if($get(id3)!=null){$get(id3).value=val3;}if($get(id4)!=null){$get(id4).selectedIndex=0;}}
function bookingValidation(id){var re=/^\d(\d)?(\d)?$/;if($get(id).value.search(re)==-1){$get(id).value=$get(id).value.substring(0,$get(id).value.length-1);}}
function bookingCalculation(id,calVal){if($get(id).value==''||$get(id).value=='0'){$get(id).value=calVal;}}
function restPUF(val){var obj1=cF('ctl00_MP_IDhcS_IDtxtRN');if(obj1!=null&&cF('ctl00_MP_IDhcS_IDdivV1')!=null&&cF('ctl00_MP_IDhcS_IDdivV1').style.display==''){obj1.value=val;}
var obj2=cF('ctl00_MP_IDhcS_IDtxtRNRS');if(obj2!=null&&cF('ctl00_MP_IDhcS_IDdivV3')!=null&&cF('ctl00_MP_IDhcS_IDdivV3').style.display==''){obj2.value=val;}
var obj3=cF('ctl00_MP_IDhcS_IDtxtRNB');if(obj3!=null&&cF('ctl00_MP_IDhcS_IDdivV2')!=null&&cF('ctl00_MP_IDhcS_IDdivV2').style.display==''){obj3.value=val;}}
function clearWhole(cId1,cId2,cId3)
{$get('ctl00_MP_IDhcS_IDtxtPreferencesAdd').value='';if($get('ctl00_MP_IDhcS_IDdivV1')!=null&&$get('ctl00_MP_IDhcS_IDdivV1').style.display==''){$get('ctl00_MP_IDhcS_IDtxtPO').disabled=false;$get('ctl00_MP_IDhcS_IDtxtPO').value='';$get('ctl00_MP_IDhcS_IDtxtPO').disabled=true;$get('ctl00_MP_IDhcS_IDcmbCT').selectedIndex=0;$get('ctl00_MP_IDhcS_IDcmbC').selectedIndex=eval(cId1);$get('ctl00_MP_IDhcS_IDcmbA').selectedIndex=0;$get('ctl00_MP_IDhcS_IDtxtRN').value='';$get('ctl00_MP_IDhcS_IDtxtRN').focus();$get('ctl00_MP_IDhcS_IDtxtCN').value='';$get('ctl00_MP_IDhcS_IDtxtCN').focus();$get('ctl00_MP_IDhcS_IDtxtHN').disabled=false;$get('ctl00_MP_IDhcS_IDtxtHN').value='';$get('ctl00_MP_IDhcS_IDtxtHN').focus();$get('ctl00_MP_IDhcS_IDtxtHN').disabled=true;$get('ctl00_MP_IDhcS_IDtxtS').disabled=false;$get('ctl00_MP_IDhcS_IDtxtS').value='';$get('ctl00_MP_IDhcS_IDtxtS').focus();$get('ctl00_MP_IDhcS_IDtxtS').blur();$get('ctl00_MP_IDhcS_IDtxtS').disabled=true;}
else if($get('ctl00_MP_IDhcS_IDdivV2')!=null&&$get('ctl00_MP_IDhcS_IDdivV2').style.display==''){$get('ctl00_MP_IDhcS_IDtxtPB').disabled=false;$get('ctl00_MP_IDhcS_IDtxtPB').value='';$get('ctl00_MP_IDhcS_IDtxtPB').disabled=true;$get('ctl00_MP_IDhcS_IDcmbCTB').selectedIndex=0;$get('ctl00_MP_IDhcS_IDcmbRTB').selectedIndex=0;$get('ctl00_MP_IDhcS_IDcmbBFB').selectedIndex=0;$get('ctl00_MP_IDhcS_IDcmbCB').selectedIndex=eval(cId2);$get('ctl00_MP_IDhcS_IDtxtRNB').value='';$get('ctl00_MP_IDhcS_IDtxtRNB').focus();$get('ctl00_MP_IDhcS_IDtxtRNB').blur();}
else if($get('ctl00_MP_IDhcS_IDdivV3')!=null&&$get('ctl00_MP_IDhcS_IDdivV3').style.display=='')
{$get('ctl00_MP_IDhcS_IDcmbRTRS').selectedIndex=0;$get('ctl00_MP_IDhcS_IDcmbCTRS').selectedIndex=0;$get('ctl00_MP_IDhcS_IDcmbCRS').selectedIndex=eval(cId3);$get('ctl00_MP_IDhcS_IDcmbBFRS').selectedIndex=0;$get('ctl00_MP_IDhcS_IDcmbPCRS').selectedIndex=0;$get('ctl00_MP_IDhcS_IDtxtPB').value='';$get('ctl00_MP_IDhcS_IDtxtPB').focus();$get('ctl00_MP_IDhcS_IDtxtCNRS').value='';$get('ctl00_MP_IDhcS_IDtxtCNRS').focus();$get('ctl00_MP_IDhcS_IDtxtRNRS').value='';$get('ctl00_MP_IDhcS_IDtxtRNRS').focus();$get('ctl00_MP_IDhcS_IDtxtRNRS').blur();}
hideControl('ctl00_MP_IDhcS_pnlPr',0);}
function prefAdd()
{var namePref=$get('ctl00_MP_IDhcS_IDtxtPreferencesAdd').value;$get('ctl00_MP_IDhcS_IDtxtPreferencesAdd').value='';if($get('ctl00_MP_IDhcS_IDdivV1')!=null&&$get('ctl00_MP_IDhcS_IDdivV1').style.display=='')
{$get('ctl00_MP_IDhcS_IDtxtPO').disabled=false;$get('ctl00_MP_IDhcS_IDtxtPO').value=namePref;$get('ctl00_MP_IDhcS_IDtxtPO').disabled=true;var sel1=$get('ctl00_MP_IDhcS_IDcmbCT');var sel2=$get('ctl00_MP_IDhcS_IDcmbC');cIDcpCallbackPrefPopUp.PerformCallback('ADD_PREF1_'+sel1.options[sel1.selectedIndex].value+'_'+$get('ctl00_MP_IDhcS_IDtxtRN').value+'_'+$get('ctl00_MP_IDhcS_IDtxtCN').value+'_'+sel2.options[sel2.selectedIndex].value+'_'+$get('ctl00_MP_IDhcS_IDtxtHN').value+'_'+namePref);}
else if($get('ctl00_MP_IDhcS_IDdivV2')!=null&&$get('ctl00_MP_IDhcS_IDdivV2').style.display=='')
{$get('ctl00_MP_IDhcS_IDtxtPB').disabled=false;$get('ctl00_MP_IDhcS_IDtxtPB').value=namePref;$get('ctl00_MP_IDhcS_IDtxtPB').disabled=true;var sel1=$get('ctl00_MP_IDhcS_IDcmbCTB');var sel2=$get('ctl00_MP_IDhcS_IDcmbRTB');var sel3=$get('ctl00_MP_IDhcS_IDcmbBFB');var sel4=$get('ctl00_MP_IDhcS_IDcmbCB');cIDcpCallbackPrefPopUp.PerformCallback('ADD_PREF2_'+sel1.options[sel1.selectedIndex].value+'_'+$get('ctl00_MP_IDhcS_IDtxtRNB').value+'_'+sel2.options[sel2.selectedIndex].value+'_'+sel3.options[sel3.selectedIndex].value+'_'+sel4.options[sel4.selectedIndex].value+'_'+namePref);}
else if($get('ctl00_MP_IDhcS_IDdivV3')!=null&&$get('ctl00_MP_IDhcS_IDdivV3').style.display=='')
{var sel1=$get('ctl00_MP_IDhcS_IDcmbRTRS');var sel2=$get('ctl00_MP_IDhcS_IDcmbCTRS');var sel3=$get('ctl00_MP_IDhcS_IDcmbCRS');var sel4=$get('ctl00_MP_IDhcS_IDcmbBFRS');var sel5=$get('ctl00_MP_IDhcS_IDcmbPCRS');cIDcpCallbackPrefPopUp.PerformCallback('ADD_PREF3_'+$get('ctl00_MP_IDhcS_IDtxtRNRS').value+'_'+sel1.options[sel1.selectedIndex].value+'_'+sel2.options[sel2.selectedIndex].value+'_'+$get('ctl00_MP_IDhcS_IDtxtCNRS').value+'_'+sel3.options[sel3.selectedIndex].value+'_'+sel4.options[sel4.selectedIndex].value+'_'+sel5.options[sel5.selectedIndex].value+'_'+namePref);}}
function clrPref(id1,id2,id3,id4,id5,id6,val)
{if($get(id1)!=null&&$get(id1).style.display=='')
{$get(id4).disabled=false;$get(id4).value=val;$get(id4).disabled=true;}
else if($get(id2)!=null&&$get(id2).style.display=='')
{$get(id5).disabled=false;$get(id5).value=val;$get(id5).disabled=true;}
else if($get(id2)!=null&&$get(id3).style.display=='')
{$get(id6).disabled=false;$get(id6).value=val;$get(id6).disabled=true;}}
function predAddGlob(ind,idCmbA,idCmbC,idTxtS,idTxtHN){if($get(idCmbA).selectedIndex==0){$get(idCmbC).selectedIndex=ind;$get(idTxtS).value='';$get(idTxtS).focus();$get(idTxtHN).value='';$get(idTxtHN).focus();$get(idTxtHN).blur();}else{var obj=$get(idCmbA);var vals=obj.options[obj.selectedIndex].value.split('_');$get(idCmbC).selectedIndex=eval(vals[2]);$get(idTxtS).value=vals[1];$get(idTxtHN).value=vals[3];}}
function predAddS(ind,txt1,txt2)
{if($get('ctl00_MP_IDhcS_IDcmbA').selectedIndex==0)
{$get('ctl00_MP_IDhcS_IDcmbC').selectedIndex=ind;$get('ctl00_MP_IDhcS_IDtxtS').value=txt1;$get('ctl00_MP_IDhcS_IDtxtS').focus();$get('ctl00_MP_IDhcS_IDtxtHN').value=txt2;$get('ctl00_MP_IDhcS_IDtxtHN').focus();$get('ctl00_MP_IDhcS_IDtxtHN').blur();}
else
{var obj=$get('ctl00_MP_IDhcS_IDcmbA');var vals=obj.options[obj.selectedIndex].value.split('_');$get('ctl00_MP_IDhcS_IDcmbC').selectedIndex=eval(vals[2]);$get('ctl00_MP_IDhcS_IDtxtS').value=vals[1];$get('ctl00_MP_IDhcS_IDtxtHN').value=vals[3];}}
function predAddAll(ind,txt1,txt2,sufix){if($get(sufix+'_IDcmbA').selectedIndex==0){$get(sufix+'_ddlIVRA').selectedIndex=0;$get(sufix+'_lblA').innerHTML="";}
else{var obj=$get(sufix+'_IDcmbA');var vals=obj.options[obj.selectedIndex].value.split('_');$get(sufix+'_ddlIVRA').selectedIndex=eval(vals[4]);$get(sufix+'_lblA').innerHTML=vals[5]+", "+vals[1]+" "+vals[3];}}
function predAdd(ind)
{if($get('ctl00_MP_IDhcS_IDcmbA').selectedIndex==0)
{$get('ctl00_MP_IDhcS_IDcmbC').selectedIndex=ind;$get('ctl00_MP_IDhcS_IDtxtS').value='';$get('ctl00_MP_IDhcS_IDtxtS').focus();$get('ctl00_MP_IDhcS_IDtxtHN').value='';$get('ctl00_MP_IDhcS_IDtxtHN').focus();$get('ctl00_MP_IDhcS_IDtxtHN').blur();}
else
{var obj=$get('ctl00_MP_IDhcS_IDcmbA');var vals=obj.options[obj.selectedIndex].value.split('_');$get('ctl00_MP_IDhcS_IDcmbC').selectedIndex=eval(vals[2]);$get('ctl00_MP_IDhcS_IDtxtS').value=vals[1];$get('ctl00_MP_IDhcS_IDtxtHN').value=vals[3];}}
function predAddRS(ind,srcId,targetId)
{var source=$get(srcId);var target=$get(targetId);if(source.selectedIndex==0)
{target.innerHTML='';}
else
{var vals=source.options[source.selectedIndex].value.split('_');target.innerHTML=vals[1]+', '+vals[3]+' '+vals[4];}}
function restPresMakeRoundness(){$("div[id$=tab0]").add("div[id$=tab0Hdn]").add("div[id$=tab1]").add("div[id$=tab1Hdn]").add("div[id$=tab2]").add("div[id$=tab2Hdn]").add("div[id$=tab3]").add("div[id$=tab3Hdn]").corner({tl:{radius:10},tr:{radius:10},bl:false,br:false,antiAlias:true,autoPad:true,validTags:["div"]});$('div#restPresBox').corner({tl:false,tr:{radius:10},bl:false,br:false,antiAlias:true,autoPad:true,validTags:["div"]});$('div#restPresBoxBtm').corner({tl:false,tr:false,bl:false,br:{radius:10},antiAlias:true,autoPad:true,validTags:["div"]});$('div#restPresOver').corner({tl:{radius:10},tr:{radius:10},bl:false,br:false,antiAlias:true,autoPad:true,validTags:["div"]});$('div#restBottomBoxes').corner({tl:false,tr:false,bl:{radius:10},br:{radius:10},antiAlias:true,autoPad:true,validTags:["div"]});$('div#restBookingConfirmPanel').corner({tl:false,tr:false,bl:{radius:10},br:{radius:10},antiAlias:true,autoPad:true,validTags:["div"]});}
function restPresTabClick(tabNo){$('#restTabs').find('.tabActive').hide();$('#restTabs').find('.tabHidden').show();$('div#restBottomBoxes').hide();$('div[id$=Div0]').add('div[id$=Div1]').add('div[id$=Div2]').add('div[id$=Div3]').add('div#restBottomBoxes').hide();switch(tabNo){case 0:$('div#dPresButtons').show();$('div#dResButtons').hide();$('div[id$=IDtab0Hdn]').hide();$('div[id$=IDtab0]').show();$('div[id$=Div0]').show();IDcbTabSelector.SendCallback('0');break;case 1:$('div#dPresButtons').hide();$('div#dResButtons').show();$('div[id$=IDtab1Hdn]').hide();$('div[id$=IDtab1]').show();$('div[id$=Div1]').show();IDcbTabSelector.SendCallback('1');break;case 2:$('div#dPresButtons').hide();$('div#dResButtons').show();$('div[id$=IDtab2Hdn]').hide();$('div[id$=IDtab2]').show();$('div[id$=Div2]').show();IDcbTabSelector.SendCallback('2');break;default:return false;}}
function previewNotification(bookingPanelId,restaurantDesc){if($("div#"+bookingPanelId+" input[id$=IdTxtNotificationMessage]").val()==""||$("div#"+bookingPanelId+" div[id$=IdDivEmails] div").length==0){cIDcpErrors.PerformCallback("TXT_30027");prgBP.hide();return false;}
GetEmailPreview($("div#"+bookingPanelId+" input:checked").parent().attr("tpl"),$("div#"+bookingPanelId+" span[id$=lblOwnerV]").text(),restaurantDesc,$("div#"+bookingPanelId+" span[id$=lblDateV]").text(),$("div#"+bookingPanelId+" input[id$=IdTxtNotificationMessage]").val());}
function sendNotification(bookingPanelId,restaurantDesc,cbkCin){if($("div#"+bookingPanelId+" input[id$=IdTxtNotificationMessage]").val()==""||$("div#"+bookingPanelId+" div[id$=IdDivEmails] div").length==0){cIDcpErrors.PerformCallback("TXT_30027");prgBP.hide();return false;}
var emails="";$("div#"+bookingPanelId+" div[id$=IdDivEmails] div").each(function(){if(emails!="")
emails+=";";emails+=$(this).find("span").text();});var tplId="0";if($("div#"+bookingPanelId+" input:checked").parent().attr("tplId")!=null){tplId=$("div#"+bookingPanelId+" input:checked").parent().attr("tplId");}
eval(cbkCin).SendCallback("NOTIFY"+"Ç"+
tplId+"Ç"+
emails+"Ç"+
$("div#"+bookingPanelId+" span[id$=lblOwnerV]").text()+"Ç"+
restaurantDesc+"Ç"+
$("div#"+bookingPanelId+" span[id$=lblDateV]").text()+"Ç"+
$("div#"+bookingPanelId+" *[id$=IdTxtNotificationMessage]").val());}
function cbkBookingManagerCallbackComplete(cbkResult,bookingPanelId){$("div#"+bookingPanelId+" div#divS2summaryBottom").hide();$("div#"+bookingPanelId+" div#divS3summaryBottom").show();if(cbkResult.toString().indexOf("SENDOK")>=0){$("div#"+bookingPanelId+" div#divS2summaryBottom").hide();$("div#"+bookingPanelId+" div#divS3summaryBottom").show();$("input[id$=IDibtnChange]").hide();$("div[id$='greyBar']").hide();$("div#"+bookingPanelId+" div#restBookingPanel").show();$("div#"+bookingPanelId+" div#restBookingNotifications").hide();}else if(cbkResult.toString().indexOf("OK")>=0){ccIDcpnlBasketBookings.PerformCallback('REFRESH');$("div#"+bookingPanelId+" div#divS2summaryBottom").hide();$("div#"+bookingPanelId+" div#divS3summaryBottom").show();$("input[id$=IDibtnChange]").hide();$("div[id$='greyBar']").hide();if($("div#"+bookingPanelId+" input[id$=cbx2_1]:checked").length==1){$("div#"+bookingPanelId+" span[id$=lblGratulationsHeaderB]").hide();$("div#"+bookingPanelId+" span[id$=lblGratulationsTextB]").hide();$("div#"+bookingPanelId+" div#restBookingPanel").hide();$("div#"+bookingPanelId+" div#restBookingNotifications").show();}else{$("div#"+bookingPanelId+" div#restBookingPanel").show();$("div#"+bookingPanelId+" div#restBookingNotifications").hide();}}else if(cbkResult.toString().indexOf("ERR")>=0){cIDcpErrors.PerformCallback(cbkResult.split('Ç')[1]);prgBP.hide();return false;}else if(cbkResult.toString().indexOf("TXT")>=0){cIDcpErrors.PerformCallback(cbkResult);prgBP.hide();return false;}}
function changeClick(bookingPanelId){if($("div#"+bookingPanelId+" input[id$=IDtxtPerson]").val()==""||$("div#"+bookingPanelId+" input[id$=IDtxtPhoneNo]").val()==""){$("div#"+bookingPanelId+" span[id$=IdLblValidator]").parent().show();prgBP.hide();return;}else{$("div#"+bookingPanelId+" span[id$=IdLblValidator]").parent().hide();$("div#"+bookingPanelId+" span[id$=lblDateV]").html($("div#"+bookingPanelId+" input[id$=IDtxtC]").val()+" "+$("div#"+bookingPanelId+" select[id$=IDcmbHB]").val()+":"+$("div#"+bookingPanelId+" select[id$=IDcmbHBm]").val());$("div#"+bookingPanelId+" span[id$=lblPerCountV]").html($("div#"+bookingPanelId+" select[id$=IDcmbHMB]").val());$("div#"+bookingPanelId+" span[id$=lblOwnerV]").html($("div#"+bookingPanelId+" input[id$=IDtxtPerson]").val());$("div#"+bookingPanelId+" span[id$=lblPhoneV]").html($("div#"+bookingPanelId+" input[id$=IDtxtPhoneNo]").val());$("div#"+bookingPanelId+" span[id$=lblNotesV]").html($("div#"+bookingPanelId+" *[id$=IDtxtAdnotations]").val());if($("div#"+bookingPanelId+" span[id$=lblNotesV]").html()==""){$("div#"+bookingPanelId+" span[id$=lblNotesV]").html("&nbsp;");}
var features="";$("div#"+bookingPanelId+" div.cbxTF input:checked").each(function(){if(features!="")
features+=", ";features+=$(this).next("label").text();});$("div#"+bookingPanelId+" span[id$=lblPreferencesV]").html(features);$("div#"+bookingPanelId+" div#restBookingConfirmPanel").show();$("input[id$=IDibtnChange]").attr("src",$("input[id$=IDibtnChange]").attr("altUrl"));$("div#"+bookingPanelId+" span[id$=lblGratulationsHeaderB]").show();$("div#"+bookingPanelId+" span[id$=lblGratulationsTextB]").show();$("div#"+bookingPanelId+" div#divS2summaryBottom").show();$("div#"+bookingPanelId+" div#divS3summaryBottom").hide();}
prgBP.hide();}
function sendNewBooking(bookingPanelId,cbkCin){if($("div#"+bookingPanelId+" *[id$=cbx2_3]")[0]!=null&&$("div#"+bookingPanelId+" input[id$=cbx2_3]:checked").length==0){cIDcpErrors.PerformCallback("TXT_30024");prgBP.hide();return false;}
var features="";$("div#"+bookingPanelId+" div.cbxTF input:checked").each(function(){if(features!="")
features+=",";features+=$(this).parent().attr("dataId");});eval(cbkCin).SendCallback("ADDB"+"Ç"+
$("div#"+bookingPanelId+" input[id$=IDtxtC]").val()+"Ç"+
$("div#"+bookingPanelId+" select[id$=IDcmbHB]").val()+"Ç"+
$("div#"+bookingPanelId+" select[id$=IDcmbHBm]").val()+"Ç"+
$("div#"+bookingPanelId+" select[id$=IDcmbHMB]").val()+"Ç"+
$("div#"+bookingPanelId+" input[id$=IDtxtPerson]").val()+"Ç"+
$("div#"+bookingPanelId+" input[id$=IDtxtPhoneNo]").val()+"Ç"+
$("div#"+bookingPanelId+" *[id$=IDtxtAdnotations]").val()+"Ç"+
features);}
function changeAllotmentInfo(result,lblTimeBeforeId,lblTimeId,lblTimeAfterId,ibtnLeftId,ibtnRightId,dateTxtId,timeDdlId,cbkAllotCheckCIN,btnNextId,trAllotYesID,trAllotNoID,nextBtnId,acceptBtnId,IdLblEmptyAllotment){if(result==''){prgBP.hide();return false;}
var a=0;var resTab=result.split('_');$get(IdLblEmptyAllotment).innerHTML=resTab[resTab.length-1];if(resTab[0]==1){$get(lblTimeBeforeId).innerHTML=resTab[3];$get(lblTimeBeforeId).style.color="#008000";$get(ibtnLeftId).onclick=function(s,e){eval(cbkAllotCheckCIN).SendCallback('BEFORE_'+resTab[3]);return false;};}
else{$get(lblTimeBeforeId).innerHTML=resTab[6];$get(lblTimeBeforeId).style.color="#FF0000";$get(ibtnLeftId).onclick=function(s,e){return false;};}
var lblOver=$("#"+lblTimeId.replace("Value",""));if(resTab[1]==1){lblOver.next("span[hour=true]").remove();$("#"+lblTimeId).html(resTab[4]);$("#"+lblTimeId).css("color","#008000");lblOver.css("color","#090");if($get(btnNextId)!=null)
$get(btnNextId).style.display="inline";$("input[id$=IDibtnChange]").attr("src",$("input[id$=IDibtnChange]").attr("url"));}
else{if(lblOver.next("span").attr("hour")=="true")
lblOver.next("span").remove();lblOver.after("<span hour='true' style='font-weight:bold;color:red;'>&nbsp;"+resTab[4]+"</span>")
$("#"+lblTimeId).html(resTab[6]);$("#"+lblTimeId).css("color","#FF0000");lblOver.css("color","#900");if($get(btnNextId)!=null)
$get(btnNextId).style.display="none";}
if(resTab[2]==1){$get(lblTimeAfterId).innerHTML=resTab[5];$get(lblTimeAfterId).style.color="#008000";$get(ibtnRightId).onclick=function(s,e){eval(cbkAllotCheckCIN).SendCallback('AFTER_'+resTab[5]);return false;};}
else{$get(lblTimeAfterId).innerHTML=resTab[6];$get(lblTimeAfterId).style.color="#FF0000";$get(ibtnRightId).onclick=function(s,e){return false;};}
$("div[id$='greyBar']").show();for(var i=0;i<$get(timeDdlId).options.length;i++){if($get(timeDdlId).options[i].value==resTab[4].split(':')[0]){$get(timeDdlId).selectedIndex=i;}}
for(var i=0;i<$get(timeDdlId+"m").options.length;i++){if($get(timeDdlId+"m").options[i].value==resTab[4].split(':')[1]){$get(timeDdlId+"m").selectedIndex=i;}}
prgBP.hide();}
function bindGaleryBehaviour(){$("div.restGalItem img").click(function(){var imgUrl=$(this).attr("src").replace("_m.",".");$("div.imgGalOverlay").css("width",$(window).width()+"px");$("div.imgGalOverlay").css("height",$(document).height()+"px");$("div.imgGalContainer").hide();$("div.imgGalContainer table").show();$("div.imgGalContainer td").html("<img alt='' src='"+imgUrl+"'/>");var ScrollTop=document.body.scrollTop;if(ScrollTop==0){if(window.pageYOffset)
ScrollTop=window.pageYOffset;else
ScrollTop=(document.body.parentElement)?document.body.parentElement.scrollTop:0;}
$("div.imgGalContainer").css("top",Math.floor(($(window).height()-480)/2)+ScrollTop+"px");$("div.imgGalContainer").css("left",Math.floor(($(window).width()-640)/2)+"px");$("div.imgGalOverlay").show();$("div.imgGalContainer").fadeIn("fast");$("div.imgGalContainer").add("div.imgGalOverlay").click(function(){$("div.imgGalOverlay").hide();$("div.imgGalContainer").fadeOut("fast");});});var imsWidth=$("div.restGalImgs").width();var containerWidth=$("div.restGalContainer").width();var marginLeft=0;if($("div.restGalContainerInner").css("marginLeft")!=null)
marginLeft=parseInt($("div.restGalContainerInner").css("marginLeft").replace("px",""));if(containerWidth>imsWidth){$("div#restGalAR").attr("class","restGalARd");$("div#restGalAL").attr("class","restGalALd");}else{$("div#restGalAR").attr("class","restGalAR");$("div#restGalAL").attr("class","restGalAL");}
$("div.restGalAL").click(function(){var imsWidth=$("div.restGalImgs").width();var containerWidth=$("div.restGalContainer").width();var marginLeft=0;if($("div.restGalContainerInner").css("marginLeft")!=null)
marginLeft=parseInt($("div.restGalContainerInner").css("marginLeft").replace("px",""));if(Math.abs(marginLeft)>260)
$("div.restGalContainerInner").animate({"marginLeft":"+=260px"},500);else
$("div.restGalContainerInner").animate({"marginLeft":"0px"},500);});$("div.restGalAR").click(function(){var imsWidth=$("div.restGalImgs").width();var containerWidth=$("div.restGalContainer").width();var marginLeft=0;if($("div.restGalContainerInner").css("marginLeft")!=null)
marginLeft=parseInt($("div.restGalContainerInner").css("marginLeft").replace("px",""));var dlToMove=imsWidth-Math.abs(marginLeft)-containerWidth;if(dlToMove<=0)
return;if(dlToMove>260)
$("div.restGalContainerInner").animate({"marginLeft":"-=260px"},500);else
$("div.restGalContainerInner").animate({"marginLeft":"-="+(dlToMove).toString()+"px"},500);});}