function winPopHelp(id){	window.open('_help.php?topic='+id,'report','status=no, menubar=yes, scrollbars=no, width=550, height=400')}function winPopMenu(id){   	window.open('popMenu.php?id='+id,'report','status=no, menubar=no, scrollbars=no, resizable=0, width=400, height=350')}function winPop(id){	window.open('popNut.php?id='+id,'report','status=no, menubar=no, scrollbars=no, resizable=0, width=400, height=225')}function popReport(report,rid,sessid) {   	theChild=window.open('popReport.php?report='+report+'&rid='+rid+'&sessid='+sessid,report,'status=no, menubar=no, scrollbars=yes, width=400, height=400');}function pdfReport(report,sid,sessid) {   	theChild=window.open('pdfReport.php?sid='+sid+'&sessid='+sessid,report,'status=no, resizable=yes, menubar=no, scrollbars=yes, width=400, height=400');}function pdfGift(gcid) {   	theChild=window.open('pdfReport.php?gcid='+gcid+'&report=giftcerts','giftcerts','status=no, resizable=yes, menubar=no, scrollbars=yes, width=400, height=400');}function winMoveSess(date,rid,schedid,sessid,name) {   	theChild=window.open('changeSessions.php?schedid='+schedid+'&rid='+rid+'&sessid='+sessid+'&name='+name,'giftcerts','status=no, resizable=yes, menubar=no, scrollbars=yes, width=400, height=400');}function updateQty (id, minus, continueOffBtnSrc, continueOnBtnSrc, srv, price, minSize){	totalSrv = document.getElementById("totalSrvs").value;	val = parseInt(document.getElementById("itemcnt_"+srv+"_"+id).innerHTML);	p = parseFloat(document.getElementById("itemprice_"+srv+"_"+id).innerHTML);	newID = id.toString();		if (minus == false)	{		if (isNaN(val))		{			document.getElementById("itemcnt_"+srv+"_"+id).innerHTML = '1';			document.getElementById("itemval_"+srv+"_"+id).value = '1';		}		else		{			document.getElementById("itemcnt_"+srv+"_"+id).innerHTML = val+1;			document.getElementById("itemval_"+srv+"_"+id).value = val+1;					 		}				if (isNaN(p))		{			document.getElementById("itemprice_"+srv+"_"+id).innerHTML = price.toFixed(2);			document.getElementById("itemprice_"+srv+"_"+id).value = price.toFixed(2);		}		else		{			ItemPrice = roundNumber(p+price,2);			document.getElementById("itemprice_"+srv+"_"+id).innerHTML = ItemPrice;			document.getElementById("itemprice_"+srv+"_"+id).value = ItemPrice;		}		//val = parseInt (document.getElementById("totalitems").innerHTML);		p = parseFloat (document.getElementById("totalprice").innerHTML);		totalsrvs = parseInt(document.getElementById("totalSrvs").value);				if(isNaN(totalsrvs)) {			totalsrvs = 0;			}				if(newID.search(/sd/i)==-1) {			document.getElementById("totalSrvs").value = eval(parseInt(totalsrvs)+parseInt(srv));		}				if (isNaN(p)) {			document.getElementById("totalprice").innerHTML = '$'+0;		} else {		    ItemPrice = roundNumber(p+price,2);			document.getElementById("totalprice").innerHTML = ItemPrice;		}			   	document.getElementById("itemcntminus_"+srv+"_"+id).style.visibility="visible";	   	   	   	if (document.getElementById("totalSrvs").value >= minSize)	   	{		   	document.getElementById ("continuebtn").src = continueOnBtnSrc;	   		document.getElementById("minOrderText").style.visibility = "hidden";	   } else {	   	   document.getElementById("minOrderText").style.visibility = "visible";	   	   document.getElementById("orderNumText").innerHTML = eval(minSize-document.getElementById("totalSrvs").value);	   }	   	   if (document.getElementById("totalSrvs").value >= 48) {	  	   document.getElementById ("continuebtn").src = continueOnBtnSrc;	   	   document.getElementById("minOrderText").style.visibility = "hidden";	   } else if (document.getElementById("totalSrvs").value >= 32) {	   	   document.getElementById ("continuebtn").src = continueOnBtnSrc;		   document.getElementById("minOrderText").style.visibility = "visible";		   document.getElementById("minOrderText").innerHTML = ' Select only <b><span id="orderNumText">'+(48-document.getElementById("totalSrvs").value)+'</span></b> additional servings to receive an additional discount';		   document.getElementById("orderNumText").innerHTML = 48-document.getElementById("totalSrvs").value;	   } else if (document.getElementById("totalSrvs").value >= minSize) {	   	   document.getElementById ("continuebtn").src = continueOnBtnSrc;		   document.getElementById("minOrderText").style.visibility = "visible";		   document.getElementById("minOrderText").innerHTML = 'You have met our minimum order select only <b><span id="orderNumText">'+(32-document.getElementById("totalSrvs").value)+'</span></b> additional servings to receive a discounted price';		   document.getElementById("orderNumText").innerHTML = 32-document.getElementById("totalSrvs").value;	   }   	}   	else   	{		if (isNaN(val) || (val-1) == 0)		{			document.getElementById("itemcnt_"+srv+"_"+id).innerHTML = '';			document.getElementById("itemcntminus_"+srv+"_"+id).style.visibility="hidden";			document.getElementById("itemval_"+srv+"_"+id).value = 0;			document.getElementById("itemprice_"+srv+"_"+id).value = 0;						document.getElementById("itemprice_"+srv+"_"+id).innerHTML = '';		}		else		{			document.getElementById("itemcnt_"+srv+"_"+id).innerHTML = val-1;			document.getElementById("itemval_"+srv+"_"+id).value = val-1;						ItemPrice = roundNumber(p-price,2);			document.getElementById("itemprice_"+srv+"_"+id).innerHTML = ItemPrice;			document.getElementById("itemprice_"+srv+"_"+id).value = ItemPrice;					}	 		p = parseFloat (document.getElementById("totalprice").innerHTML);				if (isNaN(p)) {			document.getElementById("totalprice").innerHTML = '0';			document.getElementById("totalprice").value = 0;		} else {			ItemPrice = roundNumber(p-price,2); 			document.getElementById("totalprice").value = ItemPrice; 			document.getElementById("totalprice").innerHTML = ItemPrice;		}						totalsrvs = parseInt(document.getElementById("totalSrvs").value);				if(isNaN(totalsrvs)) {			totalsrvs = 0;			}				if(newID.search(/sd/i)==-1) {			document.getElementById("totalSrvs").value = eval(totalsrvs - srv);		}			   if (document.getElementById("totalSrvs").value < minSize) {		   document.getElementById("continuebtn").src = continueOffBtnSrc;		   document.getElementById("minOrderText").style.visibility = "visible";		   document.getElementById("minOrderText").innerHTML = 'Our minimum order is '+minSize+' servings please select <span id="orderNumText"></span></b> servings in order to continue.';		   document.getElementById("orderNumText").innerHTML = minSize-document.getElementById("totalSrvs").value;	   } else if (document.getElementById("totalSrvs").value < 32) {	   	   document.getElementById("continuebtn").src = continueOnBtnSrc;		   document.getElementById("minOrderText").style.visibility = "visible";		   document.getElementById("orderNumText").innerHTML = 32-document.getElementById("totalSrvs").value;	   } else if (document.getElementById("totalSrvs").value < 48) {	   	   document.getElementById("continuebtn").src = continueOnBtnSrc;	   	   document.getElementById("minOrderText").style.visibility = "visible";		   document.getElementById("orderNumText").innerHTML = 48-document.getElementById("totalSrvs").value;	   }   	}      	document.getElementById("itemcntadd_"+srv+"_"+id).style.visibility="visible";}function roundNumber(num, dec) {	var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);		r = num.toFixed(2);	return r;}function submitMenuItems (minSize){	val = parseInt (document.getElementById("totalSrvs").value);	if (isNaN(val) || val < minSize)	   return;	else	   document.forms['mySession'].submit();}
