function init_misc() {
	var trs = document.getElementsByTagName("tr");
	for (var i=0;i<trs.length; i++)
		if (trs[i].className=="record-row") {
			trs[i].onmouseover = function() {
				this.style.backgroundImage = "url(images/record-row-bg.gif)";
			}
			trs[i].onmouseout = function() {
				this.style.backgroundImage = "none";
			}
		}
}

function check_Reg_Form(){
	
	
	emptyfield="";correct="";
	if (document.pform.name.value == "") emptyfield="Name, ";
	if (document.pform.username.value == "") emptyfield += "UserName, ";
	if (document.pform.password.value == "") {emptyfield +="Password, "} else {if (document.pform.password.value!=document.pform.password2.value) correct="Password/Confirm Pwd"}
	if (document.pform.mail.value == "") {emptyfield +="Email, "} else {if (document.pform.mail.value!=document.pform.mail2.value) correct +="Email/Confirm Email"}
	
	if (emptyfield!="") {
		alert ("Please fill fields : " + emptyfield);
		return (false);
	} else { 
		if (correct!="") {	
			alert("Please correct fields : " + correct)	;
			return (false);
		} else {
			document.pform.password2.disabled=true;
			document.pform.mail2.disabled=true;
			document.pform.fMonth.disabled=true;
			document.pform.fDay.disabled=true;
			document.pform.fYear.disabled=true;
			return (true);
		}
	}
	
}

function check_getTicket_Form(){
	
	emptyfield="";correct="";
	if (document.order.ticket_nr.value == "") emptyfield="Specify the number of tickets you want to order";
	
	if (emptyfield!="") {
		alert (emptyfield);
		return (false);
	} else { 
		for (i = 0; i < document.order.ticket_nr.value.length; i++){   
	        // Check that current character is number.
    		var c = document.order.ticket_nr.value.charAt(i);
    		if (((c < "0") || (c > "9"))) {
    			correct="This is not a number!";
    			alert(correct);
				return (false);
    		}
	    }
		
	return (true);
	
	}
	
}

function insert_new_date(form, field){
	field.value=form.fYear.value+"-"+form.fMonth.value+"-"+form.fDay.value;
}

function insert_new_time(form, field){
	field.value=form.fHour.value+":"+form.fMinute.value+":"+form.fSecond.value;
}