/* 
 * Documentatie:
 * 
 * Cufon:              http://cufon.shoqolate.com/
 * InnerFade:          http://medienfreunde.com/lab/innerfade/
 * StylishSelect:		  http://www.scottdarby.com/plugins/stylish-select/0.4/
 * DD_Belated pngfix:  http://www.dillerdesign.com/experiment/DD_belatedPNG/
 *
 */

$(function(){


	// Cufon: font replacement
	Cufon.replace('#header .text li, #left h1, #left .refs h3, #left .ref h4, #right .image .txt span, #right .list h3, #footer .left');
	Cufon.replace('#header .nav > ul > li > a', { hover: true });


	// InnerFade: Header text rotator
	$('#header .text ul').innerfade({
		animationtype: 'fade', // fade or slide
		speed: 500, // animation speed in milliseconds
		timeout: 5000, // time between animations in milliseconds
		type: 'sequence', // sequence, random, or random_start
		containerheight: '75px' // height of the containing element
	});


	// InnerFade: Right column text rotator
	$('#right .image .txt').innerfade({
		animationtype: 'fade', // fade or slide
		speed: 500, // animation speed in milliseconds
		timeout: 5000, // time between animations in milliseconds
		type: 'sequence', // sequence, random, or random_start
		containerheight: '52px' // height of the containing element
	});


	// SimplyScroll: Ref logo image scroller
	$('#left .refs .logos').simplyScroll({
		autoMode: 'loop'
	});


	// StylishSelect: Custom select boxes in forms
	$('select.styled').sSelect({
		ddMaxHeight: '300px'
	});


	// Form item focus & blur
	var labels = new Array();
	$('.form .item input[value]:text').each(function(){
		labels[$(this).attr('name')] = $(this).val();
		$(this).focus(function(){
			if ($(this).val() == labels[$(this).attr('name')]) { $(this).val(''); }
		}).blur(function(){
			if ($(this).val() == '') { $(this).val(labels[$(this).attr('name')]); }
		});
	});


	// Navigation submenu
	$('#header .nav > ul > li').hover(
		function(){
			$(this).find('ul:not(ul:animated)').slideDown(300);
			$(this).addClass('hover');
		},
		function(){
			$(this).find('ul').slideUp(300);
			$(this).removeClass('hover');
		}
	);


	// DD_Belated pngfix: IE6 png transparacy fix
	if (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32") {
		DD_belatedPNG.fix('img, #header .nav .bgb, #content, #left .bg-top, #left .bg-mid, #left .bg-bottom, #left .refs h3, #left .refs .cntr1, #right .bg-top, #right .bg-mid, #right .bg-bottom, #right .image .txt, #right .search .butn input');
	}



});
