$(document).ready(function(){

    $("a.tip").fancybox({
            'autoDimensions'	: true,
            'padding'           : 0,
            'scrolling'         : 'auto',
            'width'         	: 600,
            'height'            : 'on',
            'overlayColor'      : '#333333',
            'autoScale'         : false
    });
    
    
    var i = 1;
    $('.news_content').each(function(){
        if(i != 1)
            $(this).toggle();
        i++;
    });
        // Toggle the Content Box
    $(".news_tab h4").css({"cursor":"s-resize"}); // Give the h3 in Content Box Header a different cursor
    $(".content-box-header-toggled").next().hide(); // Hide the content of the header if it has the class "content-box-header-toggled"

    $(".news_tab h4").click( // When the h3 is clicked...
            function () {
              $(this).parent().parent().find(".news_content").toggle(); // Toggle the Content Box
              $(this).parent().toggleClass("content-box-header-toggled"); // Give the Content Box Header a special class for styling and hiding
            }
    );
    // Content box tabs:
		
		$('.content-box .content-box-content div.tab-content').hide(); // Hide the content divs
		$('.content-box-content div.default-tab').show(); // Show the div with class "default-tab"
		$('ul.content-box-tabs li a.default-tab').addClass('current'); // Set the class of the default tab link to "current"
		
		$('.content-box ul.content-box-tabs li a').click( //When a tab is clicked...
			function() { 
				$(this).parent().siblings().find("a").removeClass('current'); // Remove "current" class from all tabs
				$(this).addClass('current'); // Add class "current" to clicked tab
				var currentTab = $(this).attr('href'); // Set variable "currentTab" to the value of href of clicked tab
				$(currentTab).siblings().hide(); // Hide all content divs
				$(currentTab).show(); // Show the content div with the id equal to the id of clicked tab
				return false; 
			}
		);
                    
    // Shop Content box tabs by category
	$(function() {
		$( ".content-box-shop" ).tabs({
			ajaxOptions: {
				error: function( xhr, status, index, anchor ) {
					$( anchor.hash ).html("Couldn't load this tab. We'll try to fix this as soon as possible.");
				}
			}
		}).find( ".ui-tabs-nav" ).sortable({axis: "x"});                
                
                $("a.order").fancybox({
                        'autoDimensions'	: false,
                        'padding'           : 0,
                        'scrolling'         : 'auto',
                        'width'         	: 600,
                        'height'            : 300,
                        'overlayColor'      : '#333333',
                        'autoScale'         : false
                });
	});
    // TOP Tip 
    $("tbody tr").tooltip({
        track: true,
        delay: 0,
        showURL: false,
        fade: 200
    });
    $(".statusServers img").tooltip({
        track: true,
        delay: 0,
        showURL: false,
        fade: 200,
        height: '50px'
    });


//    $('.head img').mouseover(function(){
//       $(this).animate({
//					width: 350,
//                                        padding: 10
//				}, 500 );
//       
//    }).mouseout(function(){
//       $(this).animate({
//           width: 300,
//           padding:10
//        }, 500 );
//        $(this).attr('style', "");
//    });


});
