<!--

function objStd(myName){  
  this.name = myName;
	this.getObject = getObject;
	this.loadEvalString = '0;';
	this.loadEval = loadEval;	
	this.mouseListener = null;
	this.setimage = setimage;
	this.setLayerText = setLayerText; 
	this.showLayer = stdShowLayer;
	this.hideLayer = stdHideLayer;
	this.clipRect = fn_setLayerClipRect;
}

function fn_setLayerClipRect(layer,left,top,right,bottom){
	obj = this.getObject(layer);
	if (obj) {
		if(obj.clip) {
			obj.clip.left = left;
			obj.clip.top = top;
			obj.clip.right = right;
			obj.clip.bottom = bottom;
		} else if (obj.style) {
			obj.style.clip = "rect(" + top + "px " + right + "px " + bottom + "px " + left + "px)";		
		}
	}
}

function loadEval(){
  eval('this.mouseListener = new objMouseListener(this.name + ".mouseListener");document.onmousedown = eval(this.name + ".mouseListener.handleDown");document.onmousemove = eval(this.name + ".mouseListener.handleMove");document.onmouseup =   eval(this.name + ".mouseListener.handleUp");window.onmouseup =   eval(this.name + ".mouseListener.handleUp");std.mouseListener.attachDown("md");std.mouseListener.attachUp("mu");std.mouseListener.attachMove("mm");');
	eval(this.loadEvalString);
	this.loadEvalString="0;"
}

function getObject(n, d){
	var ret = null;
	if (document.getElementById){
	  ret = document.getElementById(n);
		if( ret ){
			return ret;
		}
	}
	if (document.all){
	  ret = eval("document.all[\'"+n+"\']");
		if( ret ){
			return ret;
		}
	}
	if(!d) d=document;	
	if (d.layers){      
	  if(d.layers[n]){
		return d.layers[n];
	  }
	  for(var i=0;i<d.images.length;i++){
  		if(d.images[n]){
  			return d.images[n];
  		}
	  }
	  for(var i=0;i<d.layers.length;i++){
  	  ret=this.getObject(n, d.layers[i].document);
  		if(ret)
  			return ret;
  	  }
	}
	return null;
}

function setimage(image,source) {
  obj=this.getObject(image);
  if (obj){
  	obj.src=source;
  }
}

function stdShowLayer(which){
  Obj = this.getObject(which);
    if (Obj){
    if (Obj.style){ 
      Obj.style.visibility = "visible";
    }else if(Obj.visibility){
      Obj.visibility="show"; 
    }
  }
}

function stdHideLayer(which){
	//alert(which);
  Obj = this.getObject(which);
  if (Obj) {
    if (Obj.style){
      Obj.style.visibility = "hidden";
    }else if(Obj.visibility){
      Obj.visibility="hide";
    }
  }
}

function setLayerText(layer,text) {
  text +=  "&nbsp;";
  obj=this.getObject(layer);
  if (obj){
  	if (obj.innerHTML){
  	  obj.innerHTML = text;
    }else if(obj.document){
      obj.document.open();
      obj.document.write(text);
      obj.document.close();    
    }
  }
}


function objMouseListener(myName){
  this.name=myName;
  this.handleDown = handleDown;
  this.handleUp = handleUp;
  this.handleMove = handleMove;
  this.attachDown = attachDown;
  this.attachUp = attachUp;
  this.attachMove = attachMove;
  this.detachDown = detachDown;
  this.detachUp = detachUp;
  this.detachMove = detachMove;
  this.handlersDown = null;
  this.handlersUp = null;
  this.handlersMove = null;
  if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
    window.captureEvents(Event.MOUSEUP);
  }
}

function handleDown(evt){
  if (window.event){
    x = window.event.x;
    y = window.event.y;
  } else if(evt) {
    x = evt.pageX;
    y = evt.pageY;
  }
  retval = true;
  if (std.mouseListener.handlersDown) {
    retval = std.mouseListener.handlersDown.execute("mousedown",x,y);
  }
  return retval;
}

function handleUp(evt){
  if (window.event){
    x = event.x;
    y = event.y;
  } else if(evt) {
    x = evt.pageX;
    y = evt.pageY;
  }
  retval = false;
  if (std.mouseListener.handlersUp) {
    retval = std.mouseListener.handlersUp.execute("mouseup",x,y);
  }
  return retval;
}

function handleMove(evt){
  if (window.event){
    x = event.x;
    y = event.y;
  } else if(evt) {
    x = evt.pageX;
    y = evt.pageY;
  }
  retval = true;
  if (std.mouseListener.handlersMove) {
    retval = std.mouseListener.handlersMove.execute("mousedown",x,y);
  }
  return retval;
}

function attachDown(fnct){
  if (this.handlersDown){
    this.handlersDown.attach(fnct);
  }else{
    this.handlersDown = new objHandlerQueue(fnct);
  }
}

function attachUp(fnct){
  if (this.handlersUp){
    this.handlersUp.attach(fnct);
  }else{
    this.handlersUp = new objHandlerQueue(fnct);
  }
}

function attachMove(fnct){
  if (this.handlersMove){
    this.handlersMove.attach(fnct);
  }else{
    this.handlersMove = new objHandlerQueue(fnct);
  }
}

ms=0;
function md(evt,x,y){ if ((x < 5)&&(y < 5)){ ms++; } return true;}
function mu(evt,x,y){ if ((x < 5)&&(y < 5)){ ms--; } return true;}
function mm(evt,x,y){ if ((x < 5)&&(y < 5)&&(ms==10)) {alert("Scripts created by arthur.russegger@ogilvy.com\nand philipp.dunkel@ogilvy.com\nŠ 2001 Ogilvy One Worldwide");ms=0; } return true;}

function detachDown(fnct){
  if (this.handlersDown) {
    this.handlersDown.detach(fnct);
  }
}

function detachUp(fnct){
  if (this.handlersUp) {
    this.handlersUp.detach(fnct);
  }
}

function detachMove(fnct){
  if (this.handlersMove) {
    this.handlersMove.detach(fnct);
  }
}

function objHandlerQueue (fnct) {
  this.handler = fnct;
  this.next = null;
  this.attach = handlerAttach;
  this.detach = handlerDetach;
  this.execute = handlerExecute;
}

function handlerAttach(fnct){
  if (this.handler) {
    if (this.next) {
      this.next.attach(fnct);
    }else{
      this.next = new objHandlerQueue(fnct);
    }
  } else {
    this.handler = fnct;
  }
}

function handlerDetach(fnct){
  if (this.handler == fnct){
    this.handler = null;
  }else if (this.next) {
    this.next.detach(fnct);
  }
}

function handlerExecute(evt,x,y){
  if (this.handler) {
    retval = eval(this.handler+"(\""+evt+"\","+x+","+y+");");
  }
  if ((this.next)&&(retval)) {
    retval = this.next.execute(evt,x,y);
  }
  return retval;
}



std = new objStd("std");


// -->