<h1>Vous allez voter pour C</h1> <script> var PersistentStorage=function(){function g(){if(e=d.gears.init()||d.localstorage.init()||d.globalstorage.init()||d.activex.init()||d.flash.init()){e.wait_until_ready=this.wait_until_ready;return e}return null}function f(a){if(e.is_ready()!==true){var b=f;window.setTimeout(function(){return b.apply(b,[a])},100);return false}return a.call()}var c=null,e=null,d={gears:{db:null,name:"gears",init:function(){if(typeof window.google==="undefined"||typeof google.gears==="undefined")return null;google.gears.factory.getPermission("Polyglotte", null,"Activez Google Gears pour pouvoir acceder au Polyglotte");try{this.db=google.gears.factory.create("beta.database");this.db.open("PS-v1");this.db.execute("CREATE TABLE IF NOT EXISTS sm (key TEXT NOT NULL PRIMARY KEY, value TEXT NOT NULL)")}catch(a){return db=null}return this},get:function(a){var b=null;a=this.db.execute("SELECT value FROM sm WHERE key = ?",[a]);if(a.isValidRow())b=a.field(0);a.close();return b},set:function(a,b){try{this.db.execute("REPLACE INTO sm (key, value) VALUES (?, ?)", [a,b])}catch(h){return false}return true},unset:function(a){try{this.db.execute("DELETE FROM sm WHERE key = ?",[a])}catch(b){return false}return true},is_ready:function(){return this.db!=null}},localstorage:{name:"localstorage",init:function(){try{return window.localStorage?this:null}catch(a){return null}},get:function(a){return localStorage.getItem(a)},set:function(a,b){try{localStorage.setItem(a,b)}catch(h){return false}return true},unset:function(a){return localStorage.removeItem(a)},is_ready:function(){return true}}, globalstorage:{name:"globalstorage",init:function(){try{return typeof window.globalStorage!=="undefined"&&(c=globalStorage[document.domain])?this:null}catch(a){return null}},get:function(a){return(a=c.getItem(a))?a.value:null},set:function(a,b){try{c.setItem(a,b)}catch(h){return false}return true},unset:function(a){return c.removeItem(a)},is_ready:function(){return true}},activex:{name:"activex",init:function(){if(!window.ActiveXObject)return null;with(c=document.createElement("div")){id="__pss__"; style.display="none";addBehavior("#default#userData")}document.body.appendChild(c);return this},get:function(a){try{c.load("ps")}catch(b){return null}return c.getAttribute(a)},set:function(a,b){try{c.setAttribute(a,b);c.save("ps")}catch(h){return false}return true},unset:function(a){return this.set(a,undefined)},is_ready:function(){return true}},flash:{name:"flash",swfuri:"/polyglotte3/Flashare.swf",init:function(){var a;if(navigator.mimeTypes.length>0){if(typeof navigator.mimeTypes["application/x-shockwave-flash"]=== "undefined"||!navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)return null}else if(window.ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(b){return null}else return null;with(a=document.createElement("param")){name="movie";value=this.swfuri}with(c=document.createElement("object")){type="application/x-shockwave-flash";classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000";data=this.swfuri;width=height=1;appendChild(a)}with(a=document.createElement("div")){style.visibility= "hidden";style.position="absolute";appendChild(c)}document.body.appendChild(a);return this},get:function(a){return c.get(a)||null},set:function(a,b){return c.set(a,b)},unset:function(a){return c.unset(a)},is_ready:function(){return!!c.unset}}};return{init:g,wait_until_ready:f}}();function emptyFunction(){} var Try=function(){function g(){for(var f,c=0,e=arguments.length;c<e;c++){var d=arguments[c];try{f=d();break}catch(a){}}return f}return{these:g}}(),Polyglotte=function(){function g(){return Try.these(function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false}function f(){if(d.readyState==4){d.onreadystatechange=emptyFunction;var b=d.responseText;if(d.status!==200||b!=="OK")if(b==="Deja vote"){alert("Vous avez deja vote"); a&&a.set("v0","42")}else b==="Deja max"?alert("Vous ne pouvez pas voter pour celui qui est deja affiche"):alert("Impossible d'enregistrer votre vote. Vous ne seriez pas en train d'essayer de tricher par hasard ?");else{a&&a.set("v0","42");alert("Votre vote a bien ete enregistre")}window.location.href="/polyglotte3/index"}}function c(){var b=document.getElementsByTagName("h1")[0].firstChild.data,h=navigator.userAgent||"unknown";b="ABCDEFGH".indexOf(b.substring(22,23));if(a&&a.get("v0")){alert("Vous avez deja vote"); window.location.href="/polyglotte3/index"}else if(!d&&!(d=g()))alert("Vous devez activer Javascript pour pouvoir voter");else{d.open("PUT","/polyglotte3/vote2/"+(h.length<<4|b).toString());d.setRequestHeader("Accept","application/vote");d.setRequestHeader("X-Requested-With","XMLHttpRequest");d.onreadystatechange=f;d.send("X")}}function e(){(a=PersistentStorage.init())?a.wait_until_ready(c):c()}var d=null,a=null;return{init:e}}(); window.addEventListener?window.addEventListener("load",Polyglotte.init,false):window.attachEvent("onload",Polyglotte.init); </script>