// JavaScript Document

function nuevoAjax(){
	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 quitarFrame() 
{
if (self.parent.frames.length != 0)
self.parent.location=document.location.href;
}

//-----------------------------------------------------------------

function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

//-----------------------------------------------------------------

function MM_jumpMenuSelecccion(targ,selObj,restore){ //v3.0
	if(document.form.selecciona2.value!=''){
		if(confirm('¿Cambiar los seleccionados?')){
			eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"&seleccion="+document.form.selecciona2.value+"'");
			if (restore) selObj.selectedIndex=0;
		}else{
			return(false);
		}
	}else{
		alert('Ningun registro seleccionado');
	}
}

//-----------------------------------------------------------------

var browser=navigator.appName;

function cambia (texto, foto){
	var eleOld=document.getElementById('texto');
    var eleNew=document.createElement('p');
	eleNew.setAttribute('id','texto');
	var texto_c = document.createTextNode(texto);
	eleNew.appendChild(texto_c);
	
    var imgOld=document.getElementById('gal');
	var imagen = document.createElement("img");
	if (browser=='Microsoft Internet Explorer')
		imagen.setAttribute('className','foto');
	else 
		imagen.setAttribute('class','foto');
	imagen.setAttribute('name','gal');
	imagen.setAttribute('id','gal');
	imagen.setAttribute('src',foto);
	
	var parent=eleOld.parentNode;
	parent.replaceChild(eleNew, eleOld);
	   
    var parent=imgOld.parentNode;
	parent.replaceChild(imagen, imgOld);
	return false;
}

//----------------------  Pa buscar nota  -------------------------------------------


function Buscar_nota (){
	var eleOld=document.getElementById('clave_p');
	alert(eleOld.value);
	return false;
}

function imagen(num){

    foto="/images/"+num;
	
    var imgOld=document.getElementById('poli_img');
	var imagen = document.createElement("img");
	imagen.setAttribute('src',foto);
	imagen.setAttribute('id','poli_img');
	
	imagen_b=imgOld.src;
	
    var parent=imgOld.parentNode;
	parent.replaceChild(imagen, imgOld);

}

function aReload() {
location.reload(true);
}


var ini="nota1";
var inima="img1";

function move(cuanto){

	document.getElementById("nota"+cuanto).style.background="url(/sitio/not_princ1.gif)";
	aux="img"+cuanto;
	if(inima!=aux){
		document.getElementById(ini).style.background="url(/sitio/not_princ.gif)";
		inima=aux;
	}
		
	ini="nota"+cuanto;

	var imgane1=document.getElementById("img1").src;
	var imgane2=document.getElementById("img2").src;
	var imgane3=document.getElementById("img3").src;
	var imgane4=document.getElementById("img4").src;	
	
	switch(cuanto){
		case 1:
			document.getElementById("imgprin").src=imgane1;
			if(ini!="nota1"){
				document.getElementById("nota1").style.background="url(/sitio/not_princ1.gif)";
			}
			break;
		case 2:
			document.getElementById("imgprin").src=imgane2;
			if(ini!="nota2"){
				document.getElementById("nota2").style.background="url(/sitio/not_princ1.gif)";
			}
			break;
		case 3:
			document.getElementById("imgprin").src=imgane3;
			if(ini!="nota3"){
				document.getElementById("nota3").style.background="url(/sitio/not_princ1.gif)";
			}
			break;
		case 4:
			document.getElementById("imgprin").src=imgane4;
			if(ini!="nota4"){
				document.getElementById("nota4").style.background="url(/sitio/not_princ1.gif)";
			}
			break;
	}
}


window.onload = inicianotas;
var secs
var timerID = null
var timerRunning = false
var delay = 1000
var contann=1;

function inicianotas()
{
    secs = 10
    StopTheClock()
    StartTheTimer()
	lascoo();
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer()
{
    if (secs==0)
    {
        StopTheClock()
	    move(contann);
	    if(contann==4)
               contann=1;
	    else
               contann=contann+1;


	    secs = 10
	    StartTheTimer()
    }
    else
    {
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}

<!-- Inician Las funciones de los gadgets -->

var bande=1;
var total=8;

function siguiente(){
	conta=bande+3;
	if(conta<=total){
			document.getElementById('b'+bande).style.display="none";
//			cambia();
			bande+=1;
	}
	
	if(bande==2){
		document.getElementById('anterior').style.visibility="visible";
	}
	
	if(conta>=total){
		document.getElementById('siguiente').style.visibility="hidden";
	}
		
}

function anterior(){
	conta2=total-bande;
	bande=bande-1;	
	if(conta2>=2 && bande>=1){
		document.getElementById('b'+bande).style.display="block";
	}
	
	if(bande==1){
		document.getElementById('anterior').style.visibility="hidden";
	}
	
	if(conta2<3){
		document.getElementById('siguiente').style.visibility="visible";
	}
	
}

function ligar(nota){
	document.location="http://nayaritpuntocom.com/tecnologia/"+nota+".html"
}



<!-- Terminan Las funciones de los gadgets -->

<!-- Inician el cargador de los periodicos -->
function cerrar(){
	document.getElementById('flota').style.display="none";
}


function lascoo() {
	resul=document.getElementById('flota');
	ajax=nuevoAjax();
	ajax.open("POST", "../jscript/fechas.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			if(ajax.responseText){
		            document.getElementById('flota').style.display="block";
		            resul.innerHTML=ajax.responseText;
		        }else{
		            document.getElementById('flota').style.display="none";
		        }
		}
	} 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send("fecha=1");
}

function Uvisita() {
	articulo=document.datos.nota.value;
	ajax=nuevoAjax();
//	alert(articulo);
	ajax.open("POST", "../padmin/include/ajax_includes.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			if(ajax.responseText){
		            /*document.getElementById('flota').style.display="block";
		            resul.innerHTML=ajax.responseText;*/
		        }
		}
	} 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send("op=3&nota="+articulo);
}



function titulo(){
    document.title = "nayaritpuntocom :: "+document.getElementById("titlenote").value;
	Uvisita();
}


