function utf8_encode(a){if(a===null||typeof a==="undefined"){return""}var b=a+"";var c="",d,e,f=0;d=e=0;f=b.length;for(var g=0;g<f;g++){var h=b.charCodeAt(g);var i=null;if(h<128){e++}else if(h>127&&h<2048){i=String.fromCharCode(h>>6|192)+String.fromCharCode(h&63|128)}else{i=String.fromCharCode(h>>12|224)+String.fromCharCode(h>>6&63|128)+String.fromCharCode(h&63|128)}if(i!==null){if(e>d){c+=b.slice(d,e)}c+=i;d=e=g+1}}if(e>d){c+=b.slice(d,f)}return c}
function md5_spam(a){var b;var c=function(a,b){return a<<b|a>>>32-b};var d=function(a,b){var c,d,e,f,g;e=a&2147483648;f=b&2147483648;c=a&1073741824;d=b&1073741824;g=(a&1073741823)+(b&1073741823);if(c&d){return g^2147483648^e^f}if(c|d){if(g&1073741824){return g^3221225472^e^f}else{return g^1073741824^e^f}}else{return g^e^f}};var e=function(a,b,c){return a&b|~a&c};var f=function(a,b,c){return a&c|b&~c};var g=function(a,b,c){return a^b^c};var h=function(a,b,c){return b^(a|~c)};var i=function(a,b,f,g,h,i,j){a=d(a,d(d(e(b,f,g),h),j));return d(c(a,i),b)};var j=function(a,b,e,g,h,i,j){a=d(a,d(d(f(b,e,g),h),j));return d(c(a,i),b)};var k=function(a,b,e,f,h,i,j){a=d(a,d(d(g(b,e,f),h),j));return d(c(a,i),b)};var l=function(a,b,e,f,g,i,j){a=d(a,d(d(h(b,e,f),g),j));return d(c(a,i),b)};var m=function(a){var b;var c=a.length;var d=c+8;var e=(d-d%64)/64;var f=(e+1)*16;var g=new Array(f-1);var h=0;var i=0;while(i<c){b=(i-i%4)/4;h=i%4*8;g[b]=g[b]|a.charCodeAt(i)<<h;i++}b=(i-i%4)/4;h=i%4*8;g[b]=g[b]|128<<h;g[f-2]=c<<3;g[f-1]=c>>>29;return g};var n=function(a){var b="",c="",d,e;for(e=0;e<=3;e++){d=a>>>e*8&255;c="0"+d.toString(16);b=b+c.substr(c.length-2,2)}return b};var o=[],p,q,r,s,t,u,v,w,x,y=7,z=12,A=17,B=22,C=5,D=9,E=14,F=20,G=4,H=11,I=16,J=23,K=6,L=10,M=15,N=21;a=this.utf8_encode(a);o=m(a);u=1732584193;v=4023233417;w=2562383102;x=271733878;b=o.length;for(p=0;p<b;p+=16){q=u;r=v;s=w;t=x;u=i(u,v,w,x,o[p+0],y,3614090360);x=i(x,u,v,w,o[p+1],z,3905402710);w=i(w,x,u,v,o[p+2],A,606105819);v=i(v,w,x,u,o[p+3],B,3250441966);u=i(u,v,w,x,o[p+4],y,4118548399);x=i(x,u,v,w,o[p+5],z,1200080426);w=i(w,x,u,v,o[p+6],A,2821735955);v=i(v,w,x,u,o[p+7],B,4249261313);u=i(u,v,w,x,o[p+8],y,1770035416);x=i(x,u,v,w,o[p+9],z,2336552879);w=i(w,x,u,v,o[p+10],A,4294925233);v=i(v,w,x,u,o[p+11],B,2304563134);u=i(u,v,w,x,o[p+12],y,1804603682);x=i(x,u,v,w,o[p+13],z,4254626195);w=i(w,x,u,v,o[p+14],A,2792965006);v=i(v,w,x,u,o[p+15],B,1236535329);u=j(u,v,w,x,o[p+1],C,4129170786);x=j(x,u,v,w,o[p+6],D,3225465664);w=j(w,x,u,v,o[p+11],E,643717713);v=j(v,w,x,u,o[p+0],F,3921069994);u=j(u,v,w,x,o[p+5],C,3593408605);x=j(x,u,v,w,o[p+10],D,38016083);w=j(w,x,u,v,o[p+15],E,3634488961);v=j(v,w,x,u,o[p+4],F,3889429448);u=j(u,v,w,x,o[p+9],C,568446438);x=j(x,u,v,w,o[p+14],D,3275163606);w=j(w,x,u,v,o[p+3],E,4107603335);v=j(v,w,x,u,o[p+8],F,1163531501);u=j(u,v,w,x,o[p+13],C,2850285829);x=j(x,u,v,w,o[p+2],D,4243563512);w=j(w,x,u,v,o[p+7],E,1735328473);v=j(v,w,x,u,o[p+12],F,2368359562);u=k(u,v,w,x,o[p+5],G,4294588738);x=k(x,u,v,w,o[p+8],H,2272392833);w=k(w,x,u,v,o[p+11],I,1839030562);v=k(v,w,x,u,o[p+14],J,4259657740);u=k(u,v,w,x,o[p+1],G,2763975236);x=k(x,u,v,w,o[p+4],H,1272893353);w=k(w,x,u,v,o[p+7],I,4139469664);v=k(v,w,x,u,o[p+10],J,3200236656);u=k(u,v,w,x,o[p+13],G,681279174);x=k(x,u,v,w,o[p+0],H,3936430074);w=k(w,x,u,v,o[p+3],I,3572445317);v=k(v,w,x,u,o[p+6],J,76029189);u=k(u,v,w,x,o[p+9],G,3654602809);x=k(x,u,v,w,o[p+12],H,3873151461);w=k(w,x,u,v,o[p+15],I,530742520);v=k(v,w,x,u,o[p+2],J,3299628645);u=l(u,v,w,x,o[p+0],K,4096336452);x=l(x,u,v,w,o[p+7],L,1126891415);w=l(w,x,u,v,o[p+14],M,2878612391);v=l(v,w,x,u,o[p+5],N,4237533241);u=l(u,v,w,x,o[p+12],K,1700485571);x=l(x,u,v,w,o[p+3],L,2399980690);w=l(w,x,u,v,o[p+10],M,4293915773);v=l(v,w,x,u,o[p+1],N,2240044497);u=l(u,v,w,x,o[p+8],K,1873313359);x=l(x,u,v,w,o[p+15],L,4264355552);w=l(w,x,u,v,o[p+6],M,2734768916);v=l(v,w,x,u,o[p+13],N,1309151649);u=l(u,v,w,x,o[p+4],K,4149444226);x=l(x,u,v,w,o[p+11],L,3174756917);w=l(w,x,u,v,o[p+2],M,718787259);v=l(v,w,x,u,o[p+9],N,3951481745);u=d(u,q);v=d(v,r);w=d(w,s);x=d(x,t)}var O=n(u)+n(v)+n(w)+n(x);return O.toLowerCase()}

