var enProcesof = false; // lo usamos para ver si hay un proceso activo
var httpf = getHTTPObject(); // Creamos el objeto XMLHttpRequest

function handleHttpResponsef() {   

document.getElementById('divfotos').innerHTML='<img src=ajax-loader.gif>  Cargando ....';
   
   if (httpf.readyState == 4) { 
       if (httpf.status == 200) { 
          if (httpf.responseText.indexOf('invalid') == -1) {
             // Armamos un array, usando la coma para separar elementos
             results = httpf.responseText; 
			 //alert(results);
             document.getElementById('divfotos').innerHTML = results;
             enProcesof = false;
          }
       }
    }
	
}

function traerAlbunesIndex(p, pais,tp) {
	
    if (!enProcesof && httpf) {
		
      var urlf = "fotosindex.asp?pagina="+p+"&pais="+pais+"&TamPagina="+tp;
	//alert(urlf);
       httpf.open("GET", urlf, true);
       httpf.onreadystatechange = handleHttpResponsef;
       enProcesof = true;
       httpf.send(null);
    }

}

function traerPrensaIndex(p, pais,tp) {
	
    if (!enProcesof && httpf) {
		
      var urlf = "Prensaindex.asp?pagina="+p+"&pais="+pais+"&TamPagina="+tp;
	//alert(urlf);
       httpf.open("GET", urlf, true);
       httpf.onreadystatechange = handleHttpResponsef;
       enProcesof = true;
       httpf.send(null);
    }

}


var enProceso4 = false; // lo usamos para ver si hay un proceso activo
var http4 = getHTTPObject(); // Creamos el objeto XMLHttpRequest

function handleHttpResponse4() {   

document.getElementById('divvideos').innerHTML='<img src=ajax-loader.gif>  Cargando ....';
   
   if (http4.readyState == 4) { 
       if (http4.status == 200) { 
          if (http4.responseText.indexOf('invalid') == -1) {
             // Armamos un array, usando la coma para separar elementos
             results = http4.responseText; 
			 //alert(results);
             document.getElementById('divvideos').innerHTML = results;
             enProceso4 = false;
          }
       }
    }
	
}

var enProceso5 = false; // lo usamos para ver si hay un proceso activo
var http5 = getHTTPObject(); // Creamos el objeto XMLHttpRequest

function handleHttpResponse5() {   

document.getElementById('divquepasa').innerHTML='<img src="ajax-loader.gif"   width="40">  Cargando ....';
   
   if (http5.readyState == 4) { 
       if (http5.status == 200) { 
          if (http5.responseText.indexOf('invalid') == -1) {
             // Armamos un array, usando la coma para separar elementos
             results = http5.responseText; 
			 //alert(results);
             document.getElementById('divquepasa').innerHTML = results;
             enProceso5 = false;
          }
       }
    }
	
}



function traerQuepasa(p, pais,tp) {
	
	//traercomentarios('{id}','2','1');
	
    if (!enProceso5 && http5) {
		
      var urlf = "noticiasindex.asp?pagina="+p+"&pais="+pais+"&TamPagina="+tp+"#top";
	//alert(urlf);
       http5.open("GET", urlf, true);
       http5.onreadystatechange = handleHttpResponse5;
       enProceso5 = true;
       http5.send(null);
    }

}


function traerAlbunesVideoIndex(p, pais,tp) {
	
    if (!enProceso4 && http4) {
		
      var urlf = "videosindex.asp?pagina="+p+"&pais="+pais+"&TamPagina="+tp;
	//alert(urlf);
       http4.open("GET", urlf, true);
       http4.onreadystatechange = handleHttpResponse4;
       enProceso4 = true;
       http4.send(null);
    }

}




function cambiastock(id,value){

		document.getElementById("stock"+id).value=value;

	}


var enProceso2 = false; // lo usamos para ver si hay un proceso activo
var http2 = getHTTPObject(); // Creamos el objeto XMLHttpRequest




function handleHttpResponse2() {    


document.getElementById('fotos').innerHTML='<img src=ajax-loader.gif>  Cargando ....';
    if (http2.readyState == 4) { 
       if (http2.status == 200) { 
          if (http2.responseText.indexOf('invalid') == -1) {
             // Armamos un array, usando la coma para separar elementos
             results2 = http2.responseText; 
             document.getElementById('fotos').innerHTML = results2;
             enProceso2 = false;
          }
       }
    }
	
}

var enProceso = false; // lo usamos para ver si hay un proceso activo
var http = getHTTPObject(); // Creamos el objeto XMLHttpRequest

