// JavaScript Document

function updatereservationcost() {
	dateselect=document.getElementById("performance");
	regtixinput=document.getElementById("tickets");
	redtixinput=document.getElementById("reducedtickets");
	datestring=dateselect.options[dateselect.selectedIndex].value;
	datecomps=datestring.split("-");
	weekday=new Date(datecomps[0],datecomps[1]-1,datecomps[2]).getDay();
	regtixcostspan=document.getElementById("regtixcost");
	redtixcostspan=document.getElementById("redtixcost");
	totalcostspan=document.getElementById("totalcost");
	regtixcostspan.innerHTML=datestring&&!weekday?12:14;
	redtixcostspan.innerHTML=datestring&&!weekday?12:13;
	totalcostspan.innerHTML=(regtixinput.value*1)*(regtixcostspan.innerHTML*1)+(redtixinput.value*1)*(redtixcostspan.innerHTML*1);
}