jQuery(document).ready(function(){		
		var h = jQuery(window).width();
		if(h<=980)
		{
			jQuery("#visualBlockHomePage .flash").css("width",980);
		}
		jQuery(window).resize(function(){
			var h = jQuery(window).width();
			if(h<=980)
			{
				jQuery("#visualBlockHomePage .flash").css("width",980);
			}else
			{
				jQuery("#visualBlockHomePage .flash").css("width","100%");
			}
		})
	});

$(function(){
	// rollover
	jQuery('.imgover').each(function(){
		this.osrc = jQuery(this).attr('src');
		this.rollover = new Image();
		this.rollover.src = this.osrc.replace(/(\.gif|\.jpg|\.png)/, "_o$1");
	}).hover(function(){
		jQuery(this).attr('src',this.rollover.src);
	},function(){
		jQuery(this).attr('src',this.osrc);
	});
	// scroll
	
});


jQuery(function(){
	setTimeout(function(){
    	if(jQuery(".flash2 .replacecontent").length <= 0 ){			
					jQuery("p.watchmovie").show();
		}
	},100);
	var w= jQuery("#Navigation .sub").each(function(){
		var w= jQuery(this).width();
		var t=false;								
		//if(t==true){jQuery(this).css("left",-l)};
	//jQuery("#Navigation .sub").css("left",-l);											
	})					
	jQuery("#Navigation .sub").hide();
	jQuery("#Navigation a ").hover(function(){
		jQuery(this).addClass("hover");										
	},function(){
		jQuery(this).removeClass("hover");		
	})
	jQuery("#Navigation > ul > li").hover(function(){
					
		if(jQuery(this).children(".sub").length>0)
		{
			jQuery(this).addClass("select");
			jQuery(this).children(".sub").addClass("show");
			jQuery(this).children(".sub").show();
		}
	},function(){
		jQuery("#Navigation .show").hide();
		jQuery(this).removeClass("select");
	})
	
	jQuery("#Navigation .sub").hover(function(){
		
	},function(){
		jQuery(this).hide();	
	})
})


