
/* Initialisation
----------------------------------------------------------------------------------------------------------------------*/
function initialisation(lang){
	initialisation_hash();
	
	initialisation_resize();
	var flashvars = {
			lang: lang,
			ie: $.browser.msie
		 };
	var params = {
			menu: "false",
			scale: "noscale",
			salign: "tl",
			allowfullscreen: "true",
			seamlesstabbing: "true",
            swliveconnect: "true",
            allowscriptaccess: "always",
            allownetworking: "all",
			/*wmode: "opaque",*/
			bgcolor: "#000000"
		 };
	var attributes = {
			id: "youTube",
            name: "youTube",
			align: "left"
		};
	swfobject.embedSWF("/core/swf/index.swf?lang="+lang+"&ie="+$.browser.msie, "flash", "100%", "750", "9", "", flashvars, params, attributes);

}

function addthis(url, title){
	var u = "http://www.addthis.com/bookmark.php?v=250&url="+encodeURIComponent(url)+"&title="+encodeURIComponent(title);
	var n = "addthispopup";
	var vars = "width=330,height=381";
	var w = window.open(u,n,vars);
	w.focus();
}

function initialisation_resize(){
	if(document.documentElement.clientHeight != undefined){
		var height = document.documentElement.clientHeight;
	}else if(window.innerHeight != undefined){
		var height = window.innerHeight;
	}else{
		var height = document.body.clientHeight;
	}
	
	if(document.documentElement.clientWidth != undefined){
		var width = document.documentElement.clientWidth;
	}else if(window.innerWidth != undefined){
		var width = window.innerWidth;
	}else{
		var width = document.body.clientWidth;
	}
	
	var iMinWidth = 990; //put here the minimal width
	var iMinHeight = 850; // put here the minimal height
	var iMaxHeight = 1000;
	var iMaxWidth = 1280;
	
	width = (width > iMaxWidth) ? iMaxWidth : width;
	height = (height > iMaxHeight) ? iMaxHeight : height;
	  
	width = (width < iMinWidth) ? iMinWidth : width;
	height = (height < iMinHeight) ? iMinHeight : height;
	
	/*if(width < 990){
		document.getElementById("flashcontent").style.width = "990px";	
		if(document.getElementById("flash")) document.getElementById("flash").style.width = "990px";	
	}else{
		if(document.getElementById("flash")) document.getElementById("flash").style.width = width+"px";
		document.getElementById("flashcontent").style.width = width+"px";	
	}*/
	
	if(document.getElementById("flash")) document.getElementById("flash").style.width = width+"px";
	document.getElementById("flashcontent").style.width = width+"px";
	
}

function initialisation_hash(){
	
}

/* Youtube
----------------------------------------------------------------------------------------------------------------------*/
var swfName = "youTube";

function sendToAS2(){
	if(movieByName(swfName)) movieByName(swfName).receieveAS2(arguments[0]);
	if(movieById(swfName)) movieById(swfName).receieveAS2(arguments[0]);
}
function sendToAS3(){
	if(movieByName(swfName)) movieByName(swfName).recieveAS3(arguments[0]);
	if(movieById(swfName)) movieById(swfName).recieveAS3(arguments[0]);
}
function isExternalAvailable(){
	return true;
}
function movieById(id){
	return document.getElementById(id);
}
function movieByName(name){
	return (navigator.appName.indexOf("Microsoft") != -1)?window[name]:document[name];
}
