/*---------------------------------------------------------------- 
  Copyright: 
  Copyright (C) 2009 danielfajardo web
  
  License: 
  GPL Software 
  
  Author: 
  danielfajardo - http: //wwww.danielfajardo.com
---------------------------------------------------------------- */


$(document).ready(function(){

	// User Menu
	//
	$("#usermenu div.tab").click(function () {
		$("#usermenu div.caption").slideToggle("slow");
		$("#usermenu div.tab a img").toggle();
	});

	// Superfish mainmenu
	//
  $("#mainmenu ul.sf-menu").superfish({
  	animation: {width:'show'},
		speed: 'fast',
		delay: 400,
		minWidth: 10,
		maxWidth: 20,
		extraWidth: 0
  });
	if( BrowserDetect.browser=="Explorer" ) {
	  $("#mainmenu").mouseenter(
			function(){
				$("#breadcrumb").fadeOut();
			}
	  ).mouseleave(
			function(){
				$("#breadcrumb").fadeIn(1000);
			}
	  );
	}

	// Sidebar
	//
	/*
	$("#sidebar li a").hover( function() {
		$(this).next().slideToggle("slow");
		return false;
	}).next().hide();
	*/

	// Links effect
	//
	if( BrowserDetect.browser!="Explorer" ) {
		$("a").hover(
			function(){
				$(this).parent().addClass("selected");
				$(this).animate({opacity: 0.5},200);
				$(this).animate({opacity: 1},100);
			},
			function(){
				$(this).parent().removeClass("selected");
				$(this).animate({opacity: 1},100);
			}
		);
	}

	// External Links
	//
	$("ul.links li a").append(" <img src='wp-content/themes/dfblog/images/icons/external.png' border ='0' />");
	$("a.external").append(" <img src='wp-content/themes/dfblog/images/icons/external.png' border ='0' />");

	// Go To Top
	//
	$("span#gototop a").click( function() {
		$.scrollTo($("body"), 1000);
		return false;
	});
});
