function asighidd(img){

document.getElementById('ImgHidd').value=img;}


function loadFoto(iddest){
	var img=document.getElementById('ImgHidd').value;
	window.open('foto.asp?foto='+img+'&dest='+iddest,'','width=400,height=400,scrollbars=no'); 
	void('');
	}



function loadImage(img,carpeta) {
	var theImage = new Image(200,200);
	theImage.src = "images/paquetes/"+carpeta+"/"+img+""
	
	document.getElementById('tbimg').style.backgroundImage = "url(" + theImage.src + ")";
}




function AjaxGenerico(iddestino) {
	

 if (!enProceso && http) {


	   //alert(valor1+" "+valor2 +" "+valor3);
	   
       var url = "imgpaqueres.asp?id="+iddestino;
	  //alert(url);
       http.open("GET", url, true);
       http.onreadystatechange = handleHttpResponse;
       enProceso = true;
       http.send(null);
    }
}


function handleHttpResponse() { 
 document.getElementById("campoMensaje").innerHTML = "Buscando espere ...<br><br><img src='../images/ajax-loader.gif'>";
    if (http.readyState == 4) { 
       if (http.status == 200) { 
          if (http.responseText.indexOf('invalid') == -1) {
             // Armamos un array, usando la coma para separar elementos
            // results = http.responseText.split(","); 
			 
             //document.getElementById("campoMensaje").innerHTML = results[0];
             document.getElementById("campoMensaje").innerHTML = http.responseText;
			 enProceso = false;
          }
       }
    }
}


function getHTTPObject() {
    var xmlhttp;
    /*@cc_on
    @if (@_jscript_version >= 5)
       try {
          xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
       } catch (e) {
          try {
             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (E) { xmlhttp = false; }
       }
    @else
    xmlhttp = false;
    @end @*/
    if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
       try {
          xmlhttp = new XMLHttpRequest();
       } catch (e) { xmlhttp = false; }
    }
    return xmlhttp;
}

var enProceso = false; // lo usamos para ver si hay un proceso activo
var http = getHTTPObject(); // Creamos el objeto XMLHttpRequest


function aleatorio(inferior,superior){ 
numPosibilidades = superior - inferior 
aleat = Math.random() * numPosibilidades 
aleat = Math.round(aleat) 
return parseInt(inferior) + aleat 
} 


