/**
 *
 * @access public
 * @return void
 **/
function popupCredits(lang){
	var width = 450;
	var height = 500;
	var left = parseInt((screen.availWidth/2) - (width/2));
	var top = parseInt((screen.availHeight/2) - (height/2));
	var url="credits_"+lang+".html";
	var windowFeatures = "width=" + width + ",height=" + height + ",status=no,resizable=1,scrollbars=yes,menubar=no,location=no,directories=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
	myWindow = window.open(url, "subWind", windowFeatures);
	//window.open('credits_'+lang+'.html','terms','width=450,height=500,toolbar=no, menubar=no, scrollbars=yes, resizable=1, location=no, directories=no, status=no');
}

/**
 *
 * @access public
 * @return void
 **/
function popupContacts(lang){
	var width = 450;
	var height = 500;
	var left = parseInt((screen.availWidth/2) - (width/2));
	var top = parseInt((screen.availHeight/2) - (height/2));
	var url="contacts_"+lang+".html";
	var windowFeatures = "width=" + width + ",height=" + height + ",status=no,resizable=1,scrollbars=yes,menubar=no,location=no,directories=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
	myWindow = window.open(url, "subWind", windowFeatures);
	//window.open('contacts_'+lang+'.html','contacts','width=450,height=500,toolbar=no, menubar=no, scrollbars=yes, resizable=1, location=no, directories=no, status=no');
}

/**
 *
 * @access public
 * @return void
 **/
function popupPrivacy(lang){
	var width = 450;
	var height = 500;
	var left = parseInt((screen.availWidth/2) - (width/2));
	var top = parseInt((screen.availHeight/2) - (height/2));
	var url="privacy_"+lang+".html";
	var windowFeatures = "width=" + width + ",height=" + height + ",status=no,resizable=1,scrollbars=yes,menubar=no,location=no,directories=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
	myWindow = window.open(url, "subWind", windowFeatures);
	//window.open('privacy_'+lang+'.html','privacy','width=450,height=500,toolbar=no, menubar=no, scrollbars=yes, resizable=1, location=no, directories=no, status=no');
}

/**
 *
 * @access public
 * @return void
 **/
function popupAUT(){
	var width = 470;
	var height = 230;
	var left = parseInt((screen.availWidth/2) - (width/2));
	var top = parseInt((screen.availHeight/2) - (height/2));
	var url="player_automator.html";
	var windowFeatures = "width=" + width + ",height=" + height + ",status=no,resizable=1,scrollbars=no,menubar=no,location=no,directories=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
	myWindow = window.open(url, "subWind", windowFeatures);
	//window.open('player_automator.html','player','width=470,height=230,toolbar=no, menubar=no, scrollbars=no, resizable=1, location=no, directories=no, status=no');
}

/**
 *
 * @access public
 * @return void
 **/
function popupLY(){
	var width = 470;
	var height = 230;
	var left = parseInt((screen.availWidth/2) - (width/2));
	var top = parseInt((screen.availHeight/2) - (height/2));
	var url="player_liveyoung.html";
	var windowFeatures = "width=" + width + ",height=" + height + ",status=no,resizable=1,scrollbars=no,menubar=no,location=no,directories=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
	myWindow = window.open(url, "subWind", windowFeatures);
	//window.open('player_liveyoung.html','player','width=470,height=230,toolbar=no, menubar=no, scrollbars=no, resizable=1, location=no, directories=no, status=no');
}

function share(network, version){
	u=window.location.hash.toString();
	code_video='';

	e=u.split("/");
	l=e.pop();

	if(l=='video-1'){
		// film
		if (version=='fr') {
			code_video='hOs0rajQTyM';
			u='http://www.youtube.com/watch?v=hOs0rajQTyM';
		}else {
			code_video='XQcVllWpwGs';
			u='http://www.youtube.com/watch?v=XQcVllWpwGs';
		}
		
	}else if(l=='video-2'){
		// teaser 1
		if (version=='fr') {
			code_video='MLUJdpDfXZA';
			u='http://www.youtube.com/watch?v=MLUJdpDfXZA';
		}else {
			code_video='MLUJdpDfXZA';
			u='http://www.youtube.com/watch?v=MLUJdpDfXZA';
		}
		
	}else if(l=='video-3'){
		// teaser 2
		if (version=='fr') {
			code_video='9a64ySqzM8Y';
			u='http://www.youtube.com/watch?v=9a64ySqzM8Y';
		}else {
			code_video='9a64ySqzM8Y';
			u='http://www.youtube.com/watch?v=9a64ySqzM8Y';
		}
		
	}else if(l=='video-4'){
		// casting
		if (version=='fr') {
			code_video='J7x_rh4-ruk';
			u='http://www.youtube.com/watch?v=J7x_rh4-ruk';
		}else {
			code_video='J7x_rh4-ruk';
			u='http://www.youtube.com/watch?v=J7x_rh4-ruk';
		}
		
	}else if(l=='video-5'){
		// interview
		if (version=='fr') {
			code_video='HQe3kQxogF8';
			u='http://www.youtube.com/watch?v=HQe3kQxogF8';
		}else {
			code_video='TO4b2ZeVEaM';
			u='http://www.youtube.com/watch?v=TO4b2ZeVEaM';
		}
		
	}else if(l=='video-6'){
		// backstage
		if (version=='fr') {
			code_video='uQXD9sx-i0A';
			u='http://www.youtube.com/watch?v=uQXD9sx-i0A';
		}else {
			code_video='uQXD9sx-i0A';
			u='http://www.youtube.com/watch?v=uQXD9sx-i0A';
		}
		
	}

	t=encodeURIComponent(document.title);
	u=encodeURIComponent(u);
	u1=encodeURIComponent(window.location);
	if(network=='facebook'){
		url='http://www.facebook.com/sharer.php?u='+u+'&t='+t;
	}else if(network=='bebo'){
		url='http://www.bebo.com/c/share?Url='+u+'&Title='+t;
	}else if (network=='myspace') {
		url='http://www.myspace.com/Modules/PostTo/Pages/?u='+u1+'&t='+t+'&c='+"%3Cobject%20width%3D%22425%22%20height%3D%22355%22%3E%3Cparam%20name%3D%22movie%22%20value%3D%22http%3A//www.youtube.com/v/"+code_video+"%26hl%3Den%26rel%3D0%22%3E%3C/param%3E%3Cembed%20src%3D%22http%3A//www.youtube.com/v/"+code_video+"%26hl%3Den%26rel%3D0%22%20type%3D%22application/x-shockwave-flash%22%20width%3D%22425%22%20height%3D%22355%22%3E%3C/embed%3E%3C/object%3E&u=http%3A//www.youtube.com/watch%3Fv%3D"+code_video+"&l=1";
	}
	window.open(url,'share_'+network,'width='+screen.width+',height='+screen.height);
}