// JavaScript Document

$(window).load(function() 
{	
	//do nothing yet
});

$(document).ready(function() 
{
	//Shadowbox.init();
	var pos_x, pos_y;
	
	$(".box_content").bind("mouseenter", function() {
		
		$(this).children("h2.title").children("a").css("color", "#CC0000");
		$(this).children("a.lnk").children("img").css("borderColor", "#CC0000");
		//$(this).children("a.lnk").children("img").css("border", "#55B5FF 1px solid;").fadeTo("slow", 0.7); //Bug IE
	});
	
	$(".box_content").bind("mouseleave", function() {
		
		$(this).children("h2.title").children("a").css("color", "#FFFFFF");
		$(this).children("a.lnk").children("img").css("borderColor", "#FFFFFF");
		//$(this).children("a.lnk").children("img").css("border", "#FFFFFF 1px solid;").fadeTo("slow", 1.0);  //Bug IE
	});
	
	$("#tags_btn").bind("mouseenter", function() {
		pos_y = $("#tags_btn").position().top - 17;
		pos_x = $("#tags_btn").position().left + 58;
		
		$("ul#nav_tags").css("top", pos_y);
		$("ul#nav_tags").css("left", pos_x);
		
		$("#nav_tags").show("slow");
	});
	
	$("ul#nav_tags").bind("mouseleave", function() {
		$("#nav_tags").hide("slow");
	});
});

function makeVote(url)
{
	var el = document.getElementById("nota");
	el.innerHTML = "Computing vote...";
	
	$.get(url, function(data){
	  el.innerHTML = "Completed!";
	});
}

function field_search(obj)
{
	if(obj.value.length == 0)
	{
		obj.value = "Search...";
	}
}

function field_focus(obj)
{
	if(obj.value == "Search...")
	{
		obj.value = "";
	}
}
