// JavaScript Document
function procesmessage1(mensaje, ass)
{
	mensaje1=mensaje.value;
	len = mensaje1.length;
	document.all[ass].innerText=len;
}


function agsim(agrega)
{
	p2=document.form1.param2.value;
	document.form1.param2.value=p2+agrega;

}

function agsim6(agrega)
{
	p2=document.form1.param6.value;
	document.form1.param6.value=p2+agrega;

}
function agsim7(agrega)
{
	p2=document.form1.param7.value;
	document.form1.param7.value=p2+agrega;

}


function cambiocaf7()
{
	p0=document.form1.param0.options[document.form1.param0.selectedIndex].value;
	tab=document.form1.tabla.value;
	document.location.href="nuevo_admin.php?tabla="+tab+"&param0="+p0;
}

function cambiocaf8()
{
	p0=document.form1.param0.options[document.form1.param0.selectedIndex].value;
	tab=document.form1.tabla.value;
	id_param=document.form1.id_param.value;
	document.location.href="cambio_admin.php?tabla="+tab+"&param0="+p0+"&id_param="+id_param;
}


function agsim1(agrega)
{
	p2=document.form1.param3.value;
	document.form1.param3.value=p2+agrega;

}

function validaCa()
{
	p1=document.form1.param1.value;
	p2=document.form1.param2.value;
	p3=document.form1.param3.value;
	p4=document.form1.param4.options[document.form1.param4.selectedIndex].value;
	if(p4==0){alert('Debe seleccionar un Item del menú');return;}
	if(p1==""){alert('Debe agregar el Nombre del sub Item');return;}
	//if(p2==""){alert('Debe agregar Descripción del sub Item');return;}
	if(p3==""){alert('Debe agregar una imágen asociada al sub Item');return;}
	document.form1.submit();
}


function validaPla()
{
	p1=document.form1.param1.value;
	p2=document.form1.param2.value;
	p3=document.form1.param3.value;
	p4=document.form1.param4.value;
	if(p1==""){alert('Debe agregar el Nombre del plato');return;}
	//if(p2==""){alert('Debe agregar la Descripción del plato');return;}
	if(p3==""){alert('Debe agregar una imagen asociada al plato');return;}
	if(p4==""){alert('Debe agregar el valor del plato');return;}
	document.form1.submit();
}

function validaSal()
{
	p1=document.form1.param1.value;
	p2=document.form1.param2.value;
	p3=document.form1.param3.value;
	if(p1==""){alert('Debe agregar el Nombre del salón');return;}
	//if(p2==""){alert('Debe agregar la Descripción del salón');return;}
	if(p3==""){alert('Debe agregar la capacidad del salón');return;}
	document.form1.submit();
}

function validaGas()
{
	p1=document.form1.param1.options[document.form1.param1.selectedIndex].value;
	p2=document.form1.param2.value;
	p3=document.form1.param3.value;
	if(p1==0){alert('Debe seleccionar un salón');return;}
	//if(p2==""){alert('Debe agregar la Descripción de la imagen');return;}
	if(p3==""){alert('Debe agregar una imagen');return;}
	document.form1.submit();
}


function validaPublic()
{
	p1=document.form1.param1.options[document.form1.param1.selectedIndex].value;
	p2=document.form1.param2.value;
	p4=document.form1.param4.value;
	p3=document.form1.param3.value;
	p5=document.form1.param5.value;
	p6=document.form1.param6.value;
	if(p1==0){alert('Debe seleccionar una categoría');return;}
	if(p2==""){alert('Debe agregar el titulo de la publicación');return;}
	if(p3==""){alert('Debe agregar una imagen de la publicación');return;}
	//if(p4==""){alert('Debe agregar la descripción de la publicación');return;}
	if(p5==""){alert('Debe agregar el valor de la publicación');return;}
	if(p6==""){alert('Debe agregar el autor de la publicación');return;}
	document.form1.submit();
}

function validaPublic1()
{
	p1=document.form1.param1.options[document.form1.param1.selectedIndex].value;
	p2=document.form1.param2.value;
	p4=document.form1.param4.value;
	p3=document.form1.param3.value;
	p5=document.form1.param5.value;
	p6=document.form1.param6.value;
	if(p1==0){alert('Debe seleccionar una categoría');return;}
	if(p2==""){alert('Debe agregar el titulo de la publicación');return;}
	//if(p4==""){alert('Debe agregar la descripción de la publicación');return;}
	if(p5==""){alert('Debe agregar el valor de la publicación');return;}
	if(p6==""){alert('Debe agregar el autor de la publicación');return;}
	document.form1.submit();
}



function validaCatpubl()
{
	p1=document.form1.param1.value;
	p2=document.form1.param2.value;
	p3=document.form1.param3.value;
	if(p1==""){alert('Debe agregar una categoría');return;}
	//if(p2==""){alert('Debe agregar la Descripción de la categoría');return;}
	if(p3==""){alert('Debe agregar una imagen de la categoría');return;}
	document.form1.submit();
}

function validaGas1()
{
	p1=document.form1.param1.options[document.form1.param1.selectedIndex].value;
	p2=document.form1.param2.value;
	p3=document.form1.param3.value;
	if(p1==0){alert('Debe seleccionar un salón');return;}
	//if(p2==""){alert('Debe agregar la Descripción de la imagen');return;}
	document.form1.submit();
}



