function jcufon(dom, extra){
	$(dom).each(function(){
		Cufon.replace(this, extra);

	})

}
var count_z=999999;
$(document).ready(function(){
	if ($.browser.msie && $.browser.version<8) {
	
		$("*").each(function (index){
			count_z=count_z-10;
			if ($(this).css("z-index")!=''){
				//$(this).css("z-index",count_z);
			}else{
				$(this).css("z-index",count_z);
			}
		});
	}
});


//Aumenta texto
function changeTextSize(newSize){
	if(newSize=='aumenta'){
		document.getElementById('detalhe').className="big";
	}
	if(newSize=='reduz'){
		document.getElementById('detalhe').className="normal";
	}
}



$.fn.slide2 = function(settings) {
	var defaults = {
	speed:300,
	width:980,
	actualpos:0,
	size:0
	}

	settings = $.extend(defaults, settings);
	var $this = $(this);
	
	$this.bind("moveTo", function (event, pos){
		pos=(settings.actualpos+pos);

		if (pos>=settings.size){
			pos=0;
		}else if (pos<0){
			pos=settings.size-1;
		}

		posx = - ((pos) * settings.width);
		
		$("ul", $this).animate({
				left: posx
			}, settings.speed, function() {
				// Animation complete.
		});
		settings.actualpos=pos;
	});	
	
	settings.size=$("ul.layers li", $this).size();
	$("ul", $this).css("width", settings.size*settings.width+'px');
	$("ul", $this).each(function (){
		$("li",this).each(function (index){
			$(this).css("left", index*settings.width+'px');
		});
	});
	
	$("a.prevwork", this).click(function (){
		$this.trigger("moveTo",-1);
		return false;
	});
	$("a.nextwork", this).click(function (){
		$this.trigger("moveTo",1);
		return false;
	});
	// function 
	return $this;
}
