$(document).ready(function() {

	// Contact
	var s="=b!isfg>#nbjmup;gfshvtpoAbobdzdmptjt/psh#?gfshvtpoAbobdzdmptjt/psh=0b?";
	m=""; 
	for (i=0; i<s.length; i++) 
		m+=String.fromCharCode(s.charCodeAt(i)-1); 
	$(".contact").html(m);

	// If not mobile, go Flash
	var is_mobile = (navigator.userAgent.toLowerCase().indexOf('mobile') != -1);
	if (!is_mobile) {

		var flashvars = {};
			
		var params = {
			menu: 'false',
			allowScriptAccess: 'always',
			WMODE: 'transparent'
		};
		
		var attributes = {
			id: 'anacyclosis',
			name: 'anacyclosis'
		};
		
		// Clone and hide content
		$("#page").clone().insertAfter("#page").hide();

		// Show flash
		swfobject.embedSWF('/design/anacyclosis.net.swf', 'page', '800', '550', '9.0.0', '', flashvars, params, attributes);
				
	}
	else {
		$("#page").css("padding-top","0px");
	}
	
});

function getFlashMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}

function requestTextFromJavaScript(id) {
	//var htmlContent = encodeURIComponent($("#"+id).html());
	var htmlContent = $("#"+id).html();
	getFlashMovie("anacyclosis").sendTextToFlash(htmlContent);
}
