
function switchBox(obj,mode){var el=document.getElementById(obj);if(el.style.display!="none"){if(mode=="off" || !mode){el.style.display="none";}}else{if(mode=="on" || !mode){el.style.display="";}}}

function gXH(){var xmlhttp=false;if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();if(xmlhttp.overrideMimeType){xmlhttp.overrideMimeType('text/xml');}}else if(window.ActiveXObject){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}if(!xmlhttp){alert('Abandon : (Impossible de créer une instance XMLHTTP');return false;}else{return(xmlhttp);}}

function similarpolls(){if(document.getElementById("taq")){var a=document.getElementById("taq");var b=document.getElementById("demande_similaire");if(a.value!=""){var xcall="/opinions/files/async.main.php?action=similarpolls&str="+encodeURIComponent(a.value);xmlhttpS=gXH();xmlhttpS.open("GET",xcall,true);xmlhttpS.onreadystatechange=function(){if(xmlhttpS.readyState==4){if(xmlhttpS.status==200){if(xmlhttpS.responseText!=""){b.innerHTML=xmlhttpS.responseText;b.style.display="block";}else{b.innerHTML="";b.style.display="none";}}else{alert("Erreur: La requête n'a pas abouti.");}}};xmlhttpS.send(null);}}}

function ofu(nom_doc,forum,num_doc){
dfocus("forum_posts","r",30,30,200,38);forum0=document.getElementById('forum');num_doc0=document.getElementById('num_doc');name0=document.getElementById('nom_forum');text0=document.getElementById('post_content');forum_posts0=document.getElementById('forum_posts');name=name0.value;text=text0.value;xmlhttpU=gXH();var xcall="/opinions/files/async.main.php?action=fupd&forum="+encodeURIComponent(forum)+"&num_doc="+encodeURIComponent(num_doc)+"&name="+encodeURIComponent(name)+"&text="+encodeURIComponent(text)+"&document="+encodeURIComponent(nom_doc);xmlhttpU.open("GET",xcall,true);xmlhttpU.onreadystatechange=function(){if(xmlhttpU.readyState==4){if(xmlhttpU.status==200){var tempCompare=forum_posts0.innerHTML;var bits=xmlhttpU.responseText.substr(0,25);var str=xmlhttpU.responseText.substr(25);forum_posts0.innerHTML=str;jfocus("post_content");}else{alert("Erreur: La requête n'a pas abouti.");}}};xmlhttpU.send(null);
}

function on(e){if(document.getElementById(e)){document.getElementById(e).style.display="block";}else if(e.style){e.style.display="block";}}

function email(mail,anchor){mail=mail.replace(/[a-zA-Z]/g,function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);});if(!anchor){document.write("<a href=\"mailto:"+mail+"\">"+mail+"</a>");}else{document.write("<a href=\"mailto:"+mail+"\">"+anchor+"</a>");}}

function big(y,lg){
var big=document.getElementById("big");var bigif=document.getElementById("bigif");var i=y.getAttribute("src").split(/_/gi);var xid0=i[0].split(/,x/gi);var xid=xid0[1];var p=document.documentElement.scrollTop;var sh=screen.height;var sw=screen.width;sh*=.9;sw*=.9;sh=Math.floor(sh);sw=Math.floor(sw);big.style.top=p+1+"px";big.style.left="1px";big.style.width=sw+"px";big.style.height=sh+"px";xmlhttpB=gXH();var xcall="/opinions/polls-bigstat-"+sw.toString(16)+"-"+sh.toString(16)+"-0-"+xid+"-"+lg+"/";xmlhttpB.open("GET",xcall,true);xmlhttpB.onreadystatechange=function(){if(xmlhttpB.readyState==4){if(xmlhttpB.status==200){var str=xmlhttpB.responseText;big.innerHTML=str;}else{alert("Erreur: La requête n'a pas abouti.");}}};xmlhttpB.send(null);
}

function BS(w){
if(parseInt(navigator.appVersion)>3){if(navigator.appName.indexOf("Microsoft")!=-1){W=document.body.offsetWidth;H=document.body.offsetHeight;}else{W=window.innerWidth;H=window.innerHeight;}}
if(!H && !W){return false;}
if(w){return(w=="w")?W:H;}
return [W,H];
}

function notify(){if(document.getElementById("notify_email")){var a=document.getElementById("notify_email");var b=document.getElementById("notify_status");var c=document.getElementById("notify_sondage");if(a.value!=""){var xcall="/opinions/files/async.main.php?action=notify&str="+encodeURIComponent(a.value)+"&s="+c.value;xN=gXH();xN.open("GET",xcall,true);xN.onreadystatechange=function(){if(xN.readyState==4){if(xN.status==200){if(xN.responseText!=""){b.innerHTML=xN.responseText;}else{}}else{alert("Erreur: La requête n'a pas abouti.");}}};xN.send(null);}}}

function demo(){var ti=2.2;var st=document.documentElement.scrollTop;var ep=YAHOO.util.Dom.getElementsByClassName("ep","div");YAHOO.util.Dom.setXY(ep,[-500,-500]);YAHOO.util.Dom.setXY("ep1",[100,st+100]);var mop1=new YAHOO.util.Anim("ep1",{opacity:{from:1,to:0.5}},ti);var mop2=new YAHOO.util.Anim("ep2",{opacity:{from:1,to:0.5}},ti);var mop3=new YAHOO.util.Anim("ep3",{opacity:{from:1,to:0.5}},ti);var mop4=new YAHOO.util.Anim("ep1",{opacity:{from:.5,to:0}},ti);var mop5=new YAHOO.util.Anim("ep2",{opacity:{from:.5,to:0}},ti);var mop6=new YAHOO.util.Anim("ep3",{opacity:{from:.5,to:0}},ti);mop1.onComplete.subscribe(function(){YAHOO.util.Dom.setXY("ep2",[300,st+150]);mop2.animate();});mop2.onComplete.subscribe(function(){YAHOO.util.Dom.setXY("ep3",[500,st+200]);mop3.animate();});mop3.onComplete.subscribe(function(){mop4.animate();mop5.animate();mop6.animate();});mop6.onComplete.subscribe(function(){YAHOO.util.Dom.setXY(ep,[-500,-500]);});mop1.animate();}

var edis="none";var edib="transparent";
function editable(){edis=(edis=="none")?"inline":"none";edib=(edis=="none")?"transparent":"yellow";var ed=document.getElementsByTagName("*");for(i=0;i<ed.length;i++){if(ed[i].getAttribute("name")=="edi"){ed[i].style.display=edis;}if(ed[i].getAttribute("name")=="edib"){ed[i].style.backgroundColor=edib;}}}

// create
//document.body.onload=function(){alert("hi");
var aed=document.createElement("a");aed.setAttribute("accessKey","e");aed.setAttribute("href","javascript:editable()");aed.setAttribute("id","eb");
document.body.insertBefore(aed,document.body.lastChild.nextSibling);
//}

