 
 function windowOpen(page, title, attributes) {
	window.open(page, title, attributes);
 }
 
 function windowClose() {
	window.close();
 }
 
 function calc() {
    var form = window.document.frm_payments;
    var frm_entry_type  = form.frm_type.value;
    var frm_entry_price = 0;
	var adult;
	var family_adult;
	var child;
	var family_child;
    
    var date = new Date();
    var day = date.getDate();
    var month = date.getMonth();

    if (frm_entry_type == 'team') frm_entry_price = 100;
    if (frm_entry_type == 'team' && month == 2 && day > 12) 	frm_entry_price = frm_entry_price + 10;

  	if (month == 2 && day > 12) {
		adult = 35;
		child = 15;
		
		family_adult = 27;
		family_child = 8;
	}
	else {
		adult = 30;
		child = 10;
		
		family_adult = 22;
		family_child = 8;
	}

    if (frm_entry_type == 'individual') {
        if (isNaN(parseInt(form.frm_adult_qty.value))) 
            frm_adult_entry_qty = 0;
        else
            frm_adult_entry_qty = parseInt(form.frm_adult_qty.value);
            
        if (isNaN(parseInt(form.frm_child_qty.value))) 
            frm_child_entry_qty = 0;
        else
            frm_child_entry_qty = parseInt(form.frm_child_qty.value);

 		frm_entry_price = (parseInt(frm_adult_entry_qty) * adult) + (parseInt(frm_child_entry_qty) * child);
	}
	
    if (isNaN(parseInt(frm_entry_price))) frm_entry_price = 0;

    var frm_adult_qty  = form.frm_adult_qty.value;
    var frm_child_qty  = form.frm_child_qty.value;
    
    if (isNaN(parseInt(frm_adult_qty))) frm_adult_qty = 0;
    if (isNaN(parseInt(frm_child_qty))) frm_child_qty = 0;
     
//    var frm_fares_price = (parseInt(frm_adult_qty) * 18) + (parseInt(frm_child_qty) * 14);
	var frm_fares_price = 0;
	
    var frm_total_price = parseInt(frm_fares_price) + parseInt(frm_entry_price);

    form.frm_fares_price.value = num_format(frm_fares_price, 0);
    form.frm_entry_price.value = num_format(frm_entry_price, 0);
    form.frm_total_price.value = num_format(frm_total_price, 0);
	
	return true;
}

function num_format(expr, decplaces) {
    var str = ' ' + Math.round(eval(expr) * Math.pow(10, decplaces));
    var decpoint = str.length;
    if (decplaces == 0)
        return '$' + str.substring(0, decpoint);
    else
        return '$' + str.substring(0, decpoint) + '.' + str.substring(decpoint,str.length);
}
