$(function(){
	// Clears floted elements
	$("#nav, #slider_container, a.small_button, a.large_button, #author_bio, input.submit, button").after("<div class='clear'></div>");
	$("#body_content, .folio1, #content, #header, .post, #sgl_post .post_image_container, .post_widgets, .post_share,  ul#comments_container li .comment_container, #comment_form_container #comment_form, .full .folio3, #footer, .featured_box").append('<div class="clear"></div>');


	
	// SuperFish dropDown navigation options
	$("ul#nav").superfish({ 
		animation:		{height:'show', opacity:'show'},
		delay:			600,
		autoArrows:		true,
    	dropShadows:	false
	});
	
	// Adds the curved edges on the dropDown	
	$("ul#nav li > ul.subnav li:first-child").addClass("first_item");
	$("ul#nav li > ul.subnav li:last-child").addClass("last_item");	

	// adds the fading effect when an image is wraped with an anchor tag and a animation class added to it
	$("a.go, a.play, a.zoom, a.view, a.read_more, a.external, a.arrow_left, a.arrow_right, a.read_article, a.zoom_rounded").hover(function(){
		$("img", this).stop().animate({ "opacity": 1 }, 400);
		}, function() {
		$("img", this).stop().animate({ "opacity": 0.6 }, 250);
	});


	
	
	// Buttons IE7 fix
	var isIE7 = (navigator.appVersion.indexOf("MSIE 7.")==-1) ? false : true;
	if (isIE7) {
		$('a.small_button.view, a.large_button.view, a.small_button.arrow, a.large_button.arrow, a.small_button.external_link, a.large_button.external_link').wrapInner('<span class="button_content"></span>');
		$('a.small_button.view, a.large_button.view').append('<span class="view_icon"></span>');
		$('a.small_button.arrow, a.large_button.arrow').append('<span class="arrow_icon"></span>');
		$('a.small_button.external_link, a.large_button.external_link').append('<span class="external_link_icon"></span>');

	} else {
		$('a.small_button.view, a.large_button.view').append('<span class="view_icon"></span>');
		$('a.small_button.arrow, a.large_button.arrow').append('<span class="arrow_icon"></span>');
		$('a.small_button.external_link, a.large_button.external_link').append('<span class="external_link_icon"></span>');
	}
	

	
	$('.projecto').hover(
	function() {        
				$(this).css('background-position', '250px 0');          		   
			}, 
	function(){
				$(this).css('background-position', '0 150px');         
	});	
	
	
	
});

var Notifier=new function(){this._alert=null;return{notify:function(f,j){var n=this.main;var i=this.main.document;var a=i.documentElement;var h=n.innerWidth?n.innerWidth+n.pageXOffset:a.clientWidth+a.scrollLeft;var e=n.innerHeight?n.innerHeight+n.pageYOffset:a.clientHeight+a.scrollTop;var l=i.createElement("div");l.id="Message";l.className=j||"";l.style.cssText="position:fixed;white-space:nowrap;";if(l.className.length==0){l.className="notifier"}l=i.body.insertBefore(l,i.body.firstChild);l.innerHTML=f;var k=l.offsetWidth;var g=l.offsetHeight;l.style.display="none";l.style.bottom=0;l.style.left=Math.random()*(h-k)+"px";l.style.display="block";setFading(l,150,0,2000,function(){i.body.removeChild(l)})},init:function(a,b){this.main=a;if(b==""||b=="null"){b="notifier"}this.classname=b||"";if(this._alert==null){this._alert=this.main.alert;this.main.alert=function(c,d){Notifier.notify(c,d)}}},shut:function(){if(this._alert!=null){this.main.alert=this._alert;this._alert=null}}}};function setFading(j,a,h,i,g){var c=setInterval(function(){a=stepFX(a,h,2);setOpacity(j,a/100);if(a==h){if(c){clearInterval(c);c=null}if(typeof g=="function"){g()}}},i/50)}function setOpacity(a,b){a.style.filter="alpha(opacity="+b*100+")";a.style.opacity=b}function stepFX(a,d,c){return a>d?a-c>d?a-c:d:a<d?a+c<d?a+c:d:a}var __alert=window.alert;var classN="";Notifier.init(window,"notifier");
