var degree=10
var curcanvas="canvas0"
var curindex=0
var nextindex=1
var bgcolor='#FFFFFF'
var pause=5000 //SET PAUSE BETWEEN SLIDE (5000=5 seconds)
	
function moveslide(){
	if (curpos>0){
		curpos=Math.max(curpos-degree,0)
		tempobj.style.top=curpos+"px"
	} else {
		clearInterval(dropslide)
		if (crossobj.filters)
		crossobj.filters.alpha.opacity=100
		else if (crossobj.style.MozOpacity)
		crossobj.style.MozOpacity=1
		nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
		tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
		tempobj.innerHTML=scrollercontent[curindex]
		nextindex=(nextindex<scrollercontent.length-1)? nextindex+1 : 0
		setTimeout("rotateslide()",pause)
	}
}
	
function rotateslide(){
	if (ie4||dom){
		resetit(curcanvas)
		crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
		crossobj.style.zIndex++
		if (crossobj.filters)
			document.all.canvas0.filters.alpha.opacity=document.all.canvas1.filters.alpha.opacity=20
		else if (crossobj.style.MozOpacity)
			document.getElementById("canvas0").style.MozOpacity=document.getElementById("canvas1").style.MozOpacity=0.2
			var temp='setInterval("moveslide()",200)'
			dropslide=eval(temp)
			curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
	} else if (document.layers){
		crossobj.document.write(scrollercontent[curindex])
		crossobj.document.close()
	}
	curindex=(curindex<scrollercontent.length-1)? curindex+1 : 0
}
	
function resetit(what){
	curpos=parseInt(scroller_height)*(1)
	var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
	crossobj.style.top=curpos+"px"
}
	
function startit(){
	crossobj=ie4? eval("document.all."+curcanvas) : dom? document.getElementById(curcanvas) : document.tickernsmain.document.tickernssub
	if (ie4||dom){
		crossobj.innerHTML=scrollercontent[curindex]
		rotateslide()
	} else{
		document.tickernsmain.visibility='show'
		curindex++
		setInterval("rotateslide()",pause)
	}
}

function cambiarColor(idElemento, numChild){
	document.getElementById(idElemento).childNodes[numChild].style.color='#000000';
}

function restaurarColor(idElemento, numChild){
	document.getElementById(idElemento).childNodes[numChild].style.color='#00ccff';
}

function validarFecha(validYear){
	//alert(document.getElementById(validYear).value);
	if (document.getElementById(validYear).value<100){
		document.getElementById(validYear).value = 2000 + Number(document.getElementById(validYear).value);	
	}
	return true;
}

function cambiarPrograma(idFrom, idTo, idLabel){
	var txtPrograma = document.getElementById(idTo);
	var labelPrograma = document.getElementById(idLabel);	
	
	txtPrograma.value = idFrom.value;
	if (idFrom.value!=0){
		labelPrograma.innerHTML = idFrom.value;
	}
}


function show_hide(idDiv){
	var divEfecto = document.getElementById(idDiv);
	if (divEfecto.style.display == "block"){
		divEfecto.style.display = "none";
	} else {
		divEfecto.style.display = "block";
	}

}

var currentShowCase = 0;
var arrayShowCases = new Array();
var showCaseTimeout;

function resetArrayShowCases() {
	arrayShowCases = new Array();
}

function addShowCase( idAnchor, urlLoad, pos ) {
	if (document.getElementById) {
		var whichpic = document.getElementById(idAnchor);
		var showCase = new Array();
		showCase[0] = whichpic;
		showCase[1] = urlLoad;
		arrayShowCases[pos] = showCase;
	}
}

function rotarShowCases() {
	currentShowCase++;
	if ( currentShowCase == arrayShowCases.length ) currentShowCase = 0;
	showPic( arrayShowCases[currentShowCase][0], arrayShowCases[currentShowCase][1], currentShowCase );
}

function showPic (whichpic, urlLoad, id ) {
	clearInterval( showCaseTimeout );
	showCaseTimeout = setInterval( "rotarShowCases()", 15000 );
	if (document.getElementById) {
		currentShowCase = id;
		//whichpic.focus();
		document.getElementById('placeholder').src = whichpic.href;
		if (whichpic.title) {
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
		} else {
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
		}
		if (urlLoad!=""){
			document.getElementById('homeHolder').href = urlLoad;
		}
		return false;
	} else {
		return true;
	}
}



/* JavaScript Image Gallery by Jeremy Keith for A List Apart Magazine - www.alistapart.com */
/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){
return false;
}return true;};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;