function handleHttpResponse() {   


//alert(document.getElementById("idocultop").value);
var id = document.getElementById("idocultop").value;

document.getElementById('div'+id).innerHTML='<img src=ajax-loader.gif>  Cargando ....';
   
   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; 
             document.getElementById('div'+id).innerHTML = results;
             enProceso = false;
          }
       }
    }
	
	
}






function traercomentarios(idp,idh,p) {
	
document.getElementById("idocultop").value=idp;
document.getElementById("idocultoh").value=idh;

//alert("en porceso:" + enProceso + ", http: "+http);

    if (!enProceso && http) {
		//enProceso = false;
       var url = "comentarios.asp?idp="+idp+"&idh="+idh+"&pagina="+p;
	//alert(url);
       http.open("GET", url, true);
       http.onreadystatechange = handleHttpResponse;
       
       http.send(null);
	   
	   
    }

}







var enProceso3 = false; // lo usamos para ver si hay un proceso activo
var http3 = getHTTPObject(); // Creamos el objeto XMLHttpRequest




function handleHttpResponse3() {    


document.getElementById('fotos').innerHTML='<img src=ajax-loader.gif>  Cargando ....';
    if (http3.readyState == 4) { 
       if (http3.status == 200) { 
          if (http3.responseText.indexOf('invalid') == -1) {
             // Armamos un array, usando la coma para separar elementos
             results3 = http3.responseText; 
             document.getElementById('fotos').innerHTML = results3;
             enProceso3 = false;
          }
       }
    }
	
}


function traerVideos(pais,ida,p) {

	
    if (!enProceso3 && http3) {
document.getElementById("paisf").value=pais;
document.getElementById("idalbum").value=ida;
//document.getElementById("idocultop").value=idf;

       var url = "videosajax.asp?ida="+ida+"&pais="+pais+"&mostrar=Album&pagina="+p;
	  //alert(url);
       http3.open("GET", url, true);
       http3.onreadystatechange = handleHttpResponse3;
       enProceso3 = true;
       http3.send(null);
    }

}


function VideoSiguiete(idf,album) {

	
    if (!enProceso3 && http3) {
document.getElementById("idf").value=idf;


traercomentarios(album,idf,1);

       var url = "videosajax.asp?id="+idf+"&mostrar=Foto&album="+album;
	  //alert(url);
       http3.open("GET", url, true);
       http3.onreadystatechange = handleHttpResponse3;
       enProceso3 = true;
       http3.send(null);
    }

}

function VideoAnterior(idf) {

	
    if (!enProceso3 && http3) {
document.getElementById("idf").value=idf;

       var url = "videosajax.asp?id="+idf+"&mostrar=Foto";
	   //alert(url);
       http3.open("GET", url, true);
       http3.onreadystatechange = handleHttpResponse3;
       enProceso3 = true;
       http3.send(null);
    }

}


function traerFotos(pais,ida,p) {

	
    if (!enProceso2 && http2) {
document.getElementById("paisf").value=pais;
document.getElementById("idalbum").value=ida;
//document.getElementById("idocultop").value=idf;

       var url = "fotosajax.asp?ida="+ida+"&pais="+pais+"&mostrar=Album&pagina="+p;
	  //alert(url);
       http2.open("GET", url, true);
       http2.onreadystatechange = handleHttpResponse2;
       enProceso2 = true;
       http2.send(null);
    }

}


function traerPrensa(pais,ida,p) {

	
    if (!enProceso2 && http2) {
document.getElementById("paisf").value=pais;
document.getElementById("idalbum").value=ida;
//document.getElementById("idocultop").value=idf;

       var url = "prensaajax.asp?ida="+ida+"&pais="+pais+"&mostrar=Album&pagina="+p;
	 //alert(url);
       http2.open("GET", url, true);
       http2.onreadystatechange = handleHttpResponse2;
       enProceso2 = true;
       http2.send(null);
    }

}




function motrarVideo(idf,album,ida) {

	
    if (!enProceso2 && http2) {
		

	traercomentarios(album,idf,1);

     var url = "videosajax.asp?id="+idf+"&mostrar=Foto&album="+album;
	 //alert(url);
       http2.open("GET", url, true);
       http2.onreadystatechange = handleHttpResponse2;
       enProceso2 = true;
       http2.send(null);
    }

}



function motrarPrensa(idf,album,ida) {


    if (!enProceso2 && http2) {
		

	traercomentarios(album,idf,1);

     var url = "prensaajax.asp?id="+idf+"&mostrar=Foto&album="+album;
	
	//alert(url);
       http2.open("GET", url, true);
       http2.onreadystatechange = handleHttpResponse2;
       enProceso2 = true;
       http2.send(null);
    }

}

