var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0
var tempY = 0

function getMouseXY(e) {
  if (IE) {
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {
    tempX = e.pageX
    tempY = e.pageY
  }  
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  return true
}


function infobull(id_info,text_info,titre_info,link_info) {
	document.write('<div style="position: absolute;visibility: hidden;z-index:9999'+id_info+';" id="'+id_info+'">');
	document.write('  <table width="400" border="1" cellpadding="0" cellspacing="0" style="background-color:#'+c09+'">');
	document.write('    <tr><td>'+text_info+'</td></tr>');
	document.write('  </table>');
	document.write('</div><a ');
	if(link_info)document.write(' href="'+link_info+'" ');
	document.write('onMouseOver = "javascript:showTip(\''+id_info+'\');" onMouseOut = "javascript:hideTip(\''+id_info+'\');">'+titre_info+'</a>');
}
function showTip(id){
	obj = document.getElementById(id);
	XX=((tempX+400)>document.body.offsetWidth)?document.body.offsetWidth-420:tempX;
	obj.style.left = XX;
	obj.style.top = tempY+15;
	obj.style.visibility = "visible";
}
function hideTip(id){
	document.getElementById(id).style.visibility = "hidden";
}
function hid(form){var i=0;
while(document[form].elements[i]){document[form].elements[i].style.visibility='hidden';i++;}
}

function style(theme_bgcolor,theme_textcolor,theme_bordercolor,theme_linkcolor,theme_textbtcolor,theme_bgbtcolor,theme_c1color,theme_c2color,theme_c1textcolor,theme_c2textcolor){
document.write('<style type="text/css">');
document.write('body{background-color:#'+theme_bgcolor+';font-family:"Arial", sans-serif;color:#'+theme_textcolor+';margin:0px;border:0px none;padding:0px;font-size:4mm;}');
document.write('table{border-collapse:collapse;font-size:4mm;border-color:#'+theme_bordercolor+';}');
document.write('td{border-color:#'+theme_bordercolor+';text-align:center;padding:5px;}a{text-decoration:none;}a:link{color:#'+theme_linkcolor+'; text-decoration:none;}a:active{color:#'+theme_linkcolor+'; text-decoration:none;}a:visited{color:#'+theme_linkcolor+'; text-decoration:none;}a:hover{color:#'+theme_textbtcolor+';}input{color:#'+theme_textbtcolor+';font-family:"Arial", sans-serif;border-style:solid;background-color:#'+theme_bgbtcolor+';border-width:1px;}');
document.write('.tr1{background-color:#'+theme_c2color+';color:#'+theme_c1textcolor+';}.tr2{background-color:#'+theme_c1color+';color:#'+theme_c2textcolor+';}');
document.write('select,textarea{color:#'+theme_textbtcolor+';border-style:solid;border-width:1px;font-family:Arial;background-color :#'+theme_bgbtcolor+';}');
document.write('.quote,.code{text-align:left;font-size:12px;color:#'+theme_c2textcolor+';line-height:125%;background-color:#'+theme_c2color+';border-style:solid;border-left-width:1px;border-top-width:1px;border-right-width:1px;border-bottom-width:1px}');
document.write('.infobulle_div{position:absolute;visibility:hidden;z-index:99999}.infobulle_table{border:1px solid #'+theme_bordercolor+';background-color :#'+theme_bgbtcolor+';width:400px;}');
document.write('.checkbox{background-color:transparent;border-style:none;}');
document.write('.cl1{background-color:'+theme_c2color+';margin-top:10px;}');
document.write('</style>');
}

function light_on(id){
	topic_row_style=document.getElementById(id);
	topic_row_style.style.background="#"+c03;
	topic_row_style.style.cursor='pointer';
}

function light_off(id){
	topic_row_style=document.getElementById(id);
	topic_row_style.style.background='transparent';
	topic_row_style.style.cursor='default';
}

function checkAllBoxes(id){var i=0;while(document[id].elements[i]){if (document[id].elements[i].name!="action_type"){document[id].elements[i].checked=1;}i++;}}
function uncheckAllBoxes(id){var j=0;while(document[id].elements[j]){if (document[id].elements[j].name!="action_type"){document[id].elements[j].checked=0;}j++;}}
function negateChoice(id){var k=0;while(document[id].elements[k]){if (document[id].elements[k].name!="action_type"){if(document[id].elements[k].checked == 1){document[id].elements[k].checked=0;}else{document[id].elements[k].checked=1;}}k++;}}

function select_switch(status){for(i=0;i<document.privmsg_list.length;i++){document.privmsg_list.elements[i].checked=status;}}

function zlitons(z){document.getElementById('user_zlitons').innerHTML=z;}

function show_hide_all(prefix,id){
	var i=0;
	var obj;
	while(obj=document.getElementById(prefix+"_"+i)){
		if(i==id){
			show_hide(prefix,id);
		}else{
			obj.style.visibility='hidden';
			obj.style.display='none';
		}
		i++;
	}
}

function show_hide(prefix,id){
	var obj=document.getElementById(prefix+"_"+id);
	if(obj.style.visibility=='hidden'){
		obj.style.visibility='visible';
		obj.style.display='';
	} else {
		obj.style.visibility='hidden';
		obj.style.display='none';
	}
	return true;
}

function flash_object(value,width,height){
	document.write('<OBJECT classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" WIDTH="'+width+'" HEIGHT="'+height+'">');
	document.write('<PARAM NAME=movie VALUE="includes/object/'+value+'">');
	document.write('<PARAM name=menu value=false>');
	document.write('<PARAM NAME=quality VALUE=high>');
	document.write('<PARAM NAME=wmode VALUE=transparent>');
	document.write('<PARAM NAME=bgcolor VALUE=#FFFFFF>');
	document.write('<EMBED src="includes/object/'+value+'" quality=high wmode=transparent bgcolor=#FFFFFF WIDTH="'+width+'" HEIGHT="'+height+'" NAME="martien" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>');
}

function flash_object1(value,width,height){
	document.write('<OBJECT classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" WIDTH="'+width+'" HEIGHT="'+height+'">');
	document.write('<PARAM NAME=movie VALUE="'+value+'">');
	document.write('<PARAM name=menu value=false>');
	document.write('<PARAM NAME=quality VALUE=high>');
	document.write('<PARAM NAME=wmode VALUE=transparent>');
	document.write('<PARAM NAME=bgcolor VALUE=#FFFFFF>');
	document.write('<EMBED src="'+value+'" quality=high wmode=transparent bgcolor=#FFFFFF WIDTH="'+width+'" HEIGHT="'+height+'" NAME="martien" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>');
}

function remplace(var1, var2, id) {
	reg0 = new RegExp( "([^0-9a-zA-Z]{1})"+var1+"([^0-9a-zA-Z]{1})" , "gi");
	reg1 = new RegExp( '<a id="?' + id + '"? [^>]+>' + var1 + '</a>', "gi");
	var message = '.'+parent.document.post.message.value+'.';
	var message2 = parent.document.getElementById('correction').innerHTML;
	message = message.replace(reg0, '$1'+var2+"$2" );
	message = message.replace(reg0, '$1'+var2+"$2" );
	message2 = message2.replace(reg1, var2 );
	parent.document.post.message.value = message.substring(1,message.length-1);
	parent.document.getElementById("correction").innerHTML = message2;
	document.getElementById("resultats").innerHTML = '<p align="center">Cliquez sur un mot mal orthographié</p>';
}

function footer(l_online_users,registered_users){
	document.write('<center><table width="975" cellpadding="0" cellspacing="0" border="0" style="margin-top:10px;border:0px;border-top:2px solid #'+c13+';background-color:#'+c04+';"><td style="font-size:11px;text-align:left;padding:5px;"> <b>'+l_online_users+'</b>: ');
	for(var i = 0; i < online_userlist.length; i++) {
		document.write('<div style="position: absolute;top:0;left:0;visibility: hidden;z-index:9999'+online_userlist[i][0]+';" id="u'+online_userlist[i][0]+'">');
		document.write('  <table width="150" height="200" border="1" cellpadding="0" cellspacing="0" style="background-color:#'+c09+'">');
		document.write('    <tr><td><b>'+online_userlist[i][1]+'</b><br><font style="font-size:12px;">'+online_userlist[i][3]+'</font>');
		if (online_userlist[i][2]) document.write('<br><img src="images/avatars/'+online_userlist[i][2]+'" alt="">');
		document.write('</td></tr>');
		document.write('  </table>');
		document.write('</div><a href="membres.php?id='+online_userlist[i][0]+'" onMouseOver = "javascript:showTipu(\'u'+online_userlist[i][0]+'\');" onMouseOut = "javascript:hideTip(\'u'+online_userlist[i][0]+'\');">'+online_userlist[i][1]+'</a>, ');
	}

	document.write( registered_users+'</td></tr></table></center>');
}
function showTipu(id){
	obj = document.getElementById(id);
	XX=((tempX+160)>document.body.offsetWidth)?document.body.offsetWidth-180:tempX;
	obj.style.left = XX;
	obj.style.top = tempY-220;
	obj.style.visibility = "visible";
}

	function open_popup(purl,pname,pwidth,pheight){
		testwindow = window.open(purl, pname, 'HEIGHT='+pheight+',resizable=yes,WIDTH='+pwidth+',scrollbars=yes');
	}