function Size(mi) {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  if(mi=="width")
  {
    return myWidth;
  }
  else
  {
    return myHeight;
  }
}

function forgat_resize()
{
  eye.x=(Size('width') / 2)-240;
}

function init_eye()
{
  eye.isVertical = 0;
  eye.x = (Size('width') / 2)-250;
  eye.y = 300; 
  eye.w = -150;
  eye.r = 200;
  eye.v = 20;
  eye.s = 8;
  eye.color = '#000000';
  eye.colorover = '#ffffff';
  eye.backgroundcolor = '';
  eye.backgroundcolorover = '';
  eye.bordercolor = '';
  eye.fontsize = 12;
  eye.fontfamily = 'Arial';
  if (document.getElementById)
  {
    eye.spinmenu();
  }
}



eye = {
    kiir:'',
    also:0,
    p: 0,
    x: 0,
    y: 0,
    w: 0,
    h: 0,
    r: 0,
    v: 0,
    s: 0,
    isVertical: 0,
    a1: 0,
    a2: 0,
    a3: 0,
    t1: 1,
    color: '#ffffff',
    colorover: '#ffffff',
    backgroundcolor: '#ff99ff',
    backgroundcolorover: '#000000',
    bordercolor: '#000000',
    fontsize: 12,
    fontfamily: 'Arial',
    pas: 0,
    
    
    spinmenu: function () {
        this.p = this.r / this.s;
        this.a1 = this.a2 = this.isVertical ? 0 : Math.PI / 2;
    },
    spinmenuitem: function (s1, a7, a6, a5) {
        
        a4 = " onclick='window.open(\"" + a6 + "\"" + (a5 ? (",\"" + a5 + "\"") : ",\"_self\"") + ")'";
        document.write("<div id='spinmenu" + this.a3 + "' style=' cursor:pointer; position:absolute;width:" + this.w + "px;left:" + this.h + "px;" + "background-color:" + this.backgroundcolor + ";color:" + this.color + ";border:0px solid " + this.bordercolor + ";font:normal " + this.fontsize + "px " + this.fontfamily + ";text-align:center; z-Index:1000;' onmouseover='this.style.color=\"" + this.colorover + "\";this.style.backgroundColor=\"" + this.backgroundcolorover + "\"'" + "onmouseout='this.style.color=\"" + this.color + "\";this.style.backgroundColor=\"" + this.backgroundcolor + "\"'" + a4 + "><img  style=' cursor:pointer; ' src="  + a7 + " id='img" + this.a3 + "' ><input type='hidden' id='tartalom" + this.t1 + "' value='"+s1+"'></div>");
        this.t1++;
        this.a3++
    },
    muta: function () {
      if(document.getElementById("controale"))
      {
        a8 = document.getElementById("controale");
        for (i = 0; i < this.a3; i++) {
            a9  = document.getElementById("spinmenu" + i + "");
            img = document.getElementById("img" + i + "");
            
            a9s = a9.style;
            
            if (this.isVertical) {
                xi = parseInt(this.r * Math.cos(this.a1 + i * this.pas)) / this.s;
                yi = parseInt(this.r * Math.sin(this.a1 + i * this.pas));
                a10 = (this.p + xi) / (2 * this.p);
                a11 = this.fontsize * (this.p + xi) / (2 * this.p) + 2;
                a12 = parseInt(100 * (this.p + xi) / (2 * this.p))
            } else {
                xi    = parseInt(this.r * Math.cos(this.a1 + i * this.pas));
                yi    = parseInt(this.r * Math.sin(this.a1 + i * this.pas)) / this.s;
                a10   = (this.p + yi) / (2 * this.p);
                a11   = this.fontsize * (this.p + yi) / (2 * this.p) + 2;
                a12   = parseInt(100 * (this.p + yi) / (2 * this.p))
            };
            
            a13 = (this.w - 20) * a10 + 20;
            a14 = (this.h - 20) * a10 + 10;
            a9s.top = (yi + this.y - a14 / 2) + "px";
            a9s.left = (xi + this.x - a13 / 2) + "px";
            //a9s.width = a13 + "px";
            a9s.fontSize = a11 + "px";
            a9s.zIndex = a12

            img.style.height = 10 * a11 +"px";
        };
        a8.style.top = this.y + (this.isVertical ? this.r : this.p) + this.h / 2 + 6;
        a8.style.left = this.x - a8.offsetWidth / 2;
        if (this.a1 != this.a2) {
            this.a1 = (this.a1 > this.a2) ? (this.a1 - this.pas / this.v) : (this.a1 + this.pas / this.v);
            if (Math.abs(this.a1 - this.a2) < this.pas / this.v) this.a1 = this.a2;
            setTimeout("eye.muta()", 10)
            
        }
        else
        {
          
          
          if(this.also == this.a3)
          {
            this.also=0;
            
          }
          
          this.also++;
          
          this.kiir=this.also;
          
          if(document.getElementById("szoveg"))
          {
            document.getElementById("szoveg").innerHTML = document.getElementById("tartalom"+this.also).value;
          }
        }
      }
    },
    
    
    spinmenuclose: function () {
        this.pas = 2 * Math.PI / this.a3;
        document.write('<div id="controale" style="position:absolute"></div>');
        eye.muta()
    }
};

function getposOffset(what, offsettype) {
    var totaloffset = (offsettype == "left") ? what.offsetLeft : what.offsetTop;
    var parentEl = what.offsetParent;
    while (parentEl != null) {
        totaloffset = (offsettype == "left") ? totaloffset + parentEl.offsetLeft : totaloffset + parentEl.offsetTop;
        parentEl = parentEl.offsetParent;
    }
    return totaloffset;
}


function forgat()
{
  eye.a2-=eye.pas;
  eye.muta();
  t=setTimeout("forgat()",3000);
}



window.onload = function() {
  
  forgat();
}



