/*********************** Fonction communes *********************************/
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

//var tab_zone=new Array("zone_jeux_butin","zone_boutique","zone_clic_gagnant","zone_loteries","zone_duels","zone_credits","zone_tournois","zone_jeux_gratuits");

function apparitionInfoRubrique(div){			
	document.getElementById(div+"_contenu").style.display="block";
	document.getElementById(div+"_lot").style.display="none";
	var flashMovie=getFlashMovieObject(div);
   	flashMovie.SetVariable("message_txt", "3");
	//desactiveZone(div);
}
	
function disparitionInfoRubrique(div){
	document.getElementById(div+"_contenu").style.display="none";
	document.getElementById(div+"_lot").style.display="block";
	var flashMovie2=getFlashMovieObject(div);
	//if(etat!=1)
	//{
		flashMovie2.SetVariable("message_txt2", "2");
	//}
	//desactiveZone(div);
}
/*
function desactiveZone(div)
{
	//alert(tab_zone.length);
	for(var i=0;i<tab_zone.length;i++)
	{
		if(tab_zone[i]!=div)
		{
			disparitionInfoRubrique(tab_zone[i],1);
		}
	}
}
*/
function getFlashMovieObject(movieName)
{	  
  if (window.document[movieName]) 
  {
	  return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
	if (document.embeds && document.embeds[movieName])
	  return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {	  
	return document.getElementById(movieName);
  }
}


if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
  navigator.userAgent.indexOf("Windows") 
!= -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('Sub zone_boutique_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call zone_boutique_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  
  document.write('on error resume next \n');
  document.write('Sub zone_tournois_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call zone_tournois_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  
  document.write('on error resume next \n');
  document.write('Sub zone_duels_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call zone_duels_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  
  document.write('on error resume next \n');
  document.write('Sub zone_clic_gagnant_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call zone_clic_gagnant_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  
  document.write('on error resume next \n');
  document.write('Sub zone_loteries_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call zone_loteries_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  
  document.write('on error resume next \n');
  document.write('Sub zone_credits_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call zone_credits_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  
  document.write('on error resume next \n');
  document.write('Sub zone_jeux_gratuits_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call zone_jeux_gratuits_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  
  document.write('on error resume next \n');
  document.write('Sub zone_jeux_butin_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call zone_jeux_butin_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('</SCRIPT\> \n');
} 


function executeActionFlash(command,args)
{
  nom_calque=args.substring(0,args.length-8)+"_lot";
  if(command=="send_var")
  {
	document.getElementById(args).style.display="block";
	document.getElementById(nom_calque).style.display="none";
  }
  else  if(command=="send_var2")
  {
  	 document.getElementById(args).style.display="none";
	 document.getElementById(nom_calque).style.display="block";
  }
}
/****************************** Fonction par zone ********************************************************/



function zone_boutique_DoFSCommand(command,args){
  //var myFlashObj = InternetExplorer ? zone_boutique : document.zone_boutique;
  executeActionFlash(command,args);
}

function zone_tournois_DoFSCommand(command,args){
  //var myFlashObj = InternetExplorer ? zone_boutique : document.zone_boutique;
  executeActionFlash(command,args);
}

function zone_jeux_gratuits_DoFSCommand(command,args){
  //var myFlashObj = InternetExplorer ? zone_boutique : document.zone_boutique;
  executeActionFlash(command,args);
}

function zone_credits_DoFSCommand(command,args){
  //var myFlashObj = InternetExplorer ? zone_boutique : document.zone_boutique;
  executeActionFlash(command,args);
}

function zone_duels_DoFSCommand(command,args){
  //var myFlashObj = InternetExplorer ? zone_boutique : document.zone_boutique;
  executeActionFlash(command,args);
}

function zone_loteries_DoFSCommand(command,args){
  //var myFlashObj = InternetExplorer ? zone_boutique : document.zone_boutique;
  executeActionFlash(command,args);
}

function zone_clic_gagnant_DoFSCommand(command,args){
  //var myFlashObj = InternetExplorer ? zone_boutique : document.zone_boutique;
  executeActionFlash(command,args);
}

function zone_jeux_butin_DoFSCommand(command,args){
  //var myFlashObj = InternetExplorer ? zone_boutique : document.zone_boutique;
  executeActionFlash(command,args);
}

function changerImgBtn(elt,etat)
{
	if(etat==0)
	{
		url_img=elt.src;
		url_img=url_img.substring(0,url_img.length-4);
		elt.src=url_img+"_on.jpg";
	}
	else
	{
		url_img=elt.src;
		url_img=url_img.substring(0,url_img.length-7);
		elt.src=url_img+".jpg";
	}	
}

function changerImgBtn2(elt,etat)
{
	if(etat==0)
	{
		url_img=elt.src;
		url_img=url_img.substring(0,url_img.length-4);
		elt.src=url_img+"_on.gif";
	}
	else
	{
		url_img=elt.src;
		url_img=url_img.substring(0,url_img.length-7);
		elt.src=url_img+".gif";
	}	
}

function MAJSoldeMembre(type)
{
	if(type=="1" || type=="2" || type=="3")
	{
		var tab_info=new Array();
		info=(file('traitement_solde.php?type='+type));
		if(info!='')
		{
			tab_info=info.split(';');
			if(type=="1")
			{
				document.getElementById("head_nbpoints").innerHTML='<a href="http://www.ludokado.com/cadeaux-boutique-ludokado.html" style="text-decoration:none;">'+tab_info[0]+' points</a>';
			}
			else if(type=="1")
			{
				document.getElementById("head_nbcredits").innerHTML='<a href="http://www.ludokado.com/obtenir-credits.html" style="text-decoration:none;">'+tab_info[1]+' crédits</a>';
			}
			else
			{
				document.getElementById("head_nbpoints").innerHTML='<a href="http://www.ludokado.com/cadeaux-boutique-ludokado.html" style="text-decoration:none;">'+tab_info[0]+' points</a>';
				document.getElementById("head_nbcredits").innerHTML='<a href="http://www.ludokado.com/obtenir-credits.html" style="text-decoration:none;">'+tab_info[1]+' crédits</a>';
			}
		}
	}
}