
function imgmoff(xid,dir) {
imag = document.getElementById(xid);
imag.src = dir;
}
function cerrar(id) {
div = document.getElementById(id);
div.style.display='none';
}

function resizeToContent(id){
var x =0;
var y =this.document.body.scrollHeight;
while (x < y){
x+=1;
}
parent.document.getElementById(id).style.height=x;
}

function text(xid,sim) {
textcon = document.getElementById(xid);
textcon.value = sim + textcon.value;

}
function mostrardiv(id) {
div = document.getElementById(id);
div.style.display = '';
}
function cerrar(id) {
div = document.getElementById(id);
div.style.display='none';
}
function Permut(flag,img) {
   if (document.images) {
        if (document.images[img].permloaded) {
            if (flag==1) document.images[img].src = document.images[img].perm.src
            else document.images[img].src = document.images[img].perm.oldsrc
        }
   }
}

function Permut_top(flag,img) {
   if (top.document.images) {
        if (top.document.images[img].permloaded) {
            if (flag==1) top.document.images[img].src = top.document.images[img].perm.src
            else top.document.images[img].src = top.document.images[img].perm.oldsrc
        }
   }
}
function preloadPermut (img,adresse) {
   if (document.images) {
        img.onload = null;
        img.perm = new Image ();
        img.perm.oldsrc = img.src;
        img.perm.src = adresse;
        img.permloaded = true;
   }
}

function preloadPermutTop (img,adresse) {
   if (document.images) {
      document.img.onload = null;
        document.img.perm = new Image ();
        document.img.perm.oldsrc = img.src;
        document.img.perm.src = adresse;
        document.img.permloaded = true;
   }
}

function color(id,x) {
texto = document.getElementById(id);
texto.style.color=x;
}
function imgx(xid) {
imag = document.getElementById(xid);
imag.src = 'IMGT/bir.jpg';
}
function imgy(xid) {
imag = document.getElementById(xid);
imag.src = 'IMGT/bi.jpg';
}
function imgmon(xid,dir) {
imag = document.getElementById(xid);
imag.src = dir;
}

function flotis (iddiv,sta){
 if (sta==1)
 {
	div = document.getElementById(iddiv);
	div.style.display = '';

	
 }
 else
 {
	div = document.getElementById(iddiv);
	div.style.display='none';
 }
}

function flotisx (iddiv,sta,frx,src){
 if (sta==1)
 {
	div = document.getElementById(iddiv);
	fra = document.getElementById(frx);
	fra.src = src;
	div.style.display = '';
	

	
 }
 else
 {
	div = document.getElementById(iddiv);
	fra = document.getElementById(frx);
	fra.src = src;
	div.style.display='none';
 }
}


function Ampliar(divc)
{
 div = document.getElementById(divc)
 NuevaAltura = parseInt(div.style.height)+10
 NuevaAltura2 = parseInt(div.style.width)+10
 if(NuevaAltura < Limite)
 {
  div.style.height = NuevaAltura+"px"
  setTimeout("Ampliar(" & div &")", 100)
  div.style.width = NuevaAltura2+"px"
  setTimeout("Ampliar(" & div &")", 100)
 }
}

function tex(valor,id,c,lim) {
texto = document.getElementById(valor);
vari = document.getElementById(id);
tecla = (document.all) ? c.keyCode : c.which; 
if (texto.value == 'Null') 
{ 
  		vari.disabled=true;

		
	}
 	 else 
  	{
			if (texto.value.length+1 > lim)
  		 		{
					vari.disabled=false;
				}
	}
    if (tecla == 8 && texto.value.length < lim)
	{
					vari.disabled=true;
	}
} 

function infor(xid,stu) {
im = document.getElementById(xid);
if (stu=='2') 
	{
		im.value = 'Esperando RFC';
	}	
if (stu=='1')
	{
		
		im.value = 'Espere un momento: Cargando Productos....';
	}
}

function Bdis(id,t1,t2) {
vari = document.getElementById(id);
v1 = document.getElementById(t1);
v2 = document.getElementById(t2);
vari.disabled=true;
v1.value='';
v2.value='';
}

