/* idTabs ~ Sean Catchpole - Version 1.0
   Andreas 3.9.2009: renamed to "idColorTabs" to make it possible to use this
   old version together with idTabs 2.2 and above */

/* Options (in any order):

 start (number|string)
    Index number of default tab. ex: idColorTabs(0)
    String of id of default tab. ex: idColorTabs("#tab1")
    default: class "selected" or index 0

 return (boolean)
    True - Url will change. ex: idColorTabs(true)
    False - Url will not change. ex: idColorTabs(false)
    default: false

 click (function)
    Function will be called when a tab is clicked. ex: idColorTabs(foo)
    If the function returns true, idTabs will show/hide content (as usual).
    If the function returns false, idTabs will not take any action.
    The function is passed three variables:
      The id of the element to be shown
      an array of all id's that can be shown
      and the element containing the tabs
*/
(function($){
  $.fn.idColorTabs = function(){

    //Setup Tabs
	$(".idTabsNav>a[href^='#']",this).each(function(){
      	var id = "#"+this.href.split('#')[1];
	    $(this).removeClass("selected");
	    //$(id).hide();
	    $(id).css("visibility", "hidden");
	    
      	$(this).mouseover(function(){
      		$(this).addClass("selected");
      		//$(id).show();
      		$(id).css("visibility", "visible");
	    });
      	$(this).mouseout(function(){
	        $(this).removeClass("selected");
			//$(id).hide();
	        $(id).css("visibility", "hidden");
	    });
	    $(id).mouseover(function(){
      		$(this).addClass("selected");
			//$(id).show();
      		$(id).css("visibility", "visible");
		});
	    $(id).mouseout(function(){
	        $(this).removeClass("selected");
			//$(id).hide();
	        $(id).css("visibility", "hidden");
		});
	 })

    //return this; //Chainable
  };
  $(function(){ $(".idColorTabs").each(function(){ $(this).idColorTabs(); }); });
})(jQuery)
