function resizeIframe(){
		var miIframe=document.getElementById("pregunta");
		var alturaPagina=miIframe.contentWindow.document.body. scrollHeight;
		miIframe.style.height=alturaPagina;
}

function valida()
 {    
   //Valido el usuario
    if (document.getElementById('usuario').value=='')
	{
	   alert("Por favor escribe el usuario")
       document.getElementById('usuario').focus()
       return 0;
    }
    //Valido contraseña
    if (document.getElementById('contrasena').value==''){
        alert("Por favor escribe la contraseña")
       	document.getElementById('contrasena').focus()
       	return 0;
    } 
 
    document.getElementById('acceso').submit();
  }
   
// Funcion Radio 
function isEmail(theElement)
{
	var s = theElement;
	var filter=/^[A-Za-z][A-Za-z0-9_.]*@[A-Za-z0-9_-]+\.[A-Za-z0-9_.]+[A-za-z]$/;
	if (filter.test(s))
		return true;
	else
		return false;
}


function valida_prodes()
 {    
    if (document.getElementById('primero').value==document.getElementById('segundo').value)
	{
	   alert("Por favor seleccione otro producto para el Producto 2")
       document.getElementById('segundo').focus()
       return 0;
    }
	
	if (document.getElementById('segundo').value==document.getElementById('tercero').value)
	{
	   alert("Por favor seleccione otro producto para el Producto 3")
       document.getElementById('tercero').focus()
       return 0;
    }
	
    if (document.getElementById('primero').value==document.getElementById('tercero').value)
	{
        alert("Por favor seleccione otro producto para el Producto 3")
       	document.getElementById('tercero').focus()
       	return 0;
    } 
 
    document.getElementById('prodes').submit();
  }


function check()
{
	var marcado = "no";
	with (document.votos)
	{
		for ( var i = 0; i < respuesta.length; i++ ) 
		{
		  if ( respuesta [i].checked ) 
			{
				document.votos.submit();
				return true;
			}
	}
	if ( marcado == "no" )
	{
		window.alert("Por favor seleccione una respuesta" ) ;
	}
   }	
} 


function seletsion(pestana,a,b,c,d)
{
	switch(pestana)
	{
		case 'empleados':
			//alert("esto es empleados");
			document.getElementById(a).style.display="block";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="none";
			break;
		case 'movimientos':
			//alert("esto es movimientos");
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="block";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="none";
			break;
		case 'principal':
			//alert("esto es principoal");
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="block";
			document.getElementById(d).style.display="none";
			break;
		case 'detalle':
			//alert("esto es detalle");
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="block";
			break;
	}
}


function seletsion3(pestana,a,b)
{
	switch(pestana)
	{
		/*Conceptos de NOMIPAQ	*/
		case 'archivo':
			//alert("esto es empleados");
			document.getElementById(a).style.display="block";
			document.getElementById(b).style.display="none";
			break;
		case 'catalogo':
			//alert("esto es movimientos");
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="block";
			break;
	}
}

function seletsion4(pestana,a,b,c,d)
{
	switch(pestana)
	{
		case 'categoria_principal':
			//Muestra Categoria Principal
			document.getElementById(a).style.display="block";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="none";
			//Termina Categoria Principal
			break;
	   case 'categoria':
			//Muestra Categoria
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="block";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="none";
			//Termina Categoria
			break;
	 	case 'subcategoria':
			//Muestra Subcategoria
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="block";
			document.getElementById(d).style.display="none";
			//Termina Subcategoria
			break;
	  	case 'marca':
			//Muestra Marca
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="block";
			//Termina Marca
			break;
	}
}


function mostrar(pestana,a,b,c,d,e)
{
	switch(pestana)
	{
		case 'productos':
			//Inicia Muestra Productos 
			document.getElementById(a).style.display="block";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="none";
			document.getElementById(e).style.display="none";
			//Termina Muestra Productos
			break;
			
		case 'categoria-principal':
			//Inicia Muestra Categoria Principal 
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="block";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="none";
			document.getElementById(e).style.display="none";
			//Termina Muestra Categoria Principal
			break;
			
		case 'categoria':
			//Inicia Muestra Categoria
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="block";
			document.getElementById(d).style.display="none";
			document.getElementById(e).style.display="none";
			//Termina Muestra Categoria
			break;
			
	  case 'subcategoria':
			//Inicia Muestra Subcategoria
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="block";
			document.getElementById(e).style.display="none";
			//Termina Muestra Subcategoria
			break;
			
	  case 'marca':
			//Inicia Muestra Marca
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="none";
			document.getElementById(e).style.display="block";
			//Termina Muestra Marca
			break;
	}
}

function cambiarDisplay(id)
{
  if (!document.getElementById) return false;
  	fila = document.getElementById(id);
  if (fila.style.display != "none")
  {
    //fila.style.display = "none"; //ocultar fila 
  } 
  	else
  {
    fila.style.display = ""; //mostrar fila 
  }
}

function oculta(id)
{
	if (!document.getElementById) return false;
  	fila = document.getElementById(id);
  if (fila.style.display != "none")
  {
	fila.style.display = "none"; //ocultar fila 
	
  } 
  	else
  {
    fila.style.display = ""; //mostrar fila 
  }
}

function verifica(opcion,renglon)
{
	if(document.getElementById(opcion).value=="")
	{
		document.getElementById(renglon).style.display="none"
	}
	else
	{
		document.getElementById(renglon).style.display="block"
	}
}
	
function boton_configuracion()
{
	if((document.getElementById('pregunta').value==""))
	{
		document.getElementById('boton').style.display='none';
	}
	else
	{
		document.getElementById('boton').style.display='block';
	}
}

function boton_relacion()
{
	if(document.getElementById('respuesta_nueva').value=="")
	{
		document.getElementById('submit').style.display='none';
	}
	else
	{
		document.getElementById('submit').style.display='block';
	}
}

function boton_conversion_noi()
{
	if((document.getElementById('fechaini').value!="")&&(document.getElementById('fechafin').value!=""))
	{
		document.getElementById('leer').style.display='block';
	}
}



/*=======================================================================================================FUNCION TEMPORAL*/

// JavaScript Document
/*para agregar elemementos a actividad prepponderante*/
		var numero = 0;
		// Funciones comunes
		c= function (tag) { // Crea un elemento
		   return document.createElement(tag);
		}
		d = function (id) { // Retorna un elemento en base al id
		   return document.getElementById(id);
		}
		e = function (evt) { // Retorna el evento
		   return (!evt) ? event : evt;
		}
		f = function (evt) { // Retorna el objeto que genera el evento
		   return evt.srcElement ?  evt.srcElement : evt.target;
		}
		
		///PARA AGREGAR ELEMENTOS A DOMICILIO
		addElements = function () {
			
			container = d('ConGral');
			
		    div = c('DIV');
			div.className = 'subCont';
		    div.id = 'Cont' + (++numero);		
			
		    container.appendChild(div);
			
			containerD = d(div.id);
			
			
			//calle
			box1 = c('DIV');
			box1.className = 'box1';
			
			box2 = c('DIV');
			box2.className = 'box1';
			
			box3 = c('DIV');
			box3.className = 'box1';
			
			box4 = c('DIV');
			box4.className = 'box1';
			
			box5 = c('DIV');
			box5.className = 'box2';
			
			quitar = c('a');
		    quitar.name = div.id;
		    quitar.href = '#up';
		    quitar.onclick = removeDiv;
		    quitar.innerHTML = 'Quitar';
			
			txtAp = c('INPUT');   
		    txtAp.name = 'txtAApellidoP[]';
			txtAp.id = 'txtAApellidoP[]';
		    txtAp.type = 'text';
		    txtAp.size = '20';
			
			txtAm = c('INPUT');   
		    txtAm.name = 'txtAapellidom[]';
			txtAm.id = 'txtAapellidom[]';
		    txtAm.type = 'text';
		    txtAm.size = '20';
			
			txtNom = c('INPUT');   
		    txtNom.name = 'txtAnombre[]';
			txtNom.id = 'txtAnombre[]';
		    txtNom.type = 'text';
		    txtNom.size = '20';
			
			txtCargo = c('INPUT');   
		    txtCargo.name = 'txtAcargo[]';
			txtCargo.id = 'txtAcargo[]';
		    txtCargo.type = 'text';
		    txtCargo.size = '20';
			
			var ini = document.getElementById('Altura').height;
			 document.getElementById('Altura').height = parseInt(ini) + (numero * 3);
			
			containerD.appendChild(box1);			
			box1.appendChild(txtAp);
			
			containerD.appendChild(box2);
			box2.appendChild(txtAm);
			
			containerD.appendChild(box3);
			box3.appendChild(txtNom);
			
			
			containerD.appendChild(box4);
			box4.appendChild(txtCargo);
			
			containerD.appendChild(box5);
			box5.appendChild(quitar);
		}
		removeDiv = function (evt) {
		   lnk = f(e(evt));
		   div = d(lnk.name);
		   div.parentNode.removeChild(div); 
		}
		
