function poponload(id)
	{ var url="/easyconsole.cfm/page/print_invoice/inv_id/"+id;
	  window.open(url, "mywindow", "location=1,status=1,scrollbars=1,titlebar=0, toolbar=0, menubar=0,width=600,height=800");
	}

function printInvoiceReceipt(id)
	{ var url="/easyconsole.cfm/page/print_invoice/inv_id/"+id+"/rcp/1";
	  window.open(url, "PrintInvoice", "location=1,status=1,scrollbars=1,titlebar=0, toolbar=0, menubar=0,width=600,height=800");
	}
	
function printCN(id)
	{ var url="/easyconsole.cfm/page/print_invoice/cr_id/"+id;
	  window.open(url, "mywindow", "location=1,status=1,scrollbars=1,titlebar=0, toolbar=0, menubar=0,width=600,height=800");
	  
	}
		
function printReceipt(id)
{ var url="/easyconsole.cfm/page/print_receipt/r_id/"+id;
  window.open(url, "mywindow", "location=1,status=1,scrollbars=1,titlebar=0, toolbar=0, menubar=0,width=700,height=800"); 
}

function printTicket(id) { 
	window.open('/easyconsole.cfm/page/printticket/ticket_id/'+id, 'TicketPrinter', 'toolbar=no,status=no,scrollbars=yes,location=no,resizable=0,menubar=no,directories=no,width=829,height=612');
}

function printTicketsInvoice(id) { 
	window.open('/easyconsole.cfm/page/printticket/inv_id/'+id, 'TicketPrinter', 'toolbar=no,status=no,scrollbars=yes,location=no,resizable=0,menubar=no,directories=no,width=829,height=612');
}
	
function markAsSelected(obj,obj2,recordcount)
{	
	for (i=1;i<=recordcount;i++)
	{
	document.getElementById('topMenuButton'+i).className="topMenuButton";
	document.getElementById('topMenuSelectedButton'+i).innerHTML=""
	}
	//container = document.getElementById('topMenuBox');
	//selectedLI = document.getElementsByClassName('topMenuButtonSelected',container);
	//selectedLI[0].className = 'topMenuButton';
	
	document.getElementById('topMenuButton'+obj).className="topMenuButtonSelected";
	document.getElementById('topMenuSelectedButton'+obj).innerHTML="<img style='margin:3px 0px 0px 0px;' src='/images/arrow-down.jpg' width='12' height='6' alt='/images/arrow-down.jpg' />";
	
}

function cs(block,row,seat,price,type) {
	var newblock=0;
	if (block==1) {newblock="A";}
	if (block==2) {newblock="B";}
	if (block==3) {newblock="C";}
	document.getElementById('blockSeatRow').innerHTML = 'Block <strong>'+newblock+'</strong>, Row <strong>'+row+'</strong>, Seat <strong>'+seat+' - Price:</strong> <span style="color:#009900;"><strong>&euro;'+price+'</strong></span>';
	if (type!='Booked' && type!='Selected' && type!="Tempor" && type!="Change") {
		document.getElementById(row+''+seat).style.backgroundColor='#00B900';
	}
}

function ds(block,row,seat,type) {
	
	document.getElementById('blockSeatRow').innerHTML = '';
	if (type!='Booked' && type!='Selected' && type!="Tempor" && type!="Change") {
		document.getElementById(row+''+seat).style.backgroundColor='#00CC00';
	}
}

function ss(block,seat_id,row,seat,price,section_id) { 
	
	document.getElementById('block').value=block;
	document.getElementById('row').value=row;
	
	var a = new seatsClass();
	var seatsResult = a.getSeats(block,row,seat);
	ColdFusion.Bind.assignValue('seat','value', seatsResult)
	document.getElementById('seat_id').value=seat_id;
	document.getElementById('price').value=section_id;
	document.getElementById('totalpriceSeat').value=price;
	
	document.getElementById('totalprice').innerHTML="&euro;"+price;
	document.addCart.submit();
}	

function getPrice(value) 
{
	var block=document.getElementById('block').value;
	var row=document.getElementById('row').value;
	ajaxSelect(block,'/include/ajax/update_price.cfm','totalprice',row,value) ; 
}
function bb(block,day_id) {
	ajaxSelect(block,'/include/ajax/update_seats.cfm','seatsBoxLeft',day_id) ; 
}

function fireEvent(element,event){
    if (document.createEventObject){
    // dispatch for IE
    var evt = document.createEventObject();
    return element.fireEvent('on'+event,evt)
    }
    else{
    // dispatch for firefox + others
    var evt = document.createEvent("HTMLEvents");
    evt.initEvent(event, true, true ); // event type,bubbling,cancelable
    return !element.dispatchEvent(evt);
    }
}


function doNothing() {}

function confirmation(r_id,row,seat) {
	var answer = confirm("Are you sure you want to Delete Ticket?");
	if (answer){ 
		ajaxSelect(r_id,'/include/ajax/delete_ticket.cfm','insertTicket',row,seat) ;
		 //document.getElementById('dd'+r_id).style.display='none';
		 //document.getElementById('divider'+r_id).style.display='none';
	}
	else{
		
	}
}
function changeSeatPrice(value,price) { 
	
	var totalprice=document.getElementById('totalprice').value;
	if(document.getElementById(value).checked) {		
		var newTotalPrice=parseFloat(totalprice)-parseFloat(price);
		document.getElementById('totalprice').value=newTotalPrice;
		ajaxSelect(value,'/include/tickets/ajax/update_tbl_change.cfm','ticketsChange','1') ;
		
	}
	else { 
		var newTotalPrice=parseFloat(totalprice)+parseFloat(price);
		document.getElementById('totalprice').value=newTotalPrice;
		ajaxSelect(value,'/include/tickets/ajax/update_tbl_change.cfm','ticketsChange','0') ;
	 }
	 
	document.getElementById('totalPriceND').innerHTML="<strong> &euro;" + newTotalPrice.toFixed(2) + "</strong>";
	if (newTotalPrice<0) {
		 document.getElementById('totalPriceND').style.color='red';
		  document.getElementById('paynowMethod').style.display='none';
		   document.getElementById('payLaterMethod').style.display='none';
		  document.getElementById('payContinueMethod').style.display='block';
		 
		 }
	else {
		 document.getElementById('totalPriceND').style.color='#009900';
		   document.getElementById('paynowMethod').style.display='block';
		   document.getElementById('payLaterMethod').style.display='block';
		  document.getElementById('payContinueMethod').style.display='none';
	}	 
}

function chechPaymentMethod(method) {
	if(method==2) {
		  document.getElementById('ckeckDetails').style.display='block';
		ajaxSelect(0,'/include/tickets/ajax/check_no_field.cfm','ckeckDetails','0') ;
	}
	else { 
		  document.getElementById('ckeckDetails').style.display='none';
	}
}