function motrarFoto(idf,album,ida) {


    if (!enProceso2 && http2) {
		

	traercomentarios(album,idf,1);

     var url = "fotosajax.asp?id="+idf+"&mostrar=Foto&album="+album;
	// alert(url);
       http2.open("GET", url, true);
       http2.onreadystatechange = handleHttpResponse2;
       enProceso2 = true;
       http2.send(null);
    }

}


function FotoSiguiete(idf,album) {

	
    if (!enProceso2 && http2) {
document.getElementById("idf").value=idf;


traercomentarios(album,idf,1);

       var url = "fotosajax.asp?id="+idf+"&mostrar=Foto&album="+album;
	  //alert(url);
       http2.open("GET", url, true);
       http2.onreadystatechange = handleHttpResponse2;
       enProceso2 = true;
       http2.send(null);
    }

}


function PrensaSiguiete(idf,album) {

	
    if (!enProceso2 && http2) {
document.getElementById("idf").value=idf;


traercomentarios(album,idf,1);

       var url = "prensaajax.asp?id="+idf+"&mostrar=Foto&album="+album;
	  //alert(url);
       http2.open("GET", url, true);
       http2.onreadystatechange = handleHttpResponse2;
       enProceso2 = true;
       http2.send(null);
    }

}

function FotoAnterior(idf) {

	
    if (!enProceso2 && http2) {
document.getElementById("idf").value=idf;

       var url = "fotosajax.asp?id="+idf+"&mostrar=Foto";
	   //alert(url);
       http2.open("GET", url, true);
       http2.onreadystatechange = handleHttpResponse2;
       enProceso2 = true;
       http2.send(null);
    }

}


function PrensaAnterior(idf) {

	
    if (!enProceso2 && http2) {
document.getElementById("idf").value=idf;

       var url = "prensaajax.asp?id="+idf+"&mostrar=Foto";
	   //alert(url);
       http2.open("GET", url, true);
       http2.onreadystatechange = handleHttpResponse2;
       enProceso2 = true;
       http2.send(null);
    }

}


function videoSiguiete(idf,album) {

	
    if (!enProceso2 && http2) {
document.getElementById("idf").value=idf;


traercomentarios(album,idf,1);

       var url = "videosajax.asp?id="+idf+"&mostrar=Foto&album="+album;
	  //alert(url);
       http2.open("GET", url, true);
       http2.onreadystatechange = handleHttpResponse2;
       enProceso2 = true;
       http2.send(null);
    }

}

function FotoAnterior(idf) {

	
    if (!enProceso2 && http2) {
document.getElementById("idf").value=idf;

       var url = "videosajax.asp?id="+idf+"&mostrar=Foto";
	   //alert(url);
       http2.open("GET", url, true);
       http2.onreadystatechange = handleHttpResponse2;
       enProceso2 = true;
       http2.send(null);
    }

}






function escribirComentario(idp,idh,p) {

var nombre=document.getElementById("nombre").value;
var com=document.getElementById("comentario").value;
var pais=document.getElementById("pais").value;
var email=document.getElementById("email").value;

if(email.indexOf('@')!=-1 && nombre!='' && com!=''&& pais!=''){


document.getElementById("idocultop").value=idp;
document.getElementById("idocultoh").value=idh;
	
			 if (!enProceso && http) {
				   var url = "comentarios.asp?ins=true&nombre="+nombre+"&com="+com+"&idp="+idp+"&idh="+idh+"&email="+email+"&pais="+pais;
				  // alert(url);
				   http.open("GET", url, true);
				   http.onreadystatechange = handleHttpResponse;
				   enProceso = true;
				   http.send(null);
				   traercomentarios(idp,idh,p);
				}
			}else{
				
				var strerror='';
				if(email.indexOf('@')==-1){
					document.getElementById("email").style.backgroundColor= "#E88E8C";
					strerror+='Email ';
				}
				
				if(nombre==''){
					document.getElementById("nombre").style.backgroundColor= "#E88E8C";
					strerror+='Nombre '
				}
				if(com==''){
					document.getElementById("comentario").style.backgroundColor= "#E88E8C";
					strerror+='Comentario '
				}
				
				if(pais==''){
					document.getElementById("pais").style.backgroundColor= "#E88E8C";
					strerror+='Pais '
				}
				
				alert('Error en Datos Ingresados : '+strerror);
				
				}
}




