function selectDate(myHour,myMin,mySel,myPlusHour,myPlusMin,myStartHour,myStartMin,myEndHour,myEndMin,mySpanTime){if(document.order.date){var num=document.order.date.selectedIndex;var myD=new Date();myMin=Math.ceil(myMin/10)*10;var plus=(parseInt(myPlusHour)*60)+parseInt(myPlusMin);myHour=parseInt(myHour);myMin=parseInt(myMin);document.order.min.options.length=1;document.order.hour.options.length=1;if(num==0){return false;}else if(num==1){if(document.order.date.value==""){return false;}
hour=myHour;for(iHourCount=0;iHourCount<12;iHourCount++){if((myMin+plus)>59){hour=hour+1;plus=plus-60;}}}else{if(document.order.date.value==""){return false;}
hour=myStartHour;}
hour=(hour<myStartHour)?myStartHour:hour;for(i=hour;i<=parseInt(myEndHour);i++){document.order.hour.options[document.order.hour.options.length]=new Option(i,i);if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}
if(mySel){for(i=0;i<document.order.hour.options.length;i++){if(document.order.hour.options[i].value==mySel){document.order.hour.selectedIndex=i;}}}}}
function selectHour(myHour,myMin,mySel,myPlusHour,myPlusMin,myStartHour,myStartMin,myEndHour,myEndMin,mySpanTime){if(document.order.hour){var num=document.order.hour.selectedIndex;var num2=document.order.date.selectedIndex;var myD=new Date();myMin=Math.ceil(myMin/10)*10;var min=0;var plus=(parseInt(myPlusHour)*60)+parseInt(myPlusMin);myHour=parseInt(myHour);myMin=parseInt(myMin);document.order.min.options.length=1;if(num2==1){if(num==0){return false;}else if(num==1){min=myMin;for(i=0;;i++){if((myMin+plus)>59){plus=plus-60;}else{break;}}
if((myMin+plus)>59){min=(myMin+plus)-60;myHour=myHour+1;}else{min=myMin+plus;}}}else{if(num==0){return false;}else if(num==1){min=00;}}
if(parseInt(document.order.hour.value)==parseInt(myStartHour)&&parseInt(document.order.hour.value)==parseInt(myEndHour)){for(i=parseInt(myStartMin);i<parseInt(myStartHour);i=i+parseInt(mySpanTime)){if(i==0){document.order.min.options[document.order.min.options.length]=new Option("00","00");if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}else{document.order.min.options[document.order.min.options.length]=new Option(i,i);if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}}}else{if(parseInt(document.order.hour.value)==parseInt(myStartHour)){if(myHour==myStartHour){if(myMin>=myStartMin){myStartMin=min;}}
for(i=parseInt(myStartMin);i<60;i=i+parseInt(mySpanTime)){if(i==0){document.order.min.options[document.order.min.options.length]=new Option("00","00");if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}else{document.order.min.options[document.order.min.options.length]=new Option(i,i);if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}}}else if(parseInt(document.order.hour.value)==parseInt(myEndHour)){for(i=0;i<=parseInt(myEndMin);i=i+parseInt(mySpanTime)){if(i==0){document.order.min.options[document.order.min.options.length]=new Option("00","00");if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}else{document.order.min.options[document.order.min.options.length]=new Option(i,i);if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}}}else{for(i=min;i<60;i=i+parseInt(mySpanTime)){if(i==0){document.order.min.options[document.order.min.options.length]=new Option("00","00");if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}else{document.order.min.options[document.order.min.options.length]=new Option(i,i);if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}}}}
if(mySel){for(i=0;i<document.order.min.options.length;i++){if(document.order.min.options[i].value==mySel){document.order.min.selectedIndex=i;}}}}}
function selectDateReservation(myHour,myMin,mySel,myPlusHour,myPlusMin,myStartHour,myStartMin,myEndHour,myEndMin,mySpanTime,selectedIndex){var num=selectedIndex;var myD=new Date();myMin=Math.ceil(myMin/10)*10;var plus=(parseInt(myPlusHour)*60)+parseInt(myPlusMin);myHour=parseInt(myHour);myMin=parseInt(myMin);document.order.min.options.length=1;document.order.hour.options.length=1;if(num==0){return false;}else if(num==1){hour=myHour;for(iHourCount=0;iHourCount<12;iHourCount++){if((myMin+plus)>59){hour=hour+1;plus=plus-60;}}}else{hour=myStartHour;}
hour=(hour<myStartHour)?myStartHour:hour;for(i=hour;i<=parseInt(myEndHour);i++){document.order.hour.options[document.order.hour.options.length]=new Option(i,i);if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}
if(mySel){for(i=0;i<document.order.hour.options.length;i++){if(document.order.hour.options[i].value==mySel){document.order.hour.selectedIndex=i;}}}}
function selectHourReservation(myHour,myMin,mySel,myPlusHour,myPlusMin,myStartHour,myStartMin,myEndHour,myEndMin,mySpanTime,selectedIndex){if(document.order.hour){var num=document.order.hour.selectedIndex;var num2=selectedIndex;var myD=new Date();myMin=Math.ceil(myMin/10)*10;var min=0;var plus=(parseInt(myPlusHour)*60)+parseInt(myPlusMin);myHour=parseInt(myHour);myMin=parseInt(myMin);document.order.min.options.length=1;if(num2==1){if(num==0){return false;}else if(num==1){min=myMin;for(i=0;;i++){if((myMin+plus)>59){plus=plus-60;}else{break;}}
if((myMin+plus)>59){min=(myMin+plus)-60;myHour=myHour+1;}else{min=myMin+plus;}}}else{if(num==0){return false;}else if(num==1){min=00;}}
if(parseInt(document.order.hour.value)==parseInt(myStartHour)&&parseInt(document.order.hour.value)==parseInt(myEndHour)){for(i=parseInt(myStartMin);i<parseInt(myStartHour);i=i+parseInt(mySpanTime)){if(i==0){document.order.min.options[document.order.min.options.length]=new Option("00","00");if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}else{document.order.min.options[document.order.min.options.length]=new Option(i,i);if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}}}else{if(parseInt(document.order.hour.value)==parseInt(myStartHour)){if(myHour==myStartHour){if(myMin>=myStartMin){myStartMin=min;}}
for(i=parseInt(myStartMin);i<60;i=i+parseInt(mySpanTime)){if(i==0){document.order.min.options[document.order.min.options.length]=new Option("00","00");if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}else{document.order.min.options[document.order.min.options.length]=new Option(i,i);if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}}}else if(parseInt(document.order.hour.value)==parseInt(myEndHour)){for(i=0;i<=parseInt(myEndMin);i=i+parseInt(mySpanTime)){if(i==0){document.order.min.options[document.order.min.options.length]=new Option("00","00");if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}else{document.order.min.options[document.order.min.options.length]=new Option(i,i);if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}}}else{for(i=min;i<60;i=i+parseInt(mySpanTime)){if(i==0){document.order.min.options[document.order.min.options.length]=new Option("00","00");if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}else{document.order.min.options[document.order.min.options.length]=new Option(i,i);if(document.layers){top.resizeBy(-10,-10)
top.resizeBy(10,10)}}}}}
if(mySel){for(i=0;i<document.order.min.options.length;i++){if(document.order.min.options[i].value==mySel){document.order.min.selectedIndex=i;}}}}}