function coolRedirect(url, msg)
{
   var TARG_ID = "COOL_REDIRECT";
   var DEF_MSG = "Redirecting...";

   if( ! msg )
   {
      msg = DEF_MSG;
   }

   if( ! url )
   {
      throw new Error('You didn\'t include the "url" parameter');
   }


   var e = document.getElementById(TARG_ID);

   if( ! e )
   {
      throw new Error('"COOL_REDIRECT" element id not found');
   }

   var cTicks = parseInt(e.innerHTML);

   var timer = setInterval(function()
   {
      if( cTicks )
      {
         e.innerHTML = --cTicks;
      }
      else
      {
         clearInterval(timer);
         document.body.innerHTML = msg;
         location = url;	  
      }

   }, 1000);
}

	function GerarSWF($arquivo,$largura,$altura,$idNome){
            //controle para ver se é a primeira vez q. entrou na pagina (sessao)
         //   if (readCookie('dhtmlHome') != 'OK'){
		document.writeln('<object id="globalnav-object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + $largura + '" height="' + $altura + '" id="' + $idNome + '" name="' + $idNome + '">');
		document.writeln('<param name="movie" value="' + $arquivo + '" />');
		document.writeln('<param name="FlashVars" value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />');
		document.writeln('<param name="bgcolor" value="#ffffff" />');
		document.writeln('<param name="menu" value="false" />');
		document.writeln('<param name="quality" value="high" />');
		document.writeln('<param name="salign" value="tl" />');
		document.writeln('<param name="scale" value="noscale" />');
		document.writeln('<param name="wmode" value="transparent" />');
		document.writeln('<embed id="globalnav-embed" src="' + $arquivo + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" bgcolor="#ffffff" menu="false" quality="high" salign="tl" scale="noscale" id="' + $idNome + '" width="' + $largura + '" height="' + $altura + '"></embed>');
		document.writeln('</object>');
		              //marca que já exibiu o dhtml na sessao 
                //createCookie('dhtmlHome','OK','');
          //  }
	}	



function vergral2(id,dest){
	
if (id==3 && dest==31){
	document.getElementById('circuitos').style.visibility='visible';
	document.getElementById('circuitos').style.display='';
	
	}	else{
		if(dest==31){
	document.getElementById('circuitos').style.visibility='hidden';
	document.getElementById('circuitos').style.display='none';}
		}
		
if (id==4 && dest==2)
	{
	document.getElementById('circuitos').style.visibility='visible';
	document.getElementById('circuitos').style.display='';
	}
	
for(i=1; i<8; i++){
if(i==id){
			document.getElementById('toptabla').style.backgroundImage='url(img/TablaContenido/fd' + id + '.jpg)';
			document.getElementById('tipo'+id).style.visibility='visible';
			document.getElementById('tipo'+id).style.display='';
			
}else{
		if(document.getElementById('tipo'+i)!='null'){
			document.getElementById('tipo'+i).style.visibility='hidden';
			document.getElementById('tipo'+i).style.display='none';
			}else{
			document.getElementById('nada').style.visibility='visible';
			document.getElementById('nada').style.display='';
			}//end if
		}//en else
			}
	}//end function




function ofocus(id){
document.getElementById(id).style.backgroundColor = "#CCD0DC";
document.getElementById(id).focus();

	}
	
function GeneratePassword() {

    if (parseInt(navigator.appVersion) <= 3) {
        alert("Sorry this only works in 4.0+ browsers");
        return true;
    }

    var length=8;
    var sPassword = "";
    length = 8;//document.aForm.charLen.options[document.aForm.charLen.selectedIndex].value;

    var noPunction = true; //(document.aForm.punc.checked);
    var randomLength = false; // (document.aForm.rLen.checked);

    if (randomLength) {
        length = Math.random();

        length = parseInt(length * 100);
        length = (length % 7) + 6
    }


    for (i=0; i < length; i++) {

        numI = getRandomNum();
        if (noPunction) { while (checkPunc(numI)) { numI = getRandomNum(); } }
        sPassword = sPassword + String.fromCharCode(numI);
    }

   document.getElementById('password').value  = sPassword;

    //return true;
}

function getRandomNum() {

    // between 0 - 1
    var rndNum = Math.random()

    // rndNum from 0 - 1000
    rndNum = parseInt(rndNum * 1000);

    // rndNum from 33 - 127
    rndNum = (rndNum % 94) + 33;
	if (rndNum >= 65 && rndNum <= 90)
	  // todo a minúsculas!
	  rndNum = rndNum + 32;
    return rndNum;
}

function checkPunc(num) {

    if ((num >=33) && (num <=47)) { return true; }
    if ((num >=58) && (num <=64)) { return true; }
    if ((num >=91) && (num <=96)) { return true; }
    if ((num >=123) && (num <=126)) { return true; }

    return false;
}




function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' No es un  e-mail Valido.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' en Blanco!.\n'; }
  } if (errors) alert('Errores Ocurridos:\n'+errors);
  document.MM_returnValue = (errors == '');
}
		
	function MM_findObj(n, d) { //v4.01
			  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
			    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
			  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
			  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
			  if(!x && d.getElementById) x=d.getElementById(n); return x;
			}




function verGralSimple(id){
if(document.getElementById(id).style.visibility=='hidden'){
			document.getElementById(id).style.visibility='visible';
			document.getElementById(id).style.display='';
			}else{
			document.getElementById(id).style.visibility='hidden';
			document.getElementById(id).style.display='none';
				}


}


