


//Función que abre una ventana dada una URL y un tamanyo para la misma (consultas)
function popUp(URL) {

day = new Date();
id = day.getTime();

if ((screen.width == 640) && (screen.height == 480)) {
width_nuevo = 640;
height_nuevo = 480;
pagepx = 1;
}
if ((screen.width == 800) && (screen.height == 600)) {
width_nuevo = 800;
height_nuevo = 600;
pagepx = 2;
}
if ((screen.width == 1024) && (screen.height == 768)) {
width_nuevo = 700;
height_nuevo = 400;
pagepx = 3;
}
if ((screen.width == 1640) && (screen.height == 480)) {
width_nuevo = l640;
height_nuevo = 480;
pagepx = 1;
}

eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=" + width_nuevo + ",height=" + height_nuevo + ",left = 0,top = 0');");

}




//Función que abre una ventana dada una URL y un tamanyo para la misma (consultas)
function popUp_incidencia(URL) {
day = new Date();
//id = day.getTime();
id = "consulta_incidencia";

if ((screen.width == 640) && (screen.height == 480)) {
width_nuevo = 640;
height_nuevo = 480;
pagepx = 1;
}
if ((screen.width == 800) && (screen.height == 600)) {
width_nuevo = 800;
height_nuevo = 500;
pagepx = 2;
}
if ((screen.width == 1024) && (screen.height == 768)) {
width_nuevo = 1000;
height_nuevo = 600;
pagepx = 3;
}
if ((screen.width == 1640) && (screen.height == 480)) {
width_nuevo = l640;
height_nuevo = 480;
pagepx = 1;
}

eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=" + width_nuevo + ",height=" + height_nuevo + ",left = 0,top = 0');");

}



//Función que abre una ventana dada una URL y un tamanyo para la misma (mail)
function popUp_mail(URL) {
day = new Date();
id = day.getTime();

if ((screen.width == 640) && (screen.height == 480)) {
width_nuevo = 640;
height_nuevo = 480;
pagepx = 1;
}
if ((screen.width == 800) && (screen.height == 600)) {
width_nuevo = 700;
height_nuevo = 500;
pagepx = 2;
}
if ((screen.width == 1024) && (screen.height == 768)) {
width_nuevo = 900;
height_nuevo = 600;
pagepx = 3;
}
if ((screen.width == 1640) && (screen.height == 480)) {
width_nuevo = l640;
height_nuevo = 480;
pagepx = 1;
}

eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=" + width_nuevo + ",height=" + height_nuevo + ",left = 0,top = 0');");
}




//Función que abre una ventana dada una URL y un tamanyo para la misma (leyenda)
function popUp_leyenda(URL) {
day = new Date();
id = day.getTime();

if ((screen.width == 640) && (screen.height == 480)) {
width_nuevo = 640;
height_nuevo = 480;
pagepx = 1;
}
if ((screen.width == 800) && (screen.height == 600)) {
width_nuevo = 700;
height_nuevo = 500;
pagepx = 2;
}
if ((screen.width == 1024) && (screen.height == 768)) {
width_nuevo = 700;
height_nuevo = 700;
pagepx = 3;
}
if ((screen.width == 1640) && (screen.height == 480)) {
width_nuevo = l640;
height_nuevo = 480;
pagepx = 1;
}

eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=" + width_nuevo + ",height=" + height_nuevo + ",left = 0,top = 0');");
}



//Función que abre una ventana dada una URL y un tamanyo para la misma (valoracion)
function popUp_valoracion(URL) {
day = new Date();
id = day.getTime();

if ((screen.width == 640) && (screen.height == 480)) {
width_nuevo = 640;
height_nuevo = 480;
pagepx = 1;
}
if ((screen.width == 800) && (screen.height == 600)) {
width_nuevo = 700;
height_nuevo = 300;
pagepx = 2;
}
if ((screen.width == 1024) && (screen.height == 768)) {
width_nuevo = 700;
height_nuevo = 700;
pagepx = 3;
}
if ((screen.width == 1640) && (screen.height == 480)) {
width_nuevo = l640;
height_nuevo = 480;
pagepx = 1;
}

eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=" + width_nuevo + ",height=" + height_nuevo + ",left = 0,top = 0');");
}


//Función que comprueba que los campos de un formulario no estén vacíos (incidencias nuevas)
function checkrequired(){
var errores=0;
var mensaje="";
if ((validacionincidencia.incidencia.value=="") || (validacionincidencia.motivo.value=="") || (validacionincidencia.subtipo_error.value=="none") || (validacionincidencia.nota.value=="")) {
	mensaje=mensaje+"Hay campos obligatorios que no has rellenado o no has seleccionado.\n";
    alert(mensaje);
    return false;
}
else {
	if ((validacionincidencia.solucion.value=="") && (validacionincidencia.solucionado.checked==true)) {
		mensaje=mensaje+"El campo SOLUCIÓN está vacio y vas a SOLUCIONAR la incidencia.\n";
		alert(mensaje);
		return false;
	}
	else {
		return true;
	}
}
}




//Función que comprueba que los campos de un formulario no estén vacíos (incidencias pendientes)
function checkrequiredpendiente(){
var errores=0;
var mensaje="";
if ((validacionincidencia_pendiente.incidencia.value=="") || (validacionincidencia_pendiente.motivo.value=="") || (validacionincidencia_pendiente.subtipo_error.value=="none") || (validacionincidencia_pendiente.nota.value=="")) {
	mensaje=mensaje+"Hay campos obligatorios que no has rellenado o no has seleccionado.\n";
    alert(mensaje);
    return false;
}
else {
	if ((validacionincidencia_pendiente.solucion.value=="") && (validacionincidencia_pendiente.solucionado.checked==true)) {
		mensaje=mensaje+"El campo SOLUCIÓN está vacio y vas a SOLUCIONAR la incidencia.\n";
		alert(mensaje);
		return false;
	}
	else {
		return true;
	}  
}
}

