

	function startup() {
		correctExternalLinks();
		initializemarquee();
	}

	var delayOnStart = 3000;
	var tickerSpeed = 1;
	var pauseOnMouseOver = true;
	
	/** TICKER CODE STARTS HERE **/
	
	var copyspeed = tickerSpeed;
	var pausespeed = (pauseOnMouseOver==0) ? copyspeed : 0;
	var actualheight = '';
	
	function scrollTicker(){
		if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
			cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
		else
			cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
	}
	
	function initializemarquee(){
		cross_marquee=document.getElementById("tickerContent");
		cross_marquee.style.top=0;
		marqueeheight=document.getElementById("tickerWrapper").offsetHeight;
		actualheight=cross_marquee.offsetHeight
		if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1) { //if Opera or Netscape 7x, add scrollbars to scroll and exit
			cross_marquee.style.height=marqueeheight+"px";
			cross_marquee.style.overflow="scroll";
			return;
		}
		setTimeout('lefttime=setInterval("scrollTicker()",35)', delayOnStart);
	}
	
	
	/*
	 * forces the external links to open in a new
	 * window, in a manner that validates against
	 * XHTML Strict. This last one does not allow
	 * 'target="_blank"' anymore, but the DOM does.
	 */
	function correctExternalLinks() {
		// run through every a tag in the document
		var serverName = window.location.hostname;
		for (var index = 0; index <= (document.links.length - 1); index++) {
			var URL = document.links[index].href;
	
			// any links not containing the current server name are outbound.
			if (URL.indexOf('javascript') != 0) {
				if (URL.indexOf(serverName) < 0)
					document.links[index].target = "_blank";
				else
					document.links[index].target = "";
				// set link for IE no-cache
				if (URL.indexOf('?') > -1 && URL.indexOf('#') < 0) {
					document.links[index].href = document.links[index].href + "&_dc=" + (new Date).getTime();
				}
			} else {
				document.links[index].target = "";
			}
		}
		
		return true;
	}
	
	
	function bookmark() {
		var title = document.title;
		var url = document.URL;
		if (window.sidebar) // firefox
			window.sidebar.addPanel(title, url, "");
		else if(window.opera && window.print){ // opera
			var elem = document.createElement('a');
			elem.setAttribute('href',url);
			elem.setAttribute('title',title);
			elem.setAttribute('rel','sidebar');
			elem.click();
		}
		else if(document.all)// ie
			window.external.AddFavorite(url, title);
	}
	
	
	
	function mailpage() {
		var mail_str = "mailto:mail_destinatario@dominio.com?subject=" + escape(document.title);
		mail_str = mail_str + "&body=(http://www.castellomasters.com), "+escape("CASTELLÓ MASTERS Costa Azahar.");
		location.href = mail_str;
	}

	
	
	if (window.addEventListener) {
		window.addEventListener("load", startup, false)
	} else if (window.attachEvent) {
		window.attachEvent("onload", startup)
	} else if (document.getElementById) {
		window.onload=startup
	}