function options(pestana,a,b,c,d,e)
{
	switch(pestana)
	{
		case 'descripcion':
		    /*document.getElementById('descripcion').style.color = "#086FB2";
			document.getElementById('ficha_tecnica').style.color = "#8DB4C5";
			document.getElementById('manual').style.color = "#8DB4C5";
			document.getElementById('video').style.color = "#8DB4C5";
			document.getElementById('software').style.color = "#8DB4C5";*/
			document.getElementById(a).style.display="block";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="none";
			document.getElementById(e).style.display="none";
			//document.getElementById(f).style.display="none";
			/*document.getElementById(g).style.display="none";
			document.getElementById(h).style.display="none";
			document.getElementById(i).style.display="none";
			document.getElementById(j).style.display="none";
			document.getElementById(k).style.display="none";
			document.getElementById(l).style.display="none";
			document.getElementById(m).style.display="none";
			document.getElementById(n).style.display="none";
			document.getElementById(o).style.display="none";
			document.getElementById(p).style.display="none";*/
			break;
		case 'ficha_tecnica':
		    /*document.getElementById('descripcion').style.color = "#8DB4C5";
			document.getElementById('ficha_tecnica').style.color = "#086FB2";
			document.getElementById('manual').style.color = "#8DB4C5";
			document.getElementById('video').style.color = "#8DB4C5";
			document.getElementById('software').style.color = "#8DB4C5";*/
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="block";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="none";
			document.getElementById(e).style.display="none";
			//document.getElementById(f).style.display="none";
			/*document.getElementById(g).style.display="none";
			document.getElementById(h).style.display="none";
			document.getElementById(i).style.display="none";
			document.getElementById(j).style.display="none";
			document.getElementById(k).style.display="none";
			document.getElementById(l).style.display="none";
			document.getElementById(m).style.display="none";
			document.getElementById(n).style.display="none";
			document.getElementById(o).style.display="none";
			document.getElementById(p).style.display="none";*/
			break;
		case 'manual':
		   /* document.getElementById('descripcion').style.color = "#8DB4C5";
			document.getElementById('ficha_tecnica').style.color = "#8DB4C5";
			document.getElementById('manual').style.color = "#086FB2";
			document.getElementById('video').style.color = "#8DB4C5";
			document.getElementById('software').style.color = "#8DB4C5";*/
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="block";
			document.getElementById(d).style.display="none";
			document.getElementById(e).style.display="none";
			//document.getElementById(f).style.display="block";
			/*document.getElementById(g).style.display="block";
			document.getElementById(h).style.display="block";
			document.getElementById(i).style.display="block";
			document.getElementById(j).style.display="block";
			document.getElementById(k).style.display="none";
			document.getElementById(l).style.display="none";
			document.getElementById(m).style.display="none";
			document.getElementById(n).style.display="none";
			document.getElementById(o).style.display="none";
			document.getElementById(p).style.display="none";*/
			break;
		case 'video':
		    /*document.getElementById('descripcion').style.color = "#8DB4C5";
			document.getElementById('ficha_tecnica').style.color = "#8DB4C5";
			document.getElementById('manual').style.color = "#8DB4C5";
			document.getElementById('video').style.color = "#086FB2";
			document.getElementById('software').style.color = "#8DB4C5";*/
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="block";
			document.getElementById(e).style.display="none";
			//document.getElementById(f).style.display="none";
			/*document.getElementById(g).style.display="none";
			document.getElementById(h).style.display="none";
			document.getElementById(i).style.display="none";
			document.getElementById(j).style.display="none";
			document.getElementById(k).style.display="block";
			document.getElementById(l).style.display="block";
			document.getElementById(m).style.display="block";
			document.getElementById(n).style.display="none";
			document.getElementById(o).style.display="none";
			document.getElementById(p).style.display="none";*/
			break;
			
	  case 'software':
	        /*document.getElementById('descripcion').style.color = "#8DB4C5";
			document.getElementById('ficha_tecnica').style.color = "#8DB4C5";
			document.getElementById('manual').style.color = "#8DB4C5";
			document.getElementById('video').style.color = "#8DB4C5";
			document.getElementById('software').style.color = "#086FB2";*/
			document.getElementById(a).style.display="none";
			document.getElementById(b).style.display="none";
			document.getElementById(c).style.display="none";
			document.getElementById(d).style.display="none";
			document.getElementById(e).style.display="block";
			//document.getElementById(f).style.display="none";
			/*document.getElementById(g).style.display="none";
			document.getElementById(h).style.display="none";
			document.getElementById(i).style.display="none";
			document.getElementById(j).style.display="none";
			document.getElementById(k).style.display="none";
			document.getElementById(l).style.display="none";
			document.getElementById(m).style.display="none";
			document.getElementById(n).style.display="block";
			document.getElementById(o).style.display="block";
			document.getElementById(p).style.display="block";*/
			break;
	}
}
function pestanas(p1,p2,p3,p4,t_a,t_b,t_c,t_d)
{
	/*PARA LAS PESTAÑAS*/
	document.getElementById(p1).style.color = '#0086FF';	
	document.getElementById(p2).style.color = '#000000';
	document.getElementById(p3).style.color = '#000000';
	document.getElementById(p4).style.color = '#000000';
	/*PARA LOS DIVS*/
	document.getElementById(t_a).style.display="block";
	document.getElementById(t_b).style.display="none";
	document.getElementById(t_c).style.display="none";
	document.getElementById(t_d).style.display="none";
}

function pestanas2(p1,p2,t_a,t_b,t_c,t_d)
{
	document.getElementById(p1).style.color = '#0086FF';	
	document.getElementById(p2).style.color = '#000000';
	
	document.getElementById(t_a).style.display="block";
	document.getElementById(t_b).style.display="none";
	document.getElementById(t_c).style.display="none";
	document.getElementById(t_d).style.display="none";
}

function agregar(a,b,c)
{
	document.getElementById(a).style.display="block";
	document.getElementById(b).style.display="none";
	document.getElementById(c).style.display="block";
	
}
function quitar(a,b,c)
{
	document.getElementById(a).style.display="none";
	document.getElementById(b).style.display="none";
	document.getElementById(c).style.display="block";
	
}


//Validar Formulario Contacto ------------------------------------------------->

function valida_contacto()
{    
	//Valido el Nombre
    if (document.contacto.nombre.value.length==0){
       alert("Por favor escribe tu nombre")
       document.contacto.nombre.focus()
       return 0;
    }
	
	//Valido Empresa
    if (document.contacto.empresa.value.length==0){
       alert("Por favor escribe la empresa")
       document.contacto.empresa.focus()
       return 0;
    }
	
	//Valido Correo
	var elemento =document.getElementById("email");	
	//var alemento=document.forma.mail;
	var s = elemento.value;
	var filter=/^[A-Za-z][A-Za-z0-9_.]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
	if (s.length == 0) {
		alert("Por favor escribe tu correo eletrónico")
		document.contacto.mail.focus()
        return 0;
	}
	if (!filter.test(s)) {
		alert("Por favor escribe tu correo eletrónico correctamente")
		document.contacto.mail.focus()
        return 0;
	}
	
	//Valido el Telefono
    if (document.contacto.telefono.value.length==0){
       alert("Por favor escribe el telefono")
       document.contacto.telefono.focus()
       return 0;
    }
	
	
	
	//valido el msj
    if (document.contacto.msj.value.length==0){
       alert("Por favor escribe tu mensaje")
       document.contacto.msj.focus()
       return 0;
    }    

   document.contacto.submit();
}

//Validar Formulario Productos ------------------------------------------------->

function valida_productos()
{    
	
    if (document.productos.categoria_principal.selectedIndex==0){
       alert("Por favor selecciona una categoria principal");
       document.productos.categoria_principal.focus();
       return 0;
    }
	
	 if (document.productos.categoria.selectedIndex==0){
       alert("Por favor selecciona una categoria");
       document.productos.categoria.focus();
       return 0;
    }
	
	if (document.productos.subcategoria.selectedIndex==0){
       alert("Por favor selecciona una Sub categoria");
       document.productos.subcategoria.focus();
       return 0;
    }
	
	if(document.getElementById('t_segunda').style.display == "block")
	{
		if(document.productos.segunda_principal.selectedIndex!=0){
		   if(document.productos.segunda_categoria.selectedIndex==0){
			  alert("Por favor selecciona la segunda categoria");
		      document.productos.segunda_categoria.focus();
		      return 0;
		   }
		}
		
		if(document.productos.segunda_categoria.selectedIndex!=0){
		   if(document.productos.segunda_subcategoria.selectedIndex==0){
			  alert("Por favor selecciona la segunda categoria");
		      document.productos.segunda_subcategoria.focus();
		      return 0;
		   }
		}
	}

    if (document.productos.marca.selectedIndex==0){
       alert("Por favor selecciona una marca");
       document.productos.marca.focus();
       return 0;
    }
	
    if (document.productos.modelo.value.length==0){
       alert("Por favor escribe el modelo");
       document.productos.modelo.focus();
       return 0;
    }
	
	//Valido Descripcion
    if (document.productos.descripcion.value.length==0){
       alert("Por favor escribe la descripcion");
       document.productos.descripcion.focus();
       return 0;
    }  
	
    if (document.productos.precio.value.length==0){
       alert("Por favor escribe el precio");
       document.productos.precio.focus();
       return 0;
    }

	if (document.productos.moneda[0].checked!=true && document.productos.moneda[1].checked!=true){
		alert("Por favor seleccione un tipo de moneda");
		document.productos.moneda[0].focus()
        return 0;
	}
	
	 if (document.productos.imagen.value.length!=0){
		 if(comprueba_extension()!= true){
		    document.productos.imagen.focus();
			return 0;
		 }
    }

   document.productos.submit();
}

