/**

 * jQuery Smooth Tabs

 * 

 * Author: Alexander Petkov

 * E-mail: petkov@webdesign-bulgaria.com

 * URL: http://www.webdesign-bulgaria.com

 * Copyright: (c) 2010 - Alexander Petkov, Webdesign Bulgaria Group Ltd.

 *

 * Example:

 * $('.smoothTabs').smoothTabs(FADE-SPEED-IN-MILISECONDS);

 *  

 * Works for:

 * <div class="smoothTabs">

 *     <ul>

 *         <li>tab 1</li>

 *         <li>tab 2</li>

 *     </ul>

 *     <div>

 *         content for tab 1

 *     </div>

 *     <div>

 *         content for tab 2

 *     </div>

 * </div>

 *

 * Tested with jQuery 1.3.2 

 *

 * LICENSE:

 *

 * Copyright (c) 2010 Alexander Petkov, http://www.webdesign-bulgaria.com

 *

 * Permission is hereby granted, free of charge, to any person obtaining

 * a copy of this software and associated documentation files (the

 * "Software"), to deal in the Software without restriction, including

 * without limitation the rights to use, copy, modify, merge, publish,

 * distribute, sublicense, and/or sell copies of the Software, and to

 * permit persons to whom the Software is furnished to do so, subject to

 * the following conditions:

 *

 * The above copyright notice and this permission notice shall be

 * included in all copies or substantial portions of the Software.

 * 

 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,

 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF

 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND

 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE

 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION

 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION

 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

 

 	(function($) {  

        $.fn.smoothTabs = function(fadeSpeed) {

            // Clicked tab class

            var $smoothTabsLiCurrent = 'smoothTabsLiCurrent';

            // Hidden div class

            var $smoothTabsDivHidden = 'smoothTabsDivHidden';

            // Visible div class

            var $smoothTabsDivVisible = 'smoothTabsDivVisible';

            

            // Makes first tab current, hides all divs and fades in the first one

            this.each(function() {

                $("ul li:first", this).addClass($smoothTabsLiCurrent);

                $(this).find("div").addClass($smoothTabsDivHidden);

                $('div:first', this).fadeIn(fadeSpeed)

                                    .addClass($smoothTabsDivVisible)

                                    .removeClass($smoothTabsDivHidden);

			});



            // Tab click function

            $('ul li', this).click(function(){

                var $parentUl = $(this).parent();

                var $parentDiv = $($parentUl).parent();

                $('li', $parentUl).removeClass($smoothTabsLiCurrent);

                $(this).addClass($smoothTabsLiCurrent);

                var $clickedIndex = $('li', $parentUl).index(this);

                var $currentDiv = $('div', $parentDiv).get($clickedIndex);

                

                // If current tab is clicked - we're done

                if ($($currentDiv).attr('class') == $smoothTabsDivVisible) {

                    return false;

                }

                

                // Current div is replaced by the selected one

                $('.'+$smoothTabsDivVisible, $parentDiv).fadeOut(fadeSpeed, function(){

                    $($currentDiv).fadeIn(fadeSpeed).addClass($smoothTabsDivVisible).removeClass($smoothTabsDivHidden);

                });

                $('.'+$smoothTabsDivVisible, $parentDiv).removeClass($smoothTabsDivVisible).addClass($smoothTabsDivHidden);

            });

        };

	})(jQuery); 
	
	
	
	
	
	
	
	
	
	// Alpha Nav Smooth Tabs
	
	(function($) {  

        $.fn.smoothTabs2 = function(fadeSpeed) {

            // Clicked tab class

            var $smoothTabs2LiCurrent = 'smoothTabs2LiCurrent';

            // Hidden div class

            var $smoothTabs2DivHidden = 'smoothTabs2DivHidden';

            // Visible div class

            var $smoothTabs2DivVisible = 'smoothTabs2DivVisible';

            

            // Makes first tab current, hides all divs and fades in the first one

            this.each(function() {

                $("ul li:first", this).addClass($smoothTabs2LiCurrent);

                $(this).find("div").addClass($smoothTabs2DivHidden);

                $('div:first', this).fadeIn(fadeSpeed)

                                    .addClass($smoothTabs2DivVisible)

                                    .removeClass($smoothTabs2DivHidden);

			});



            // Tab click function

            $('ul li', this).click(function(){

                var $parentUl = $(this).parent();

                var $parentDiv = $($parentUl).parent();

                $('li', $parentUl).removeClass($smoothTabs2LiCurrent);

                $(this).addClass($smoothTabs2LiCurrent);

                var $clickedIndex = $('li', $parentUl).index(this);

                var $currentDiv = $('div', $parentDiv).get($clickedIndex);

                

                // If current tab is clicked - we're done

                if ($($currentDiv).attr('class') == $smoothTabs2DivVisible) {

                    return false;

                }

                

                // Current div is replaced by the selected one

                $('.'+$smoothTabs2DivVisible, $parentDiv).fadeOut(fadeSpeed, function(){

                    $($currentDiv).fadeIn(fadeSpeed).addClass($smoothTabs2DivVisible).removeClass($smoothTabs2DivHidden);

                });

                $('.'+$smoothTabs2DivVisible, $parentDiv).removeClass($smoothTabs2DivVisible).addClass($smoothTabs2DivHidden);

            });

        };

	})(jQuery); 
	
	
	
	
	
	// Jobs section tabs
	
	(function($) {  

        $.fn.smoothTabs3 = function(fadeSpeed) {

            // Clicked tab class

            var $smoothTabs3LiCurrent = 'smoothTabs3LiCurrent';

            // Hidden div class

            var $smoothTabs3DivHidden = 'smoothTabs3DivHidden';

            // Visible div class

            var $smoothTabs3DivVisible = 'smoothTabs3DivVisible';

            

            // Makes first tab current, hides all divs and fades in the first one

            this.each(function() {

                $("ul li:first", this).addClass($smoothTabs3LiCurrent);

                $(this).find("div").addClass($smoothTabs3DivHidden);

                $('div:first', this).fadeIn(fadeSpeed)

                                    .addClass($smoothTabs3DivVisible)

                                    .removeClass($smoothTabs3DivHidden);

			});



            // Tab click function

            $('ul li', this).click(function(){

                var $parentUl = $(this).parent();

                var $parentDiv = $($parentUl).parent();

                $('li', $parentUl).removeClass($smoothTabs3LiCurrent);

                $(this).addClass($smoothTabs3LiCurrent);

                var $clickedIndex = $('li', $parentUl).index(this);

                var $currentDiv = $('div', $parentDiv).get($clickedIndex);

                

                // If current tab is clicked - we're done

                if ($($currentDiv).attr('class') == $smoothTabs3DivVisible) {

                    return false;

                }

                

                // Current div is replaced by the selected one

                $('.'+$smoothTabs3DivVisible, $parentDiv).fadeOut(fadeSpeed, function(){

                    $($currentDiv).fadeIn(fadeSpeed).addClass($smoothTabs3DivVisible).removeClass($smoothTabs3DivHidden);

                });

                $('.'+$smoothTabs3DivVisible, $parentDiv).removeClass($smoothTabs3DivVisible).addClass($smoothTabs3DivHidden);

            });

        };

	})(jQuery); 







	// Quote section tabs
	
	(function($) {  

        $.fn.smoothTabs4 = function(fadeSpeed) {

            // Clicked tab class

            var $smoothTabs4LiCurrent = 'smoothTabs4LiCurrent';

            // Hidden div class

            var $smoothTabs4DivHidden = 'smoothTabs4DivHidden';

            // Visible div class

            var $smoothTabs4DivVisible = 'smoothTabs4DivVisible';

            

            // Makes first tab current, hides all divs and fades in the first one

            this.each(function() {

                $("ul li:first", this).addClass($smoothTabs4LiCurrent);

                $(this).find("div").addClass($smoothTabs4DivHidden);

                $('div:first', this).fadeIn(fadeSpeed)

                                    .addClass($smoothTabs4DivVisible)

                                    .removeClass($smoothTabs4DivHidden);

			});



            // Tab click function

            $('ul li', this).click(function(){

                var $parentUl = $(this).parent();

                var $parentDiv = $($parentUl).parent();

                $('li', $parentUl).removeClass($smoothTabs4LiCurrent);

                $(this).addClass($smoothTabs4LiCurrent);

                var $clickedIndex = $('li', $parentUl).index(this);

                var $currentDiv = $('div', $parentDiv).get($clickedIndex);

                

                // If current tab is clicked - we're done

                if ($($currentDiv).attr('class') == $smoothTabs4DivVisible) {

                    return false;

                }

                

                // Current div is replaced by the selected one

                $('.'+$smoothTabs4DivVisible, $parentDiv).fadeOut(fadeSpeed, function(){

                    $($currentDiv).fadeIn(fadeSpeed).addClass($smoothTabs4DivVisible).removeClass($smoothTabs4DivHidden);

                });

                $('.'+$smoothTabs4DivVisible, $parentDiv).removeClass($smoothTabs4DivVisible).addClass($smoothTabs4DivHidden);

            });

        };

	})(jQuery);
	
	
	
	
	
	// Bollywood tabs
	
	(function($) {  

        $.fn.smoothTabs5 = function(fadeSpeed) {

            // Clicked tab class

            var $smoothTabs5LiCurrent = 'smoothTabs5LiCurrent';

            // Hidden div class

            var $smoothTabs5DivHidden = 'smoothTabs5DivHidden';

            // Visible div class

            var $smoothTabs5DivVisible = 'smoothTabs5DivVisible';

            

            // Makes first tab current, hides all divs and fades in the first one

            this.each(function() {

                $("ul li:first", this).addClass($smoothTabs5LiCurrent);

                $(this).find("div").addClass($smoothTabs5DivHidden);

                $('div:first', this).fadeIn(fadeSpeed)

                                    .addClass($smoothTabs5DivVisible)

                                    .removeClass($smoothTabs5DivHidden);

			});



            // Tab click function

            $('ul li', this).click(function(){

                var $parentUl = $(this).parent();

                var $parentDiv = $($parentUl).parent();

                $('li', $parentUl).removeClass($smoothTabs5LiCurrent);

                $(this).addClass($smoothTabs5LiCurrent);

                var $clickedIndex = $('li', $parentUl).index(this);

                var $currentDiv = $('div', $parentDiv).get($clickedIndex);

                

                // If current tab is clicked - we're done

                if ($($currentDiv).attr('class') == $smoothTabs5DivVisible) {

                    return false;

                }

                

                // Current div is replaced by the selected one

                $('.'+$smoothTabs5DivVisible, $parentDiv).fadeOut(fadeSpeed, function(){

                    $($currentDiv).fadeIn(fadeSpeed).addClass($smoothTabs5DivVisible).removeClass($smoothTabs5DivHidden);

                });

                $('.'+$smoothTabs5DivVisible, $parentDiv).removeClass($smoothTabs5DivVisible).addClass($smoothTabs5DivHidden);

            });

        };

	})(jQuery);
