﻿/*
  Main Javascript file for Servicecut.net
  
  Author: Ezra Pool(ezra@servicecut.net);
  
  Copyright Servicecut.net 2009;
*/
$(function(){
  $("#featured").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);

  $.gaTracker(
    'UA-12379200-1', 
    { 
      external:       '/external/', 
      mailto:         '/mailto/', 
      download:       '/downloads/', 
      extensions:     [ 
        'pdf','doc','xls','csv','jpg','gif', 'mp3', 
        'swf','txt','ppt','zip','gz','dmg','xml' 
      ]
    }
  );
  $(document).pngFix();
  $("#menu").accordion({collapsible: false, active: 3, autoHeight: false });
  
  $(".bericht .message img:not(.postpic)").each(function(){
    rndname = Math.floor ( Math.random () * 1000 + 1 );
    $item = $(this);
    $item.wrap("<a href='http://servicecut.nl"+$item.attr("src")+"' rel='lightbox-"+rndname+"' class='lightbox'></a>");
  });
  $(".bericht .message a.lightbox").lightBox();
  
  $("img").lazyload({threshold:200, placeholder: "http://servicecut.nl/img/transpBlack.png", effect : "fadeIn"});
  
  $("#comingsoon [title]").hovertip();
  
  //Make sure the searchform uses the prettylink system.
  $("#searchform").bind('submit', function(){
    window.location = $(this).attr("rel") + $("#searchform > #searchfield").val();
    return false;
  });
  
  Cufon.replace('h2, h3, .leesmeer, .hovertip, .post_categorie, #more', {hover: true, fontFamily: 'BadaBoom'});
});