function _Opiniac()
{
  if (arguments.length < 1)
    return null;
    
  this.opiniac_hash = arguments[0];  
  this.add_params = new Object();


  //--------------------------------------------------------------------
  this.segment = function(segment) {
    this.addParam('segment', segment);
  } 


  //--------------------------------------------------------------------
  this.addParam = function(key, val) {
    if (key in {'s':'', 'c':'', 'r':'', 'u':'', 't':''})
      return;
      
    this.add_params[key] = val;
  } 
  
  //--------------------------------------------------------------------
  this.run = function() {
    var p = '';
    if (window.screen) {
      p += "/s/"+window.screen.width+"x"+window.screen.height;
      if (!isNaN(screen.pixelDepth) && (screen.pixelDepth) != 0) {
        p += "/c/"+screen.pixelDepth;
      } else {
        p += "/c/"+screen.colorDepth;
      }
    }
    if (document.referrer)
      p += "/r/"+encodeURIComponent(encodeURIComponent((document.referrer).substring(0,299)));
    if (document.URL)
      p += "/u/"+encodeURIComponent(encodeURIComponent((document.URL).substring(0,299)));
    p += "/t/"+(new Date()).getTime();

    for (var i in this.add_params) {
      p+= "/" + i + "/" + encodeURIComponent((this.add_params[i]).substring(0,128));
    }

    var s = "<style type=\"text/css\">\n";
    s += "#opiniac_blk { position: absolute; right: 10px; bottom: 10px; }\n";
    s += "div > div#opiniac_blk { position: fixed; }\n";
    s += "</style>\n";
    s += "<!--[if gte IE 5.5]><![if lt IE 7]>\n";
    s += "<style type=\"text/css\">\n";
    s += "div#opiniac_blk {\n";
    s += "right: auto; bottom: auto;\n";
    s += "left: expression( ( -10 - opiniac_blk.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );\n";
    s += "top: expression( ( -10 - opiniac_blk.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );\n";
    s += "}\n";
    s += "</style>\n";
    s += "<![endif]><![endif]-->";
    document.writeln(s);

    var b = '<div><div id="opiniac_blk" style="text-align: center; padding: 10px; color: #003333; font-size: 13px;">Oceń stronę <a href="#" onclick="window.open(\'http://polls.opiniac.com/s/' + this.opiniac_hash+p+'\', \'Opiniac\', \'width=700,height=600,innerWidth=700,innerHeight=600,titlebar=0,scrollbars=1,status=0,location=0,toolbar=0,menubar=0\'); return false;" title="oceń stronę bluerank.pl" style="position: relative; top: 3px;"><img src="http://polls.opiniac.com/files/standard/opiniac_pictogram.gif" alt="oceń stronę bluerank.pl" style="border: none;" /></a></div></div>';
    document.writeln(b);
  }
  
  return this;
}
