function startTimer(time) {
	time = 100;
	timeOn = window.setTimeout("AWhideMenu()",time);
}

function startTimer2(time) {
	time2 = 100;
	timeOn2 = window.setTimeout("AWhideMenuAdmin()",time2);
}

function stopTimer() {	
	window.clearTimeout(timeOn);
	timeOn=null;
}

function stopTimer2() {	
	window.clearTimeout(timeOn2);
	timeOn2=null;
}


function MM_preloadImages() {
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function HomePage(text) {
	if (document.all && document.getElementById)
		document.write('<A HREF="#" onClick="doHomePage(this);return(false);"><font color="#666666">'+text+'</font></A>');
}

function doHomePage(obj) {
	obj.style.behavior='url(#default#homepage)';
	obj.setHomePage('http://www.indiana-jones-fanclub.com/');
}

function fermer() {
	self.close();
}

var acompteur=0;
function anti_spam() {
	acompteur++;
	if (acompteur>1)
		return false;
}

function check(img) {
	disable(img);
	window.setTimeout("enable()",15000);
}

function disable(img) {
	document.getElementById("attentemess").innerHTML = "email en cours d'envoie...<br>";
	document.getElementById("valboutton").disabled = true;
}

function enable() {
	document.getElementById("attentemess").innerHTML = "";
	document.getElementById("valboutton").disabled = false;
}

function makevisible(cur,which) {
	if(document.getElementById)
	{
		if (which==0)
		{
			if(document.all)
				cur.filters.alpha.opacity=100;
			else
				cur.style.setProperty("-moz-opacity", 1, "");
		}
		else
		{
			if(document.all)
				cur.filters.alpha.opacity=40
			else
				cur.style.setProperty("-moz-opacity", .4, "");
		}
	}
}


function AWhpPlaySound() {
	sendToPage();
}

navigateur = navigator.appName;
navVersion = navigator.appVersion;   

function Plateforme()
{
	if (navigator.appVersion.indexOf("Win") > -1) {return "Windows";}
	if (navigator.appVersion.indexOf("Macintosh") > -1) {return "Macintosh";}
	if (navigator.appVersion.indexOf("X11") > -1) {return "Unix";}
	if (navigator.appVersion.indexOf("Unix") > -1) {return "Unix";}
	if (navigator.appVersion.indexOf("Linux") > -1) {return "Unix";}
	return "Unknown";
}

function Navigateur()
{
	if (navigator.appName.indexOf("Netscape") > -1) {return "Netscape";}
	if (navigator.appName.indexOf("Explorer") > -1) {return "Explorer";}
	return "Unknown";
}

function SagaForm(SagaF) {
	if (SagaF.SListe.selectedIndex != 0)
		window.open('file.php?e_id='+SagaF.SListe.options[SagaF.SListe.selectedIndex].value,'_parent');
}

function PopupPhoto(img, titre) {
	w=open("",'photoimg','width=400,height=400,toolbar=no,scrollbars=no,resizable=yes');	
	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+60); 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 PopupPhotoAlbum(img, titre)  {
	w=open("",'photoimg','width=400,height=400,toolbar=no,scrollbars=no,resizable=yes');	
	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+60); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' height='550' border=0>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

function awtv() {
	window.open('popup/awlive.php','awtv','toolbar=no,location=no,directory=no,menubar=no,scrollbars=no,status=no,resizable=no,height=400,width=650,left=75,top=60');
}

function InsertAWlive(live)
{
	document.write('<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="320" height="255" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">\n');
	document.write('<param name="bgcolor" value="#FFFFFF">\n');
	document.write('<param name="src" value="http://www.anakinweb.tv/frame/qt4_required.mov">\n');
	document.write('<param name="qtsrc" value="rtsp://stream.steredenn.fr:554/'+live+'">\n');
	document.write('<param name="autoplay" value="true">\n');
	document.write('<param name="controller" value="true">\n');
	document.write('<embed src="http://www.anakinweb.tv/frame/qt4_required.mov" qtsrc="rtsp://stream.steredenn.fr:554/'+live+'" width="320" height="255" target="myself" bgcolor="#FFFFFF" border="0" controller="true" autoplay="true" kioskmode="true" pluginspage="http://www.apple.com/fr/quicktime/download/"></embed>\n');
	document.write('</object>\n');
}

function InsertAWlivetest(live)
{
	document.write('<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="320" height="255" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">\n');
	document.write('<param name="bgcolor" value="#FFFFFF">\n');
	document.write('<param name="src" value="http://www.anakinweb.tv/frame/qt4_required.mov">\n');
	document.write('<param name="qtsrc" value="rtsp://stream.anakinweb.tv/'+live+'">\n');
	document.write('<param name="autoplay" value="true">\n');
	document.write('<param name="controller" value="true">\n');
	document.write('<embed src="http://www.anakinweb.tv/frame/qt4_required.mov" qtsrc="rtsp://stream.anakinweb.tv/'+live+'" width="320" height="255" target="myself" bgcolor="#FFFFFF" border="0" controller="true" autoplay="true" kioskmode="true" pluginspage="http://www.apple.com/fr/quicktime/download/"></embed>\n');
	document.write('</object>\n');
}

function InsertAWenlive(live)
{
	document.write('<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="640" height="495" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">\n');
	document.write('<param name="bgcolor" value="#FFFFFF">\n');
	document.write('<param name="src" value="http://www.anakinweb.tv/frame/qt4_required.mov">\n');
	document.write('<param name="qtsrc" value="rtsp://stream.steredenn.fr:554/vod/enlive-'+live+'.mov">\n');
	document.write('<param name="autoplay" value="true">\n');
	document.write('<param name="controller" value="true">\n');
	document.write('<embed src="http://www.anakinweb.tv/frame/qt4_required.mov" qtsrc="rtsp://stream.steredenn.fr:554/vod/enlive-'+live+'.mov" width="640" height="495" target="myself" bgcolor="#FFFFFF" border="0" controller="true" autoplay="true" kioskmode="true" pluginspage="http://www.apple.com/fr/quicktime/download/"></embed>\n');
	document.write('</object>\n');
}

function HomeCHATapplet(colorbgchat, colorfgchat, colorbgtchat, chatusername)
{
	document.write('<applet name="EIRC" code="EIRC.class" width="100%" height="418">\n');
	document.write('<param name="archive" value="EIRC.jar,EIRC-cfg.jar" />\n');
	document.write('<param name="cabbase" value="EIRC.cab,EIRC-cfg.cab" />\n');
	document.write('<param name="port" value="6667" />\n');
	document.write('<param name="irc_pass" value="" />\n');
	document.write('<param name="font_name" value="Helvetica" />\n');
	document.write('<param name="font_size" value="12" />\n');
	document.write('<param name="language" value="" />\n');
	document.write('<param name="mainbg" value="#'+colorbgchat+'" />\n');
	document.write('<param name="mainfg" value="#'+colorfgchat+'" />\n');
	document.write('<param name="textbg" value="#'+colorbgtchat+'" />\n');
	document.write('<param name="textfg" value="#'+colorfgchat+'" />\n');
	document.write('<param name="selbg" value="#'+colorbgchat+'" />\n');
	document.write('<param name="selfg" value="#'+colorfgchat+'" />\n');
	document.write('<param name="join" value="#anakinweb" />\n');
	document.write('<param name="username" value="anakinweb" />\n');
	document.write('<param name="realname" value="AnakinWeb" />\n');
	document.write('<param name="nickname" value="'+chatusername+'" />\n');
	document.write('<param name="nickserv_pass" value="" />\n');
	document.write('<param name="login" value="1" />\n');
	document.write('<param name="asl" value="1" />\n');
	document.write('<param name="spawn_frame" value="0" />\n');
	document.write('<param name="width" value="100%" />\n');
	document.write('<param name="height" value="418" />\n');
	document.write('<param name="write_color" value="12" />\n');
	document.write('<param name="debug_traffic" value="0" />\n');
	document.write('<param name="boxmessage" value="Merci de patienter durant le chargement d\'AnakinWeb Home..." />\n');
	document.write('<param name="boxbgcolor" value="#'+colorbgchat+'" />\n');
	document.write('<param name="boxfgcolor" value="#'+colorfgchat+'" />\n');
	document.write('<param name="progressbar" value="true" />\n');
	document.write('<param name="progresscolor" value="red" />\n');
	document.write('<div align="center">Cette salle de chat nécessite le support de Java</div>\n');
	document.write('</applet>\n');
}

function showhide(pi_object)
{
	var the_element = document.getElementById(pi_object);
	if (the_element.style.display == "none")
	{
		the_element.style.display = "inline";
	}
	else
	{
		the_element.style.display = "none";
	}
}

i=0;
function colorsemail()
{
    tabColoris = new Array ("#333333","#FFFFFF");
    if (i+1 == tabColoris.length) i=0;
    else i++;
    document.getElementById("newemails").setAttribute('color',tabColoris[i]);
    setTimeout("colorsemail()",700);
}

function newsprint(a_id)
{ 	
	window.open('newsprint.php?awnid='+a_id,'awnewsprint','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=650,height=500,left=75,top=60');
}

function openAWHome(page) 
{
	window.open('http://home.anakinweb.com/'+page+'.php','home','toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,copyhistory=0,menuBar=0,width=990,height=600,left=75,top=60');
}

function SendNewPseudo(name,first,namenum,town) 
{
	var newusername = name.substr(0,3)+first.substr(0,2)+"-"+namenum.substr(0,2)+town.substr(0,3);
	document.forms["fform"].elements["username"].value = newusername.toLowerCase();
	verifpseudo(document.forms["fform"].elements["username"]);
	verifpseudo(document.forms["fform"].elements["username"]);
}