function valdat(formulario) 
{
//Nomnbre
  if (formulario.rf2.value.length < 8) {
    alert("Escriba por lo menos 8 caracteres en el campo \"* Clave\".");
    formulario.rf2.focus();
    return (false);
  }
    ////Correo
  if ((formulario.rf.value.indexOf ('@', 0) == -1)||(formulario.rf.value.length < 5)) { 
    alert("Escriba una dirección de correo válida en el campo \"E-mail\"."); 
    return (false); 
  }
  return (true); 
} 
function Descar(cmb) {
cmb = document.getElementById(cmb);
fi='http://www.fibremex.com.mx/download.php?file=cat/CATALOGO_FIBREMEX_2010.pdf';
op='http://www.optronics.com.mx/download.php?file=dwo/Opcat07.pdf';
fic='/descargaft/descargaft.asp';
if (cmb.value=='1' || cmb.value==1)
{
	window.open(fi.toString());
}
if (cmb.value=='2' || cmb.value==2)
{
	window.open(op.toString());
}
if (cmb.value=='3' || cmb.value==3)
{
	window.open(fic.toString(),'ARE');
}

}
function ulink(src,frm)
{
	cmb = document.getElementById(frm);
	cmb.src=src;
	
	}

function uno(v,src,sw)
	{
	fram = document.getElementById(v);
	if (sw==0)
	{
	Permut(0,'Hm');
    Permut(0,'qm');
    Permut(0,'ic');
    Permut(0,'pa');
    Permut(0,'bt');
    Permut(0,'co');
	}
	if (sw==1)
	{
	Permut(0,'Hm');
    Permut(0,'qm');
    Permut(0,'ic');
    Permut(0,'pa');
    Permut(0,'bt');
    Permut(0,'co');
	fram.src=src;
	}
	
	}
function dos(v,src,sw)
	{
	fram = document.getElementById(v);
	if (sw==0)
	{
	Permut(1,'Hm');
    Permut(1,'qm');
    Permut(0,'ic');
    Permut(0,'pa');
    Permut(0,'bt');
    Permut(0,'co');
	}
	if (sw==1)
	{
	Permut(1,'Hm');
    Permut(1,'qm');
    Permut(0,'ic');
    Permut(0,'pa');
    Permut(0,'bt');
    Permut(0,'co');
	fram.src=src;	
	}
	
	}
function tres(v,src,sw)
	{
		fram = document.getElementById(v);
	if (sw==0)
	{
	Permut(1,'Hm');
    Permut(0,'qm');
    Permut(1,'ic');
    Permut(0,'pa');
    Permut(0,'bt');
    Permut(0,'co');
		}
	if (sw==1)
	{
	Permut(1,'Hm');
    Permut(0,'qm');
    Permut(1,'ic');
    Permut(0,'pa');
    Permut(0,'bt');
    Permut(0,'co');
	fram.src=src;	
	}
	
	}
function cuatro(v,src,sw)
	{
	fram = document.getElementById(v);
	if (sw==0)
	{
    Permut(1,'Hm');
    Permut(0,'qm');
    Permut(0,'ic');
    Permut(1,'pa');
    Permut(0,'bt');
    Permut(0,'co');
		}
	if (sw==1)
	{
	Permut(1,'Hm');
    Permut(0,'qm');
    Permut(0,'ic');
    Permut(1,'pa');
    Permut(0,'bt');
    Permut(0,'co');
	fram.src=src;	
	}
	
	}
function cinco(v,src,sw)
	{
	fram = document.getElementById(v);
	if (sw==0)
	{
	Permut(1,'Hm');
    Permut(0,'qm');
    Permut(0,'ic');
    Permut(0,'pa');
    Permut(1,'bt');
    Permut(0,'co');
		}
	if (sw==1)
	{
	Permut(1,'Hm');
    Permut(0,'qm');
    Permut(0,'ic');
    Permut(0,'pa');
    Permut(1,'bt');
    Permut(0,'co');
	fram.src=src;
		}
	
	}