jQuery(function(){
	jQuery(".Actions input").wrap("<p class='start'></p>");
	jQuery(".start input").hover(function(){jQuery(this).addClass("hover")},function(){jQuery(this).removeClass("hover");})
	jQuery(".Actions p.start:first").addClass("startF");
})

jQuery(function(){
	jQuery(".thixbox h2 span").click(function(){
		jQuery("#TB_closeWindowButton").click();									  
	})				
})

jQuery(function(){
	jQuery(".googleMap h2 span").click(function(){
		jQuery("#TB_closeWindowButton").click();									  
	})				
})



jQuery(function(){
	jQuery(".contactForm .field").each(function(){
		if(jQuery(this).find("textarea").length >0)
		{
			jQuery(this).addClass("textArea");
		}									 
	})
})



jQuery(function(){
	jQuery(".formCenter .contact .field").each(function(index){
	if(index <=2)
	{
		jQuery(this).addClass("leftClass");		
	}
		else
	{
		jQuery(this).addClass("rightClass");	
	}
	
	})

	jQuery(".leftClass").wrapAll("<div class='column2 left'><div class='field CompositeField  nolabel'>");
	jQuery(".rightClass").wrapAll("<div class='column2'><div class='field CompositeField  nolabel'>");
})

jQuery(function(){		
	jQuery(".mapContent .center_box").prepend('<iframe width="925" height="520" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=d&source=s_d&saddr=&daddr=Haerstraat+43+7573+AN+Oldenzaal&hl=nl&geocode=&mra=ls&sll=52.302391,6.946321&sspn=0.009998,0.026565&ie=UTF8&ll=52.309791,6.932416&spn=0.010023,0.026565&t=p&z=15"></iframe><br />')
})

function writeContent(id,link)
{
	jQuery(id).prepend('<iframe width="925" height="520" frameborder="0" scrolling="yes" marginheight="0" marginwidth="0" src="'+link+'"></iframe>');
}

function div(class1,class2,class3,content){
	return "<div class='"+class1+" "+class2+" "+class3+"'>"+content+"</div>"; 	
}

function h2(class1,class2,class3,content){
	return "<h2 class='"+class1+" "+class2+" "+class3+"'>"+content+"</h2>"; 	
}

function label(class1,class2,class3,content){
	return "<label class='"+class1+" "+class2+" "+class3+"'>"+content+"</label>"; 	
}

