function GetId(id) {
	return document.getElementById(id);
}
var i=false;
 function move(e) {
  if(i) {
    if (navigator.appName!="Microsoft Internet Explorer") {
    GetId("infobulle").style.left=e.pageX + 5+"px";
    GetId("infobulle").style.top=e.pageY + 10+"px";
    }
    else { 
        if(document.documentElement.clientWidth>0) {
	     GetId("infobulle").style.left=event.x+document.documentElement.scrollLeft+5+"px";
	     GetId("infobulle").style.top=event.y+document.documentElement.scrollTop+10+"px";
        } 
        else {
	      GetId("infobulle").style.left=event.x+document.body.scrollLeft+5+"px";
	      GetId("infobulle").style.top=event.y+document.body.scrollTop+10+"px";
	     }
	     
    }
  }
}
function affiche_infobulle(text) {
  if(i==false) {
	  GetId("infobulle").style.visibility="visible";
	  GetId("infobulle").innerHTML = text;
	  i=true;
  }
}
function cache_infobulle() {
	if(i==true) {
		GetId("infobulle").style.visibility="hidden";
		i=false;
	}
}
document.onmousemove=move;


function affiche_details( iddiv, etat ) {
	if ( etat )	{
		document.getElementById( iddiv ).style.display = "inline";
	}
	else {
		document.getElementById( iddiv ).style.display = "none";
	}
	return false;
}
function openClose(id) {
	var obj = "";	
		// Check browser compatibility
	if(document.getElementById)
		obj = document.getElementById(id).style;
	else if(document.all)
		obj = document.all[id];
	else if(document.layers)
		obj = document.layers[id];
	else
		return 1;
	// Do the magic :)
	if(obj.display == "")
		obj.display = "none";
	else if(obj.display != "none")
		obj.display = "none";
	else
		obj.display = "block";
}
function drapeaux_pop(){
	window.open("insert_flag.htm","Drapeaux","width=300,height=300,resizable=yes,scrollbars=no"); 
}
function leximot_pop(idmot){
	window.open("lexique.php?mot="+idmot+"","Leximot","width=600,height=300,resizable=yes,scrollbars=yes"); 
}
function aide_pop(idaide){
	window.open("page.php?aide="+idaide+"&popup=1&nomenu=1","Aide","width=600,height=300,resizable=yes,scrollbars=yes"); 
}
function imgup_pop(rubrique){
	window.open("../admin_des_images.php?mode=upload&rubrique="+rubrique+"&nomenu=1&popup=1&nobottommenu=1","Images","width=500,height=500,resizable=yes,scrollbars=yes"); 
}
function imgup_pop_jeux(rubrique,jeux)
{
	window.open("../admin_des_images.php?mode=upload&rubrique="+rubrique+"&nomenu=1&popup=1&nobottommenu=1&jeu="+jeux+"","Images","width=500,height=500,resizable=yes,scrollbars=yes"); 	
}
function add_imgup(code) {
	//opener.document.REPLIER.Post.value += ' ' + code + ' ';
	opener.document.post.req_message.value+=''+code+'';
	//return true;
	//window.close();
}
function add_logoup(code) {
	opener.document.formulaire.logo.value="";
	opener.document.formulaire.logo.value+=''+code+'';
	//return true;
	window.close();
}
function ChangeUrl(formulaire)
{
if (formulaire.ListeUrl.selectedIndex != 0)
{
location.href = formulaire.ListeUrl.options[formulaire.ListeUrl.selectedIndex].value;
}
else
{
alert('Veuillez faire un choix.');
}
}
function PopupImage(img)
{
titre="Unreal.fr";w=open("",'image','width=640,height=480,toolbar=no,scrollbars=no,resizable=no');
w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+30); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
w.document.write("");
w.document.write("</BODY></HTML>");
w.document.close();
}
function telecharger(fichier)
{
titre="Unreal.fr";
w=open("",'fichier','width=380,height=190,toolbar=no,scrollbars=no,resizable=no');
w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
w.document.write("<BODY leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
w.document.write("<iframe name=telechargement frameborder=no width=380 height=190 src=http://www.unreal.fr/telechargement_popup.php></iframe>");
w.document.write("<br/>");
w.document.write("<iframe name=fichier frameborder=no width=0 height=0 src='"+fichier+"'></iframe>");
w.document.write("");
w.document.write("</BODY></HTML>");
w.document.close();
}
function afficherDepts() {
var a = document.getElementById("dept1");
var b = document.getElementById("dept1value");
var c = document.getElementById("dept2");
var d = document.getElementById("dept2value");
var e = document.getElementById("dept3");
var f = document.getElementById("dept3value");
var g = document.getElementById("dept4");
var h = document.getElementById("dept4value");

if (document.formulaire.pays.value == 1) {
		c.style.display = "none";
		d.name = "";
		e.style.display = "none";
		f.name = "";
		g.style.display = "none";
		h.name = "";
	if (a.style.display == "none")
		a.style.display = "block";
		b.name = "departement";
		b.value = "0";
	}
else if (document.formulaire.pays.value == 2) {
		a.style.display = "none";
		b.name = "";
		e.style.display = "none";
		f.name = "";
		g.style.display = "none";
		h.name = "";
	if (c.style.display == "none")
		c.style.display = "block";
		d.name = "departement";
		d.value = "0";
	}
else if (document.formulaire.pays.value == 3) {
		a.style.display = "none";
		b.name = "";
		c.style.display = "none";
		d.name = "";
		g.style.display = "none";
		h.name = "";
	if (e.style.display == "none")
		e.style.display = "block";
		f.name = "departement";
		f.value = "0";
	}
else if (document.formulaire.pays.value == 4) {
		a.style.display = "none";
		b.name = "";
		c.style.display = "none";
		d.name = "";
		e.style.display = "none";
		f.name = "";
	if (g.style.display == "none")
		g.style.display = "block";
		h.name = "departement";
		h.name = "0";
	}
else {
		a.style.display = "none";
		b.name = "";
		c.style.display = "none";
		d.name = "";
		e.style.display = "none";
		f.name = "";
		g.style.display = "none";
		h.name = "";
}
}
function creewin1() { 
myWin= open("shoutbox.php?mode=shoutbox_popup","SHOUBOX","width=450,height=300,status=no,toolbar=no,menubar=no,scrollbars=yes"); 
}
function creewin10() { 
myWin= open("images/pages/unrealtournament2003/3d/assault.php","ASSAULT","width=400,height=300,status=no,toolbar=no,menubar=no,scrollbars=no"); 
}
function creewin20() { 
myWin= open("images/pages/unrealtournament2003/3d/bio.php","BIO","width=400,height=300,status=no,toolbar=no,menubar=no,scrollbars=no"); 
}
function creewin30() { 
myWin= open("images/pages/unrealtournament2003/3d/flak.php","FLAK","width=400,height=300,status=no,toolbar=no,menubar=no,scrollbars=no"); 
}
function creewin40() { 
myWin= open("images/pages/unrealtournament2003/3d/link.php","LINK","width=400,height=300,status=no,toolbar=no,menubar=no,scrollbars=no"); 
}
function creewin50() { 
myWin= open("images/pages/unrealtournament2003/3d/minigun.php","MINIGUN","width=400,height=300,status=no,toolbar=no,menubar=no,scrollbars=no"); 
}
function creewin60() { 
myWin= open("images/pages/unrealtournament2003/3d/painter.php","PAINTER","width=400,height=300,status=no,toolbar=no,menubar=no,scrollbars=no"); 
}
function creewin70() { 
myWin= open("images/pages/unrealtournament2003/3d/redeemer.php","REDEEMER","width=400,height=300,status=no,toolbar=no,menubar=no,scrollbars=no"); 
}
function creewin80() { 
myWin= open("images/pages/unrealtournament2003/3d/rocket.php","ROCKET","width=400,height=300,status=no,toolbar=no,menubar=no,scrollbars=no"); 
}
function creewin90() { 
myWin= open("images/pages/unrealtournament2003/3d/shield.php","SHIELD","width=400,height=300,status=no,toolbar=no,menubar=no,scrollbars=no"); 
}
function creewin100() { 
myWin= open("images/pages/unrealtournament2003/3d/shock.php","SHOCK","width=400,height=300,status=no,toolbar=no,menubar=no,scrollbars=no"); 
}
function creewin110() { 
myWin= open("images/pages/unrealtournament2003/3d/sniper.php","SNIPER","width=400,height=300,status=no,toolbar=no,menubar=no,scrollbars=no"); 
}

function AddLink() { 
   var oForm = document.linkForm;
   if (oForm.imgurl.value == '') {
      alert(window.opener.lblImageVal0);
      return false; 
   } 
   if (oForm.url.value != '') {
   html = '<a href="images.php?image=' + oForm.url.value + '"><img src="http://' + oForm.imgurl.value + '" alt="' + oForm.alttext.value +'" border="' + oForm.border.value + '"></a>';
   }
   else {
   html = '<img src="http://' + oForm.imgurl.value + '" alt="' + oForm.alttext.value +'" border="' + oForm.border.value + '">';
   }
   window.opener.insertHTML(html);
   window.close(); 
   return true; 
}

function AddImguploadBACKUP(rubrique, vignette) { 
   var oForm = document.vignetteForm;
   if (oForm.codevignette.value == '') {
      alert(window.opener.lblImageVal0);
      return false; 
   }
   if (vignette == 1) {
	html = '<a href="http://www.unreal.fr/images.php?image=images/rubriques/'+rubrique+'/' + oForm.codevignette.value + '"><img id="vignette" src="http://www.unreal.fr/images/rubriques/'+rubrique+'/TN_' + oForm.codevignette.value + '"></a>';

   }
   else {
	html = '<a href="http://www.unreal.fr/images.php?image=images/rubriques/'+rubrique+'/' + oForm.codevignette.value + '">Mon image</a>';
   }
   window.opener.insertHTML(html);
   window.close(); 
   return true; 
}

function AddImgupload(rubrique, vignette, nom, extension, id) {
	 if (vignette == 1) {
		html = '<a href="http://www.unreal.fr/images/rubriques/'+rubrique+'/'+nom+'.'+extension+'" onclick="document.getElementById(\'zone_galerie\').style.display= \'\'; javascript:affiche_images(\''+id+'\',\'0\',\'0\'); return(false)"><img src="http://www.unreal.fr/images/rubriques/'+rubrique+'/TN_'+nom+'.'+extension+'" class="vignette"></a>'
	 }
	else {
		html = '<a href="http://www.unreal.fr/images/rubriques/'+rubrique+'/'+nom+'.'+extension+'" onclick="document.getElementById(\'zone_galerie\').style.display= \'\'; javascript:affiche_images(\''+id+'\',\'0\',\'0\'); return(false)"><img src="http://www.unreal.fr/images/rubriques/'+rubrique+'/'+nom+'.'+extension+'" class="vignette2"></a>'
	 }	 
   window.opener.insertHTML(html);
   window.close(); 
   return true; 
}


function AddImggalerie(home, rubrique, vignette, nom, extension) { 
   if (vignette == 1) {
	html = '<a href="http://www.unreal.fr/images.php?image='+home+'/'+rubrique+'/'+nom+'.'+extension+'"><img id="vignette" src="'+home+'/'+rubrique+'/TN_'+nom+'.'+extension+'"></a>';

   }
   else {
	html = '<a href="http://www.unreal.fr/images.php?image='+home+'/'+rubrique+'/'+nom+'.'+extension+'"><img id="vignette" src="'+home+'/'+rubrique+'/'+nom+'.'+extension+'"></a></a>';
   }
   window.opener.insertHTML(html);
   window.close(); 
   return true; 
}