$(document).ready(function() {  
  $(window).resize(function()
   {
     setcolumns();
   });      
  setcolumns();   
  
    $('#down a').click(function(){
      var offset = 500;
      var pos = $('html, body, .content').offset().top;
      var nextpos = (pos * -1) + offset;    
      $('html, body, .content').animate({scrollTop: nextpos}, 800);     
      return false;
    });
    
    $('#up a').click(function(){
    var offset = 500;
    var pos = $('html, body, .content').offset().top;
    var nextpos = (pos * -1) - offset; 
    
    $('html, body, .content').animate({scrollTop: nextpos}, 800); 
    return false;
        }); 
 

  
  // EMail Spam 
  if ( $("span.mailme").length ) {
    // variables, which will be replaced
    var at = / AT /;
    var dot = / DOT /g;
  
    // function, which replaces pre-made class
    $('span.mailme').each(function () {
      var addr = $(this).text().replace(at, '@').replace(dot, '.');
      $(this).after('<a href="mailto:' + addr + '">' + addr + '</a>');
      $(this).remove();
    });
  }
  // EMail Spam 
  

  
  $('#videoNavigation li').click(function(){
    $('#videos .video').empty();      
    var url = $(this).find('a').attr('href');    
    var iframeurl = "/videoiframe?url=" + url;
    $('<iframe />', {
      name: 'videoFrame',
      id:   'videoFrame',
      src: iframeurl,
      style: 'width:100%; height: 100%;'
    }).appendTo('#videos .video'); 
    
    $("#videoNavigation li ").addClass("activeSlide").not(this).removeClass("activeSlide"); 
    return false;
    });
});

  
  function setcolumns()
{
  var leftpos = $('#left').offset().left;
  var rightpos = $('#right').offset().left;
  
  $('.containerleftfixed').css("left", leftpos);
  $('.rightColumnfixed').css("left", rightpos ); 
  
  if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
  {
      $("#shadowtop").hide();
      $("#shadowbottom").hide();    
    }
  }



  
