jQuery.noConflict();

jQuery(function(){

jQuery('#widgetscroll').newsScroll({
		speed: 2000,
		delay: 5000
	});

jQuery("ul.sf-menu").supersubs({
        minWidth: 12, // minimum width of sub-menus in em units 
        maxWidth: 27, // maximum width of sub-menus in em units 
        extraWidth: 1 // extra width can ensure lines don't sometimes turn over 
        // due to slight rounding differences and font-family 
    }).superfish({
        delay: 1200, // delay on mouseout 
        animation: {
            height: 'show'
        }, // fade-in and slide-down animation 
        speed: 'fast', // faster animation speed 
        autoArrows: true, // disable generation of arrow mark-up 
        dropShadows: true // disable drop shadows 
    });
    
 jQuery('#showcase-news-nav-popular').click(function(){
   jQuery('#showcase-latest').hide();
     jQuery('#showcase-popular').show(); 
  });
	jQuery('#showcase-news-nav-latest').click(function(){
   jQuery('#showcase-popular').hide();
     jQuery('#showcase-latest').show();  
  });
jQuery('#showcase-readers-nav-forums').click(function(){
    jQuery('#showcase-comments').hide();
    jQuery('#showcase-forums').show(); 
  });
jQuery('#showcase-readers-nav-comments').click(function(){
     jQuery('#showcase-forums').hide();
    jQuery('#showcase-comments').show(); 
  });
});

jQuery(document).ready(function(){


	/**
	 * my new jQuery Tooltip function '09 (c) aseptik@gmail.com
	 * 27.09.2009
	 */         	
	 
   jQuery(".bbcode_buttons, a, img, input").mouseover(function(e) {
   
   var title = jQuery(this).attr('title');
   var alt = jQuery(this).attr('alt');
   
   var attribute = null;
   var tooltip = null;
   
   if ( ( title != 'undefined' ) &&  ( title != '' ) && ( title != null ) ) {
   
   attribute = 'title';
   tooltip = title;
  
   
   } else if ( ( alt != 'undefined' ) && ( alt != '' ) && ( alt != null ) ) {
   
   attribute = 'alt';
   tooltip = alt;
  
   }
   
   if ( attribute ) {
   
   jQuery(this).attr( attribute , '' );
   
   }
   
   if ( tooltip ) {
   
   jQuery("body").append("<div class='tooltip' id='tooltip'>"+tooltip+"</div>");

  jQuery("#tooltip").css({opacity:0.85, display:"none", visibility:"visible"}).animate({"padding": "6px"}, 100).fadeIn(400);
					
			jQuery(this).mousemove(function(e){
				  
        	jQuery("#tooltip").css({left:e.pageX+14, top:e.pageY+14});
			
      });
    }
  }).mouseout( function(e) {
  
        var tooltip_back = jQuery("#tooltip").text();
        
        if ( ( tooltip_back != '' ) && ( tooltip_back != 'undefined' ) && ( tooltip_back != null ) ) {
        
        if ( jQuery(this).is("img, input") ) {
        
        jQuery(this).attr('alt', tooltip_back);
        
        } else if ( jQuery(this).is(".bbcode_buttons, a") ) {
        
        jQuery(this).attr('title', tooltip_back); 
        
        }
         
         jQuery("#tooltip").remove();
        
        }
         
        });

jQuery("a.zoom").fancybox();

  /*jQuery("input, textarea").mouseover(
  function () {

jQuery(this).css({'background-image' : 'url("http://whitetigerselite.altervista.org/php5/e107/e107_themes/whitetiger/images/textareahover.jpg")'});
  

}).mouseout( function () { 

jQuery(this).css({'background-image' : 'url("http://whitetigerselite.altervista.org/php5/e107/e107_themes/whitetiger/images/textarea.jpg")'});
});
*/

jQuery("#showcase-readers-nav a").click(function(){
	    jQuery("#showcase-readers-nav a").removeClass("current").addClass("");
	   jQuery(this).addClass("current");
	});

jQuery("#showcase-news-nav a").click(function(){
	    jQuery("#showcase-news-nav a").removeClass("current").addClass("");
	   jQuery(this).addClass("current");
	});
	
});
// Create a self-invoking anonymous function. That way, 
// we're free to use the jQuery dollar symbol anywhere within.
(function($) {

// We name our plugin "newscroll". When creating our function, 
// we'll allow the user to pass in a couple of parameters.
$.fn.newsScroll = function(options) {
	
	// For each item in the wrapped set, perform the following. 
	return this.each(function() {	
	  
		var
		  // Caches this - or the ul widget(s) that was passed in.
		  //  Saves time and improves performance.
		  $this = $(this), 
		  
		  // If the user doesn't pass in parameters, we'll use this object. 
		  defaults = {
		  	speed: 400, // How quickly should the items scroll?
		  	delay: 3000, // How long a rest between transitions?
		  	list_item_height: $this.children('li').outerHeight() // How tall is each list item? If this parameter isn't passed in, jQuery will grab it.
	     },
	      // Create a new object that merges the defaults and the 
	      // user's "options".  The latter takes precedence.
		  settings = $.extend({}, defaults, options);
		 
	  // This sets an interval that will be called continuously.
	  setInterval(function() {
	  	    // Get the very first list item in the wrapped set.
	  	    $this.children('li:first')
	  	    		// Animate it
	  	    		.animate({ 
	  	    			marginTop : '-' + settings.list_item_height, // Shift this first item upwards.
	  	    		   opacity: 'hide' }, // Fade the li out.
	  	    		   
	  	    		   // Over the course of however long is 
	  	    		   // passed in. (settings.speed)
	  	    		   settings.speed, 
	  	    		   
	  	    		   // When complete, run a callback function.
	  	    		   function() {
	  	    		   	
	  	    		   	// Get that first list item again. 
	  	 					$this.children('li:first')
	  	 					     .appendTo($this) // Move it the very bottom of the ul.
	  	 					     
	  	 					     // Reset its margin top back to 0. Otherwise, 
	  	 					     // it will still contain the negative value that we set earlier.
	  	 					     .css('marginTop', 0) 
	  	 					     .fadeIn(300); // Fade in back in.
  		 			  }
 	 			  ); // end animate
 	  }, settings.delay); // end setInterval
	  });
}

})(jQuery);