function mostrar(id)
{
	switch(id)
	{
		case "ubi_fictec":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_ficha_tecnica').style.display = "none";
		document.getElementById('link_fictec').style.display = "none";
		break;
		case "ubi_fictec_2":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_ficha_tecnica_2').style.display = "none";
		document.getElementById('link_fictec_2').style.display = "none";
		break;
		case "ubi_fictec_3":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_ficha_tecnica_3').style.display = "none";
		document.getElementById('link_fictec_3').style.display = "none";
		break;
		case "ubi_manusu":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_manual_usuario').style.display = "none";
		document.getElementById('link_manusu').style.display = "none";
		break;	
		case "ubi_manusu_2":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_manual_usuario_2').style.display = "none";
		document.getElementById('link_manusu_2').style.display = "none";
		break;	
		case "ubi_manusu_3":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_manual_usuario_3').style.display = "none";
		document.getElementById('link_manusu_3').style.display = "none";
		break;
		case "ubi_maninst":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_manual_instalacion').style.display = "none";
		document.getElementById('link_maninst').style.display = "none";
		break;
		case "ubi_maninst_2":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_manual_instalacion_2').style.display = "none";
		document.getElementById('link_maninst_2').style.display = "none";
		break;	
		case "ubi_maninst_3":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_manual_instalacion_3').style.display = "none";
		document.getElementById('link_maninst_3').style.display = "none";
		break;
		case "ubi_video":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_video').style.display = "none";
		document.getElementById('link_video').style.display = "none";
		break;
		case "ubi_video_2":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_video_2').style.display = "none";
		document.getElementById('link_video_2').style.display = "none";
		break;
		case "ubi_video_3":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_video_3').style.display = "none";
		document.getElementById('link_video_3').style.display = "none";
		break;	
		case "ubi_sofdow":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_software_download').style.display = "none";
		document.getElementById('link_sofdow').style.display = "none";
		break;
		case "ubi_sofdow_2":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_software_download_2').style.display = "none";
		document.getElementById('link_sofdow_2').style.display = "none";
		break;
		case "ubi_sofdow_3":
		document.getElementById(id).style.display = "block";
		document.getElementById('t_software_download_3').style.display = "none";
		document.getElementById('link_sofdow_3').style.display = "none";
		break;										
	}
}

function ocultar(id)
{
	switch(id)
	{
		case "ubi_fictec":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_ficha_tecnica').style.display = "block";
		document.getElementById('link_fictec').style.display = "block";
		break;
		case "ubi_fictec_2":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_ficha_tecnica_2').style.display = "block";
		document.getElementById('link_fictec_2').style.display = "block";
		break;
		case "ubi_fictec_3":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_ficha_tecnica_3').style.display = "block";
		document.getElementById('link_fictec_3').style.display = "block";
		break;
		case "ubi_manusu":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_manual_usuario').style.display = "block";
		document.getElementById('link_manusu').style.display = "block";
		break;	
		case "ubi_manusu_2":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_manual_usuario_2').style.display = "block";
		document.getElementById('link_manusu_2').style.display = "block";
		break;	
		case "ubi_manusu_3":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_manual_usuario_3').style.display = "block";
		document.getElementById('link_manusu_3').style.display = "block";
		break;
		case "ubi_maninst":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_manual_instalacion').style.display = "block";
		document.getElementById('link_maninst').style.display = "block";
		break;
		case "ubi_maninst_2":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_manual_instalacion_2').style.display = "block";
		document.getElementById('link_maninst_2').style.display = "block";
		break;	
		case "ubi_maninst_3":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_manual_instalacion_3').style.display = "block";
		document.getElementById('link_maninst_3').style.display = "block";
		break;
		case "ubi_video":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_video').style.display = "block";
		document.getElementById('link_video').style.display = "block";
		break;
		case "ubi_video_2":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_video_2').style.display = "block";
		document.getElementById('link_video_2').style.display = "none";
		break;
		case "ubi_video_3":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_video_3').style.display = "block";
		document.getElementById('link_video_3').style.display = "block";
		break;	
		case "ubi_sofdow":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_software_download').style.display = "block";
		document.getElementById('link_sofdow').style.display = "block";
		break;
		case "ubi_sofdow_2":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_software_download_2').style.display = "block";
		document.getElementById('link_sofdow_2').style.display = "block";
		break;
		case "ubi_sofdow_3":
		document.getElementById(id).style.display = "none";
		document.getElementById('t_software_download_3').style.display = "block";
		document.getElementById('link_sofdow_3').style.display = "block";
		break;									
	}
}

function agregar_fichastec()
{
	document.getElementById('agregar_fichastec').style.display = "none";
	document.getElementById('quitar_fichastec').style.display = "block";
	document.getElementById('t_ficha_tecnica').style.display = "block";
	document.getElementById('link_fictec').style.display = "block";
	document.getElementById('t_ficha_tecnica_2').style.display = "block";
	document.getElementById('link_fictec_2').style.display = "block";
	document.getElementById('t_ficha_tecnica_3').style.display = "block";
	document.getElementById('link_fictec_3').style.display = "block";	
}
function agregar_manusu()
{
	document.getElementById('agregar_manusu').style.display = "none";
	document.getElementById('quitar_manusu').style.display = "block";
	document.getElementById('t_manual_usuario').style.display = "block";
	document.getElementById('link_manusu').style.display = "block";
	document.getElementById('t_manual_usuario_2').style.display = "block";
	document.getElementById('link_manusu_2').style.display = "block";
	document.getElementById('t_manual_usuario_3').style.display = "block";
	document.getElementById('link_manusu_3').style.display = "block";
}
function agregar_mansinst()
{
	document.getElementById('agregar_mansinst').style.display = "none";
	document.getElementById('quitar_mansinst').style.display = "block";
	document.getElementById('t_manual_instalacion').style.display = "block";
	document.getElementById('link_maninst').style.display = "block";
	document.getElementById('t_manual_instalacion_2').style.display = "block";
	document.getElementById('link_maninst_2').style.display = "block";
	document.getElementById('t_manual_instalacion_3').style.display = "block";
	document.getElementById('link_maninst_3').style.display = "block";	
}
function agregar_videos()
{
	document.getElementById('agregar_videos').style.display = "none";
	document.getElementById('quitar_videos').style.display = "block";
	document.getElementById('t_video').style.display = "block";
	document.getElementById('link_video').style.display = "block";
	document.getElementById('t_video_2').style.display = "block";
	document.getElementById('link_video_2').style.display = "block";
	document.getElementById('t_video_3').style.display = "block";
	document.getElementById('link_video_3').style.display = "block";
}
function agregar_software()
{
	document.getElementById('agregar_software').style.display = "none";
	document.getElementById('quitar_software').style.display = "block";
	document.getElementById('t_software_download').style.display = "block";
	document.getElementById('link_sofdow').style.display = "block";
	document.getElementById('t_software_download_2').style.display = "block";
	document.getElementById('link_sofdow_2').style.display = "block";
	document.getElementById('t_software_download_3').style.display = "block";
	document.getElementById('link_sofdow_3').style.display = "block";
}


