winWidth=screen.availWidth; 
winHeight=screen.availHeight;
window.opener = '';

function fs(url) {
	if (winWidth < 1024) {
		treeWindow = window.open(url+"?res="+winWidth+"&lang=es", 'gjp', 'scrollbars=yes,toolbar=no,location=no,status=no,menubar=no,resizable=no');
	} else {
		treeWindow = window.open(url+"?res="+winWidth+"&lang=es", 'gjp', 'scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=no');
	}
	treeWindow.moveTo(0,0);
	treeWindow.resizeTo(winWidth,winHeight);
	treeWindow.focus();
	self.close();
}

function sendForm(formRef) {
	if (formRef.elements[0].value == "") {
		alert("Por favor, introduzca su email");
	} else {
		formRef.submit();
	}
}

/******************************************************************************
This code is from Dynamic Web Coding at http://www.dyn-web.com/
See Terms of Use at http://www.dyn-web.com/bus/terms.html
Permission granted to use this code as long as this entire notice is included.
******************************************************************************/
function changeContent(id,shtml) {
	if (document.getElementById || document.all) {
		var el = document.getElementById? document.getElementById(id): document.all[id];
		if (el && typeof el.innerHTML != "undefined") el.innerHTML = shtml;
	}
}

function chgLang(l) {
	switch (qs) {
		case 0:
			window.location.href = url+"?lang="+l;
			break;
		case 1:
			i = url.indexOf("msg=");
			if (i != -1) {
				url = url.substring(0, i-1);
				i = url.indexOf("?");
				if (i == -1) {
					window.location.href = url+"?lang="+l;
					break;
				}
			}

			i = url.indexOf("lang=");
			if (i == -1) {
				window.location.href = url+"&lang="+l;
			} else {
				window.location.href = url.substring(0, i+5)+l;
			}
			break;
	}
}

/*
function chgLang(l) {
	if (qs) {
		i = url.indexOf("msg=");
		if (i != -1) {
			url = url.substring(0, i-1);
		}

		i = url.indexOf("lang=");
		if (i == -1) {
			window.location.href = url+"&lang="+l;
			} else {
			window.location.href = url.substring(0, i+5)+l;
		}
	} else {
		window.location.href = url+"?lang="+l;
	}
}
*/
