﻿

var contento = {};



contento.startcycle = {
    init: function() {

    jQuery(".cycle").cycle({
        fx: 'fade',
        timeout: 6000,
        speed: 2500,
       next: '#next2',
        prev: '#prev2'
    });
    
    }
}





contento.tabs = {
    init: function() {

        var str = "<ul>";
        jQuery('.tabs2011 .tabstitle').each(function(index) {

            node = $(this).children('h2').text();
            admin = $(this).children('.menu').html();
            //admin =""
            str += "<li><a href='#tab" + index + "'>" + node + "</a>" + admin + "</li>"
            $(this).next(".Tabs2011").addClass("tab" + index).attr('id', 'tab' + index);
            $(this).hide();
        });
        str += "</ul>"
     //   $('.tabs2011  > .tabstitle').before(str);
        $('#ctl00_contentpane').append(str);

        $(".tabs2011").tabs().addClass('ui-tabs-vertical ui-helper-clearfix');
        // $("#content li").removeClass('ui-corner-top').addClass('ui-corner-left');
        $(".tabs2011  .tabstitle").tabs().addClass('ui-tabs-vertical ui-helper-clearfix');
        // $(".box h2").removeClass('ui-corner-top').addClass('ui-corner-left');
    }
}


contento.previmage = {
    init: function() {
        var startimg = $("#ctl00_middlepane img").attr("src");
        $('a[previmage*="/"]').hover(
  function() {
      $("#ctl00_middlepane img").attr("src", $(this).attr("previmage"));
$("#ctl00_middlepane a").attr("href", $(this).attr("href"));

  },
  function() {
 // $("#ctl00_middlepane img").attr("src", startimg);
  }
);


    }
}





contento.snav2011 = {
    init: function() {

try
  {
        var roottabid = $('.active').attr('id').replace('hnav', '');
        $('.parent' + roottabid).show();
/*
        $(".level3 > li").hover(
         function() {
             $(this).addClass('li2open');
             $(this).children("ul").attr('class', 'ddd');

             $(this).children("ul").slideDown();
         },
  function() {
      });*/

        $('.li2open').click(function() {
            $(this).removeClass('li2open');
            $(this).children("ul").slideUp();
        });
     
}
catch(err)
  { }
    }

}





//fügt allen links einen pfeil hinzu
contento.linkicons = {
    init: function() {
    $(".vers2011Inside  #content a:not('.keinpfeil'):not(:empty)' ").append('<img style=padding-left:7px src="/portaldata/1/images/skin/pfeil-d-r.png">');
    $(".vers2011Inside  #right a:not('.keinpfeil'):not(:empty)' ").prepend('<img style=padding-right:7px src="/portaldata/1/images/skin/pfeil-d-r.png">')
  //  $(".pfeilrahmen").append('<img style=padding-left:7px src="/portaldata/1/images/skin/pfeil-rahmen-h.png">')
    }
}


//#right a[class!=keinpfeil]"


//newdetail grosses Bild rechts
contento.userimage1Right = {
    init: function() {
        var imgsrc = $('.userimage1').html();
      //  $('#right').append(imgsrc);
        $(imgsrc).appendTo('#right');
    }
}


//fügt allen links einen pfeil hinzu
contento.gnav2011 = {
    init: function() {


    $("#gnav > ul > li").hover(
         function() {
                 aktiv =  $(this).children("ul").slideDown();
         },
  function() {
    // aktiv = window.setTimeout(function() {
             $(this).children("ul").hide();
    //    }, 3)
  });
        
        
    }
}
function hide(obj) {
    $(this).children("ul").hide();
}






function initAddThis() {
    addthis.init()
}
// After the DOM has loaded...






$(document).ready(function() {
   contento.startcycle.init();
    contento.tabs.init();
    contento.previmage.init();
    contento.snav2011.init();
    contento.linkicons.init();
    contento.gnav2011.init();
    contento.userimage1Right.init();
    initAddThis();
});



