
var etat_register=0;
var etat_spell_list=0;
var dep_ok=0;


//detection du plugin flash
var contentVersion = 7;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
 var words = navigator.plugins["Shockwave Flash"].description.split(" ");
 for (var i = 0; i < words.length; ++i)
 {
 if (isNaN(parseInt(words[i])))
 continue;
 var PluginVersion = words[i]; 
 }
 var FlashCanPlay = PluginVersion >= contentVersion;
 }
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
&& (navigator.appVersion.indexOf("Win") != -1)) {
 document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
 document.write('on error resume next \n');
 document.write('FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & contentVersion)))\n');
 document.write('</SCR' + 'IPT\> \n');
 }
// fin detection plugin flash


function largeur_fenetre()
{
 if (window.innerWidth) return window.innerWidth;
 else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
 else return 0;
}

function hauteur_fenetre()
{
 if (window.innerHeight) return window.innerHeight  ;
 else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
 else if (screen.Height) return (screen.Height-190);
 else return 0;
}

function header(langue, theme) {

// resultat player flash ok
  if ( FlashCanPlay ) {
 	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='995' height='190'>");
	document.write("\n        <param name=movie value='anims/header.swf?lang=" + langue + "'>");
	document.write("\n        <param name='wmode' value='transparent'>");
	document.write("\n        <param name='allowScriptAccess' value='always'>");
	document.write("\n        <param name=quality value=high>");
	document.write("\n        <param name='flashvars' value='lang=" + langue + "&theme=" + theme + "'>");
	document.write("\n        <embed src='anims/header.swf?lang=" + langue + "&theme=" + theme + "' wmode='transparent' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' swLiveConnect='true' width='995' height='190'>");
	document.write("\n        </embed>\n");
	document.write("\n      </object>\n"); 
 } 
 // resultat pas de player flash
 else{
	document.write("\n <div class='noflash'><div id='logoflash'><a href='http://www.adobe.com/go/getflashplayer' target='blank'><img src='img/flashdetect_logo.jpg' border='0'></a></div>");
	document.write("\n <div class='noflash_texte'>This site requires the latest version of Adobe Flash Player and JavaScript enabled.<br />Click the link below to upgrade your version of Flash.<br>");
	document.write("\n <a href='http://www.adobe.com/go/getflashplayer' target='blank'>DOWNLOAD</a></div>");
 }
 
}

function home_enavant(langue) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='450' height='323'>");
	document.write("\n        <param name=movie value='anims/enavant_" + langue + ".swf'>");
	document.write("\n        <param name='wmode' value='transparent'>");
	document.write("\n        <param name='allowScriptAccess' value='always'>");
	document.write("\n        <param name=quality value=high>");
	document.write("\n        <embed src='anims/enavant_" + langue + ".swf' wmode='transparent' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' swLiveConnect='true' width='450' height='323'>");
	document.write("\n        </embed>\n");
	document.write("\n      </object>\n");
}

function bloc_tmuf(langue) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='259' height='280'>");
	document.write("\n        <param name=movie value='anims/bloc_tmuf_" + langue + ".swf'>");
	document.write("\n        <param name='wmode' value='transparent'>");
	document.write("\n        <param name='allowScriptAccess' value='always'>");
	document.write("\n        <param name=quality value=high>");
	document.write("\n        <param name=loop value=true>");
	document.write("\n        <embed src='anims/bloc_tmuf_" + langue + ".swf' wmode='transparent' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' swLiveConnect='true' width='259' height='280'>");
	document.write("\n        </embed>\n");
	document.write("\n      </object>\n");
}

function bloc_tm() {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='259' height='241'>");
	document.write("\n        <param name=movie value='anims/bloc_tm.swf'>");
	document.write("\n        <param name='wmode' value='transparent'>");
	document.write("\n        <param name='allowScriptAccess' value='always'>");
	document.write("\n        <param name=quality value=high>");
	document.write("\n        <param name=loop value=true>");
	document.write("\n        <embed src='anims/bloc_tm.swf' wmode='transparent' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' swLiveConnect='true' width='259' height='241'>");
	document.write("\n        </embed>\n");
	document.write("\n      </object>\n");
}

