function page_on(id) {
	var previous_postup_page = postup_page;
	postup_page = id;
	button_off(previous_postup_page);
}

function button_on(id) {
	var btn = document.getElementById(id + '_button_img');
	if (btn) btn.src = 'images/' + id + '_on.jpg';
}

function button_off(id) {
	if (id.match(/^\s*$/)) return;
	if (typeof(postup_page)== 'undefined') postup_page = '';
	if (postup_page == id) { 
		button_on(id); 
	} else { 
		document.getElementById(id + '_button_img').src = 'images/' + id + '_off.jpg';
	}
}

function button_over(id) {
	document.getElementById(id + '_button_img').src = 'images/' + id + '_over.jpg';
}
	

function checkage(form) {
	dd = form.day.value;
	mm = form.month.value;
	yy = form.year.value;

	if (dd == '' || mm == '' || yy == '') {
		alert("You must enter your date of birth!");
		return false;
	}

	days = new Date();
	gdate = days.getDate();
	gmonth = days.getMonth();
	gyear = days.getYear();

	if (gyear < 2000) gyear += 1900;

	age = gyear - yy;

	if ((mm == (gmonth + 1)) && (dd <= parseInt(gdate))) {
		age = age; 
	} else {
		if (mm <= (gmonth)) {
			age = age;
		} else {
			age = age - 1; 
	   }
	}

	if (age == 0)
		age = age;

	if (age < 13) {
		alert("You must be 13 to upload a video!");
		return false;
	}

	return true;
}

	/* Trim string and return */
	function trim(str) {
		s = str.replace(/^(\s)*/, '');
		s = s.replace(/(\s)*$/, '');
		return s;
	}