function validaPla1()
{
	p1=document.form1.param1.value;
	p2=document.form1.param2.value;
	p3=document.form1.param3.value;
	p4=document.form1.param4.value;
	if(p1==""){alert('Debe agregar el Nombre del plato');return;}
	//if(p2==""){alert('Debe agregar la Descripción del plato');return;}
	if(p4==""){alert('Debe agregar el valor del plato');return;}
	document.form1.submit();
}



function validaIt()
{
	p1=document.form1.param1.value;
	p2=document.form1.param2.value;
	p3=document.form1.param3.value;
	if(p1==""){alert('Debe agregar el Nombre del Item del menú');return;}
	//if(p2==""){alert('Debe agregar Descripción del Item del menú');return;}
	document.form1.submit();
}

function validaRo()
{
	p1=document.form1.param1.value;
	if(p1==""){alert('Debe agregar el Nombre del Rol');return;}
	document.form1.submit();
}


function validaPr()
{
	p1=document.form1.param1.options[document.form1.param1.selectedIndex].value;
	p2=document.form1.param2.value;
	p3=document.form1.param3.value;
	p4=document.form1.param4.value;
	p5=document.form1.param5.value;
	if(p1==0){alert('Debe Seleccionar una Categoría');return;}
	if(p2==""){alert('Debe agregar el Nombre del Producto');return;}
	//if(p3==""){alert('Debe agregar Descripción del Producto');return;}
	if(p4==""){alert('Debe agregar el precio del Producto');return;}
	if(p5==""){alert('Debe agregar una imágen asociada al Producto');return;}
	document.form1.submit();
}

function validaPrC()
{
	p1=document.form1.param1.options[document.form1.param1.selectedIndex].value;
	p2=document.form1.param2.value;
	p3=document.form1.param3.value;
	p4=document.form1.param4.value;
	if(p1==0){alert('Debe Seleccionar una Categoría');return;}
	if(p2==""){alert('Debe agregar el Nombre del Producto');return;}
	//if(p3==""){alert('Debe agregar Descripción del Producto');return;}
	if(p4==""){alert('Debe agregar el precio del Producto');return;}
	document.form1.submit();
}



function validaCaE()
{
	p1=document.form1.param1.value;
	p2=document.form1.param2.value;
	p4=document.form1.param4.options[document.form1.param4.selectedIndex].value;
	if(p4==0){alert('Debe seleccionar un Item del menú');return;}
	if(p1==""){alert('Debe agregar el Nombre del sub Item');return;}
	//if(p2==""){alert('Debe agregar Descripción del sub Item');return;}
	document.form1.submit();
}


function validaNot()
{
	p1=document.form1.param1.value;
	p2=document.form1.param2.value;
	p3=document.form1.param3.value;
	if(p1==""){alert('Debe agregar el Nombre del titular');return;}
	//if(p2==""){alert('Debe agregar el parrafo del titular');return;}
	if(p3==""){alert('Debe agregar una imagen para el titular');return;}
	document.form1.submit();
}

function validaNot1()
{
	p1=document.form1.param1.value;
	p2=document.form1.param2.value;
	if(p1==""){alert('Debe agregar el Nombre del titular');return;}
	//if(p2==""){alert('Debe agregar el parrafo del titular');return;}
	document.form1.submit();
}



function validaUS()
{
	p1=document.form1.param1.options[document.form1.param1.selectedIndex].value;
	p2=document.form1.param2.value;
	p3=document.form1.param3.value;
	p4=document.form1.param4.value;
	p5=document.form1.param5.value;
	p12=document.form1.param12.value;
	if(p1==0)
	{
		alert('Debe seleccionar un nivel de acceso');
		return;
	}
	if(p2=='')
	{
		alert('Debe especificar un nombre');
		return;
	}
	if(p3=='')
	{
		alert('Debe especificar el número de cédula');
		return;
	}
	if(parseInt(p4.length)<5)
	{
		alert('Debe definir un usuario con más de 5 o más caracteres');
		return;
	}		
	if(parseInt(p5.length)<5)
	{
		alert('Debe definir una contraseña con más de 5 o más caracteres');
		return;
	}		
	if(p5!=p12)
	{
		alert('Debe escribir la misma contraseña');
		return;
	}
	form1.submit(); 
}


function validaAgenda()
{
	p1=document.form1.param1.options[document.form1.param1.selectedIndex].value;
	p2=document.form1.param2.value;
	p3=document.form1.param3.options[document.form1.param3.selectedIndex].value;
	p4=document.form1.param4.options[document.form1.param4.selectedIndex].value;
	p5=document.form1.param5.value;
	p6=document.form1.param6.value;
	p7=document.form1.param7.value;
	if(p1==0){alert('Debe seleccionar un salón');return;}
	if(p2==""){alert('Debe seleccionar la fecha del evento');return;}
	if(p3==0){alert('Debe seleccionar la hora de inicio del evento');return;}
	if(p4==0){alert('Debe seleccionar la hora de fin del evento');return;}
	if(p5==""){alert('Debe agregar el nombre del evento');return;}
	document.form1.submit();
}



function popup (URL){ 
window.open(URL,"ventana1","width=800, height=600, scrollbars=yes, menubar=no, location=no, resizable=no") 
} 