function nav_environnements() {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='493' height='128'>");
	document.write("\n        <param name=movie value='anims/bloc_enviro.swf'>");
	document.write("\n        <param name='wmode' value='transparent'>");
	document.write("\n        <param name='allowScriptAccess' value='always'>");
	document.write("\n        <param name=quality value=high>");
	document.write("\n        <embed src='anims/bloc_enviro.swf' wmode='transparent' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' swLiveConnect='true' width='493' height='128'>");
	document.write("\n        </embed>\n");
	document.write("\n      </object>\n");
}

function home_video_of_the_week() {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='229' height='163'>");
	document.write("\n        <param name=movie value='anims/video_of_the_week.swf'>");
	document.write("\n        <param name='wmode' value='transparent'>");
	document.write("\n        <param name='allowScriptAccess' value='always'>");
	document.write("\n        <param name=quality value=high>");
	document.write("\n        <embed src='anims/video_of_the_week.swf' wmode='transparent' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' swLiveConnect='true' width='229' height='163'>");
	document.write("\n        </embed>\n");
	document.write("\n      </object>\n");
}

function home_bloc_jeux() {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='493' height='130'>");
	document.write("\n        <param name=movie value='anims/bloc_jeux.swf'>");
	document.write("\n        <param name='wmode' value='transparent'>");
	document.write("\n        <param name='allowScriptAccess' value='always'>");
	document.write("\n        <param name=quality value=high>");
	document.write("\n        <embed src='anims/bloc_jeux.swf' wmode='transparent' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' swLiveConnect='true' width='493' height='130'>");
	document.write("\n        </embed>\n");
	document.write("\n      </object>\n");
}

function header_environ(section) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='733' height='210'>");
	document.write("\n        <param name=movie value='anims/header_environ.swf?section=" + section + "'>");
	document.write("\n        <param name='wmode' value='transparent'>");
	document.write("\n        <param name='allowScriptAccess' value='always'>");
	document.write("\n        <param name=quality value=high>");
	document.write("\n        <embed src='anims/header_environ.swf?section=" + section + "' wmode='transparent' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' swLiveConnect='true' width='733' height='210'>");
	document.write("\n        </embed>\n");
	document.write("\n      </object>\n");
}

function nav_environ(langue) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='675' height='120'>");
	document.write("\n        <param name=movie value='anims/nav_environ_" + langue + ".swf'>");
	document.write("\n        <param name='wmode' value='transparent'>");
	document.write("\n        <param name='allowScriptAccess' value='always'>");
	document.write("\n        <param name=quality value=high>");
	document.write("\n        <embed src='anims/nav_environ_" + langue + ".swf' wmode='transparent' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' swLiveConnect='true' width='675' height='120'>");
	document.write("\n        </embed>\n");
	document.write("\n      </object>\n");
}

function environ_united() {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='350' height='900'>");
	document.write("\n        <param name=movie value='anims/environ_united.swf'>");
	document.write("\n        <param name='wmode' value='transparent'>");
	document.write("\n        <param name='allowScriptAccess' value='always'>");
	document.write("\n        <param name=quality value=high>");
	document.write("\n        <embed src='anims/environ_united.swf' wmode='transparent' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' swLiveConnect='true' width='350' height='900'>");
	document.write("\n        </embed>\n");
	document.write("\n      </object>\n");
}

function environ_nations() {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='350' height='800'>");
	document.write("\n        <param name=movie value='anims/environ_nations.swf'>");
	document.write("\n        <param name='wmode' value='transparent'>");
	document.write("\n        <param name='allowScriptAccess' value='always'>");
	document.write("\n        <param name=quality value=high>");
	document.write("\n        <embed src='anims/environ_nations.swf' wmode='transparent' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' swLiveConnect='true' width='350' height='800'>");
	document.write("\n        </embed>\n");
	document.write("\n      </object>\n");
}

function page_screen() {
	window.open('viewer/','DungeonPartyScreenshots','toolbar=no,location=no,directories=no,status=no,copyhistory=no,scrollbars=no,resizable=no,width=900,height=663');
}

