var sc_version = '1.10 - 04-03-2010';
///////////////////////////////////////////////
// spamCle@ner.org JS - (c)2007-2008 Jerome Bruandet
// http://spamcleaner.org
///////////////////////////////////////////////
// Affiche les erreurs sur page index lors du login:
function get_error() {
   var error= document.location.href.split('?')[1];
   if (!error) return;
   if (error == '01') {
      document.write("<span style='background-color:red;color:white;font-size: 10px;'>&nbsp;You must enter your email and password !&nbsp;</span><br>");
   } else if (error=='02') {
      document.write("<span style='background-color:red;color:white;font-size: 10px;'>&nbsp;Email or password are not valid !&nbsp;</span><br>");
   } else if (error=='03') {
      document.write("<span style='background-color:red;color:white;font-size: 10px;'>&nbsp;This account is awaiting activation ! To activate it, please&nbsp;<br>&nbsp;click on the link that was sent to you when you signed up.&nbsp;</span><br>");
   }else if (error=='04'){
      document.write("<span style='background-color:red;color:white;font-size: 10px;'>&nbsp;You must enable your browser's cookies in order to get connected !&nbsp;</span><br>");
   }else if (error=='05'){
      document.write("<span style='background-color:red;color:white;font-size:10px;'>&nbsp;This account is locked for 10 minutes because there were&nbsp;<br>&nbsp;4 consecutive and unsuccessful connection attempts !&nbsp;</span><br>");
   }
}
///////////////////////////////////////////////
// Affiche une table blanche et/ou le petit logo et/ou le copyright:
function version(table,image,copyright) {
   var ct = new Date();
   var cy = ct.getFullYear();
   var path = "http://spamcleaner.org/en/";
//  var path = 'http://'+self.location.host+'/';
   if (table) {
      document.write('<table style="border: 1px solid #666666;" bgcolor="white" cellpadding=3 cellspacing=0 width="100%">');
      document.write('<tr><td>');
   }
   if (image) {document.write('<center><img src="'+path+'gif/sclogosmall.gif" width="210" height="35"></center>');}
   if (copyright) {
      document.write('<center><font class="tinyblack">')
      document.write('&copy;2008-'+cy+' Jérôme Bruandet - <a class=links href=http://spamcleaner.net target=_blank>spamCle@ner.net</a><br>');
      document.write('<a class=links href="javascript:popup(\''+path+'update.html\',640,480)">[v.'+sc_version+']</a></font></center>');
   }
   if (table) {
      if ((!image) & (!copyright)) {document.write('&nbsp;');}
      document.write('</td></tr></table>');
   }
}
///////////////////////////////////////////////
// Affiche une fenetre pop-up
// scroll_bar: 0=oui, 1=non ;P
function popup(url,width,height,scroll_bar) {
   height=height+20;
   width=width+20;
   var str = "height=" + height + ",innerHeight=" + height;
   str += ",width=" + width + ",innerWidth=" + width;
   if (window.screen) {
      var ah = screen.availHeight - 30;
      var aw = screen.availWidth - 10;
      var xc = (aw - width) / 2;
      var yc = (ah - height) / 2;
      str += ",left=" + xc + ",screenX=" + xc;
      str += ",top=" + yc + ",screenY=" + yc;
      if (scroll_bar) {
         str += ",scrollbars=no";
      }else {
         str += ",scrollbars=yes";
      }
      str += ",status=no,location=no,resizable=yes";
   }
   win = open(url, 'SpamScleaner', str);
   setTimeout("win.window.focus()",1300);
}
//////////////////////////////////////////////////
// Share :
var URL = location.href;
if (location.href.search("\\?") != -1) {
   URL = location.href.split("?")[0];
}

function Delicious() {
   var Title=document.getElementById('titre').innerHTML;
   popup('http://del.icio.us/post?url='+encodeURIComponent(URL)+'&title='+encodeURIComponent(Title), 650, 500, 0);
}
function Furl() {
   var Title=document.getElementById('titre').innerHTML;
   popup('http://www.furl.net/storeIt.jsp?u='+encodeURIComponent(URL)+'&t='+encodeURIComponent(Title), 650, 500, 0);
}
function Google(){
   var Title=document.getElementById('titre').innerHTML;
   popup('http://google.com/bookmarks/mark?op=edit&bkmk='+encodeURIComponent(URL)+'&title='+encodeURIComponent(Title), 650, 500, 0);
}
function Yahoo() {
   var Title=document.getElementById('titre').innerHTML;
   popup('http://myweb2.search.yahoo.com/myresults/bookmarklet?t='+encodeURIComponent(Title)+'&u='+encodeURIComponent(URL)+'&ei=UTF-8', 650, 500, 0);
}
function Facebook() {
   var Title=document.getElementById('titre').innerHTML;
   popup('http://www.facebook.com/sharer.php?u='+encodeURIComponent(URL)+'&t='+encodeURIComponent(Title), 650, 500, 0);
}
function Myspace(){
   var Title=document.getElementById('titre').innerHTML;
   popup('http://www.myspace.com/Modules/PostTo/Pages/?l=3&u='+encodeURIComponent(URL)+'&t='+encodeURIComponent(Title), 650, 500, 0);
}
function Twitter(){
   var Title=document.getElementById('titre').innerHTML;
   popup('http://twitter.com/home?status=I+am+reading+'+encodeURIComponent(URL), 650, 500, 0);
}