function verBannere(id)
{
    if(document.getElementById(id)!='null')
    {
        for(i=1;i<4;i++)
        {
            if(id==i)
            {
		        document.getElementById(i).style.visibility='visible';
		        document.getElementById(i).style.display='';	
		    }
		    else
		    {
				if(document.getElementById(id)!='null')
				{
		            document.getElementById(i).style.visibility='hidden';
		            document.getElementById(i).style.display='none';
			    }
		    }
        }
    }
}

function verBannere2(id)
{
    id = id + 2;
    if(document.getElementById(id)!='null')
    {
        for(i=3;i<4;i++)
        {
        alter(id);
            if(id==i)
            {
		        document.getElementById(i).style.visibility='visible';
		        document.getElementById(i).style.display='';	
		    }
		    else
		    {
				if(document.getElementById(id)!='null')
				{
		            document.getElementById(i).style.visibility='hidden';
		            document.getElementById(i).style.display='none';
			    }
		    }
        }
    }
}



function vergral(id){


			if(document.getElementById(id).style.visibility=='hidden'){
			document.getElementById(id).style.visibility='visible';
			document.getElementById(id).style.display='';
			}else{
			document.getElementById(id).style.visibility='hidden';
			document.getElementById(id).style.display='none';
			}

}


function vergralempresa(id,a,b){


			if(document.getElementById(id).style.visibility=='hidden'){
				
			document.getElementById(id).style.visibility='visible';
			document.getElementById(id).style.display='';
			
			document.getElementById(a).style.visibility='hidden';
			document.getElementById(a).style.display='none'
			document.getElementById(b).style.visibility='hidden';
			document.getElementById(b).style.display='none'
			
			}else{
			document.getElementById(id).style.visibility='hidden';
			document.getElementById(id).style.display='none';
			}

}




function guardaActividad(desc){
	
document.formPasos.hiddAct.value==desc;

alert(desc);}

function limpiar(id){

alert(document.getElementById(id).value);
	document.getElementById(id).value=='';
	
	}




function pintar(id) {

document.getElementById(id).style.backgroundColor = "#F4F2F2";

}

function nopintar(id) {

document.getElementById(id).style.backgroundColor = "";

}


function pintarlist(id) {
	

document.getElementById(id).style.backgroundColor = "#CCD0DC";


}

function nopintarlist(id) {

document.getElementById(id).style.backgroundColor = "";

}


function validar(p,pos){
 for (i=1; i <4; i++) {
 if (pos!=i)
document.getElementById('p'+p+''+i).checked=false;
}
}

function validaruser(){
	var user=document.getElementById("txtUsername");
	var pass=document.getElementById("txtPassword");
	

if (user.value=='' && pass.value==''){

alert('Debe ingresar Usuario y Clave');
return false;
}else{

//document.Frm.submit();
return true;
}

}






function Page(sEntidad, iEntidad,iPage){
	
	window.open('?' + sEntidad + '='+ iEntidad +'&iPagina='+iPage, "_self");
		
		}
		
		
		
					<!--
			function MM_preloadImages() { //v3.0
			  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
			    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
			    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
			}
			
			function MM_swapImgRestore() { //v3.0
			  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
			}
			

			
			function MM_swapImage() { //v3.0
			  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
			   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
			}
			
			function MM_showHideLayers() { //v6.0
			  var i,p,v,obj,args=MM_showHideLayers.arguments;
			  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
			    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
			    obj.visibility=v; }
			}
			
			function MM_reloadPage(init) {  //reloads the window if Nav4 resized
			  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
			  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
			}
			
			MM_reloadPage(true);
			
function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' No es un  e-mail Valido.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' en Blanco!.\n'; }
  } if (errors) alert('Errores Ocurridos:\n'+errors);
  document.MM_returnValue = (errors == '');
}
		
	function MM_findObj(n, d) { //v4.01
			  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
			    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
			  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
			  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
			  if(!x && d.getElementById) x=d.getElementById(n); return x;
			}
			
			
			//-->
			
					
	function valForm(){
	if (document.formPasos.value=='' || document.desccripcion.value==''){
	alert('No puede estar en blanco');
	}else{
	formPasos.submit()
	}
	}

