// JavaScript Document

function tracking() {

	var query_string = "";
	if (document.tracking && document.tracking.num_guia) {
		query_string = "?num_guia=" + document.tracking.num_guia.value;
	}
	win = window
			.open(
					'/tracking.html' + query_string,
					'tracking',
					"toolbar=1,titlebar=yes,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=400,height=400");
	win.focus();
}

function creditos() {
	win = window
			.open(
					'/creditos.html',
					'creditos',
					"toolbar=1,titlebar=yes,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=640,height=480");
	win.focus();
}

function maswoc() {

	document.getElementById("woc").style.display = "inline";

}

function numbersonly(myfield, e, dec) {
	var key;
	var keychar;

	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);

	// control keys
	if ((key == null) || (key == 0) || (key == 8) || (key == 9) || (key == 13)
			|| (key == 27))
		return true;

	// numbers
	else if ((("0123456789").indexOf(keychar) > -1))
		return true;

	// decimal point jump
	else if (dec && (keychar == ".")) {
		myfield.form.elements[dec].focus();
		return false;
	} else
		return false;
}