function seis(v,src,sw)
	{
	fram = document.getElementById(v);
	if (sw==0)
	{
	Permut(1,'Hm');
    Permut(0,'qm');
    Permut(0,'ic');
    Permut(0,'pa');
    Permut(0,'bt');
    Permut(1,'co');
		}
	if (sw==1)
	{
	Permut(1,'Hm');
    Permut(0,'qm');
    Permut(0,'ic');
    Permut(0,'pa');
    Permut(0,'bt');
    Permut(1,'co');
	fram.src=src;
		}
	
	}
	/*Pestañas de menu arriba*/
function Puno(v,src)
	{
	fram = document.getElementById(v);
	//alert('Puno' + v +src);
	Permut_top(0,'Pfibra');
	Permut_top(0,'Pce');
	Permut_top(0,'Pina');
	Permut_top(0,'Pcc');
	Permut_top(0,'cama');
	Permut_top(0,'equiac');
	Permut_top(0,'elec');	
    on('fib');on('MNUFibra');
	off('MNUCest');off('MNUmedi');off('MNUactivo');off('MNUherr');off('MNUredes');off('MNUelec');
	off('cob');off('medi');off('herr');off('redes');off('activo');off('elect');
	fram.src=src;
	
	}
function Puno_top(v,src)
	{
	fram = top.document.getElementById(v);
	//alert('Puno' + v +src);
	Permut_top(0,'Pfibra');
	Permut_top(0,'Pce');
	Permut_top(0,'Pina');
	Permut_top(0,'Pcc');
	Permut_top(0,'cama');
	Permut_top(0,'equiac');
	Permut_top(0,'elec');	
	on_top('fib');on_top('MNUFibra');
	off_top('MNUCest');off_top('MNUmedi');off_top('MNUactivo');off_top('MNUherr');off_top('MNUredes');off_top('MNUelec');
	off_top('cob');off_top('medi');off_top('herr');off_top('redes');off_top('activo');off_top('elect');
	fram.src=src;
	
}
function Pdos(v,src)
{
	fram = document.getElementById(v);
	//alert('Pdos' + v +src);
	Permut(1,'Pfibra');
	Permut(1,'Pce');
	Permut(0,'Pina');
	Permut(0,'Pcc');
	Permut(0,'cama');
	Permut(0,'equiac');
	Permut(0,'elec');	
	on('cob');on('MNUCest');
	off('MNUFibra');off('MNUmedi');off('MNUactivo');off('MNUherr');off('MNUredes');off('MNUelec');
	off('fib');off('medi');off('herr');off('redes');off('activo');off('elect');
	fram.src=src;
}
function Pdos_top(v,src){
	fram = top.document.getElementById(v);
	//alert('Pdos' + v +src);
	Permut_top(1,'Pfibra');
	Permut_top(1,'Pce');
	Permut_top(0,'Pina');
	Permut_top(0,'Pcc');
	Permut_top(0,'cama');
	Permut_top(0,'equiac');
	Permut_top(0,'elec');	
	on_top('cob');on_top('MNUCest');
	off_top('MNUFibra');off_top('MNUmedi');off_top('MNUactivo');off_top('MNUherr');off_top('MNUredes');off_top('MNUelec');
	off_top('fib');off_top('medi');off_top('herr');off_top('redes');off_top('activo');off_top('elect');
	fram.src=src;
}
function Ptres(v,src)
	{
	fram = document.getElementById(v);
	//alert('Ptres' + v +src);
	Permut(1,'Pfibra');
	Permut(0,'Pce');
	Permut(1,'Pina');
	Permut(0,'Pcc');
	Permut(0,'cama');
	Permut(0,'equiac');
	Permut(0,'elec');
	on('medi');on('MNUmedi');
	off('MNUFibra');off('MNUCest');off('MNUactivo');off('MNUherr');off('MNUredes');off('MNUelec');
	off('fib');off('cob');off('herr');off('redes');off('activo');off('elect');
	fram.src=src;
	}
function Ptres_top(v,src)
	{
	fram = top.document.getElementById(v);
	//alert('Ptres' + v +src);
	Permut_top(1,'Pfibra');
	Permut_top(0,'Pce');
	Permut_top(1,'Pina');
	Permut_top(0,'Pcc');
	Permut_top(0,'cama');
	Permut_top(0,'equiac');
	Permut_top(0,'elec');
	on_top('medi');on_top('MNUmedi');
	off_top('MNUFibra');off_top('MNUCest');off_top('MNUactivo');off_top('MNUherr');off_top('MNUredes');off_top('MNUelec');
	off_top('fib');off_top('cob');off_top('herr');off_top('redes');off_top('activo');off_top('elect');
	fram.src=src;
	}
