function clickItem(item) { var isTable = item.getAttribute("TableName"); if(document.Event.ReadOnly) { // Do Nothing return; } var seatcount = parseInt(item.getAttribute("seatcount")); var available = parseInt(item.getAttribute("available")); var selected = parseInt(item.getAttribute("selected")); if(seatcount > ((seatcount-available)+selected)) { // Available - Allocate reserveSeatAtTable(isTable); } else { alert("Selected Seats Are Not Available"); } } function clickItem(item,count) { //alert('clickItem 2 vars: '+item+" -> "+count); var isTable = item.getAttribute("TableName"); if(document.Event.ReadOnly) { // Do Nothing return; } var seatcount = parseInt(item.getAttribute("seatcount")); var available = parseInt(item.getAttribute("available")); var selected = parseInt(item.getAttribute("selected")); //if(seatcount > ((seatcount-available)+count)) if(count <= available) { // Available - Allocate reserveSeatAtTable(isTable,count); } else { alert("Selected Seats Are Not Available"); } } function clickSeat(item,count) { var isTable = item.getAttribute("SeatName"); // alert('clickSeat 2 vars: '+item+" -> "+count+", *"+isTable); if(document.Event.ReadOnly) { // Do Nothing return; } var seatcount = parseInt(item.getAttribute("seatcount")); var available = parseInt(item.getAttribute("available")); var selected = parseInt(item.getAttribute("selected")); //if(seatcount > ((seatcount-available)+count)) if(count <= available) { // Available - Allocate //reserveSeatAtTable(isTable,count); reserveSeat(isTable,count); } else { alert("Selected Seat Is Not Available"); } } function allocateSuccess(itemname) { var item = document.getElementById(itemname); var isTable = item.getAttribute("TableName"); var seatcount = parseInt(item.getAttribute("seatcount")); var available = parseInt(item.getAttribute("available")); var selected = parseInt(item.getAttribute("selected")); selected++; item.innerHTML = '
' + selected; item.setAttribute("selected",selected); //alert(item.className); if(item.className.indexOf('seat')==0){ item.className = "seatselected"; }else{ item.className = "tableselected"; } } function allocateSuccess(itemname,count) { var item = document.getElementById(itemname); var oldClass = item.className; var selected = parseInt(item.getAttribute("selected")); selected=count; var x = item.innerHTML; // x = x.toLowerCase(); x = x.replace('DIV','div'); // alert(x); var ptr1 = x.indexOf('0){ item.className = "seatselected"; }else if(oldClass == "seatselected") { item.className = "seatempty"; }else{ item.className = oldClass; } item.innerHTML=x; }else{ if(count>0){ item.innerHTML = '
' + selected + x; item.className = "tableselected"; }else{ item.innerHTML = x; } } } function reserveSeatAtTable(tableName) { document.getElementById('ReservingFrame').src="reserveseatattable.jsp?EventID=" + document.Event.EventID.value + "&TableName="+tableName; } function reserveSeatAtTable(tableName,count) { document.getElementById('ReservingFrame').src="reserveseatattable.jsp?EventID=" + document.Event.EventID.value + "&TableName="+tableName+"&Selected="+count; } function reserveSeat(tableName) { document.getElementById('ReservingFrame').src="reserveseat.jsp?EventID=" + document.Event.EventID.value + "&SeatName="+tableName; } function reserveSeat(tableName,count) { document.getElementById('ReservingFrame').src="reserveseat.jsp?EventID=" + document.Event.EventID.value + "&SeatName="+tableName+"&Selected="+count; }