/* ITM CUSTOM SCRIPT */
///<reference path="jquery.js" />

$(function () {
    /* Main Menu DropDown */
    function makeTall() {
        $(this).children('.tm_sub').slideDown('200');
        $(this).children('a').toggleClass('active');

    }
    function makeShort() {

        $(this).children('.tm_sub').hide();
        $(this).children('a').toggleClass('active');
    }
    var config = {
        over: makeTall, // function = onMouseOver callback (REQUIRED)    
        timeout: 0, // number = milliseconds delay before onMouseOut    
        out: makeShort // function = onMouseOut callback (REQUIRED)    
    };
    $('#top_menu li').hoverIntent(config);

    $(".has_child").click(function () {
        return false;
    });

    /* Ken Burns Effect for the EmoPic .fadeIn(3000) */
    $(".emopic").animate(
        {
            width: '990px',
            height: '300px'
        },

        { duration: 10000 });


    /* Attention Slide on Front Page*/
    //Make the tab
    $('.SlideTab').tabSwitch('create', { type: 'toggle', toggle: 'fade', height: 300, width: 990 });

    // Triggers the Slide to Start
    //$('.SlideTab').tabSwitch('startAuto', { interval: 8000});

    // Starts with a specific slide
//    function goToTab() {
//        $('.SlideTab').tabSwitch('moveTo', { index: 0 });
//        $("a[rel='0']").addClass('selectedTab');
//    }

//    goToTab();

    //Move to a specific tab base on its rel
    $('#a_nav li a').click(function (e) {
        $('.SlideTab').tabSwitch('moveTo', { index: $(this).attr('rel') });
        $('#a_nav li a').removeClass("selectedTab");
        $(this).addClass("selectedTab");
        e.preventDefault();
        index = $('.SlideTab').tabSwitch('index');
        console.log(index);
    });

    //This code to move to the next or previous tab
    // $('.SlideTab').tabSwitch('moveStep', { step: parseInt($(this).attr('rel')) });

    /* Show Thumb on Hover 
     function showThumb() {
       $(this).children(".a_teaser").show();
       $(this).children(".a_teaser").fadeIn(1000);
       $(this).animate({
           opacity: 1
       }, 1000, function () {
       Animation complete.
      });
      }
     Hide Thumb on Out
     function hideThumb() {
         $(this).children(".a_teaser").hide();
         $(this).children(".a_teaser").fadeOut(300);
        $(this).animate({
          opacity: 0.7
     }, 1000, function () {
        // Animation complete.
      });
       }
      var config = {
          over: showThumb, // function = onMouseOver callback (REQUIRED)
          timeout: 200, // number = milliseconds delay before onMouseOut
           out: hideThumb // function = onMouseOut callback (REQUIRED)
      };
      $("#a_nav li a").hoverIntent(config);*/




    /* Search Field HACK 
    $('.itmsearch').attr("value", "Suchbegriff");
    $('.itmsearch').focus(function () {
        $(this).attr("value", "").css("color", "#333");


    });
    $('.itmsearch').blur(function () {
        $(this).attr("value", "Suchbegriff").css("color", "#e9e9e9"); ;
    });*/



    /*var ie6nagscreen = true;
   

    function OpenIE6Windows() {
        $("body").prepend('<div id="ienotify" style="padding:20px; display:none; font-weight:bold; background:#FAED54; border-bottom:2px solid #000; border-top:2px solid #000; text-align: center;">Bitte installieren Sie einen <a href="http://www.microsoft.com/germany/windows/internet-explorer/browse-with-confidence.aspx" target="_blank">aktuellen Browser</a>. Diese Seite ist nicht für den Internet Explorer 6 optimiert. (<a href="#" onclick="return CloseIE6Windows()" id="ienotify_close">x schließen</a>)</div>');
        
          setTimeout(function() {
               $('#ienotify').slideDown(1000);
          },2000);  
    }
    function CloseIE6Windows() {
           $('#ienotify').slideUp(1000);
    }
    */
    /* Detect IE 6 */
   /* if (jQuery.browser.msie) {
        if (parseInt(jQuery.browser.version) == 6) {
            if (ie6nagscreen == false) {
                OpenIE6Windows();
            }
        }
    } */



});

