var elm = ['header','footer','article','aside','nav','figure','figcaption','time','section'];
for(i=0;i<elm.length;++i) {
	document.createElement(elm[i]);
}

Cufon.replace('header h1, #main #content h1', { hover: false });
Cufon.replace('header nav a, #home article h1', { hover: true });

$(document).ready(function(){

	var srchtxt = 'Typ hier je zoekterm';
	$('#top nav input[name=s]').blur(function(){
		if($(this).val()=='') {
			$(this).val(srchtxt);
		}
	}).focus(function(){
		if($(this).val()==srchtxt) {
			$(this).val('');
		}
	}).trigger('blur');


	$('#home article img').load(function(){
		if(!$(this).hasClass('blended')) {
			$(this).addClass('blended');
			var img = this;
			var blendImg = new Image();
			blendImg.onload = function() {
				Pixastic.process(img, "blend", {
					amount : 1,
					mode : "multiply",
					image : blendImg
					},
					function(node) {
						if(!node) {
			     			$(blendImg).css({
			    				opacity: 0.7,
			    				zIndex: 11
			    			}).appendTo( $(img).parent() );
			    		}
					}
	    		);
	    	}
    		blendImg.src = __WP_THEME__ + "/img/home_blend.gif";
    	}
		return false;
    }).each(function(){
    	if(this.complete && this.naturalWidth !== 0 ) {
      		$(this).trigger('load');
   		}
    });
    
    		
	$('#headerimg').load(function(){
		if(!$(this).hasClass('blended')) {
			$(this).addClass('blended');
			var img = this;
			var blendImg = new Image();
			blendImg.onload = function() {
				Pixastic.process(img, "blend", {
					amount : 1,
					mode : "multiply",
					image : blendImg
					},
					function(node) {
						if(!node) {
			     			$(blendImg).css({
			    				opacity: 0.55,
			    				zIndex: 11
			    			}).appendTo('header');
			    		}
					}
	    		);
	    	}
    		blendImg.src = __WP_THEME__ + "/img/header_blend.gif";
    	}
		return false;
    }).each(function(){
    	if(this.complete && this.naturalWidth !== 0 ) {
      		$(this).trigger('load');
   		}
    });
});
