//Lib objects  ********************
function lib_obj(obj,nest){
  if(!bw.bw) return lib_message('Old browser')
  nest=(!nest) ? "":'document.'+nest+'.';
  this.evnt=bw.dom? document.getElementById(obj):
    bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers[obj]"):0;	
  /*if(!this.evnt) return lib_message('The layer does not exist ('+obj+')' 
    +'- \nIf your using Netscape please check the nesting of your tags!')*/
   if(!this.evnt) return -1;

  this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt; 
  this.ref=bw.dom||bw.ie4?document:this.css.document;
  this.x=parseInt(this.css.left)||this.css.pixelLeft||this.evnt.offsetLeft||0;
  this.y=parseInt(this.css.top)||this.css.pixelTop||this.evnt.offsetTop||0;
  this.w=this.evnt.offsetWidth||this.css.clip.width||
    this.ref.width||this.css.pixelWidth||0;
  this.h=this.evnt.offsetHeight||this.css.clip.height||
    this.ref.height||this.css.pixelHeight||0;
  this.c=0; //Clip values
  if((bw.dom || bw.ie4) && this.css.clip) {
  this.c=this.css.clip; this.c=this.c.slice(5,this.c.length-1); 
  this.c=this.c.split(' ');
  for(var i=0;i<4;i++){this.c[i]=parseInt(this.c[i])}
  }
  this.ct=this.css.clip.top||this.c[0]||0; 
  this.cr=this.css.clip.right||this.c[1]||this.w||0;
  this.cb=this.css.clip.bottom||this.c[2]||this.h||0; 
  this.cl=this.css.clip.left||this.c[3]||0;
  this.obj = obj + "Object"; eval(this.obj + "=this");
  return this;
}

//Showing object ************
lib_obj.prototype.showIt = function(){
    this.css.visibility="visible";
    if(this.evnt.id != 'infolayer') {
        emospro.pageId = emosLocation.protocol + '//' + emosLocation.host + emosLocation.pathname + emosLocation.search + '_' + this.evnt.id;
        window.emosPropertiesEvent(emospro);
    }
}

//Hiding object **********
lib_obj.prototype.hideIt = function(){
	this.css.visibility="hidden";
	}

function initObjects(){
		myInfoLayer = new lib_obj('infolayer');
		myScheibeLayer = new lib_obj('scheibe');
		myHandLayer = new lib_obj('info_hand');
		myStempelLayer = new lib_obj('info_stempel');
		myBriefLayer = new lib_obj('info_brief');
		myTelefonLayer = new lib_obj('info_telefon');
		myLaptopLayer = new lib_obj('info_laptop');
		myEuroLayer = new lib_obj('info_euro');
		myWaageLayer = new lib_obj('info_waage');
		myCo2Layer = new lib_obj('info_co2');
		myHybridLayer = new lib_obj('info_hybrid');
		myMapFFTLayer = new lib_obj('karte_fft');
		myFormLayer = new lib_obj('formlayer');
	}

function hideAll(){
		myScheibeLayer.hideIt();
		myInfoLayer.hideIt();
		myHandLayer.hideIt();
		myStempelLayer.hideIt();
		myBriefLayer.hideIt();
		myWaageLayer.hideIt();
		myLaptopLayer.hideIt();
		myEuroLayer.hideIt();
		myTelefonLayer.hideIt();
		myCo2Layer.hideIt();
		myHybridLayer.hideIt();
		myFormLayer.hideIt();
	}

//preload

initImages(["button1", "images/button_tnt.gif"],
		["button2", "images/button_tnt_ro.gif"],
		["backbutton1", "images/backbutton.gif"],
		["backbutton2", "images/backbutton_ro.gif"],
		["infobutton1", "images/infobutton.gif"],
		["infobutton2", "images/infobutton_ro.gif"],
		["sendbutton1", "images/sendbutton.gif"],
		["sendbutton2", "images/sendbutton_ro.gif"],
		["map1", "images/map.gif"],
		["map2", "images/map_fft_ro.gif"],
		["laptop1", "images/laptop.gif"],
		["laptop2", "images/laptop_ro.gif"],
		["euro1", "images/euro.gif"],
		["euro2", "images/euro_ro.gif"],
		["hand1", "images/hand.gif"],
		["hand2", "images/hand_ro.gif"],
		["stempel1", "images/stempel.gif"],
		["stempel2", "images/stempel_ro.gif"],
		["brief1", "images/brief.gif"],
		["brief2", "images/brief_ro.gif"],
		["waage1", "images/waage.gif"],
		["waage2", "images/waage_ro.gif"],
		["co21", "images/co2.gif"],
		["co22", "images/co2_ro.gif"],
		["hybrid1", "images/hybrid.gif"],
		["hybrid2", "images/hybrid_ro.gif"],
		["telefon1", "images/telefon.gif"],
		["telefon2", "images/telefon_ro.gif"]);

function initImages()
{
	args_images_II = initImages.arguments;

	for (var i = 0; i < args_images_II.length; i++)
	{
		eval (args_images_II[i][0] + '= new Image();')
		eval (args_images_II[i][0] + '.src = "' + args_images_II[i][1] + '";');
	}
}

function showImages()
{
	args_images_SI = showImages.arguments;
	
	eval ('document.images["' + args_images_SI[0] + '"].src = ' + args_images_SI[1] + '.src;');
}

function hidePics(amount){
		for (var i = 1; i <= amount; i++){
			eval("myPic"+i+".hideIt();");
		}
}

function initPics(amount){
		for (var i = 1; i <= amount; i++){
			eval("myPic"+i+"= new lib_obj('pic"+i+"');");
		}
}

function no()
   {}
