$(document).ready(function(){


     /*   

    // set content height to fill right col background (bg is set in  #contener)
     var bodyHeight = document.body.offsetHeight;
     console.log(bodyHeight);
     
     var contentHeight = document.getElementById("content");
     console.log(contentHeight);
     
     contentHeight = contentHeight.offsetHeight;
     console.log(contentHeight);
     
     if(bodyHeight>contentHeight)
     {
       contentHeight=bodyHeight;
     }
 
     $('#contener').css('height', (contentHeight)+'px');
     $('#content').css('height', (contentHeight)+'px');
     $('#rightContent').css('height', (contentHeight)+'px');
*/

  // ------------------------------
  $('a.external').click(function() {
    this.target = "_blank";
  });
  //$('#nlSubsciption').toggle();
  
  // ------------------------------
  $('#newsletter p a').click(function() {
    $('#nlSubsciption').slideToggle('slow');
  });
  
  // ------------------------------
  $('#nlSubsciption').submit(function(){
    tb_show(" ", $(this).attr('action')+'?layout=false&em='+$("#em").attr('value'), "/assets/img/loadingAnimation.gif");
    return false;
  });
  
  // ------------------------------
  var timer;
  
  // ------------------------------  
  $('#smartInfo').hover(function() {
    clearTimeout(timer)
    $('#baseline').css({'background-position' : '0 -86px'});
  }, function() {
    timer = setTimeout(function(){
      $('#baseline').css({'background-position' : '0 0'});
    }, 500 );
  });
  
  // ------------------------------  
  $('#smartTools').hover(function() {
    clearTimeout(timer)
    $('#baseline').css({'background-position' : '0 -172px'});
  }, function() {
    timer = setTimeout(function(){
      $('#baseline').css({'background-position' : '0 0'});
    }, 500 );
  });
  
  // ------------------------------  
  $('#smartAgora').hover(function() {
    clearTimeout(timer)
    $('#baseline').css({'background-position' : '0 -258px'});
  }, function() {
    timer = setTimeout(function(){
      $('#baseline').css({'background-position' : '0 0'});
    }, 500 );
  });
  
  // ------------------------------  
  
  //global vars
  var searchBoxes = $(".text");
  var searchBox2 = $(".mb2");

  var myTextInputs = [];
  searchBox2.each(function(){
    myTextInputs[$(this).attr('id')] = $(this).attr('value');
  })

  //Searchbox2 show/hide default text if needed
  searchBox2.focus(function(){
    if($(this).attr("value") == myTextInputs[$(this).attr("id")]) $(this).attr("value", "");
  });
  searchBox2.blur(function(){
    if($(this).attr("value") == "") $(this).attr("value", myTextInputs[$(this).attr("id")]);
  });


  
});


function loginForm(url)
{
  // location.href='http://account.smartasbl.be/login.aspx?access=member';
  tb_show("", url+'?context=tb', "/assets/img/loadingAnimation.gif");
}


