jQuery(function($) {  
	
	//input hint
	if($('input')[0]){
		$('input').hint();
	}
	//special list
	$('a#specialListTrigger.closed').live("click", function(){
		$(this).removeClass('closed').addClass('opened');
		$('#specialListContainer').fadeIn("slow");
		return false;
	});
	$('a#specialListTrigger.opened').live("click", function(){
		$(this).removeClass('opened').addClass('closed');
		$('#specialListContainer').fadeOut("slow");
		return false;
	});
	
	//foto gallery
	$('.fotoGal .fotoGalItem:nth-child(3n)').css({"margin-right":"0"});
	
	//tabs
	if($('#tabs')[0]){
		$('#tabs').tabs();
	}
	
	//vacature table
	$('table.rightTable tr').hover(
      function () {
        $(this).find('a').css({"color":"#000"});
      }, 
      function () {
        $(this).find('a').removeAttr("style");
      }
    );
	
	//vacature list table
	$("table.vacaturesTable tr").hover(
      function () {
        $(this).addClass("hovered");
      }, 
      function () {
        $(this).removeAttr("class");
      }
    );
	
	//table sorter
	if($('table.vacaturesTable')[0]){
		$('table.vacaturesTable').tablesorter();
	}
	//Content Height vs Menu height
	var $subNav = $('#subMenu');
	var $content = $('#content');
	
	if ($content.height() < $subNav.height()) {
		$content.css('height',$subNav.height()-20);
	}

	//Tell a friend
	var $tip = $('form.tipAFriend');
	if ($tip[0]) {
		var $field = $('fieldset', $tip);
		if (!$('.tipError', $field)[0]) $field.hide();
		$('.email a', $tip).click(function(){
			$field.slideToggle('fast');
		})
	}
	
});