function quitar_fichastec()
{
	document.getElementById('agregar_fichastec').style.display = "block";
	document.getElementById('quitar_fichastec').style.display = "none";
	document.getElementById('t_ficha_tecnica').style.display = "none";
	document.getElementById('link_fictec').style.display = "none";
	document.getElementById('t_ficha_tecnica_2').style.display = "none";
	document.getElementById('link_fictec_2').style.display = "none";
	document.getElementById('t_ficha_tecnica_3').style.display = "none";
	document.getElementById('link_fictec_3').style.display = "none";	
}
function quitar_manusu()
{
	document.getElementById('agregar_manusu').style.display = "block";
	document.getElementById('quitar_manusu').style.display = "none";
	document.getElementById('t_manual_usuario').style.display = "none";
	document.getElementById('link_manusu').style.display = "none";
	document.getElementById('t_manual_usuario_2').style.display = "none";
	document.getElementById('link_manusu_2').style.display = "none";
	document.getElementById('t_manual_usuario_3').style.display = "none";
	document.getElementById('link_manusu_3').style.display = "none";
}
function quitar_mansinst()
{
	document.getElementById('agregar_mansinst').style.display = "block";
	document.getElementById('quitar_mansinst').style.display = "none";
	document.getElementById('t_manual_instalacion').style.display = "none";
	document.getElementById('link_maninst').style.display = "none";
	document.getElementById('t_manual_instalacion_2').style.display = "none";
	document.getElementById('link_maninst_2').style.display = "none";
	document.getElementById('t_manual_instalacion_3').style.display = "none";
	document.getElementById('link_maninst_3').style.display = "none";	
}
function quitar_videos()
{
	document.getElementById('agregar_videos').style.display = "block";
	document.getElementById('quitar_videos').style.display = "none";
	document.getElementById('t_video').style.display = "none";
	document.getElementById('link_video').style.display = "none";
	document.getElementById('t_video_2').style.display = "none";
	document.getElementById('link_video_2').style.display = "none";
	document.getElementById('t_video_3').style.display = "none";
	document.getElementById('link_video_3').style.display = "none";
}
function quitar_software()
{
	document.getElementById('agregar_software').style.display = "block";
	document.getElementById('quitar_software').style.display = "none";
	document.getElementById('t_software_download').style.display = "none";
	document.getElementById('link_sofdow').style.display = "none";
	document.getElementById('t_software_download_2').style.display = "none";
	document.getElementById('link_sofdow_2').style.display = "none";
	document.getElementById('t_software_download_3').style.display = "none";
	document.getElementById('link_sofdow_3').style.display = "none";
}

function numeros(e,txt) {
        tecla = (document.all) ? e.keyCode : e.which;
            if (tecla==8) return true; //Tecla de retroceso (para poder borrar)
            if (tecla==35) return true; //Tecla Fin
            if (tecla==36) return true; //Tecla Inicio
            if (tecla==37) return true; //Tecla cursor izquierda
            if (tecla==39) return true; //Tecla cursor derecha
            if (tecla==52) return false; //Dólar
            if (tecla==53) return false; //Porcentaje
        if ((tecla<48 || tecla>57) && tecla!=46 && tecla!=44 ) return false
        if (tecla == 46 && (txt.indexOf('.')!=-1 || txt.indexOf(',')!=-1)) return false;
        if (tecla == 44 && (txt.indexOf(',')!=-1 || txt.indexOf('.')!=-1)) return false;
}

function lTrim(sStr){
     while (sStr.charAt(0) == " ")
      sStr = sStr.substr(1, sStr.length - 1);
	return sStr;
}

function valida_solicitud()
{
	with(document.frmSolicitud) 
	{    
	   //document.getElementById('msj5');
		var errores =" ";	
		var errores1_1=" ";	
		var errores1=" ";		
		var errores2=" ";
		var errores3=" ";
		var errores4=" ";
		var errores5=" ";
		var ok = 0;
		/*VALIDANDO TITULAR*/
		if(lTrim(txtTapaterno.value) == '')		
			errores = errores + "* Esbriba su Apellido Paterno.<br>";
		if(lTrim(txtTamaterno.value) == '')		
			errores = errores + "* Esbriba su apellido Paterno.<br>";				
		if(lTrim(txtTnombre.value) == '')		
			errores = errores + "* Esbirba el Nombre del Titular.<br>";
		if(lTrim(txtTpuesto.value) =='')
			errores = errores + "* Escriba el puesto que ocupa.<br>";
		if(lTrim(txtTcorreo.value)=='')
			errores = errores + "* Escriba el correo.<br>";
		if((txtTcorreo.value)!=''){
			if(!isEmail(txtTcorreo.value)){
				errores = errores + "* Escriba un correo valido.<br>";
				document.getElementById('correo1').style.display = "block";
			}
			else
				document.getElementById('correo1').style.display = "none";
		}
		if(txtExiste.value == 1)
			errores = errores + "* El correo ya esta usado por otro usuario, intente otro.<br>";
		if(cmbTtipo1.value=='')
			errores = errores + "* Selecione un tipo de telefono.<br>";
		if(lTrim(txtTlada1.value)=='')
			errores = errores + "* Escriba la lada del Telefono.<br>";
		if(txtTtelefono1.value=='' )
			errores = errores + "* Escriba un telefono.<br>";
				
		for(var i = 2;i<=4;i++){
			if(document.getElementById('r1_' + i).style.display == ""){
				if(document.getElementById('cmbTtipo' + i).value=='')
					errores = errores + "* Selecione un tipo de telefono .<br>";
				if(document.getElementById('txtTlada' + i).value=='')
					errores = errores + "* Escriba la lada del Telefono .<br>";
				if(document.getElementById('txtTtelefono' + i).value=='')
					errores = errores + "* Escriba un telefono .<br>";
			}
		}
		if(lTrim(txtTUNombre.value)=='' )
			errores = errores + "* Escriba  su nombre.<br>";
		if(lTrim(txtTUsuario.value)=='' )
			errores = errores + "* Escriba su nombre de Usuario.<br>";
		if(lTrim(txtContrasena.value)=='')
			errores = errores + "* Escriba su Contrase&ntilde;a.<br>";
		if(errores != " ")
			errores = "<br>- Datos de Titular.<br><br>" + errores;
			
		//FACTURACION
		if(lTrim(txtFrazon.value)=='' )
			errores1_1 = errores1_1 + "* Escriba el nombre o la Razon Social.<br>";	
		if(lTrim(txtFrfc.value)=='' )
			errores1_1 = errores1_1 + "* Escriba el RFC.<br>";	
		if(lTrim(txtFdomicilio.value)=='' )
			errores1_1 = errores1_1 + "* Escriba el Domicilio Fiscal.<br>";	
		if(lTrim(txtFcolonia.value)=='' )
			errores1_1 = errores1_1 + "* Escriba la colonia.<br>";			
		if(lTrim(cmbFtipo1.value)=='')
			errores1_1 = errores1_1 + "* Seleccione un tipo de Telefono.<br>";				
		if(lTrim(txtFLada1.value) =='')
			errores1_1 = errores1_1 + "* Escriba la lada del Telefono.<br>";
		if(lTrim(txtFtelefono1.value)=='' )
			errores1_1 = errores1_1 + "* Escriba un numero de Telefono.<br>";
				
		for(var i = 2;i<=4;i++){
			if(document.getElementById('r2_' + i).style.display == ""){
				if(document.getElementById('cmbTtipo' + i).value=='')
					errores1_1 = errores1_1 + "* Selecione un tipo de telefono .<br>";
				if(document.getElementById('txtTlada' + i).value=='')
					errores1_1 = errores1_1 + "* Escriba la lada del Telefono .<br>";
				if(document.getElementById('txtTtelefono' + i).value=='')
					errores1_1 = errores1_1 + "* Escriba un telefono .<br>";
			}
		}
			
		if(lTrim(txtFciudad.value)=='' )
			errores1_1 = errores1_1 + "* Escriba la Ciudad o Municipio.<br>";
		if(lTrim(txtFcp.value)=='' )
			errores1_1 = errores1_1 + "* Escriba el Codigo Postal.<br>";
		if((txtFcorreo.value)=='' )
			errores1_1 = errores1_1 + "* Escriba el correo.<br>";
		if(lTrim(txtFcorreo.value)!=''){
			if(!isEmail(txtFcorreo.value))
				errores1_1 = errores1_1 + "* Escriba un correo valido.<br>";
		}
		if(errores1_1 != " ")
			errores1_1 = "- Datos de Facturacion.<br><br>" + errores1_1 ;
				
		/*PARA REPRESENTACION LEGAL*/
		if(lTrim(txtLapaterno.value)=='' )
			errores1 = errores1 + "* Escriba el Apellido Paterno.<br>";
		if(lTrim(txtLamaterno.value)=='' )
			errores1 = errores1 + "* Escriba el Apellido Materno.<br>";
		if(lTrim(txtLnombre.value)=='' )
			errores1 = errores1 + "* Escriba el Nombre.<br>";			
		if(errores1 != " ")
			errores1 = "<br>- Datos de la Representacion Legal.<br><br>" + errores1;
				
		/*MERCANCIA*/
		if(lTrim(txtMdomicilio.value)=='')
			errores2 = errores2 + "* Escriba su Domicilio.<br>";			
		if(lTrim(txtMcolonia.value)=='')
			errores2 = errores2 + "* Escriba la Colonia.<br>";
		if(lTrim(cmbMtipo1.value)=='')
			errores2 = errores2 + "* Selecione un tipo de Telefono.<br>";
		if((txtMlada1.value) == '')
			errores2 = errores2 + "* Escriba la lada del Telefono.<br>";
		if(lTrim(txtMtelefono1.value)=='')
			errores2 = errores2 + "* Escriba el Numero de Telefono.<br>";				
		for(var i = 2;i<=4;i++){
			if(document.getElementById('r3_' + i).style.display == ""){
				if(document.getElementById('cmbMtipo' + i).value=='')
					errores2 = errores2 + "* Selecione un tipo de telefono .<br>";
				if(document.getElementById('txtMlada' + i).value=='')
					errores2 = errores2 + "* Escriba la lada del Telefono .<br>";
				if(document.getElementById('txtMtelefono' + i).value=='')
					errores2 = errores2 + "* Escriba un telefono .<br>";
			}
		}
		if(lTrim(txtMciudad.value)=='')
			errores2 = errores2 + "* Escriba la Ciudad o Municipio.<br>";
		if(lTrim(txtMestado.value)=='')
			errores2 = errores2 + "* Escriba el Estado.<br>";
		if(lTrim(txtMcp.value)=='')
			errores2 = errores2 + "* Escriba el Codigo Postal.<br>";
		if(lTrim(txtMpais.value)=='')
			errores2 = errores2 + "* Escriba el Pais.<br>";
		if(errores2 != " ")
			errores2 = "<br>- Direccion de entrega de Mercancia.<br><br>" + errores2 ;
		
		/*PERSONAL AUTORIZADO*/
		apaterno = document.getElementsByName("txtAApellidoP[]");	
		amaterno = document.getElementsByName("txtAapellidom[]");	
		nombre = document.getElementsByName("txtAnombre[]");	
		cargo = document.getElementsByName("txtAcargo[]");
		if(apaterno[0].value=='')
			errores3 = errores3 + "* Escriba el Apellido Paterno.<br>";
		if(amaterno[0].value=='')
			errores2 = errores3 + "* Escriba el Apellido Materno.<br>";
		if(nombre[0].value=='')
			errores3 = errores3 + "* Escriba un Nombre.<br>";
		if(cargo[0].value=='')
			errores3 = errores3 + "* Escriba el Cargo.<br>";
		if(errores3 != " ")
			errores3 = "<br>- Personal Autorizado.<br><br>" + errores3 ;	
				
		/*VALIDA EMPRESA*/
		if(lTrim(txtEgiro.value)=='')
			errores4 = errores4 + "* Escriba el Giro de la Empresa.<br>";	
		if(lTrim(txtEfacturacion.value)=='' )
			errores4 = errores4 + "* Escriba la Facturacion Mensual.<br>";		
		for(var i=0; i< txtEmoneda.length; i++){
			if(txtEmoneda[i].checked)
				ok++;
		}
		if(ok <= 0){
			errores4 = errores4 + "* Sleccione un tipo de moneda.<br>";
		}
		if(errores4 != " ")
			errores4 = "<br>- Datos de la Empresa <br><br>" + errores4;
			
		/*PARA PROVEEDORES*/
		if(lTrim(txtPempresas1.value)=='' )
				errores5 = errores5 + "* Escriba el nombre de  la Empresa o Persona.<br>";
		if(errores5 != " ")
			errores5 = "<br><br>- Proveedores Actuales <br><br>" + errores5;
		
		if(errores4==" " && errores5==" " && errores3==" " && errores2==" " && errores1==" " && errores1_1==" " && errores==" ")
			return true;
		  document.getElementById('msj5').innerHTML = "Por favor llene lo siguiente en: <br>"+errores+errores1_1+errores1+errores2+errores3+errores4+errores5;
		  return false;
	 }
}