function Pcuatro(v,src)
	{
	fram = document.getElementById(v);
	//alert('Pcuatro' + v +src);
	Permut(1,'Pfibra');
	Permut(0,'Pce');
	Permut(0,'Pina');
	Permut(1,'Pcc');
	Permut(0,'cama');
	Permut(0,'equiac');
	Permut(0,'elec');
	on('herr');
	on('MNUherr');
	off('MNUFibra');off('MNUCest');off('MNUactivo');off('MNUmedi');off('MNUredes');off('MNUelec');
	off('fib');off('cob');off('medi');off('redes');off('activo');off('elect');
	fram.src=src;
	}
function Pcuatro_top(v,src) {
	fram = top.document.getElementById(v);
	//alert('Pcuatro' + v +src);
	Permut_top(1,'Pfibra');
	Permut_top(0,'Pce');
	Permut_top(0,'Pina');
	Permut_top(1,'Pcc');
	Permut_top(0,'cama');
	Permut_top(0,'equiac');
	Permut_top(0,'elec');
	on_top('herr');
	on_top('MNUherr');
	off_top('MNUFibra');off_top('MNUCest');off_top('MNUactivo');off_top('MNUmedi');off_top('MNUredes');off_top('MNUelec');
	off_top('fib');off_top('cob');off_top('medi');off_top('redes');off_top('activo');off_top('elect');
	fram.src=src;
}
	
	function Pcinco(v,src)
	{
	fram = document.getElementById(v);
	//alert('Pcinco' + v +src);
	Permut(1,'Pfibra');
	Permut(0,'Pce');
	Permut(0,'Pina');
	Permut(0,'Pcc');
	Permut(1,'cama');
	Permut(0,'equiac');
	Permut(0,'elec');
	on('redes');on('MNUredes');
	off('MNUFibra');off('MNUCest');off('MNUactivo');off('MNUmedi');off('MNUherr');off('MNUelec');
	off('fib');off('cob');off('medi');off('herr');off('activo');off('elect');
	fram.src=src;
	}
function Pcinco_top(v,src)
	{
	fram = top.document.getElementById(v);
	//alert('Pcinco' + v +src);
	Permut_top(1,'Pfibra');
	Permut_top(0,'Pce');
	Permut_top(0,'Pina');
	Permut_top(0,'Pcc');
	Permut_top(1,'cama');
	Permut_top(0,'equiac');
	Permut_top(0,'elec');
	on_top('redes');on_top('MNUredes');
	off_top('MNUFibra');off_top('MNUCest');off_top('MNUactivo');off_top('MNUmedi');off_top('MNUherr');off_top('MNUelec');
	off_top('fib');off_top('cob');off('medi');off_top('herr');off_top('activo');off_top('elect');
	fram.src=src;
}
	
	function Pseis(v,src)
	{
	fram = document.getElementById(v);
	//alert('Pseis' + v +src);
	Permut(1,'Pfibra');
	Permut(0,'Pce');
	Permut(0,'Pina');
	Permut(0,'Pcc');
	Permut(0,'cama');
	Permut(1,'equiac');
	Permut(0,'elec');
	on('activo');on('MNUactivo');
	off('MNUFibra');off('MNUCest');off('MNUredes');off('MNUmedi');off('MNUherr');off('MNUelec');
	off('fib');off('cob');off('medi');off('herr');off('redes');off('elect');
	fram.src=src;
	}
