function change_over(src1) {
//src1.style.backgroundImage="url('images/bckgd_categ_over.gif')";
src1.bgColor = "#334279";
src1.style.cursor = "pointer";
}
function change_out(src1) {
//src1.style.backgroundImage="url('images/bckgd_categ_out.gif')";
src1.bgColor = "";
}
function show_art(catid){
location.href="articulos.php?catid="+catid;
}
function go_url(catid){
window.open(catid, '_blank');
}
function uno(src1, src2, src3, color_entrada, color_texto) {
src1.bgColor=color_entrada;
src1.style.color = color_texto;
src2.bgColor=color_entrada;
src2.style.color = color_texto;
src3.bgColor=color_entrada;
src3.style.color = color_texto;


var pepe=navigator.appName=="Microsoft Internet Explorer"?true:false;
var curs=pepe?'hand':'pointer';
src1.style.cursor=curs;
src2.style.cursor=curs;
src3.style.cursor=curs;
} 
function dos(src1, src2, src3, color_default, color_texto) {
src1.bgColor=color_default;
src1.style.cursor="default"; 
src1.style.color = color_texto;
src2.bgColor=color_default;
src2.style.cursor="default"; 
src2.style.color = color_texto;
src3.bgColor=color_default;
src3.style.cursor="default"; 
src3.style.color = color_texto;
} 
function tres(donde) {
var ir=window.location=donde;
} 




function reload_image()
{
  document.getElementById('captcha').src = "../securimage/securimage_show.php?" + Math.random();
}

//=============================
function hideall()
{
document.getElementById("msgrecuadro").style.display="none";
document.getElementById("msgtitulo").style.display="none";
document.getElementById("msgnombre").style.display="none";
document.getElementById("msgapellido").style.display="none";
document.getElementById("msgemail").style.display="none";
document.getElementById("msgcelular").style.display="none";
document.getElementById("msgusuario").style.display="none";
document.getElementById("msgcontrasena").style.display="none";
document.getElementById("msgcontrasena2").style.display="none";

}
//==========================0
function validar_env_foto(formulario) {
//hideall_comment();
//------------------------------------------
//Chequeo q el campo nombre no este vacio

var checkOK = "0123456789";
var checkStr = formulario.txt_cel.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++) {
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length) {
allValid = false;
break;
}
allNum += ch;
}


if (formulario.txt_cel.value.length < 1 || !allValid) {
	document.getElementById("divform").style.display="none";
	document.getElementById("btn_form").style.display="none";
	document.getElementById("cruz_cerrar").style.display="none";
	document.getElementById("msg_env").style.display="block";	
	err1 = 1;	
}else{
	
	//document.getElementById("divform").style.display="none";
	err1 = 0;
}	

if(err1 == 1){

	return(false);

}else{

	return(true);
} 
}


//================================
function hideall_comment()
{
document.getElementById("alerta_comm1").style.display="none";
document.getElementById("alerta_comm2").style.display="none";
}


function validar_contacto(formulario){

if (formulario.txt_name.value.length < 1) {
	alert("Please enter you name");
	return(false);
}else if ((formulario.txt_email.value.indexOf ('@', 0) == -1)||(formulario.txt_email.value.length < 5)) {

	alert("Please enter you email address");
	return(false);
}else if (formulario.txt_comment.value.length < 1) {
	alert("Please enter the comment");
	return(false);
}else{
	formulario.submit();	
}

}

//==============================
function validar_art_nuevo(formulario) {

//------------------------------------------
//Chequeo q el campo nombre no este vacio

if (formulario.categorias.selectedIndex==0) {
	alert("Please choose a section");
	return(false);
}
if (formulario.subcategorias.selectedIndex==0) {
	alert("Please choose a group");
	return(false);
}
if (formulario.txt_descripcion.value.length < 1) {
	alert("Please enter the item's description");
	return(false);
}
if (formulario.txt_foto.value.length < 1) {
	alert("Plase choose the item's picture");
	return(false);
}

}
//==============================