function solicitud_next1()
{
	with(document.frmSolicitud) 
	{    
		var errores=" ";
		if(document.getElementById('t_titular').style.display == "block"){
			if(lTrim(txtTapaterno.value) == '')		
				errores = errores + "* Esbriba su Apellido Paterno.<br>";
			if(lTrim(txtTamaterno.value) == '')		
				errores = errores + "* Esbriba su apellido Paterno.<br>";				
			if(lTrim(txtTnombre.value) == '')		
				errores = errores + "* Esbirba el Nombre del Titular.<br>";
			if(lTrim(txtTpuesto.value) =='')
				errores = errores + "* Escriba el puesto que ocupa.<br>";
			if(lTrim(txtTcorreo.value)=='')
				errores = errores + "* Escriba el correo.<br>";
			if((txtTcorreo.value)!=''){
				if(!isEmail(txtTcorreo.value)){
					errores = errores + "* Escriba un correo valido.<br>";
					document.getElementById('correo1').style.display = "block";
				}
				else
					document.getElementById('correo1').style.display = "none";
			}
			if(txtExiste.value == 1)
				errores = errores + "* El correo ya esta usado por otro usuario, intente otro.<br>";
			if(cmbTtipo1.value=='')
				errores = errores + "* Selecione un tipo de telefono.<br>";
			if(lTrim(txtTlada1.value)=='')
				errores = errores + "* Escriba la lada del Telefono.<br>";
			if(txtTtelefono1.value=='' )
				errores = errores + "* Escriba un telefono.<br>";
				
			for(var i = 2;i<=4;i++){
				if(document.getElementById('r1_' + i).style.display == ""){
					if(document.getElementById('cmbTtipo' + i).value=='')
						errores = errores + "* Selecione un tipo de telefono .<br>";
					if(document.getElementById('txtTlada' + i).value=='')
						errores = errores + "* Escriba la lada del Telefono .<br>";
					if(document.getElementById('txtTtelefono' + i).value=='')
						errores = errores + "* Escriba un telefono .<br>";
				}
		    }
			if(lTrim(txtTUNombre.value)=='' )
				errores = errores + "* Escriba  su nombre.<br>";
			if(lTrim(txtTUsuario.value)=='' )
				errores = errores + "* Escriba su nombre de Usuario.<br>";
			if(lTrim(txtContrasena.value)=='')
				errores = errores + "* Escriba su Contrase&ntilde;a.<br>";
		}
		if(errores == " "){
			document.getElementById('facturacion').style.color = '#0086FF';
			document.getElementById('titular').style.color = '#000000';
			document.getElementById('t_facturacion').style.display = "block";
			document.getElementById('t_titular').style.display = "none";
			document.getElementById('msj1').innerHTML = " ";
			/*ACTIVAMOS MENUS*/
			document.getElementById('facturacion2').style.display = "none";
			document.getElementById('facturacion').style.display = "block";
			
			/*ARRASTRAMOS ALGUNOS VALORES*/
			/*PARA LEGAL*/
			txtLapaterno.value = txtTapaterno.value;
			txtLamaterno.value = txtTamaterno.value;
			txtLnombre.value = txtTnombre.value;	
			/*PARA PERSONAL AUTORIZADO*/
			apaterno = document.getElementsByName("txtAApellidoP[]");	
			amaterno = document.getElementsByName("txtAapellidom[]");	
			nombre = document.getElementsByName("txtAnombre[]");	
			cargo = document.getElementsByName("txtAcargo[]");
			apaterno[0].value = txtTapaterno.value;
			amaterno[0].value = txtTamaterno.value;
			nombre[0].value = txtTnombre.value;	
			cargo[0].value = txtTpuesto.value;
			/*PASAMOS EL PAIS*/
			var pais = cmbPais1.value;
			var elem = pais.split('(');
			txtMpais.value = elem[0];
			
			var i;
			/*PARA PASAR LOS VALORES*/
			for(i = 1;i<5;i++){
				if(document.getElementById('cmbTtipo' + i).value!=''){	
					/*ACTIVAR LOS TD OCULTOS*/
					document.getElementById('r2_' + i).style.display = "block";
					document.getElementById('r3_' + i).style.display = "block";
					/*TIPOS DE TELEFONO*/
					document.getElementById('cmbFtipo' + i).value = document.getElementById('cmbTtipo' + i).value;
					document.getElementById('cmbMtipo' + i).value = document.getElementById('cmbTtipo' + i).value;
					/**PASAR LADA ******/				
					document.getElementById('txtFLada' + i).value = document.getElementById('txtTlada' + i).value;
					document.getElementById('txtMlada' + i).value = document.getElementById('txtTlada' + i).value;
					/*PASAR TELEFONOS***********/
					document.getElementById('txtFtelefono' + i).value = document.getElementById('txtTtelefono' + i).value;
					document.getElementById('txtMtelefono' + i).value = document.getElementById('txtTtelefono' + i).value;
				}
			}
		}
		else
			document.getElementById('msj1').innerHTML = "Por favor llene lo siguiente: <br><br>" + errores;
	}
}
			