function getHTTPObject() {
    var xmlhttp;

    if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
       try {
          xmlhttp = new XMLHttpRequest();
       } catch (e) { xmlhttp = false; }
    }
    return xmlhttp;
}



function seleccionarPromo(id){
	window.location.href='hacerpedido.asp?pedidos='+id+',';
	
	}

function validarPedido(session){


	if (document.form.pedidos.value==''){
		alert('Debe seleccionar platos para poder hacer un pedido...');
		return false;
		}else{
			return true;
			}

	}


//seleccionar
function seleccionar(id,precio){

	var actual=document.form.pedidos.value;
	document.form.pedidos.value=actual+','+id;

		var objCamp1=document.form1.precio;
		var objCamp2=document.form1.Preciohidden;
		
		if(objCamp2.value==''){
			objCamp2.value=0;
			}
			

if(document.getElementById("che"+id).checked){
	
	var cantind = document.getElementById("cant"+id).value;
	var multli;
	multli=(parseFloat(precio)*parseInt(cantind));
	objCamp1.value=parseFloat(parseFloat(objCamp2.value) + parseInt(multli));
		
		var cantidad=document.getElementById("cantidad").value;
		
		if(cantind ==''){
			cantidad=1;
			}
		if(cantidad==''){
			cantidad=0;
			}
			document.getElementById("cantidad").value=parseInt(cantidad)+parseInt(cantind);
			objCamp2.value=parseFloat(objCamp1.value);
		}
		else//si deschequeo
		{
			
		var cantind = document.getElementById("cant"+id).value;
		//sumo a precio total
		var multli=parseFloat(parseFloat(precio)*parseInt(cantind));
		
		objCamp1.value=parseFloat(parseFloat(objCamp2.value) - parseFloat(multli));
		
		var cantidad=document.getElementById("cantidad").value;
			if(cantidad==''){
			cantidad=0;
			}
		
		document.getElementById("cantidad").value=parseInt(cantidad)-parseInt(cantind);
		objCamp2.value=parseFloat(objCamp1.value);
		
		
	}
	
}
	
	function mas(id,precio){
		
		if (document.getElementById("che"+id).checked==false){
			
			alert('Debe seleccionar el Plato');
			}else{
			//cantidad de individual
		var cant=document.getElementById("cant"+id).value ;

		document.getElementById("che"+id).checked=true;
				

			//sumo uno a cant individual
			document.getElementById("cant"+id).value = parseInt(cant) + 1;
		
		//cant general
		var cantidad=document.getElementById("cantidad").value;

		if(cantidad=='')
			cantidad=1;

		
		if(document.getElementById("che"+id).checked)
		{
			//tomo la cantidadg ral y le sumo 1
			document.getElementById("cantidad").value=parseInt(cantidad)+1;
			var actual=document.form.pedidos.value;
			
			document.form.pedidos.value=actual+','+id;
			var objCamp1=document.getElementById('precio');
			var objCamp2=document.getElementById('Preciohidden');
		
		if(objCamp2.value==''){
			objCamp2.value=0;
			}

	if(document.getElementById("che"+id).checked){
			var cantind = parseInt(document.getElementById("cant"+id).value)-1;
			objCamp1.value=parseFloat(objCamp2.value) + parseFloat(precio);
			var cantidad=document.getElementById("cantidad").value;
			objCamp2.value=objCamp1.value;
	
				}else{
		var cantind = document.getElementById("cant"+id).value;		
		//sumo a precio total
		objCamp1.value=parseFloat(objCamp2.value) - parseFloat(precio)*parseInt(cantind);
		var cantidad=document.getElementById("cantidad").value;
		objCamp2.value=parseFloat(objCamp1.value);
		}
			
			}
		}
	}
	
	
	//menos***********************************************
	function menos(id,precio){

if (document.getElementById("che"+id).checked==false){
			
			alert('Debe seleccionar el Plato');
			}else{
				
		var cant=document.getElementById("cant"+id).value ;
		//alert(cant);
		if (cant>1)
	document.getElementById("cant"+id).value = parseInt(cant) - 1;
	//fin suna cant individual
	
		var actual=document.form.pedidos.value;
		document.form.pedidos.value=actual+','+id;

		var objCamp1=document.getElementById('precio');
		var objCamp2=document.getElementById('Preciohidden');
		
		if(objCamp2.value==''){
			objCamp2.value=0;
			}
	if (cant>1){
	var cantidad=document.getElementById("cantidad").value;
		if(cantidad=='')
		{cantidad=0;}
		
		
		cant=document.getElementById("cant"+id).value ;
		objCamp2.value=objCamp1.value;
		
if(document.getElementById("che"+id).checked){
		document.getElementById("cantidad").value=parseInt(cantidad)-1;

		}
	if(document.getElementById("che"+id).checked){
		//sumo a precio total
		objCamp1.value=parseFloat(parseFloat(objCamp2.value) - parseFloat(precio));
		var cantidad=document.getElementById("cantidad").value;
				}
			}
		}
	}
	
	
	
	function alerta(){
	
alert('Debe asignar una foto al producto, O asignar sin Foto');	
	
}