//==============================
function validar_entrada(formulario) {

//------------------------------------------
//Chequeo q el campo nombre no este vacio

if (formulario.txt_titulo.value.length < 1) {
	alert("Please enter the title");
	return(false);
}

if (formulario.elm1.value.length < 1) {
	alert("Please enter the content");
	return(false);
}

}
//==============================

//==============================
function validar_acercade(formulario) {

//------------------------------------------
//Chequeo q el campo nombre no este vacio

if (formulario.elm1.value.length < 1) {
	alert("Please, enter the content");
	return(false);
}

}
//==============================

//==============================
function validar_links(formulario) {

//------------------------------------------
//Chequeo q el campo nombre no este vacio

if (formulario.elm1.value.length < 1) {
	alert("Please, enter the content");
	return(false);
}

}
//==============================

//==============================
function validar_art(formulario) {

//------------------------------------------
//Chequeo q el campo nombre no este vacio

if (formulario.categorias.selectedIndex==0) {
	alert("Debes elegir una categoría");
	return(false);
}
if (formulario.subcategorias.selectedIndex==0) {
	alert("Debes elegir una subcategoría");
	return(false);
}
if (formulario.txt_nombre.value.length < 1) {
	alert("Debes ingresar el nombre del articulo");
	return(false);
}

if (formulario.txt_descripcion.value.length < 1) {
	alert("Debes ingresar la descripción del articulo");
	return(false);
}

}

//==============================
function validar_subcategoria_nueva(formulario) {

//------------------------------------------
//Chequeo q el campo nombre no este vacio

if (formulario.categorias.selectedIndex==0) {
	alert("Please choose a section");
	return(false);
}

if (formulario.txt_nombre.value.length < 1) {
	alert("Please enter the group name");
	return(false);
}

/*if (formulario.txt_foto.value.length < 1 && formulario.txt_foto2.value.length < 1 ) {
	alert("Debes elegir o las dos fotos (la grande y la chica) o no elegir ninguna");
	return(false);
}*/

}

//==============================
function validar_subcategoria_editada(formulario) {

//------------------------------------------
//Chequeo q el campo nombre no este vacio

if (formulario.categorias.selectedIndex==0) {
	alert("Please choose a section");
	return(false);
}

if (formulario.txt_nombre.value.length < 1) {
	alert("Please enter the group name");
	return(false);
}


}

//==============================
function validar_categoria_nueva(formulario) {

//------------------------------------------
//Chequeo q el campo nombre no este vacio

if (formulario.txt_nombre.value.length < 1) {
	alert("Please enter the category's name");
	return(false);
}

}


//==============================
function validar_opcion_nueva(formulario) {

//------------------------------------------
//Chequeo q el campo nombre no este vacio

if (formulario.txt_nombre.value.length < 1) {
	alert("Please enter the name");
	return(false);
}

}


//==============================

function validar(formulario) {
	


hideall();


//------------------------------------------
//Chequeo q el campo nombre no este vacio

if (formulario.txt_nombre.value.length < 1) {
	document.getElementById("msgnombre").style.display="block";
	err1 = 1;	
}else{
	
	document.getElementById("msgnombre").style.display="none";
	err1 = 0;
}	


//------------------------------------------
//Chequeo q el campo apellido no este vacio

if (formulario.txt_apellido.value.length < 1) {
	document.getElementById("msgapellido").style.display="block";
	err2 = 1;	
}else{
	
	document.getElementById("msgapellido").style.display="none";
	err2 = 0;
}	

//------------------------------------------
//Chequeo q el campo email no este vacio

if ((formulario.txt_email.value.indexOf ('@', 0) == -1)||(formulario.txt_email.value.length < 5)) {

	document.getElementById("msgemail").style.display="block";
	err3 = 1;
}else{
	
	document.getElementById("msgemail").style.display="none";
    err3 = 0;
}	

//------------------------------------------
//Chequeo q se haya elegido el sexo



if ((!formulario.sexo[0].checked && !formulario.sexo[1].checked)) {

	document.getElementById("msgsexo").style.display="block";
	err7 = 1;
}else{
	
	document.getElementById("msgsexo").style.display="none";
    err7 = 0;
}	


//------------------------------------------------------------
//chequeo q el campo celular sea solo numerico y no este vacio

var checkOK = "0123456789";
var checkStr = formulario.txt_celular.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++) {
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length) {
allValid = false;
break;
}
allNum += ch;
}