function solicitud_next2()
{
	with(document.frmSolicitud) 
	{    
		var errores=" ";
		var errores2=" ";
		//FACTURACION
		if(document.getElementById('t_facturacion').style.display == "block"){
			if(lTrim(txtFrazon.value)=='' )
				errores = errores + "* Escriba el nombre o la Razon Social.<br>";	
			if(lTrim(txtFrfc.value)=='' )
				errores = errores + "* Escriba el RFC.<br>";	
			if(lTrim(txtFdomicilio.value)=='' )
				errores = errores + "* Escriba el Domicilio Fiscal.<br>";	
			if(lTrim(txtFcolonia.value)=='' )
				errores = errores + "* Escriba la colonia.<br>";			
			if(lTrim(cmbFtipo1.value)=='')
				errores = errores + "* Seleccione un tipo de Telefono.<br>";				
			if(lTrim(txtFLada1.value) =='')
				errores = errores + "* Escriba la lada del Telefono.<br>";
			if(lTrim(txtFtelefono1.value)=='' )
				errores = errores + "* Escriba un numero de Telefono.<br>";
				
			for(var i = 2;i<=4;i++){
				if(document.getElementById('r2_' + i).style.display == ""){
					if(document.getElementById('cmbTtipo' + i).value=='')
						errores = errores + "* Selecione un tipo de telefono .<br>";
					if(document.getElementById('txtTlada' + i).value=='')
						errores = errores + "* Escriba la lada del Telefono .<br>";
					if(document.getElementById('txtTtelefono' + i).value=='')
						errores = errores + "* Escriba un telefono .<br>";
				}
		    }
			
			if(lTrim(txtFciudad.value)=='' )
				errores = errores + "* Escriba la Ciudad o Municipio.<br>";
			if(lTrim(txtFcp.value)=='' )
				errores = errores + "* Escriba el Codigo Postal.<br>";
			if((txtFcorreo.value)=='' )
				errores = errores + "* Escriba el correo.<br>";
			if(lTrim(txtFcorreo.value)!=''){
				if(!isEmail(txtFcorreo.value))
					errores = errores + "* Escriba un correo valido.<br>";
			}
			if(errores != " ")
				errores = "- Datos de Facturacion.<br><br>" + errores ;
				
			/*PARA REPRESENTACION LEGAL*/
			if(lTrim(txtLapaterno.value)=='' )
				errores2 = errores2 + "* Escriba el Apellido Paterno.<br>";
			if(lTrim(txtLamaterno.value)=='' )
				errores2 = errores2 + "* Escriba el Apellido Materno.<br>";
			if(lTrim(txtLnombre.value)=='' )
				errores2 = errores2 + "* Escriba el Nombre.<br>";			
			if(errores2 != " ")
				errores2 = "<br>- Datos de la Representacion Legal.<br><br>" + errores2 ;				
		}
		if(errores == " " && errores2 == " "){
			document.getElementById('mercancia').style.color = '#0086FF';
			document.getElementById('facturacion').style.color = '#000000';
			document.getElementById('t_facturacion').style.display = "none";
			document.getElementById('t_mercancia').style.display = "block";
			document.getElementById('msj2').innerHTML = " ";
			document.getElementById('mercancia').style.display = "block";
			document.getElementById('mercancia2').style.display = "none";
			document.getElementById('mercancia').style.display = "block";
			/*ARASTRAMOS ALGUNOS VALORES*/
			txtMcolonia.value = txtFcolonia.value;
			txtMciudad.value = txtFciudad.value;
			txtMestado.value = txtFestado.value;
			txtMcp.value = txtFcp.value;
		}
		else
			document.getElementById('msj2').innerHTML = "Por favor llene lo siguiente: <br><br>" + errores + errores2;
	}
}
			
function solicitud_next3()
{
	with(document.frmSolicitud) 
	{    
		var errores=" ";
		var errores2=" ";
    	/*MERCANCIA	*/
		if(document.getElementById('t_mercancia').style.display == "block"){
			if(lTrim(txtMcolonia.value)=='')
				errores = errores + "* Escriba la Colonia.<br>";
			if(lTrim(cmbMtipo1.value)=='')
				errores = errores + "* Selecione un tipo de Telefono.<br>";
			if((txtMlada1.value) == '')
				errores = errores + "* Escriba la lada del Telefono.<br>";
			if(lTrim(txtMtelefono1.value)=='')
				errores = errores + "* Escriba el Numero de Telefono.<br>";				
			for(var i = 2;i<=4;i++){
				if(document.getElementById('r3_' + i).style.display == ""){
					if(document.getElementById('cmbMtipo' + i).value=='')
						errores = errores + "* Selecione un tipo de telefono .<br>";
					if(document.getElementById('txtMlada' + i).value=='')
						errores = errores + "* Escriba la lada del Telefono .<br>";
					if(document.getElementById('txtMtelefono' + i).value=='')
						errores = errores + "* Escriba un telefono .<br>";
				}
		    }
			if(lTrim(txtMciudad.value)=='')
				errores = errores + "* Escriba la Ciudad o Municipio.<br>";
			if(lTrim(txtMestado.value)=='')
				errores = errores + "* Escriba el Estado.<br>";
			if(lTrim(txtMcp.value)=='')
				errores = errores + "* Escriba el Codigo Postal.<br>";
			if(lTrim(txtMpais.value)=='')
				errores = errores + "* Escriba el Pais.<br>";
			if(errores != " ")
				errores = "<br>- Direccion de entrega de Mercancia.<br><br>" + errores ;	
			
			/*PERSONAL AUTORIZADO*/
			apaterno = document.getElementsByName("txtAApellidoP[]");	
			amaterno = document.getElementsByName("txtAapellidom[]");	
			nombre = document.getElementsByName("txtAnombre[]");	
			cargo = document.getElementsByName("txtAcargo[]");
			if(apaterno[0].value=='')
				errores2 = errores2 + "* Escriba el Apellido Paterno.<br>";
			if(amaterno[0].value=='')
				errores2 = errores2 + "* Escriba el Apellido Materno.<br>";
			if(nombre[0].value=='')
				errores2 = errores2 + "* Escriba un Nombre.<br>";
			if(cargo[0].value=='')
				errores2 = errores2 + "* Escriba el Cargo.<br>";
			if(errores2 != " ")
				errores2 = "<br>- Personal Autorizado.<br><br>" + errores2 ;	
			
		}
		if(errores == " " && errores2 == " "){
			document.getElementById('empresa').style.color = '#0086FF';
			document.getElementById('mercancia').style.color = '#000000';
			document.getElementById('t_empresa').style.display = "block";
			document.getElementById('t_mercancia').style.display = "none";
			document.getElementById('msj3').innerHTML = " ";
			
			document.getElementById('empresa2').style.display = "none";
			document.getElementById('empresa').style.display = "block";
		}
		else
			document.getElementById('msj3').innerHTML = "Por favor llene lo siguiente: <br><br>" + errores + errores2 ;
	}
}

function solicitud_next4()
{
	with(document.frmSolicitud) 
	{    
		var errores=" ";
		
		if(document.getElementById('t_proveedores').style.display == "block"){
			if(lTrim(txtPempresas1.value)=='' )
				errores = errores + "* Escriba el nombre de  la Empresa Persona.<br>";
			/*if(lTrim(txtPdireccion1.value)=='' )
				errores = errores + "* Escriba la Direccion de la Empresa.<br>";
			if(lTrim(txtPcolonia1.value)=='' )
				errores = errores + "* Escriba la Colonia.<br>";
			if(lTrim(txtPtelefono1.value)=='' )
				errores = errores + "* Escriba el Telefono.<br>";*/
		}
		if(errores == " "){
			document.getElementById('legal').style.color = '#0086FF';
			document.getElementById('proveedores').style.color = '#000000';
			document.getElementById('t_proveedores').style.display = "none";
			document.getElementById('t_legal').style.display = "block";
			document.getElementById('msj4').innerHTML = " ";
			document.getElementById('legal').style.display = "block";
			
			document.getElementById('legal2').style.display = 'none';
			document.getElementById('legal').style.display = 'block';
			
		}
		else
			document.getElementById('msj4').innerHTML = "Verifique: <br>" + errores;
	}
}

function solicitud_next5()
{
	with(document.frmSolicitud) 
	{    
		var errores=" ";
		if(document.getElementById('t_empresa').style.display == "block"){
			if(lTrim(txtEgiro.value)=='' )
				errores = errores + "* Escriba el Giro de la Empresa.<br>";	
			if(lTrim(txtEfacturacion.value)=='' )
				errores = errores + "* Escriba la Facturacion Mensual.<br>";
		}
		if(errores == " "){
			document.getElementById('proveedores').style.color = '#0086FF';
			document.getElementById('empresa').style.color = '#000000';
			document.getElementById('t_proveedores').style.display = "block";
			document.getElementById('t_empresa').style.display = "none";
			document.getElementById('msj5').innerHTML = " ";
			document.getElementById('proveedores').style.display = "block";
			
			document.getElementById('proveedores2').style.display = 'none';
			document.getElementById('proveedores').style.display = 'block';
			
		}
		else
			document.getElementById('msj5').innerHTML = "Verifique: <br>" + errores;
	}
}