/**
 * Micox Word Wrap 2.0 
 * elmicoxcodes.blogspot.com - www.ievolutionweb.com - micoxjcg@yahoo.com.br
 * Creative Commons License - creativecommons.org
 * 
 * Description:
 * Wraps large words in Firefox and Opera.
 * Works just like the word-wrap: break-word; CSS property in Internet Explorer
 *
 * Usage:
 * 1) Include this JS file in your page. Example: <script type='text/javascript' src='micoxWordWrap.js'></script>
 * 2) Set 'dcha' as the classname of the elements that you want to word break. Example: <p class='dcha'>
 *
**/

function wrap(quem){
	var larg_total,larg_carac,quant_quebra,pos_quebra, over_orig;
	var elementos,quem, pai, caracs, texto, pai_texto, display_orig, wid_orig;
    
    if(quem.nodeType==3){
		if(quem.nodeValue.replace('\n','').replace('\t','').trim()==''){
			return true;
		}
		
		pai = quem.parentNode;		
		texto = quem.nodeValue;			
		
		display_orig = pai.style.display;
		over_orig = pai.style.overflow;
		wid_orig = pai.style.width;
		pai.style.display="block";
		pai.style.overflow="hidden";
		larg_oficial = pai.offsetWidth;
		
		pai.style.display="table";
		pai.style.width = "auto"; //para Opera
		pai.style.overflow = "visible";
		larg_total = pai.offsetWidth;
		pai.style.overflow = over_orig;
		
		if(larg_total>larg_oficial){
			pos_quebra = 0;
			caracs = pai.textContent.length;
			
			quem.nodeValue = pai.textContent.replace(/ /g,"Ø") + " ";
			larg_total = pai.offsetWidth;
			pai.style.display = display_orig;
			
			larg_carac = larg_total / caracs ;
			quant_quebra = parseInt(larg_oficial/larg_carac) - 2;
			quant_quebra = quant_quebra>0 ? quant_quebra : 1 ;
			
			quem.nodeValue = '';
			
			while(pos_quebra<=caracs){
				quem.nodeValue += texto.substring(pos_quebra,pos_quebra + quant_quebra) + " "
				pos_quebra = pos_quebra + quant_quebra;
			}			
		}
		pai.style.display = display_orig;
		pai.style.display = over_orig;
		pai.style.width = wid_orig;
		
	}else if(quem.childNodes.length==1 && quem.childNodes[0].nodeType==3){
		texto = String(quem.innerHTML); 
		
		
		display_orig = quem.style.display;
		over_orig = quem.style.overflow;
		wid_orig = quem.style.width;
		quem.style.display="block";
		quem.style.overflow="hidden";
		larg_oficial = quem.offsetWidth;
		
		quem.style.display="table";
		quem.style.width = "auto"; 
		quem.style.overflow = "visible";
		larg_total = quem.offsetWidth;
		quem.style.overflow = over_orig;
				
		if(larg_total>larg_oficial){ 
			pos_quebra = 0;
			caracs = texto.length;
			quem.innerHTML = quem.innerHTML.replace(/ /g,"Ø");
			larg_total = quem.offsetWidth;
			larg_carac = larg_total / caracs ;
			
			quant_quebra = parseInt(larg_oficial/larg_carac) - 2; 
			quant_quebra = quant_quebra>0 ? quant_quebra : 1 ;
			quem.innerHTML = ""
			
			while(pos_quebra<=caracs){
				quem.innerHTML += texto.substring(pos_quebra,pos_quebra + quant_quebra) + " "
				pos_quebra = pos_quebra + quant_quebra;
			}
			
		}	
		quem.style.display = display_orig;
		quem.style.display = over_orig;
		quem.style.width = wid_orig;
		
	}else if(quem.childNodes.length>0){
		for(var i=0;i<quem.childNodes.length;i++){
			wrap(quem.childNodes[i]);
		}
	}
}
function wordWrap(){  
    var elementos = document.body.getElementsByTagName("*") 
 
    if(navigator.appName.indexOf("Internet Explorer")>-1){
        for(var i=0; i<elementos.length;i++){
            if(elementos[i].className.indexOf("dcha")>-1){
                elementos[i].style.wordWrap = "break-word";
            }
        }
    }else{
        for(var i=0; i<elementos.length;i++){
            if(elementos[i].className.indexOf("dcha")>-1){
                wrap(elementos[i]);
            }
        }
    }
}
String.prototype.trim = function() { 
   return this.replace(/^[ ]+|[ ]+$/g,"");
}
function bodyOnReady(func){
 //call the function when DOM loaded
 //http://www.elmicox.com/2007/evento-body-onready-sem-o-uso-de-libs/
 //by Micox - www.elmicox.com - elmicox.blogspot.com - webly.com.br
 if(!(document.body==null)){
  func();
 }else{
  var func_rep = func;
  setTimeout(function(){ bodyOnReady(func_rep) },100);
 }
}

bodyOnReady(wordWrap);