﻿// JavaScript Document

<!--
function imgzoom(urlimage) {
	string="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,fullscreen=no,top=0,left=0";
	url = "/zoomimage.php?image=" + urlimage;
	window.open(url,"_blank",string);
}

function opendoc(urlinc,lang) {
	url = "/doc_inc.php?lang=" + lang + "&url_inc=" + urlinc;
	window.open(url,"_blank");
}

function resizewindow() {
	window.moveTo(0,0);
	window.resizeTo(screen.availWidth,screen.availHeight);
}

function validatePreferenceForm()	{
	fullform = document.forms[0].elements;
  
	for (x=0; x < fullform.length; x++) {
		if ((fullform[x].value == '' && fullform[x].type=='text') || fullform[x].selectedIndex == 0){
			alert('Es obligatorio rellenar todos los datos.');
			return false;
		}
	}
			
	if(document.getElementById('legal'))
	{
		legalcheckbox = document.getElementById('legal');
		if(legalcheckbox.checked){			
			document.forms[0].submit();
			return false;
		}
		else{
			alert('Debe leer y aceptar la Cláusula Legal antes de enviar los datos.');
			return false;
		}
	}
	else{
		document.forms[0].submit();
		return false;
	}
}

function validateMailForm()	{
	fullform = document.forms[0].elements;
	for (x=0; x < fullform.length; x++) {
		if ((fullform[x].value == '' && fullform[x].type=='text') || fullform[x].selectedIndex == 0){
			return false;
		}
	}
	document.forms[0].submit();
	return false;
}
// -->