jQuery.noConflict();
jQuery(document).ready(function(){

  //external window
  jQuery('a[class="external"]').click(function(){
    this.target = "_blank";
  });
  
  //popup window
  jQuery('a[class="popup"]').click(function(){
    window.open(this.href, 'Popup', 'height=580,width=400,scrollTo,resizable=0,scrollbars=0,location=0,left=50,top=50', 'false');
    return false;
  });
  
  //close popup window link
  jQuery('a[class="popup_close"]').click(function(){
    window.close();
    return false;
  });
  
  //print link
  jQuery('a[class="print"]').click(function(){
    window.print();
    return false;
  });
  
  //confirm link
  jQuery('a[class="confirm"]').click(function(){
    return confirm(this.title);
  });
  
  //bookmark link 
  jQuery("a.bookmark").click(function(event){
    event.preventDefault();
    var url = this.href;
    var title = this.title;
    if (window.sidebar) {
      window.sidebar.addPanel(title, url, "");
    }
    else 
      if (window.external) {
        window.external.AddFavorite(url, title);
      }
      else {
        alert('Uw browser ondersteunt helaas niet deze optie.');
      }
  });
  
  //iframe replacement
  jQuery('a[class="iframe"]').each(function(i){
    jQuery(this).replaceWith("<iframe src='" + this.getAttribute("href") + "' frameborder='0' scrolling='no' width='934' height='600'></iframe>");
  });
  
  //image rollover
  jQuery("img.rollover").hover(function(){
    this.src = this.src.replace("_off.", "_on.");
  }, function(){
    this.src = this.src.replace("_on.", "_off.");
  });
  
  //forms - focus
  jQuery("input[type=password], input[type=text], textarea").focus(function(){
    jQuery(this).addClass("focus");
  });
  jQuery("input[type=password], input[type=text], textarea").blur(function(){
    if (jQuery(this).find(".focus")) {
      jQuery(this).removeClass("focus");
    }
  });
  
  //forms - hover
  jQuery("input.submit").hover(function(){
    jQuery(this).addClass("hover");
  }, function(){
    jQuery(this).removeClass("hover");
  });
  
  //forms - select all
  //jQuery("input[@name=select_deselect]").click(function(){
  //  var checked_status = this.checked;
  //  jQuery("input[@class=check_me]").each(function(){
  //    this.checked = checked_status;
  //  });
  //});
  
  //forms - hover
  jQuery("input.submit").hover(function(){
    jQuery(this).addClass("hover");
  }, function(){
    jQuery(this).removeClass("hover");
  });
  
  //forms - multi select transfer
  jQuery('a#add').click(function(){
    return !jQuery('select#select1 option:selected').remove().appendTo('#select2');
  });
  jQuery('a#remove').click(function(){
    return !jQuery('select#select2 option:selected').remove().appendTo('#select1');
  });
  
  //forms - toggle visibility information
  jQuery('p.more_info').hide();
  jQuery('.toggle_info input[type=radio]').click(function(){
    (jQuery(this).val() == 'Yes') ? jQuery('p.more_info').show() : jQuery('p.more_info').hide();
  });
  
  //forms - auto submit
  jQuery(".auto_submit").change(function(){
    jQuery(this.form).submit();
  });
  
  //forms - no javascript button
  jQuery('input.no_javascript').hide();
  
  jQuery('div#intro h2').sifr({
    font: '/flash/delicious_heavy.swf',
    fontSize: '36',
    version: 3,
    build: '419',
    height: 200
  });
  
  jQuery('div.spotlight_summary h2').sifr({
    font: '/flash/delicious_heavy.swf',
    fontSize: '21',
    height: 26,
    version: 3,
    build: '419'
  });
  
  jQuery('div#content_primary h2').sifr({
    font: '/flash/delicious_heavy.swf',
    fontSize: '21',
    height: 26,
    width: 590,
    version: 3,
    build: '419'
  });
  
  jQuery('div#content_secondary h2.secondary_projects').sifr({
    font: '/flash/delicious_heavy.swf',
    fontSize: '18',
    height: 22,
    version: 3,
    build: '419'
  });
  
  //FAQ - toggle
  jQuery("dd.content").hide();
  jQuery("dt.toggle a").click(function(){
    jQuery(this).parent().next("dd").toggle();
    return false;
  });
  
  //dropdown menu - hover IE6
  jQuery('div#footer ul li').hover(function(){
    jQuery(this).addClass('hover');
  }, function(){
    jQuery(this).removeClass('hover');
  });
  
  //forms - autoclear
  jQuery('form#form_search input[type="text"]').attr({
    value: 'Zoek'
  }).focus(function(){
    if (jQuery(this).val() == "Zoek") {
      jQuery(this).val("");
    }
  }).blur(function(){
    if (jQuery(this).val() == "") {
      jQuery(this).val("Zoek");
    }
  });
  
  //flash 
  jQuery('a.media_flash').media({
    type: 'swf',
    caption: false
  });
  
});