if (formulario.txt_celular.value.length < 1 || !allValid) {
	document.getElementById("msgcelular").style.display="block";
	err4 = 1;	
}else{
	
	document.getElementById("msgcelular").style.display="none";
	err4 = 0;
}	


//------------------------------------------
//Chequeo q el campo usuario no este vacio

if (formulario.txt_usuario.value.length < 1) {
	document.getElementById("msgusuario").style.display="block";
	err5 = 1;	
}else{
	
	document.getElementById("msgusuario").style.display="none";
	err5 = 0;
}	


//------------------------------------------
//Chequeo q el campo contraseña no este vacio

if (formulario.txt_contrasena.value.length < 1) {
	document.getElementById("msgcontrasena").style.display="block";
	err6 = 1;	
}else{
	
	document.getElementById("msgcontrasena").style.display="none";
	err6 = 0;
}	


if(err1 == 1 || err2 == 1 || err3 == 1 || err4 == 1 || err5 == 1 || err6 == 1 || err7 == 1){
	document.getElementById("msgrecuadro").style.display="block";	
	document.getElementById("msgtitulo").style.display="block";
	window.location="#Top";
	return(false);

}else{

	return(true);
} 


}


//==============================
function validar_edicion(formulario) {
hideall();


//------------------------------------------
//Chequeo q el campo nombre no este vacio

if (formulario.txt_nombre.value.length < 1) {
	document.getElementById("msgnombre").style.display="block";
	err1 = 1;	
}else{
	
	document.getElementById("msgnombre").style.display="none";
	err1 = 0;
}	


//------------------------------------------
//Chequeo q el campo apellido no este vacio

if (formulario.txt_apellido.value.length < 1) {
	document.getElementById("msgapellido").style.display="block";
	err2 = 1;	
}else{
	
	document.getElementById("msgapellido").style.display="none";
	err2 = 0;
}	

//------------------------------------------
//Chequeo q el campo email no este vacio

if ((formulario.txt_email.value.indexOf ('@', 0) == -1)||(formulario.txt_email.value.length < 5)) {

	document.getElementById("msgemail").style.display="block";
	err3 = 1;
}else{
	
	document.getElementById("msgemail").style.display="none";
    err3 = 0;
}	

//------------------------------------------
//Chequeo q se haya elegido el sexo



if ((!formulario.sexo[0].checked && !formulario.sexo[1].checked)) {

	document.getElementById("msgsexo").style.display="block";
	err7 = 1;
}else{
	
	document.getElementById("msgsexo").style.display="none";
    err7 = 0;
}	


//------------------------------------------------------------
//chequeo q el campo celular sea solo numerico y no este vacio

var checkOK = "0123456789";
var checkStr = formulario.txt_celular.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++) {
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length) {
allValid = false;
break;
}
allNum += ch;
}

if (formulario.txt_celular.value.length < 1 || !allValid) {
	document.getElementById("msgcelular").style.display="block";
	err4 = 1;	
}else{
	
	document.getElementById("msgcelular").style.display="none";
	err4 = 0;
}	


//------------------------------------------
//Chequeo q el campo usuario no este vacio

if (formulario.txt_usuario.value.length < 1) {
	document.getElementById("msgusuario").style.display="block";
	err5 = 1;	
}else{
	
	document.getElementById("msgusuario").style.display="none";
	err5 = 0;
}	


//------------------------------------------
//Chequeo q el campo contraseña no este vacio

if (formulario.txt_contrasena.value.length < 1) {
	document.getElementById("msgcontrasena").style.display="block";
	err6 = 1;	
}else{
	
	document.getElementById("msgcontrasena").style.display="none";
	err6 = 0;
}	


if(err1 == 1 || err2 == 1 || err3 == 1 || err4 == 1 || err5 == 1 || err6 == 1 || err7 == 1){
	document.getElementById("msgrecuadro").style.display="block";	
	document.getElementById("msgtitulo").style.display="block";
	window.location="#Top";
	return(false);

}else{

	return(true);
} 


}