function page_videos() {
	window.open('videos/','videos','toolbar=no,location=no,directories=no,status=no,copyhistory=no,scrollbars=no,resizable=no,width=750,height=610');
}

var etat_log=1;

function aff_mas_news(id) {
	if (etat_log==1) {
		afficher_news(id);
		etat_log=2;
	}
	else {
		cacher_news(id);
		etat_log=1;
	}
}

function afficher_news(id) {
	if (document.getElementById) {
	document.getElementById(id).style.display="block";

	} else if (document.all) {
	document.all[id].style.display="block";

	} else if (document.layers) {
	document.layers[id].display="block";

	}
}

function cacher_news(id) {
	if (document.getElementById) {
	document.getElementById(id).style.display="none";
	} else if (document.all) {
	document.all[id].style.display="none";
	} else if (document.layers) {
	document.layers[id].display="none";
	}
}


function active_bloc_news(){
	$("#onglet_news").click(function () {
	document.getElementById('videos_bloc').className = '';
	document.getElementById('news_bloc').className = 'active';
	$("#bloc_videos_contents").fadeOut("fast");
	$("#bloc_news_contents").fadeIn("slow");
  });	
}

function active_bloc_videos(){
	$("#onglet_videos").click(function () {
	document.getElementById('videos_bloc').className = 'active';
	document.getElementById('news_bloc').className = '';
	$("#bloc_news_contents").fadeOut("fast");
    $("#bloc_videos_contents").fadeIn("slow");
  });	
}

function active_bloc_communautes(langue) {
	$("#onglet_communautes").click(function () {
	document.getElementById('communautes_bloc_' + langue).className = 'active';
	document.getElementById('competitions_bloc').className = '';
	$("#bloc_competitions_contents").fadeOut("fast");
    $("#bloc_communautes_contents").fadeIn("slow");
  });	
}

function active_bloc_competitions(langue) {
	$("#onglet_competitions").click(function () {
	document.getElementById('communautes_bloc_' + langue).className = '';
	document.getElementById('competitions_bloc').className = 'active';
    $("#bloc_communautes_contents").fadeOut("fast");
	$("#bloc_competitions_contents").fadeIn("slow");
  });	
}

function active_bloc_plusdenews(id_page, nb_page){
	$("#boutonplusdenews_"+id_page).click(function () {	
	$("#blocplusdenews_"+id_page).fadeIn("slow");
	document.getElementById('lienplusdenews_'+id_page).style.background = "#B72020"; 
	document.getElementById('lienplusdenews_'+id_page).style.color = "#FFFFFF"; 
	for (var i = 1; i <= nb_page; ++i)
		{
		if (i != id_page) {
			document.getElementById('lienplusdenews_'+i).style.background = "";
			document.getElementById('lienplusdenews_'+i).style.color = ""; 
			$("#blocplusdenews_"+i).fadeOut("fast");
			}
		}	
  });	
}

function init_bloc_plusdenews(id_page, nb_page){
	$("#blocplusdenews_"+id_page).fadeIn("slow");
	document.getElementById('lienplusdenews_'+id_page).style.background = "#B72020"; 
	document.getElementById('lienplusdenews_'+id_page).style.color = "#FFFFFF";
	for (var i = 1; i <= nb_page; ++i)
		{
		if (i != id_page) {
			document.getElementById('lienplusdenews_'+i).style.background = "";
			document.getElementById('lienplusdenews_'+i).style.color = ""; 
			$("#blocplusdenews_"+i).fadeOut("fast");
			}
		}	
}

function active_communaute_page1(){
	$("#bouton_page1").click(function () {
	$("#communaute_page1").fadeIn("slow");
	document.getElementById('lien_bouton1').className = 'active';
	$("#communaute_page2").fadeOut("fast");
	document.getElementById('lien_bouton2').className = '';
  });	
}
function active_communaute_page2(){
	$("#bouton_page2").click(function () {
	$("#communaute_page2").fadeIn("slow");
	document.getElementById('lien_bouton2').className = 'active';
	$("#communaute_page1").fadeOut("fast");
	document.getElementById('lien_bouton1').className = '';
  });	
}



