// JavaScript Document
function dates (){
var d = new Date(); //creates a new date
var dd = d.getDate(); //retrieves the date from the system
var mm = d.getMonth() + 1; //retrieves the month JS starts counting at zero, so add a 1 to start January at 1
var yyyy = d.getYear(); //retrieves the year
var now = dd + "/" + mm + "/" + yyyy; //formats the date*/

document.freshers_mailing.date_submitted.value = now;

}

	function getRadioValue(radioObject){
		var value = null
		for (var i=0; i<radioObject.length; i++) {
			if (radioObject[i].checked){
				value = radioObject[i].value
				break}else{
				value = 'Null';
				}
		}
		return value
	}
	
	function calcTotal(){
		//var value = 0
		var handbook_back_cover = document.freshers_mailing.handbook_back_cover.checked;
		var handbook_inside_front_cover = document.freshers_mailing.handbook_inside_front_cover.checked;
		var handbook_inside_back_cover = document.freshers_mailing.handbook_inside_back_cover.checked;
		var handbook_full_page = document.freshers_mailing.handbook_full_page.checked;
		var handbook_half_page = document.freshers_mailing.handbook_half_page.checked;
		var map_outlet = document.freshers_mailing.map_outlet.checked;
		var map_sponsor = document.freshers_mailing.map_sponsor.checked;
		var map_back_cover = document.freshers_mailing.map_back_cover.checked;
		var insert = document.freshers_mailing.insert.checked;
		var amount = 0;
		var total;
		
		if (handbook_back_cover == true){
			amount = 1600;
		}
		if (handbook_inside_front_cover == true){
			amount = amount + 1300;
		}
		if (handbook_inside_back_cover == true){
			amount = amount + 1100;
		}
		if (handbook_full_page == true){
			amount = amount + 700;
		}
		if (handbook_half_page == true){
			amount = amount + 450;
		}
		if (map_outlet == true){
			amount = amount + 150;
		}
		if (map_sponsor == true){
			amount = amount + 1000;
		}
		if (map_back_cover == true){
			amount = amount + 1600;
		}
		if (insert == true){
			amount = amount + 1200;
		}
		
		document.getElementById('total').innerHTML = '£' + amount;
					
		document.freshers_mailing.total.value = document.getElementById('total').innerHTML;
					
	}
