
// vie61=1 if IE6 is detected
vie61=0;
if(navigator.appVersion.indexOf("MSIE 6")!=-1) vie61=1;

//gallery
function setGallery1(galId1,id){
	var aItems1=$("#"+galId1+" a");
	aItems1[0].className="gallery" + id + "-selected";
	document.getElementById("gallery-large").src=aItems1[0].href;
	document.getElementById("gallery-large").imgLoad1();
	document.getElementById("gallery-large").parentNode.href=aItems1[0].href;
	for(i=0;i<aItems1.length;i++){
		aItems1[i].onmouseover=function(){
			$(this.getElementsByTagName("img")[0]).stop().fadeTo(250,1);
		}
		aItems1[i].onmouseout=function(){
			$(this.getElementsByTagName("img")[0]).stop().fadeTo(250,0.5);
		}
		aItems1[i].onclick=function(){
			var aItems1=this.parentNode.parentNode.getElementsByTagName("a");
			for(i=0;i<aItems1.length;i++){
				aItems1[i].className="";
			}
			this.className="gallery" + id + "-selected";
			var largeImg=document.getElementById("gallery-large");
			largeImg.src=this.href;
			largeImg.imgLoad1();
			largeImg.parentNode.href=this.href;
			return false;
		}
	}
}

//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);
	}
}

$('head').append('<link rel="stylesheet" href="estilo/css/script.css" type="text/css" />');
if(navigator.appVersion.indexOf("Chrome")!=-1) $('head').append('<link rel="stylesheet" href="estilo/css/chrome.css" type="text/css" />');
if(navigator.userAgent.indexOf("Firefox/2")!=-1) $('head').append('<link rel="stylesheet" href="estilo/css/ff2.css" type="text/css" />');

$(document).ready(function(){

aPanscan1=$(".panscan");
$(aPanscan1).each(function(i){
	this.Panscan1=Panscan1;
	this.imgLoad1=imgLoad1;
	this.index1=i;
	this.method1="Panscan";
	this.imgLoad1();
});


//sifr
if(sIFR.isActive){
	sIFR.replace(font1, {
		selector: '.button ',
		tuneWidth: 2,
		forceSingleLine:true,
		transparent:true,
		thickness:-70,
		sharpness:-10,
		css: [ '.sIFR-root { color:#FFFFFF; font-size:16px; letter-spacing:0.2;  cursor:pointer;  }',' a { color:#FFFFFF; font-size:16px; letter-spacing:0.2;  cursor:pointer; text-decoration:none; } ',' a:hover { text-decoration:underline; color:#FFFFFF }' ]
	});
	
//	sIFR.replace(font1, {
//		selector: '.r-menu .title-embedded1',
//		forceSingleLine:true,
//		tuneWidth: 2,
//		transparent:true,
//		thickness:-70,
//		sharpness:-10,
//		css: [ '.sIFR-root { color:#6f672c; font-size:17px; letter-spacing:-0.2;  cursor:pointer;  }',' a { color:#6f672c; font-size:17px; letter-spacing:-0.2;  cursor:pointer; text-decoration:none; } ',' a:hover { text-decoration:underline; color:#6f672c;  }' ]
//	});
//
//	sIFR.replace(font1, {
//		selector: '#left-cont .title-embedded ',
//		forceSingleLine:true,
//		transparent:true,
//		tuneWidth: 2,
//		thickness:0,
//		sharpness:10,
//		css: [ '.sIFR-root { color:#6f7459; font-size:20px; letter-spacing:-0.2; font-weight:normal; }','a { text-decoration:none; color:#6f7459; font-size:20px; letter-spacing:-0.2; font-weight:normal; } ','a:hover { display:block; color:#ffffff; }'  ]
//	});
//	
//	sIFR.replace(font1, {
//		selector: '#left-cont .title-embedded-active a',
//		forceSingleLine:true,
//		transparent:true,
//		thickness:0,
//		tuneWidth: 2,
//		sharpness:10,
//		css: [ '.sIFR-root { color:#ffffff; font-size:20px; letter-spacing:-0.2; font-weight:normal; }' ]
//	});
}else $("head link").each(function(){
	if(this.href.indexOf("script")!=-1) $(this).remove();
});//end sifr

//if gallery
		for(iFoto=4;iFoto>0;iFoto--) {
			if(document.getElementById("gallery" + iFoto)){
				setGallery1("gallery" + iFoto, iFoto);
				$("#gallery-large-container a").fancybox();
			}
		}
// end if gallery

setTimeout("setMenuHover()",1);

});

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/futura-lt-condensed-light.swf' };
sIFR.activate(font1);
