$(document).ready(function(){
	//Comments
	$("#comments-view ul li:last").css("border", "none");
	$("#comments-view ul li").hover(function() {
		$(this).find(".actions").show();
	}, function(){
		$(this).find(".actions").hide();
	});
	
	// Category click
		//$("#cat.topic ul li a").bind("click",function() { 	
		//});

	
	
	//Browse Categories
    $("div.box.explore ul.segment li:last").css("border", "none");
    $("div.box.explore ul.segment a").click(function() {
													 

    	if($(this).parent().hasClass("current")) {
    		$(this).parent().removeClass("current");
    		$(this).parent().find("ul.type").slideUp("fast");	
			
    	} else {
    		$(this).parent().addClass("current");
    		$(this).parent().find("ul.type").slideDown("fast");
    	}
    });
	



    
    //Top Navigation
    $(".topnav").find("li:last").css("border", "none");
    
	
	$("#account_menu li.dropdown a.choose").corner("5px");

    $("#account_menu li.dropdown a.choose").corner("5px");
    
    $("#account_menu ul.subnav").parent().hover(function() { 
    },function () {
    	$(this).find("a:first").removeClass("choose_hover");
    	$(this).parent().find("ul.subnav").slideUp("fast", function(){
    		$(this).parent().find("a:first").corner("5px");
    	});
    }).click(function(summ) {
    	$(this).find("a:first").addClass("choose_hover");
    	$(this).find("a:first").corner("1px").corner("5px top");
    	$(this).parent().find("ul.subnav").slideDown("fast", function(){
    		$(this).corner("5px bottom");
    	});
    });
    
	
    //Account Navigation
    // --> Flyttad till -->  /inc_parts/login.php

    
    //Top Search
    var value = "Search";
    
    
    $("#header input[type=text]").focus(function() {
    	if($(this).val()!=value) {
    		$(this).val($(this).val());
    	} else {
    		$(this).val("");
    	}
    });
    
    $("#header input[type=text]").blur(function() {
    	if($(this).val()=="") {
    		$(this).val(value);
    	}
    });
    
    //Tournament
    $(".tournament .open_more_info").click(function() {
    	$("#more_info").slideDown();
    })
    
     $(".tournament .close_more_info").click(function() {
    	$("#more_info").slideUp();
    })
    


    
    //Tabs
    $("ul.tabs").tabs("div.panes>div");
    
    //Footer
  
});
