try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}


Cufon.replace('h1');


function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}		

var animate = readCookie("flashIslandMini")
var boolAnim = true;

if(animate) boolAnim = false;
else document.cookie = "flashIslandMini=true; path=/";

$(function(){
	var pageLang = ($('body').attr('class') == "lang-en") ? "en" : "fr";
	swfobject.embedSWF("/App_Themes/GreenBin/_flash/gbisland02mini.swf", "island-mini", "300", "200", "9.0.0", "", {
		xmlConfigFilePath: "/App_Themes/GreenBin/_flash/xmlConfig/gb-islandConfig-mini1-"+pageLang+".xml",
		animate: boolAnim
	}, {
		allowScriptAccess: "always",
		quality: "high",
		wmode: "transparent"
	});	
});


/* Capture mouse movement events and report back to Flash island movie so
that it will animate. 
$(function(){
	$('#page').mousemove(function(e){
		var coords = e.pageX + "," + e.pageY;
		mouseCoords(coords);
	});
});
*/

/*
Ensure all third-party sites open up in a new browser window.

$(function(){
	$('#body a, #sidebar-right a').click(function(){
		var currHref = $(this).attr('href');
		var currHost = document.location.host;
		
		if(currHref.indexOf('http') < 0) return true;
		
		if(currHref.indexOf(currHost) < 0)
		{
			var newWindow = window.open(currHref, '_blank');
			newWindow.focus();
			return false;
		}
		else
		{
			return true;
		}
	});
});
*/