function SinFoto(id){
		window.location.href='producto.asp?sinfoto=true&acc=editar&id='+id;
	}
	
	
function SinFotonew(){
		window.location.href='productonew.asp?sinfoto=true&acc=nuevo';
	}





function ModFoto(id){
window.open('FormUpload.asp?id='+id+'','','toolbar=no,directories=no,location=no,resizable=nn,status=yes,scrollbars=yes,menubar=no,width=500,height=400');
return true;
}


function newFoto(id){
window.open('FormUpload.asp?acc=nuevo&id='+id,'','toolbar=no,directories=no,location=no,resizable=nn,status=yes,scrollbars=yes,menubar=no,width=500,height=400');
return true;
}


function newFotonew(){
window.open('FormUploadnew.asp?acc=nuevo','','toolbar=no,directories=no,location=no,resizable=nn,status=yes,scrollbars=yes,menubar=no,width=500,height=400');
return true;
}



function submitForm(id){

form=document.getElementById('form'+id);

		form.action='producto.asp?id='+id+'&modificar=1';
		form.submit();

	}


var pic = null
var popImg = null  // use this when referring to pop-up image
var picTitle = null
var imgCount = 0
var imgWinName = "popImg"
var imgPop = 'templates/imgpop.htm';

function openPopImg(picName, windowTitle, windowWidth, windowHeight){
  closePopImg()
  picTitle = windowTitle
  imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
  popImg = window.open(picName, imgWinName,
           "toolbar=no,scrollbars=yes,resizable=yes,width=" 
           + (parseInt(windowWidth)+20)  + ",height=" 
           + (parseInt(windowHeight)+15)) 
  }
function closePopImg(){    // close pop-up window if it is open 
  if (navigator.appName != "Microsoft Internet Explorer" 
      || parseInt(navigator.appVersion) >=4) //do not close if early IE
    if(popImg != null) if(!popImg.closed) popImg.close() 
  }
function setStatus(msg){
  status = msg
  return true
  }

// for Netscape 3+ and IE 4+
var priorPic = new Array()
var noPic = 0
var foundit = false

function openPopImg(picName,  windowTitle, windowWidth, windowHeight){
 var i = 0
  if(pic == picName && winOpen()){
    popImg.focus()
    }
  else{
    foundit = false
    for(i=0; i<=noPic; i++){
      if (priorPic[i] == picName)
        foundit = true 
      }
    pic = picName
    closePopImg()
    picTitle = windowTitle
    imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
    if(!foundit){
      priorPic[noPic++] = pic
      }
    popImg = openPopImgWin(imgWinName, windowWidth, windowHeight)
    }
  }
function openPopImgWin(imgWinName, windowWidth, windowHeight){
  var winFeatures = "toolbar=no,scrollbars=yes,resizable=no,width=" 
    + windowWidth + ",height=" + windowHeight
  return window.open(imgPop, imgWinName, winFeatures)
  }
function winOpen(){
  if(popImg != null){ 
    if(popImg.closed != true) return true; else return false
    }  
  else
    return false
  }

// Use this function to control placement of pop-up window
// in Netscape 4+ and Internet Explorer 4+
function openPopImgWin(imgWinName, windowWidth, windowHeight){
 var leftX = 20  // distance of window's left side from left of screen
  var topY = 20   // distance of window's top side from top of screen
  var winFeatures = "toolbar=no,scrollbars=yes,resizable=yes,width=" 
    + (parseInt(windowWidth)+18) + ",height=" + windowHeight
  if (leftX>0){
    winFeatures += ",screenX=" + leftX + ",left=" + leftX	
                + ",screenY=" + topY + ",top=" + topY
    }
  return window.open(imgPop, imgWinName, winFeatures)
  }



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 vergral(id){
	
	//alert(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 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 = "#B2BDCE";

}

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(){

if (document.frm.txtUsername.value=='' && document.frm.txtPassword.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");
		
		}
		
		
		


