
/*---------------------------------------------------------------- 
  Copyright: 
  Copyright (C) 2009 - 2011 danielfajardo web

  License: GNU General Public License v2.0
  License URI: http://www.gnu.org/licenses/gpl-2.0.html

  Author: 
  danielfajardo - http: //wwww.danielfajardo.com
---------------------------------------------------------------- */

jQuery(document).ready(function(){

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

	// Superfish mainmenu
	//
	jQuery(".wp_page_menu ul").toggleClass("sf-menu");
  jQuery("#mainmenu ul.sf-menu").supersubs({ 
      minWidth:    12,
      maxWidth:    24,
      extraWidth:  3
  }).superfish({
  	animation: {width:'show'},
		speed: 'fast',
		delay: 100
  });

	if( BrowserDetect.browser=="Explorer" ) {
	  jQuery("#mainmenu").mouseenter(
			function(){
				jQuery("#breadcrumb").fadeOut();
			}
	  ).mouseleave(
			function(){
				jQuery("#breadcrumb").fadeIn(1000);
			}
	  );
	}

	// Clear the class .section to display the correct height
	jQuery("<div class='clear'></div>").insertAfter("div.section");

	jQuery("#sidebar h2").click(function() {
		jQuery(this).next().toggle("normal");
		return false;
	}).next().show();

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

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