$(document).ready(function() {
  $.ajaxSetup ({
    // Disable caching of AJAX responses */
    cache: false
  });
  $("#videocontent").toggle();
  $("#kven_nojs").toggle();
  $("#kven_js").toggle();
  initTicker();
});





/* functions */

function toogleVideocontent(){
    $("#videocontent").toggle("fast");
}

function toogleKVLink(id){
    var listitems = $("#kven_js").children('li');
    var y = document.documentElement.scrollTop;
    listitems.each(function() {
        var itemid = $(this).attr('id');
        if(itemid != "kvlink"+id && itemid != "kvlink"+id+"_img"){
            if(itemid.substring(itemid.length-4, itemid.length)=="_img"){
                $(this).css('display','none');
            }else{
                $(this).css('display','block');
            }
        }
    });        
    if($.browser.msie){
        $("#kvlink"+id).toggle();
        $("#kvlink"+id+"_img").toggle();
        $("#kven_1").toggle();
        $("#kven_1").toggle();
        $("#kven_2").toggle();
        $("#kven_2").toggle();
        window.scrollTo(0,y);
    }else{
        $("#kvlink"+id).toggle("fast");
        $("#kvlink"+id+"_img").toggle("fast");
    }

}

function initTicker(){
    
    var showTime=500;
    var effectTime=2000;
    var childDivClass='tickerText';
    var activeClass="activeTicker";
    var tickerDiv=$('#tickerTextHolder');
    
    // let the news begin
    tickerDiv.newsTicker({
          showTime: showTime,
          effectTime: effectTime,
          activeClass: activeClass,
          childDivClass: childDivClass
        });
}
