

;

/* *	jQuery nowplaying *	copyright 2009 * *	@author 	Boy van Amstel *	@version 	1.0 * *	Usage: *	$(".nowplaying").nowplaying({ showImages: true, imageLoading: "someimage.gif", imageRefresh: "someimage.gif", refreshTimeout: 10000, url: "somefile.xml" }); * *	Minimal setup: *	$(".nowplaying").nowplaying(); * *	Changes 1.0: *	[02/10/2009]	- First release  */ jQuery.nowplaying = {	build : function(options) {		try {					jQuery(this).log("Class loaded", "info", "jQuery.nowplaying");				// Default settings			var defaults = {				showImages: true,				imageLoading: "/static/img/loading-small.gif",				imageRefresh: "/static/img/refresh-small.gif",				refreshTimeout: 15000,				url: "/data/cache/xml/nowplaying.xml"			}				// Move to options			var options = jQuery.extend(defaults, options);				var object = this;					// Rotate			jQuery(object).everyTime(options.refreshTimeout, "refresh", function() {								updateFields();						});						if(options.showImages) {				jQuery(object).append('<img src="' + options.imageRefresh + '" alt="Refresh" class="nowplaying_interaction" />');			}			jQuery(object).find(".nowplaying_interaction").unbind("click").click(function() {				updateFields();								return false;			});					function updateFields() {				jQuery(object).find(".nowplaying_interaction").attr("src", options.imageLoading);								$.ajax({					type: "GET",					url: options.url,					dataType: "xml",					success: function(xml) {						jQuery(object).find(".artist").html(jQuery(xml).find("artist").text());						jQuery(object).find(".track").html(jQuery(xml).find("track").text());						jQuery(object).find(".nowplaying_interaction").attr("src", options.imageRefresh);					}				});						}						updateFields();					}		catch(err) {			jQuery(this).log(err.toString(), "error", "jQuery.nowplaying");		}		return this;			}};jQuery.fn.extend({		nowplaying: jQuery.nowplaying.build});	jQuery(function() {	// Attach to fotologs on the homepage	if(jQuery(".nowplaying").length > 0)	jQuery(".nowplaying").nowplaying();});

;

/* *	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();});

;

/* *	jQuery fotolog homepage *	copyright 2009 * *	@author 	Boy van Amstel *	@version 	1.0 * *	Usage: *	// Load fotolog_homepage class *	$(".fotolog").fotolog_homepage({ defaultSize: "m", thumbList: ".fotolog_thumb_list", bigImage: ".fofolog_big" }); * *	Minimal setup: *	$(".fotolog").fotolog_homepage(); * *	Changes 1.0: *	[18/09/2009]	- First release  */ jQuery.fotolog_homepage = {	build : function(options) {		try {			jQuery(this).log("Class loaded", "info", "jQuery.fotolog_homepage");				// Default settings			var defaults = {				defaultSize: "m",				thumbList: ".fotolog_thumb_list",				bigImage: ".fotolog_big"					}				// Move to options			var options = jQuery.extend(defaults, options);				var object = this;				// When the thumbnails are clicked			jQuery(object).find(options.thumbList + " li a").unbind("click").click(function() {								// Get current values				var imageUrl =  jQuery(this).find("img").attr("src");				var href = jQuery(this).attr("href");				var title = jQuery(this).attr("title");				var alt = jQuery(this).find("img").attr("alt");								// Change to a different size (Flickr)				var newImageUrl = imageUrl.replace("_s.jpg", "_" + (options.defaultSize + ".jpg"));								// Apply the new image				jQuery(object).find(options.bigImage + " img").attr("src", newImageUrl);				jQuery(object).find(options.bigImage + " img").attr("alt", alt);				jQuery(object).find(options.bigImage + " img").attr("title", title);								jQuery(object).find(options.bigImage + " a").attr("href", href);				return false;			});			}		catch(err) {			jQuery(this).log(err.toString(), "error", "jQuery.fotolog_homepage");		}			}};jQuery.fn.extend({		fotolog_homepage: jQuery.fotolog_homepage.build});	jQuery(function() {	// Attach to fotologs on the homepage	jQuery(".fotolog_homepage").fotolog_homepage();});