function solicitud_next6()
{
	with(document.frmSolicitud) 
	{    
		var errores=" ";
		if(document.getElementById('t_legal').style.display == "block"){
			
			if(lTrim(txtLapaterno.value)=='' )
				errores = errores + "* Escriba el Apellido Paterno.<br>";
			if(lTrim(txtLamaterno.value)=='' )
				errores = errores + "* Escriba el Apellido Materno.<br>";
			if(lTrim(txtLnombre.value)=='' )
				errores = errores + "* Escriba el Nombre.<br>";
			/*if(lTrim(txtLtelefono.value)=='' )
				errores = errores + "* Escriba el Telefono.<br>";
			if(lTrim(txtLciudad.value)=='' )
				errores = errores + "* Escriba la Ciudad o Municipio.<br>";
			if(lTrim(txtLestado.value)=='')
				errores = errores + "* Escriba el Estado.<br>";
			if(lTrim(txtLcp.value)=='' )
				errores = errores + "* Escriba el Codigo Postal.<br>";
			if(lTrim(txtLcargo.value)=='' )
				errores = errores + "* Escriba el Cargo Desempe&ntilde;ado.<br>";*/
		}
		if(errores == " "){
			document.getElementById('personal').style.color = '#0086FF';
			document.getElementById('legal').style.color = '#000000';
			document.getElementById('t_personal').style.display = "block";
			document.getElementById('t_legal').style.display = "none";
			document.getElementById('msj6').innerHTML = " ";
			document.getElementById('personal').style.display = "block";			
				
			nombre = document.getElementsByName("txtAnombre[]");		
			cargo = document.getElementsByName("txtAcargo[]");
			
			nombre[0].value = document.getElementById('txtTnombre').value;
			cargo[0].value = document.getElementById('txtTpuesto').value;
			
			document.getElementById('personal2').style.display = "none";
			document.getElementById('personal').style.display = "block";
			
			
		}
		else
			document.getElementById('msj6').innerHTML = "Verifique: <br>" + errores;
	}
}
function igual()
{
	document.getElementById('txtMdomicilio').value = document.getElementById('txtFdomicilio').value;

}
function igual2()
{
	document.getElementById('txtTUNombre').value = document.getElementById('txtTnombre').value;

}
function igual3()
{
	document.getElementById('txtFcorreo').value = document.getElementById('txtTcorreo').value;

}

function acceptNum(evt){ 
	var nav4 = window.Event ? true : false;
	var key = nav4 ? evt.which : evt.keyCode; 
	return (key <= 13 || (key >= 48 && key <= 57));
}

function validatext(e,modo) {
//alert(e.keyCode);
tecla = (document.all) ? e.keyCode : e.which;
if ( (tecla==8) || (tecla==32) || (tecla == 9) ) return true;
patron = (modo=='letra') ? /[A-Za-zñÑ\s]/ : /[0-9.]/;
te = String.fromCharCode(tecla);
return patron.test(te);
}
/*para validar usuario exixtente*/
var req;
var respuesta;

var req2;
var respuesta2;

function leer_doc2(url) { 
 req2 = false; 
 // Llama objeto XMLHttpRequest
 if (window.XMLHttpRequest) {
   req2 = new XMLHttpRequest();
   if (req2.overrideMimeType) {
     req2.overrideMimeType('text/xml'); 
   }
 
 // Si no funciona intenta utiliar el objeto IE/Windows ActiveX 
 } else if (window.ActiveXObject) {
   req2 = new ActiveXObject("Microsoft.XMLHTTP"); 
 }
 
 if(req2!=null){
   req2.onreadystatechange = procesarmail;
   req2.open('GET', url, true);
   req2.send(null);
 } 
}

function leer_doc(url) {
 
 req = false; 
 // Llama objeto XMLHttpRequest
 if (window.XMLHttpRequest) {
   req = new XMLHttpRequest();
   if (req.overrideMimeType) {
     req.overrideMimeType('text/xml'); 
   }
 
 // Si no funciona intenta utiliar el objeto IE/Windows ActiveX 
 } else if (window.ActiveXObject) {
   req = new ActiveXObject("Microsoft.XMLHTTP"); 
 }
 
 if(req!=null){
   req.onreadystatechange = procesarRespuesta;
   req.open('GET', url, true);
   req.send(null);
 } 
}

function autentica(){
 usuario = document.getElementById("txtTUsuario").value;
 url = "verusr.php?usuario=" + usuario;
 leer_doc(url);
}

function procesarRespuesta(){
 respuesta = req.responseXML;
 var existe = respuesta.getElementsByTagName('existe').item(0).firstChild.data;
   if (existe=="true"){
     document.getElementById("error").style.visibility = "visible";
	 document.getElementById("btnSisguiente1").disabled = true;
   }
   else{
     document.getElementById("error").style.visibility = "hidden";
	 document.getElementById("btnSisguiente1").disabled = false;
   }
}

function valida_email(){
 mail = document.getElementById("txtTcorreo").value;
 url = "verusr.php?mail=" + mail;
 leer_doc2(url);
}

function procesarmail(){
 respuesta2 = req2.responseXML;
 var existe = respuesta2.getElementsByTagName('existe').item(0).firstChild.data;
   if (existe=="true"){
     document.getElementById("txtExiste").value  = 1;
	 document.getElementById("btnSisguiente1").disabled = true;
   }
   else{
      document.getElementById("txtExiste").value  = 0;
	 document.getElementById("btnSisguiente1").disabled = false;
   }
}

function objetoAjax(){
	 var xmlhttp=false;
	  try{
	   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	  }catch(e){
	   try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	   }catch(E){
		xmlhttp = false;
	   }
	  }
	  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	   xmlhttp = new XMLHttpRequest();
	  }
	  return xmlhttp;
	}
	
	
	
	
	function cambiarcategoria(elemento,x)
	{
		var valor = elemento;
		var idSpan='advice';
		var peticion = objetoAjax();
		if(peticion)
		{
			peticion.onreadystatechange = function()
				{
					if(peticion.readyState == 4 && (peticion.status == 200 || peticion.status == 304))
					{
						if(x == 0){
							document.getElementById(idSpan).innerHTML = "<select name='categoria' onchange='cambiarcategoria2(this.value,0)'>" + peticion.responseText + "</select>"; }
						else{	
							document.getElementById(idSpan).innerHTML = "<select name='categoria' onchange='cambiarcategoria2(this.value,0)'>"+ peticion.responseText + "</select>"; }
					}
				}
			peticion.open('GET', '../../carga_select.php?id_1='+valor,true);
			peticion.send(null);
		}
	}
	function cambiarcategoria2(elemento,x)
	{
		var valor = elemento;
		var idSpan='advice2';
		var peticion = objetoAjax();
		if(peticion)
		{
			peticion.onreadystatechange = function()
				{
					if(peticion.readyState == 4 && (peticion.status == 200 || peticion.status == 304))
					{
						if(x == 0){
							document.getElementById(idSpan).innerHTML = "<select name='subcategoria'>" + peticion.responseText + "</select>"; }
						else{	
							document.getElementById(idSpan).innerHTML = "<select name='subcategoria'>"+ peticion.responseText + "</select>"; }
					}
				}
			peticion.open('GET', '../../carga_select.php?id_2='+valor,true);
			peticion.send(null);
		}
	}


	function cambiarcategoria22(elemento,x)
	{
		var valor  = elemento;
		var idSpan = 'advice3';
		var idSpan_2 = 'advice4';
		var peticion = objetoAjax();
		if(peticion)
		{
			peticion.onreadystatechange = function()
				{
					if(peticion.readyState == 4 && (peticion.status == 200 || peticion.status == 304))
					{
						if(x == 0){
							document.getElementById(idSpan).innerHTML = "Segunda Categoria: <select name='segunda_categoria' onchange='cambiarcategoria23(this.value,0)'>" + peticion.responseText + "</select>";
							if(valor==-1){
							document.getElementById(idSpan_2).innerHTML = "Segunda Subcategoria: <select name='segunda_subcategoria'><option value='0'>Ninguna</option></select>";
							}
						}
						else{	
							document.getElementById(idSpan).innerHTML = " Segunda Categoria: <select name='segunda_categoria' onchange='cambiarcategoria23(this.value,0)'>"+ peticion.responseText + "</select>";
							if(valor==-1){
							document.getElementById(idSpan_2).innerHTML = "Segunda Subcategoria: <select name='segunda_subcategoria'><option value='0'>Ninguna</option></select>";
							}
						}
					}
					
				}
			peticion.open('GET', 'carga_select.php?id_1='+valor,true);
			peticion.send(null);
		}
	}
	function cambiarcategoria23(elemento,x)
	{
		var valor = elemento;
		var idSpan='advice4';
		var peticion = objetoAjax();
		if(peticion)
		{
			peticion.onreadystatechange = function()
				{
					if(peticion.readyState == 4 && (peticion.status == 200 || peticion.status == 304))
					{
						if(x == 0){
							document.getElementById(idSpan).innerHTML = "Segunda Subcategoria: <select name='segunda_subcategoria'>" + peticion.responseText + "</select>"; }
						else{	
							document.getElementById(idSpan).innerHTML = "Segunda Subcategoria: <select name='segunda_subcategoria'>"+ peticion.responseText + "</select>"; }
					}
				}
			peticion.open('GET', 'carga_select.php?id_2='+valor,true);
			peticion.send(null);
		}
	}
	
	function select_edo(valor,name,num,span)
	{
		var valor = valor;
		var idSpan= span;
		var peticion = objetoAjax();
		var selec = document.getElementById(idSpan);
		if(peticion)
		{
			peticion.onreadystatechange = function()
				{
					if(peticion.readyState == 4 && (peticion.status == 200 || peticion.status == 304))
					{
						if(valor == 0){
							selec.innerHTML = '<select name='+name+' id='+name+' onchange=comb2(this.value,'+num+')>' + peticion.responseText + '</select>'; }
						else{	
							selec.innerHTML = '<select name='+name+' id='+name+' onchange=comb2(this.value,'+num+')>' + peticion.responseText + '</select>'; }
					}
				}
			peticion.open('GET', 'estados.php?id='+valor,true);
			peticion.send(null);
		}
	}
	
	function select_edo2(valor,name,span)
	{
		var valor = valor;
		var idSpan= span;
		var peticion = objetoAjax();
		var selec = document.getElementById(idSpan);
		if(peticion)
		{
			peticion.onreadystatechange = function()
				{
					if(peticion.readyState == 4 && (peticion.status == 200 || peticion.status == 304))
					{
						if(valor == 0){
							selec.innerHTML = '<select name='+name+' id='+name+'>' + peticion.responseText + '</select>'; }
						else{	
							selec.innerHTML = '<select name='+name+' id='+name+'>' + peticion.responseText + '</select>'; }
					}
				}
			peticion.open('GET', 'estados.php?id='+valor,true);
			peticion.send(null);
		}
	}

