function init() {
	// quit if this function has already been called
	if (arguments.callee.done) return;

	var versionIsValid = false;
	
	// flag this function so we don't do the same thing twice
	arguments.callee.done = true;
	try
	{
		 //check if version is valid, if so
		versionIsValid = swfobject.hasFlashPlayerVersion("10");
	} catch(err) {
	     //Handle errors here
	}

	
	
	//see if there is a hash present in the address bar
	var hash = (/#/g.test(location.href));

	if (versionIsValid) {
		enable();
	} else {
	    document.getElementsByTagName("html")[0].className += " expressInstall";
	}
	
	
	
	/**
	 * The magic. If either of the following scenarios, trigger the redirect:
	 * 1. Flash is installed and is the correct version, but no anchor is found.
	 * 2. An anchor is present, but Flash is not installed or not the correct version.
	 */
	if ((!hash && versionIsValid) || (hash && !versionIsValid)) {
		document.getElementsByTagName("html")[0].className += " hideContent";
		var link = redirect(hash);
		location.replace(link);
	}
};


function enable() {
	document.getElementsByTagName("html")[0].className += " enableFlash";
}

function redirect(hash){
	//parse the address
	var protocol = location.protocol + "//", host = location.host, path = location.href.split(host)[1];
	
	//sent to homepage if path is empty
	if (path == "/" || path == "/#") {
		return "/";
	}
	
	if (path.indexOf("islands") != -1)
		path = "/islands/"+ id;
	else
		path = "/houses/" +  id;
	
	return (protocol + host + (hash ? "" : "/#") + path);
}