<!--

  function f_abs(x) {
    if(x < 0) x = x * -1;
    return x;
  }
  
  function Math_Object() {
    this.abs = f_abs;
    return this
  }
  
  MyMath = new Math_Object();
  
  var ie = null;
  var nn = null;
  var dom = false;
  
  if(document.layers) nn = true;
  if(document.all) ie = true;
  if(document.getElementById) dom = true;

  function MakeObject(el,objName) {

    function f_x() {
      if(ie) return this.css.pixelLeft;
      else return this.css.left;
    }  
  
    function f_y() {
      if(ie) return this.css.pixelTop;
      else return this.css.top;
    }
  
    function f_height() {
      if(ie) return this.css.pixelHeight;
      else return this.css.document.height;
    }

    function f_width() {
      if(ie) return this.css.pixelWidth;
      else return this.css.document.width;
    }
  
    function f_moveMe(x,y) {
      this.name;
      this.css.top = y;
      this.css.left = x;
    }
  
    function f_show() {
      this.css.visibility = "visible";
    }

    function f_hide() {
      this.css.visibility = "hidden";
    }
  
    function f_moveBy(x,y) {
      this.moveMe(this.x() + x, this.y() + y);
    }
  

    function f_moveToAux(xx,yy,speed) {
      var x = xx - this.x();
      var y = yy - this.y();
      if(!speed) speed = 5;
      
      if( (MyMath.abs(this.x()-xx) < speed) && (MyMath.abs(this.y()-yy) < speed) ) {  //Not at destination as x & y = 0

        this.moveMe(xx,yy);
        this.moving = false;
        //alert("Movement Ended: (" + objBomberman.x() + "," + objBomberman.y() + ")");
     
      } else {  
    
        // Find modulus of vector
        var mod = Math.sqrt(x*x + y*y);
      
        //Get unit vector and multiply by speed
        var dx = Math.round(x / mod * speed);
        var dy = Math.round(y / mod * speed);

        //Move towards target
        this.moveBy(dx,dy);
      
        timeout = setTimeout(this.name + ".moveToAux(" + xx + "," + yy + "," + speed + ");",20);      
      }
    
    }
  
    function f_moveTo(xx,yy,speed) {
      if(this.moving) { //Wait until last movement has finished before starting newone
        timeout = setTimeout(this.name + ".moveTo(" + xx + "," + yy + "," + speed + ");",20);
    
      } else {
        //alert("Starting Movement To: (" + xx + "," + yy + ")");
        this.moving = true;
        this.moveToAux(xx,yy,speed);
      }
    }



    function f_moveToPlusAux(xx,yy,destspeed,curspeed,acc) {
      var x = xx - this.x();
      var y = yy - this.y();
      if(!destspeed) destspeed = 5;
      if(!curspeed) curspeed = 0;
      if(!acc) acc = 1;
      
      if( (MyMath.abs(this.x()-xx) < curspeed) && (MyMath.abs(this.y()-yy) < curspeed) ) {  //Not at destination as x & y = 0

        this.moveMe(xx,yy);
        this.moving = false;
        //alert("Movement Ended: (" + objBomberman.x() + "," + objBomberman.y() + ")");
     
      } else {  
    
        // Find modulus of vector
        var mod = Math.sqrt(x*x + y*y);
        
        curspeed += acc;
        if(curspeed > destspeed) curspeed = destspeed;
        
        //Get unit vector and multiply by speed
        var dx = Math.round(x / mod * curspeed);
        var dy = Math.round(y / mod * curspeed);

        //Move towards target
        this.moveBy(dx,dy);
      
        timeout = setTimeout(this.name + ".moveToPlusAux(" + xx + "," + yy + "," + destspeed + "," + curspeed + "," + acc + ");",20);      
      }
    
    }
  
    function f_moveToPlus(xx,yy,speed,acc) {
      if(this.moving) { //Wait until last movement has finished before starting newone
        timeout = setTimeout(this.name + ".moveToPlus(" + xx + "," + yy + "," + speed + "," + acc + ");",20);
    
      } else {
        //alert("Starting Movement To: (" + xx + "," + yy + ")");
        this.moving = true;
        this.moveToPlusAux(xx,yy,speed,0,acc);
      }
    }
  
   
    //BEGIN CONSTRUCTION OF OBJECT 			
    //============================
   
    if(dom) {
      //alert("DOM: Making Object: '" + el + "'");
      this.css = document.getElementById(el).style;
      this.obj = document.getElementById(el);
      
    } else if(ie) {
      //alert("IE: Making Object: '" + el + "'");
      this.css = document.all[el].style;
      this.obj = document.all[el];
      
    } else if(nn) {
      //alert("NN: Making Object: '" + el + "'");
      this.css = document.layers[el];
      this.obj = document.layers[el];
      
    }
    
    //Behaviour Functions
    this.moveMe = f_moveMe;
    this.moveBy = f_moveBy;
    this.moveTo = f_moveTo;
    this.moveToAux = f_moveToAux;
    this.moveToPlus = f_moveToPlus;
    this.moveToPlusAux = f_moveToPlusAux;
    this.show = f_show;
    this.hide = f_hide;
    
    //Retrieval Functions
    this.y = f_y;
    this.x = f_x;    
    this.height = f_height;
    this.width = f_width;
    
    //Variables:
    this.name = objName;
    return this;
  }
   //Center Pop
function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
    if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
		if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
		if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
		if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0; 						
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  popupWindow[wp] = window.open(theURL,winName,features);
  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
  if (document.all || document.layers || document.getElementById) {
    if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") {
    	ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
    	popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }
    if (autoCloseTime && autoCloseTime > 0) {
    	popupWindow[wp].document.body.onbeforeunload = function() {
  			if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
    		window.onbeforeunload = null;	}  
   		autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
  	window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}


//-->