function onLoad() {
}

function submitForm(id,action) {
	obj = document.getElementById(id);
	if (obj) {
		obj.action = action;
		obj.submit();
	}
}

function submitMobi(id, action){
	var asuntos = document.getElementsByName("asunto");
	var checked = false;
	for(var i=0;i<asuntos.length;i++){
		if(asuntos[i].checked){
			checked = true;
			break;
		}
	}
	
	if(checked){
		document.getElementById('mobiError').style.display = 'none';
		submitForm(id, action);
	}else{
		document.getElementById('mobiError').style.display = 'block';
	}	
}

function submitMessage(id, action){
	var asunto = document.getElementsByName("asunto")[0];
	var mensaje = document.getElementsByName("mensaje")[1];
	if(asunto.value.length > 0 && mensaje.value.length > 0){
		document.getElementById('msgError').style.display = 'none';
		submitForm(id, action);
	}else{
		document.getElementById('msgError').style.display = 'block';
	}
}

_refreshTime = 10000;


function pageRefresh() {
	document.location = document.location;
}


function initRefresh(time) {
	_refreshTime = time;
	setTimeout("pageRefresh()",time);
}


function getScreenWidth() {
	return document.width;
}

//Esto no es el largo de la pantalla sino del documento
//no puede usarse para calcular el alto de la pantalla.
function getScreenHeight() {
	return document.height;
}

function checkScreenSize(w,h) {
	rw = getScreenWidth();
	rh = getScreenHeight();
	var location = String(document.location);
	if (w!=rw) {
		if (location.indexOf("?")>0) {
			document.location=location+"&chs="+rw + "x" + rh;
		} else {
			document.location=location+"?chs="+rw + "x" + rh;
		}
	}
	
}