function Pseis_top(v,src)
	{
	fram = top.document.getElementById(v);
	//alert('Pseis' + v +src);
	Permut_top(1,'Pfibra');
	Permut_top(0,'Pce');
	Permut_top(0,'Pina');
	Permut_top(0,'Pcc');
	Permut_top(0,'cama');
	Permut_top(1,'equiac');
	Permut_top(0,'elec');
	on_top('activo');on_top('MNUactivo');
	off_top('MNUFibra');off_top('MNUCest');off_top('MNUredes');off_top('MNUmedi');off_top('MNUherr');off_top('MNUelec');
	off_top('fib');off_top('cob');off_top('medi');off_top('herr');off_top('redes');off_top('elect');
	fram.src=src;
}
	function Psiete(v,src)
	{
	fram = document.getElementById(v);
	//alert('Psiete' + v +src);
	Permut(1,'Pfibra');
	Permut(0,'Pce');
	Permut(0,'Pina');
	Permut(0,'Pcc');
	Permut(0,'cama');
	Permut(0,'equiac');
	Permut(1,'elec');
	on('elect');on('MNUelec');
	off('MNUFibra');off('MNUCest');off('MNUredes');off('MNUmedi');off('MNUherr');off('MNUactivo');
	off('fib');off('cob');off('medi');off('herr');off('redes');off('activo');
	fram.src=src;
	}
function Psiete(v,src){
	fram = top.document.getElementById(v);
	//alert('Psiete' + v +src);
	Permut_top(1,'Pfibra');
	Permut_top(0,'Pce');
	Permut_top(0,'Pina');
	Permut_top(0,'Pcc');
	Permut_top(0,'cama');
	Permut_top(0,'equiac');
	Permut_top(1,'elec');
	on_top('elect');on_top('MNUelec');
	off_top('MNUFibra');off_top('MNUCest');off_top('MNUredes');off_top('MNUmedi');off_top('MNUherr');off_top('MNUactivo');
	off_top('fib');off_top('cob');off_top('medi');off_top('herr');off_top('redes');off_top('activo');
	fram.src=src;
}
	
	
	
function HMcable(id,esta)
{
	
	td = document.getElementById(id);
	//alert('HM' + id +esta);
	td.style.display='none';

	}
	
function HMcableon(id,esta)
{
	
	td = document.getElementById(id);
	td.style.display='';
	}
//mostrar submenus
function SBmnu(id,frm,src,mi)
{
	
	tdmi = document.getElementById(mi);
	frm=  document.getElementById(frm);
	back1='url(.mnuiz/fmenucl.jpg)';
	back2='url(.mnuiz/fmenu.jpg)';
	//if (esta=='none')
		//{
			//tdmi.style.backgroundImage=back1;
			frm.src=src;
	//	}
	//else
	//	{
			tdmi.style.backgroundImage=back2;
	//	}
	
	}
	//Mustrar menus principales
function mnu(id)
{
	td = document.getElementById(id);
	//alert('mnu' + id);
	esta=td.style.display;
	if (esta=='none')
		{
			td.style.display='';
		}
	else
		{
			td.style.display='none';
		}
	
}
	
function off(id)
{
	td = document.getElementById(id);
	//alert('OFF' + id);
	td.style.display='none';
}
function on(id)
{
	
	td = document.getElementById(id);
	//alert('on' + id);
	td.style.display='';
	}
	
function off_top(id)
{
	td = top.document.getElementById(id);
	//alert('OFF' + id);
	td.style.display='none';
}
function on_top(id)
{
	
	td = top.document.getElementById(id);
	//alert('on' + id);
	td.style.display='';
}
	
	function backo(id)
{
	
	td = document.getElementById(id);
	backi='url(Index2010/l.jpg)';
	backv='url(Index2010/2.jpg)';
	bc=prompt('Color','#000000')
	td.style.backgroundColor=bc;
	
	}
	
	function redix(id,hj)
{
	
	dv = document.getElementById(id);
	hji = document.getElementById(hj);
	divL=dv.style.left;
	hji=hji.style.width;
	if (hji>=1014)
	{
		alert('hjl'+hji);
	}
}
	
	
function arr(tec,imgs) {
img = document.getElementById(imgs);
estado = document.getElementById('Submit');
texto = document.getElementById(tec);
 ////Correo
  if ((texto.value.indexOf ('@') == -1) && (texto.value.indexOf ('.') == -1) ) 
  { 
  img.src = '.flm/IMGT/bir.jpg';
 	}
 	 else
  	{
   img.src = '.flm/IMGT/bi.jpg';
  }
}