var delayOnStart = 500;	var tickerSpeed = 1;
var pauseOnMouseOver = true; var copyspeed = tickerSpeed;
var pausespeed = (pauseOnMouseOver==0) ? copyspeed :0;
var cHeight = '';

function scrollTicker(){
	if (parseInt(wmlTicker.style.top)>(cHeight*(-1)+8))
		wmlTicker.style.top=parseInt(wmlTicker.style.top)-copyspeed+"px"
	else
		wmlTicker.style.top=parseInt(marqueeheight)+8+"px"
}
function initializemarquee(){
	wmlTicker=document.getElementById("tickerID")
	wmlTicker.style.top=0
	marqueeheight=document.getElementById("tickerContent").offsetHeight
	cHeight=wmlTicker.offsetHeight
	if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ 
		wmlTicker.style.height=marqueeheight+"px"
		cross_marquee.style.overflow="scroll"
		return
	}
	setTimeout('lefttime=setInterval("scrollTicker()",35)', delayOnStart)
}
if (window.addEventListener)
	window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
	window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
	window.onload=initializemarquee
		
function writeNews(){
	//[idNoticia,Titulo,Grupo,Sumilla,Fecha]
	var html="<div id=\"tickerContent\" onMouseover=\"copyspeed=pausespeed;\" onMouseout=\"copyspeed=tickerSpeed;\">";
	html+="<div id=\"tickerID\" style=\"position: absolute; width: 98%;\">";
	if (newsArray.length==0){
		html+="<div class=message align=center><div class=noNews>";
		html+="HORARIOS DE ATENCION:<br><br>De Lunes a Viernes de<br> 9:15 a.m. a 5:45 p.m.<br>Sábados de <br>10:15 a.m. a 12:45 p.m.<br><br>Kennel Club Peruano</div></div>";
	}else{
		for (var i=0;i<newsArray.length;i++){
			html+="<div class=message onclick=\"gotoNews("+i+");\" title=\"pulse aquí para ver el detalle...\">";
			html+="<div class=fechado>"+newsArray[i][4]+"</div>";			
			html+="<div class=titulo onmouseover=\"togleButtons(this);\" onmouseout=\"togleButtons(this);\" >"+newsArray[i][1]+"</div>";
			if(newsArray[i][1]!=newsArray[i][3]){
				html+="<div class=sumilla>"+newsArray[i][3]+"</div>";
			}
			html+="<hr class=interesHR>";
			//html+="<div class=spacer></div>";
			html+="</div>";
		}	
	}
	html+="</div></div>"
	document.write(html);
}
function gotoNews(index){
	if(newsArray[index][2].toUpperCase()=="EXPOR"){
		document.location.href = "/noticias.asp?pag=expo&idexpo="+newsArray[index][0];
	}else{
		document.location.href = "/noticias.asp?pag=detalle&idnoticia="+newsArray[index][0];
	}
}

