//marquesina desplazandose
var msg=""
var delay=50 
var startPos=100 
var timerID=null 
var timerRunning=false 
var pos=0
StartScrolling() 

function StartScrolling(){ 
    StopTheClock() 
    for (var i = 0; i < startPos; i++) 
    msg=" " + msg 
    DoTheScroll() 
}
 
function StopTheClock(){ 
    if(timerRunning) 
        clearTimeout(timerID) 
    timerRunning=false 
} 

function DoTheScroll(){ 
    if (pos < msg.length) 
        self.status= 
    msg.substring(pos, msg.length); 
    else 
        pos=-1; 
    ++pos 
    timerRunning=true 
    timerID= 
   self.setTimeout("DoTheScroll()", delay) 
}
//fin de marquesina desplazandose	

//desabilitar el boton derecho del mouse
var message = ""; 

   function clickIE(){ 
    if (document.all){ 
     (message); 
     return false; 
    } 
   } 

   function clickNS(e){ 
    if (document.layers || (document.getElementById && !document.all)){ 
     if (e.which == 2 || e.which == 3){ 
      (message); 
      return false; 
     } 
    } 
   } 

   if (document.layers){ 
    document.captureEvents(Event.MOUSEDOWN); 
    document.onmousedown = clickNS; 
   } else { 
    document.onmouseup = clickNS; 
    document.oncontextmenu = clickIE; 
   } 
   document.oncontextmenu = new Function("return false") 
//fin desabilitar el boton derecho del mouse

//bloquear la tecla F5
function efe5(){
	var tecla=window.event.keyCode;
	if (tecla==116){
		//alert("ESTA OPERACIÓN ESTA INVALIDADA...!");
		event.keyCode=0;
		event.returnValue=false;
	}
}
//fin bloquear la tecla F5

	
function estaVacio(valor){
	if(valor==null){return true;}
	for(var i=0;i<valor.length;i++) {
		if ((valor.charAt(i)!=' ')&&(valor.charAt(i)!="\t")&&(valor.charAt(i)!="\n")&&(valor.charAt(i)!="\r")){return false;}
	}
	return true;
}

function comboSeleccionado(combo){
	seleccion=combo.selectedIndex;
	if(seleccion==0){
	 return false;
	}
	return true;
}

function chequearOpcion(frm){
	for (var i=0;i < frm.elements.length;i++)
	{	var elemento = frm.elements[i];
		if (elemento.type == "radio"){
			if (elemento.checked)
				return (true);
		}		
	}
	return (false);
}

function soloNumeros(){
	var tecla=window.event.keyCode;
	if (tecla<48||tecla>58){
		window.event.keyCode=0;
	}
}

/*function detener(){
	control.scrollAmount="0"
}
	
function sigue(){
	control.scrollAmount="4"
}*/


//*****************busqueda en google**************************//
function buscarGoogle(frm){
	if (estaVacio(frm.q.value)){
		alert ("Digite parametro de busqueda");
		frm.q.focus();
	}
	else{
		frm.action = "http://www.google.com/search";
		frm.submit();
	}
}


//**********************gestion de encuestas********************
function guardarEncuesta(frm){
	if(!chequearOpcion(frm)){
		alert("Debe seleccionar una opcion de la lista");
	}
	else{
		frm.action = "enc_agr.php";
		frm.submit();
	}
}

