// CUFON
Cufon.replace('section#productInfo a.cta,', {hover: true});
Cufon.replace('h1, h2, div.slide h3, h4, a.leesverder, article a.cta, section a.cta, ul.sloepen li a h4, ul li h5, section#text ul li', { fontFamily: 'Frutiger' });

$(function(){
	$("article a.cta, section a.cta").each(function(){
		$(this).after("<div class=\"clear\"></div>")/*.prepend("<span></span>")*/;
	});
});

$(function(){
	$("section#text ul li:odd").addClass("odd");
	$("article table tr:odd, section table tr:odd").addClass("odd");
	$("article table tr:even, section table tr:even").addClass("even");
});

// CYCLE PLUGIN (advanced)
$(function() {
	$('.slideshow').each(function(i){
		$(this).cycle({ 
			fx:            'scrollHorz',
			speed:         2000,
			/*timeout:       0,*/
			easeIn:        'easeOutExpo',
			easeOut:       'easeOutExpo',
			pager:         '.page',
			cleartype:     true,
			cleartypeNoBg: true
		});
	});
});

$(function() {
	$('section#cycle').mouseover(function() {
		$('.slideshow').cycle('pause'); 
	}).mouseout(function() {
		$('.slideshow').cycle('resume'); 
	});
});


// MENU
$(function(){
	$("ul.subnav").parent().append("<span></span>");
	$("ul.topnav li a, ul.topnav li span") .mouseover(function() {
		$(this).parent().find("ul.subnav").slideDown('fast').show();
		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav").slideUp('medium');
		});
		}).hover(function() { 
			$(this).addClass("subhover");
		}, function(){
			$(this).removeClass("subhover");
	});
});

// GALLERY 
$(function() {
	 $("div.scrollable").scrollable();
});

$(function() {
	$(".items img").click(function() {
		var url = $(this).attr("big");
		var $wrap = $("#image_wrap");

		if ($(this).attr("type") == "video") {

			$wrap.find("img").hide();
			$wrap.find("video, embed, object").remove();
			
			var v = document.createElement('video');
			var bVideo = !!(v.canPlayType && v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/, ''));
			
			if (bVideo && $(this).attr("video").indexOf(".mp4") >= 0) {
				$("<video src=\"" + $(this).attr("video") + "\" controls poster=\"" + url + "\"></video>").appendTo($wrap);
			} else {
				$("<OBJECT name=\"" + $(this).attr("flash") + "\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"630\" align=\"middle\" height=\"310\"><PARAM NAME=\"Movie\" VALUE=\"" + $(this).attr("flash") + "\"><PARAM NAME=\"Src\" VALUE=\"" + $(this).attr("flash") + "\"><PARAM NAME=\"WMode\" VALUE=\"Window\"><PARAM NAME=\"Play\" VALUE=\"0\"><PARAM NAME=\"Loop\" VALUE=\"0\"><PARAM NAME=\"Quality\" VALUE=\"High\"><PARAM NAME=\"SAlign\" VALUE=\"LT\"><PARAM NAME=\"Menu\" VALUE=\"-1\"><PARAM NAME=\"Base\" VALUE=\"\"><PARAM NAME=\"AllowScriptAccess\" VALUE=\"always\"><PARAM NAME=\"Scale\" VALUE=\"NoScale\"><PARAM NAME=\"DeviceFont\" VALUE=\"0\"><PARAM NAME=\"EmbedMovie\" VALUE=\"0\"><PARAM NAME=\"BGColor\" VALUE=\"\"><PARAM NAME=\"SWRemote\" VALUE=\"\"><PARAM NAME=\"MovieData\" VALUE=\"\"><PARAM NAME=\"SeamlessTabbing\" VALUE=\"1\"><PARAM NAME=\"Profile\" VALUE=\"0\"><PARAM NAME=\"ProfileAddress\" VALUE=\"\"><PARAM NAME=\"ProfilePort\" VALUE=\"0\"><PARAM NAME=\"AllowNetworking\" VALUE=\"all\"><PARAM NAME=\"AllowFullScreen\" VALUE=\"true\"><embed width=\"630\" height=\"310\" align=\"middle\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" menu=\"true\" name=\"" + $(this).attr("flash") + "\" bgcolor=\"\" devicefont=\"false\" wmode=\"window\" scale=\"noscale\" loop=\"false\" play=\"false\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" quality=\"high\" src=\"" + $(this).attr("flash") + "\"></OBJECT>").appendTo($wrap);
			}
			

		} else {
			var img = new Image();
			img.onload = function() {
				$wrap.fadeTo("fast", 1);
				$wrap.find("img").show();
				$wrap.find("video, embed, object").remove();
				$wrap.find("img").attr("src", url);
			};
			img.src = url;
		}
	}).filter(":first").click();
	$(".items span").click(function() {
		$(this).siblings("img").click();
	});
});


$(function() {
	$(".mapDot").tooltip({ 
		effect: 'toggle',
		delay: 40,
		offset: [5, 30],
		relative: true
	}); 
});

// SHADOWBOX
Shadowbox.init({
	animate: true,
	fadeDuration: 1,
	overlayOpacity: 0.7,
	modal: false
});


