
$.preloadImages = function() {
  for(var i = 0; i<arguments.length; i++)  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

$(function() {
	swfobject.embedSWF("flash/header.swf", "homeflash", "739", "446", "9.0.0", "flash/expressInstall.swf", {
	   technologie_clickTAG:'diensten/technologie',
	   concept_clickTAG:'diensten/concept',
	   design_clickTAG:'diensten/design'
	}, {wmode:'transparent',menu:false});
	swfobject.embedSWF("flash/chat_as3.swf", "chat_flash", "202", "199", "9.0.0", "flash/expressInstall.swf", {settingsUrl: 'flash/settings/settings.xml'}, {wmode:'transparent',menu:false});
	
	// Replace img PNG's in IE6
	if ($.browser.msie && $.browser.version < 7) {
		$('img[src$=.png]').each(function(){
			$(this).css({
				filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.src+"')"
			});
			this.src = 'images/blank.gif';
		});
	}

	// activate detail-lists
	$('table.detail_list tr').hover(function(){
		$(this).toggleClass('hover');
		$('td.detail_list_button img',$(this)).get(0).src = 'images/icon_view_active.gif';
	},function(){
		$(this).toggleClass('hover');
		$('td.detail_list_button img',$(this)).get(0).src = 'images/icon_view.gif';
	}).click(function(){
		location.href = $('a.detail_link',$(this)).attr('href');
	});

	$('div.leesmeer>a').hover(function(){
		$('img',$(this)).get(0).src = 'images/icon_view_active.gif';
	},function(){
		$('img',$(this)).get(0).src = 'images/icon_view.gif';
	});
	
	$('a.external').click (function () {
	   window.open(this.href);
	   return false; 
	});
	
	$('a#headermore').click(function(){
		var self = this;
		var open = $(this).attr('open');
		if (typeof open == 'undefined')
			open = 0;
		
		if (open == 1) {
			$(this).parent().animate({height:'185px'},500,'swing',function(){
				$(self).removeClass('min');
				$(self).attr('open',0);
			});
		} else {
			$(this).parent().animate({height:'493px'},500,'swing',function(){
				$(self).addClass('min');
				$(self).attr('open',1);
			});
		}
		$(this).blur();
		return false;
	});

	// Contact submit hover
	$('input.contact_submit').hover(function(){
		$(this).css({backgroundImage:'url(images/button_verzenden_active.gif)'});
	},function(){
		$(this).css({backgroundImage:'url(images/button_verzenden.gif)'});
	});

	$.preloadImages (
		'/images/button_verzenden_active.gif',
		'/images/button_volgende_active.gif',
		'/images/button_vorige_active.gif',
		'/images/button_route_active.gif',
		'/images/button_nieuwsoverzicht_active.gif',
		'/images/button_aanmelden_active.gif',
		'/images/button_overzicht_active.gif',
		'/images/icon_view_active.gif',
		'/images/icon_plus_active.gif',
		'/images/icon_min_active.gif',
		'/images/more_over.png',
		'/images/button_next_small_active.gif',
		'/images/button_prev_small_active.gif'
	);
});

