/**
 * @author pedromoraes@gmail.com
 */
function getShareURL( title, href, service ) {
	href = escape(href);
	switch ( service ) {
		case "tw": return "http://twitter.com/?status=" + title + " " + href;
		case "fb": return "http://www.facebook.com/share.php?u=" + href + "&t=" + title;
	}
}
$.fn.wait = function(time, type) {
    time = time || 1000;
    type = type || "fx";
    return this.queue(type, function() {
        var self = this;
        setTimeout(function() {
            $(self).dequeue();
        }, time);
    });
};
$(document).ready(function(){
	$("img").each(function(i){
		if ( this.src.indexOf("_off") > -1 ) {
			$("<img />").attr("src",this.src.replace("_off","_on")).css("display","none").appendTo("body")
			$(this).hover(
				function() {
					this.src = this.src.replace("_off","_on");
				},
				function() {
					this.src = this.src.replace("_on","_off");
				}
			);
		}
	});
	$("#quefazemos_link").mouseover(function(){
		$(".submenu").css("opacity",0).css("display","inline").animate({ opacity: 1 }, 200);
	});
	$("#topRightMenu").mouseleave(function(){$(".submenu").animate({ opacity: 0  }, 200, null, function(){ $(this).css("display","none"); }); })
});
