////////////////
////GENERAL////
////////////////


function newWindow(mypage, w, h)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2 -50;
	w=w+15;
	h=h+15;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no,toolbar=no,status=no,location=no';
	win = window.open(mypage, 'ampliada', winprops)
	if (parseInt(navigator.appVersion) >= 4) 
	{ win.window.focus(); }
}//end newWindow





////////////////
////PEDIDOS////
////////////////

function new_order(){
		if (new_order2()){
			document.data_form.submit();
		}
}//end anadir_faq

function new_order2(){
		if (document.data_form.nombre.value==""){
			alert("Debe indicar su nombre.");
			document.data_form.nombre.focus();
			return false;
		}
		if (document.data_form.apellidos.value==""){
			alert("Debe indicar sus apellidos.");
			document.data_form.apellidos.focus();
			return false;
		}
		if (document.data_form.telefono.value==""){
			alert("Debe indicar un teléfono de contacto.");
			document.data_form.telefono.focus();
			return false;
		}
		if (document.data_form.direccion.value==""){
			alert("Debe indicar una dirección de entrega.");
			document.data_form.direccion.focus();
			return false;
		}
		if (document.data_form.fecha_hora.value==""){
			alert("Debe indicar un día y un horario de entrega.");
			document.data_form.fecha_hora.focus();
			return false;
		}
		
		return true;
}//end new_order2





////////////////
////FAQ////
////////////////

function anadir_faq(){
		if (anadir_faq_2()){
			document.data_form.submit();
		}
}//end anadir_faq

function anadir_faq_2(){
		if (document.data_form.pregunta_nombre.value==""){
			alert("Debe indicar su nombre.");
			document.data_form.pregunta_nombre.focus();
			return false;
		}
		if (document.data_form.pregunta_asunto.value==""){
			alert("Debe indicar el tema de la consulta.");
			document.data_form.pregunta_asunto.focus();
			return false;
		}
		if (document.data_form.pregunta_contenido.value==""){
			alert("Debe indicar su pregunta.");
			document.data_form.pregunta_contenido.focus();
			return false;
		}
		return true;
}//end anadir_faq_2



////////////////
////CONTACTO////
////////////////

function new_contact(){
		if (new_contact2()){
			document.data_form.submit();
		}
}//end new_contact

function new_contact2(){
		if (document.data_form.nombre.value==""){
			alert("Debe escribir su nombre.");
			document.data_form.nombre.focus();
			return false;
		}
		if (document.data_form.asunto.value==""){
			alert("Debe escribir un Asunto para su mensaje.");
			document.data_form.asunto.focus();
			return false;
		}
		if (document.data_form.mensaje.value==""){
			alert("Debe escribir un mensaje.");
			document.data_form.mensaje.focus();
			return false;
		}
		return true;
}//end new_contact2