jQuery(function(){	
	   	setInterval(function() {
			if(jQuery(".sliderContent p.prev").css("opacity")=="0.4")
			{
				jQuery(".sliderContent p.prev").addClass("removeHand");
			}
			else
			{
				jQuery(".sliderContent p.prev").removeClass("removeHand");
			}
			
		}, 200);
		
			setInterval(function() {
			if(jQuery(".sliderContent p.next").css("opacity")=="0.4")
			{
				jQuery(".sliderContent p.next").addClass("removeHand");
			}
			else
			{
				jQuery(".sliderContent p.next").removeClass("removeHand");
			}
			
		}, 200);
})

//detect screen resolution 
//jQuery(document).ready(function() {
//	if ( screen.width <= 1024 ) {
//		jQuery("link[id=smallLayout]").attr({href : "themes/publisher/css/1024layout.css"});
//	}
//});


function label(clss,content){
	return "<label class="+clss+">"+content+"</label>";
}

jQuery(function(){
	window.scrollBy(0,0);				
	jQuery(window).load(function(){
		window.scrollBy(0,0);		
	})			
})

function sliderNext(length,left){	
	var ul=jQuery("#mycarousel ul");
	var curr=jQuery("#mycarousel ul").css("left").replace("px","");
	if(curr==-(length-950)||curr<=-(length-950)){
		curr = jQuery("#mycarousel ul").css("left","-950px");
	}
	
	jQuery(".sliderContent p.next").unbind('click');
	
	ul.animate({
		left: '-=190'		
  	}, 500, function () {
  		jQuery(".sliderContent p.next").bind('click', function() {
  			var length=jQuery("#mycarousel ul").width();
  			var left=jQuery("#mycarousel ul").css('left').replace("px","");
  			sliderNext(length, left);
  		});
  	});
};

function sliderNext2(length,left){	
	var ul=jQuery("#mycarousel ul");
	var curr=jQuery("#mycarousel ul").css("left").replace("px","");
	if(curr==-(length-490)||curr<=-(length-950)){
		curr = jQuery("#mycarousel ul").css("left","-490px");
	}
	
	jQuery(".sliderContent p.next").unbind('click');
	
	ul.animate({
		left: '-=165'		
  	}, 500, function () {
  		jQuery(".sliderContent p.next").bind('click', function() {
  			var length=jQuery("#mycarousel ul").width();
  			var left=jQuery("#mycarousel ul").css('left').replace("px","");
  			sliderNext(length, left);
  		});
  	});
};


function sliderPrev(length,left){
	
	var ul=jQuery("#mycarousel ul");
	var curr=jQuery("#mycarousel ul").css("left").replace("px","");
	var defaul=-(length-(950*2));
	if(curr==0||curr>0){
		curr=jQuery("#mycarousel ul").css("left",defaul);
	}
	
	jQuery(".sliderContent p.prev").unbind('click');
	
	ul.animate({
		left: '+=190'		
  	}, 500, function () {
  		jQuery(".sliderContent p.prev").bind('click', function() {
  			var length=jQuery("#mycarousel ul").width();
  	  		var left=jQuery("#mycarousel ul").css('left').replace("px","");
  	  		sliderPrev(length,left)
  		});  		
  	});
};

function sliderPrev2(length,left){
	
	var ul=jQuery("#mycarousel ul");
	var curr=jQuery("#mycarousel ul").css("left").replace("px","");
	var defaul=-(length-(490*2));
	if(curr==0||curr>0){
		curr=jQuery("#mycarousel ul").css("left",defaul);
	}
	
	jQuery(".sliderContent p.prev").unbind('click');
	
	ul.animate({
		left: '+=165'		
  	}, 500, function () {
  		jQuery(".sliderContent p.prev").bind('click', function() {
  			var length=jQuery("#mycarousel ul").width();
  	  		var left=jQuery("#mycarousel ul").css('left').replace("px","");
  	  		sliderPrev(length,left)
  		});  		
  	});
};