/*validar usuario */
function validar(){
	var usuario = document.getElementById("txtTUsuario").value;
	var dato;
	ajax=objetoAjax();
	ajax.open("GET", "verusr.php?usuario="+usuario);
	ajax.onreadystatechange = function(){
		if(ajax.readyState==4 && document.getElementById("txtContrasena").value != ''){
			dato = ajax.responseText;
			if (dato=='1'){
			   document.getElementById("error").style.visibility = "visible";
			   document.getElementById("txtContrasena").value = "";
			   document.getElementById("btnSisguiente1").disabled = true;
			}else{
		    	document.getElementById("error").style.visibility = "hidden";
				document.getElementById("btnSisguiente1").disabled = false;
			}
		}
	}
	ajax.send(null);
}


function tiene_numeros(texto)
{
   var numeros="0123456789";
   for(i=0; i<texto.length; i++)
   {
      if (numeros.indexOf(texto.charAt(i),0)!=-1)
	  {
         return 1;
      }
   }
   return 0;
} 




function tiene_minusculas(texto)
{
   var letras="abcdefghyjklmnñopqrstuvwxyz";	
   for(i=0; i<texto.length; i++)
   {
      if (letras.indexOf(texto.charAt(i),0)!=-1)
	  {
         return 1;
      }
   }
   return 0;
} 


function tiene_mayusculas(texto)
{
   var letras_mayusculas="ABCDEFGHYJKLMNÑOPQRSTUVWXYZ";
   for(i=0; i<texto.length; i++)
   {
      if (letras_mayusculas.indexOf(texto.charAt(i),0)!=-1)
	  {
         return 1;
      }
   }
   return 0;
} 

/*validar contraseña */
function validar_cont(){
	var contrasena = document.getElementById("txtContrasena").value;
	var numero;
	var minusculas;
	var mayusculas;
	
	numero=tiene_numeros(contrasena);
	minusculas=tiene_minusculas(contrasena);
	mayusculas=tiene_mayusculas(contrasena);
	if(contrasena.length >= 8 && numero == 1 && minusculas == 1 && mayusculas == 1)
	{
		document.getElementById("error_cont").style.visibility = "hidden";
		document.getElementById("letrero").style.visibility = "visible";
		document.getElementById("btnSisguiente1").disabled = false;
	}
	else
	{
		document.getElementById("error_cont").style.visibility = "visible";
		document.getElementById("letrero").style.visibility = "hidden";
		document.getElementById("btnSisguiente1").disabled = true;
	}
}



/*ver mail*/
function validar_email(){
	var mail = document.getElementById("txtTcorreo").value;
	var dato;
	ajax=objetoAjax();
	ajax.open("GET", "verusr.php?mail="+mail);
	ajax.onreadystatechange = function(){
		if(ajax.readyState==4){
			dato = ajax.responseText;
			if (dato=='1'){
			   document.getElementById("txtExiste").value  = 1;
			}else{
		    	 document.getElementById("txtExiste").value  = 0;
			}
		}
	}
	ajax.send(null);
}

function valida_promo(op)
{
	with(document.promocion) 
	{    
		var errores = " ";
		
			if(txtTitulo.value=='')		
				errores = errores + "* Esbrba el titulo de la promocion.\n";
			if(op == 1){
				if(txtImagen.value=='')
					errores = errores + "* Selecione una Imagen.\n";
			}
	}
		if(errores == " ")
			return true;
		  alert("Verifique: \n" + errores);
		  return false;
}
function comb(dato,n)
{
	var valor = dato;
		document.getElementById('cmbFPais' + n).value = valor;
		document.getElementById('cmbMPais' + n).value = valor;
}
function comb2(dato,n)
{
	var valor = dato;
		document.getElementById('cmbFCiudad' + n).value = valor;
		document.getElementById('cmbMCiudad' + n).value = valor;
}

function conMayusCatPri(categoria_principal) 
{   
	categoria_principal.value = categoria_principal.value.toUpperCase();  
}  

function conMayusCat(categoria) 
{   
	categoria.value = categoria.value.toUpperCase();  
} 
function conMayusSub(subcategoria) 
{   
	subcategoria.value = subcategoria.value.toUpperCase();  
} 
function conMayusMar(marca) 
{   
	marca.value = marca.value.toUpperCase();  
} 

function comprueba_extension(formulario, archivo) { 
   formulario = document.productos;
   archivo = document.productos.imagen.value;
   extensiones_permitidas = new Array(".png", ".gif",".jpg"); 
   mierror = ""; 
   if (!archivo) { 
      //Si no tengo archivo, es que no se ha seleccionado un archivo en el formulario 
       mierror = "No has seleccionado ningún archivo"; 
   }else{ 
      //recupero la extensión de este nombre de archivo 
      extension = (archivo.substring(archivo.lastIndexOf("."))).toLowerCase(); 
      //alert (extension); 
      //compruebo si la extensión está entre las permitidas 
      permitida = false; 
      for (var i = 0; i < extensiones_permitidas.length; i++) { 
         if (extensiones_permitidas[i] == extension) { 
         permitida = true; 
         break; 
         } 
      } 
      if (!permitida) { 
         mierror = "Comprueba la extensión de los archivos a subir. \nSólo se pueden subir archivos con extensiones: " + 
		 extensiones_permitidas.join(); 
       }else{ 
         return true; 
       } 
   } 
   //si estoy aqui es que no se ha podido submitir 
   alert (mierror); 
   return false; 
} 

function cambiar_busqueda(opcion)
{
	switch(opcion)
    {
      case "COMPLETA":
	    document.getElementById('cri_com').style.display = "block";
		document.getElementById('cam_com').style.display = "block";
		document.getElementById('cri_mod').style.display = "none";
		document.getElementById('cam_mod').style.display = "none";
      break;
      
	  case "MODELO":
	    document.getElementById('cri_com').style.display = "none";
		document.getElementById('cam_com').style.display = "none";
		document.getElementById('cri_mod').style.display = "block";
		document.getElementById('cam_mod').style.display = "block";
      break;
	}
}

function filtra_edo(elemento,x)
	{
		var valor = elemento;
		var idSpan='edo';
		var peticion = objetoAjax();
		if(peticion)
		{
			peticion.onreadystatechange = function()
				{
					if(peticion.readyState == 4 && (peticion.status == 200 || peticion.status == 304))
					{
						if(x == 0){
							document.getElementById(idSpan).innerHTML = "<select name='txtFestado' onchange='filtra_cd(this.value,0)'>" + peticion.responseText + "</select>"; }
						else{	
							document.getElementById(idSpan).innerHTML = "<select name='txtFestado' onchange='filtra_cd(this.value,0)'>"+ peticion.responseText + "</select>"; }
					}
				}
			peticion.open('POST', 'carga_edo.php',true);
			peticion.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            peticion.send("estado="+valor);
		}
	}
	
function filtra_cd(elemento,x)
	{
		var valor = elemento;
		var idSpan='cd';
		var peticion = objetoAjax();
		if(peticion)
		{
			peticion.onreadystatechange = function()
				{
					if(peticion.readyState == 4 && (peticion.status == 200 || peticion.status == 304))
					{
						if(x == 0){
							document.getElementById(idSpan).innerHTML = "<select name='txtFciudad'>" + peticion.responseText + "</select>"; }
						else{	
							document.getElementById(idSpan).innerHTML = "<select name='txtFciudad'>"+ peticion.responseText + "</select>"; }
					}
				}
			peticion.open('POST', 'carga_cd.php',true);
			peticion.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            peticion.send("ciudad="+valor);
		}
	}
	

