/* -------------------------------------------------------------------

	Boondoggle - Hans Dreesen
	Coca Cola
	
	This JavaScript file collects all general functions used
	throughout the site, as well as some smaller specific
	functions.

------------------------------------------------------------------- */



// when the document is ready to be traversed and manipulated...
$(document).ready(function(){
	var popupWidth = 800;
	var popupHeight = 600;
	$("a[class*=popup]").each(function(){
		var className = $(this).attr("class");
		var popupClass = className.match(/popup\d+x\d+/);
		if (popupClass) {
			var popupDimensions = popupClass.toString().match(/\d+x\d+/)
			popupWidth = popupDimensions.toString().split("x")[0];
			popupHeight = popupDimensions.toString().split("x")[1];
		}

		$(this).click(function(){
			window.open($(this).attr("href"), "cocacolaPopup","toolbar=0, status=0, width=" + popupWidth + ", height=" + popupHeight);
			return false;
		});
	});
});





// generic functions
function plaatsTijdlijn(sfilenaam) {
	// plaatst de tijdlijn.swf op de plaats waar het script aangeroepen wordt binnen HTML
	with (document) {
		write ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="330" HEIGHT="120" id="tijdlijn" ALIGN="">');
	 	write ('<PARAM NAME=movie VALUE="swf/tijdlijn.swf?datafile='+sfilenaam+'">');
		write ('<PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF>');
		write ('<EMBED src="swf/tijdlijn.swf?datafile='+sfilenaam+'" quality=high bgcolor=#FFFFFF  WIDTH="330" HEIGHT="120" NAME="tijdlijn" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>');
	}
}
