

;

/* *	jQuery youtube homepage *	copyright 2009 * *	@author 	Boy van Amstel *	@version 	1.0 * *	Usage: *	// Load youtube_homepage class *	$(".youtube").youtube_homepage({ defaultSize: "m", movieList: ".youtube_thumb_list", bigImage: ".fofolog_big" }); * *	Minimal setup: *	$(".youtube").youtube_homepage(); * *	Changes 1.0: *	[23/09/2009]	- First release  */ jQuery.youtube_homepage = {	build : function(options) {		try {			jQuery(this).log("Class loaded", "info", "jQuery.youtube_homepage");				// Default settings			var defaults = {				moviePlayer: ".youtube_player",				movieList: ".youtube_thumb_list",				movieTitle: ".youtube_title_main",				width: 480,				height: 340			}				// Move to options			var options = jQuery.extend(defaults, options);				var object = this;				// When the thumbnails are clicked			jQuery(object).find(options.movieList + " li a").unbind("click").click(function() {								// Get current values								var movieUrl =  jQuery(this).attr("href");				var movieUrlSplit = movieUrl.split("?v=");				var movieCode = movieUrlSplit[1];								var movieTitle = jQuery(this).parents("li").find("h3").html();								//var movie = '<object type="application/x-shockwave-flash" data="http://www.youtube-nocookie.com/v/' + movieCode + '&amp;hl=nl&amp;fs=1&amp;showsearch=0" width="' + options.width + '" height="' + options.height + '">';				//movie += '<param name="movie" value="http://www.youtube-nocookie.com/v/' + movieCode + '&amp;hl=nl&amp;fs=1&amp;showsearch=0" />';				//movie += '<param name="allowFullScreen" value="true"></param>';				//movie += '<param name="allowscriptaccess" value="always"></param>';				//movie += '<param name="wmode" value="opaque"></param>';				//movie += '</object>';								var wmodeadd = false;												jQuery(this).parent().find(".youtube_thumb_content param").each(function(){																	if(jQuery(this).attr("name") == "wmode"){																	wmodeadd = true;						jQuery(this).attr("value","opaque");					}				});								if(wmodeadd == false){										jQuery(this).parent().find(".youtube_thumb_content object").append('<param name="wmode" value="opaque"></param>');								}								jQuery(this).parent().find(".youtube_thumb_content embed").attr("wmode","opaque");								var movie = jQuery(this).parent().find(".youtube_thumb_content").html();								//alert(movie);																jQuery(object).find(options.moviePlayer).html(movie);				jQuery(object).find(options.movieTitle).html(movieTitle);								return false;			});			$(".youtube_thumb_list").children("li").eq(0).children("a").eq(0).click();			}		catch(err) {			jQuery(this).log(err.toString(), "error", "jQuery.youtube_homepage");		}			}};jQuery.fn.extend({		youtube_homepage: jQuery.youtube_homepage.build});	jQuery(function() {	// Attach to youtubes on the homepage	jQuery(".youtube_homepage").youtube_homepage();});

;

/* *	News cover *	copyright 2009 * *	@author 	Boy van Amstel *	@version 	1.0 * *	Usage: *	$("#news_cover").newscover({ title: "jQuery.newscover", effectSpeed: 750, rotationTimeOut: 3000, mouseOverTimeout: 5000 }); * *	Minimal setup: *	$("#news_cover").newscover(); * *	Changes 1.0: *	[11/09/2009]	- First release */jQuery.newscover = {	build : function(options) {		try {			// Default settings			var defaults = {				title: "jQuery.newscover",				effectSpeed: 750,				rotationTimeout: 3000,				mouseOverTimeout: 5000			}			// Move to options			var options = jQuery.extend(defaults, options);						// Variables			var object = this;			var index = 0;			var mouseOver = false;			var mouseOverCheck = false;			var mouseOverCounter = 0;			jQuery(this).log("Class loaded", "info", options.title);			/*			 *	Setup			 */			changeImage();			/*			 *	Mouse actions			 */			// Hover over buttons event 			jQuery(object).hover(function() {				// Set the mouseOver variables to true and 0				mouseOver = true;				mouseOverCheck = true;				mouseOverCounter = 0;			}, function() {				mouseOver = false;				mouseOverCounter = 0;			});			// Hover over buttons event 			jQuery(object).find(".list_news_cover li").hover(function() {				// Get the index of the current selection				index = jQuery(object).find(".list_news_cover li").index(this);								// Change the image				changeImage();			}, function() {			});			/*  			 *	Automatic rotation 			 */ 			 			// Rotate			jQuery(object).everyTime(options.rotationTimeout, "rotation", function() {				// Only if the mouse isn't over the images				if(mouseOverCheck == false) {					// Set the index to that of the next button					index++;					// Check if the index is in reach					if(index >= jQuery(object).find(".list_news_cover li").length) index = 0;					// Change the image					changeImage();				}			});			// MouseOver check			jQuery(object).everyTime(options.mouseOverTimeout/10, function() {				// If the mouse isn't over anymore and the check is still running				if(mouseOver == false && mouseOverCheck == true) {					mouseOverCounter++;				}				// Counter log				//jQuery(object).log(mouseOverCounter, "info", "MouseOverCounter");								// If the mouse isn't over and the counter reacher 10, enable auto rotation				if(mouseOver == false && mouseOverCounter >= 10) {					mouseOverCheck = false;					mouseOverCounter = 0;				}			});		}		catch(err) {			jQuery(this).log("Error during loading - " + err, "error", options.name);		}		function changeImage() {			// Remove active class			jQuery(object).find(".list_news_cover li a").removeClass("active");			// Add active class to current selection			jQuery(object).find(".list_news_cover li:eq(" + index + ") a").addClass("active");			// Hide all images			jQuery(object).find(".list_news_cover_images li").stop(true, true);			jQuery(object).find(".list_news_cover_images li").hide();			// Show selected image			jQuery(object).find(".list_news_cover_images li:eq(" + index + ")").fadeIn(options.effectSpeed);			/*			// Hide description			jQuery(object).find(".list_news_cover_images li:eq(" + index + ") .description").slideUp(0);			// Slide up description			jQuery(object).find(".list_news_cover_images li:eq(" + index + ") .description").slideDown(options.effectSpeed*2);			*/		}		return this;	}};jQuery.fn.extend({		newscover: jQuery.newscover.build});jQuery(function() {jQuery("#news_cover").newscover();jQuery("#acties_switcher").newscover();});
