jQuery(document).ready(function(){
	jQuery(".menu").hover(function(){
		jQuery(this).animate({left: "+=40"}, "fast");
		return false;
	}, function() {
		jQuery(this).animate({left: "-=40"}, "fast");
		return false;
	});

	
	if(top.location.href != location.href) {
		top.location.href = location.href;
	}
	
	if(screen.width > 1024) {
		jQuery("#ads250x650").css("display", "block");
	}
});

function ajaxsuggestions_load(query_b64) {
	if(typeof jQuery != 'undefined') {
				
		jQuery.ajax({url: '/?get_ajax_suggestions=1&q='+query_b64+'&r='+Math.random(), success: function(xml) {
			var xml = jQuery(xml).children("suggestions");
			
			jQuery(xml).find("suggestion").each(function() {
				var html = "";
				
				var title = jQuery(this).attr("title");
				var permalink = jQuery(this).attr("permalink");
				var excerpt = jQuery(this).attr("excerpt");
				
				html += title+"<br />";
				
				jQuery("#suggestions").append(html);
			});
				
			jQuery("#suggestions").css("display", "block");
		}, error: function(a,b,c) {
			jQuery("#suggestions").css("display", "none");
		}, dataType: 'xml'});
	}
} 

/* Sem animação */
/*
jQuery(document).ready(function(){
		jQuery(".menu").hover(function(){
			jQuery(this).css("left", "40px");
			return false;
		}, function() {
			jQuery(this).css("left", "0px");
			return false;
		});
});
*/

function getAnchorPosition(anchorName) {
	
	for(var i=0;i<window.document.anchors.length;i++){
		if(window.document.anchors[i].name==anchorName) {
			var anchor = window.document.anchors[i];
		}
	}
	
	if (document.layers) {
		return { x: anchor.x, y: anchor.y };
	} else if (document.getElementById) {
		var coords = {x: 0, y: 0 };
		while (anchor) {
			coords.x += anchor.offsetLeft;
			coords.y += anchor.offsetTop;
			anchor = anchor.offsetParent;
		}
		return coords;
	}
}

function scrollTo_(link) {
	var coords = getAnchorPosition(link);
	scrollTo(coords.x , coords.y);
}

function recordOutboundLink(link, category, action) {
	try {
		var pageTracker=_gat._getTracker("UA-173753-4");
		pageTracker._trackEvent(category, action);
		setTimeout('document.location = "' + link.href + '"', 100)
	} catch(err){}
}