
// vie61=1 if IE6 is detected
vie61=0;
if(navigator.appVersion.indexOf("MSIE 6")!=-1) vie61=1;


//pan & scan images with class .panscan
function Panscan1(){
	var oPnode=(this.parentNode.tagName=="A")?this.parentNode.parentNode:this.parentNode;
	this.style.top="0";
	this.style.left="0";
	oPnode.style.overflow="hidden";
	oPnode.style.position="relative";
	this.style.width=oPnode.offsetWidth+"px";
	this.style.height="auto";
	var vDiff=oPnode.offsetHeight-this.offsetHeight;
	this.style.position="absolute";
	if(vDiff<0){
		this.style.top=Math.round(vDiff/2)+"px";
	}
	else if(vDiff==0){}
	else{
		this.style.width="auto";
		this.style.height=oPnode.offsetHeight+"px";
		vDiff=oPnode.offsetWidth-this.offsetWidth;
		this.style.left=Math.round(vDiff/2)+"px";
	}
}
windowLoaded1=false;
$(function(){windowLoaded1=true;})
function imgLoad1(){
	this.hasTimer1=false;
	if(this.complete) {
		eval("a"+this.method1+"1["+this.index1+"]."+this.method1+"1()");
		this.style.visibility="visible";
		this.hasTimer1=false;
	}
	else{
		if(windowLoaded1&&this.hasTimer1){
			this.hasTimer1=false;
			return;
		}
		this.hasTimer1=true;
		setTimeout("a"+this.method1+"1["+this.index1+"].imgLoad1()",100);
	}
}


function shownoticias(value){
	var infoPM = $("#ato"+value).html();
	if(infoPM.indexOf("+") >= 0) {
		$("#num-texto-"+value).animate( { height:"100%"},{ queue:false}); //, duration:30000
		$("#ato"+value).html(infoPM.replace("+","-"));
	}
	else {
		$("#num-texto-"+value).animate( { height:"36px"},{ queue:false}); //, duration:30000
		$("#ato"+value).html(infoPM.replace("-","+"));
	}
}


function clearIficha(){
	aItems=oIficha1.getElementsByTagName("a");
	for(i=0;i<aItems.length;i++){
		aItems[i].className="";
	}
}

$(document).ready(function(){

	//panscan
	aPanscan1=$(".panscan");
	$(aPanscan1).each(function(i){
		this.Panscan1=Panscan1;
		this.imgLoad1=imgLoad1;
		this.index1=i;
		this.method1="Panscan";
		this.imgLoad1();
	});
	//end panscan

	//sifr
	if(sIFR.isActive){
		sIFR.replace(font1, {
			selector: '.header-bottom .title',
			forceSingleLine:true,
			transparent:true,
			thickness:-70,
			sharpness:-10,
			css: [ '.sIFR-root { color:#d9001d; font-size:19px; letter-spacing:0.2;  }' ]
		});
		
		sIFR.replace(font1, {
			selector: '.home-left .title',
			forceSingleLine:true,
			transparent:true,
			thickness:-70,
			sharpness:-10,
			css: [ '.sIFR-root { color:#d9001d; font-size:16px; letter-spacing:0.2;  }' ]
		});
		
		sIFR.replace(font1, {
			selector: '.sub-menu .active',
			forceSingleLine:true,
			transparent:true,
			thickness:-70,
			sharpness:-10,
			css: [ '.sIFR-root { color:#d9001d; font-size:14px; letter-spacing:0.2;  }','a {color:#d9001d; font-size:14px; letter-spacing:0.2; text-decoration:none; }',' a:hover {color:#d9001d; font-size:14px; text-decoration:underline; letter-spacing:0.2;}' ]
		});
		
		sIFR.replace(font1, {
			selector: '.sub-menu li',
			forceSingleLine:true,
			transparent:true,
			thickness:-70,
			sharpness:-10,
			css: [ '.sIFR-root { color:#666666; font-size:14px; letter-spacing:0.2;  }','a {color:#666666; font-size:14px; letter-spacing:0.2; text-decoration:none; }',' a:hover {color:#d9001d; font-size:14px; text-decoration:underline; letter-spacing:0.2;}' ]
		});

		sIFR.replace(font1, {
			selector: '.telefono-banner .title',
			forceSingleLine:true,
			transparent:true,
			thickness:-70,
			sharpness:-10,
			css: [ '.sIFR-root { color:#ffffff; font-size:15px; letter-spacing:0.2;  }','a {color:#ffffff; font-size:15px; letter-spacing:0.2; text-decoration:none; }',' a:hover {color:#ffffff; font-size:15px; text-decoration:underline; letter-spacing:0.2;}' ]
		});
		sIFR.replace(font1, {
			selector: '.telefono-banner .subtitle',
			forceSingleLine:true,
			transparent:true,
			thickness:-70,
			sharpness:-10,
			css: [ '.sIFR-root { color:#ffffff; font-size:19px; letter-spacing:0.2;  }','a {color:#ffffff; font-size:19px; letter-spacing:0.2; text-decoration:none; }',' a:hover {color:#ffffff; font-size:19px; text-decoration:underline; letter-spacing:0.2;}' ]
		});
		sIFR.replace(font1, {
			selector: '.mail-banner .title',
			forceSingleLine:true,
			transparent:true,
			thickness:-70,
			sharpness:-10,
			css: [ '.sIFR-root { color:#ffffff; font-size:15px; letter-spacing:0.2;  }','a {color:#ffffff; font-size:15px; letter-spacing:0.2; text-decoration:none; }',' a:hover {color:#ffffff; font-size:15px; text-decoration:underline; letter-spacing:0.2;}' ]
		});
		sIFR.replace(font1, {
			selector: '.home-right .title',
			forceSingleLine:true,
			transparent:true,
			thickness:-70,
			sharpness:-10,
			css: [ '.sIFR-root { color:#666666; font-size:15px; letter-spacing:0.2;  }','a {color:#666666; font-size:15px; letter-spacing:0.2; text-decoration:none; }',' a:hover {color:#666666; font-size:15px; text-decoration:underline; letter-spacing:0.2;}' ]
		});
		
		
	}else $("head link").each(function(){
		if(this.href.indexOf("script")!=-1) $(this).remove();
	});//end sifr

	setTimeout("setMenuHover()",1);
	
	//set all select box
	$(".sel").selectbox().parent().addClass('sel ie6fix');

	if(document.getElementById("ificha")){
		oIficha1=document.getElementById("ificha");
		aItems=oIficha1.getElementsByTagName("a");
		for(i=0;i<aItems.length;i++){
			aItems[i].onclick=function(){
				clearIficha();
				this.className="selected";
				oIficha1.getElementsByTagName("img")[0].src=this.href;
				//oIficha1.getElementsByTagName("img")[0].imgLoad1;
				if(document.getElementById("descrip"))document.getElementById("descrip").innerHTML = this.title;
				return false;
			}
		}
	}

});

function setMenuHover(){
	$(".title-embedded .sIFR-flash").each(function(){
		$(this).hover(
			function(){$(this).parent().addClass("title-embedded-hover")},
			function(){$(this).parent().removeClass("title-embedded-hover")}
		);
	});
}

//set font SIRF
font1 = { src: 'js/helveticacd.swf' };
sIFR.activate(font1);
