// Copyright (c) 2000 - 2001 by Webking (R) GmbH, Hugo-Eckener-Str. 31, 50829 Köln, Tel. +49 221 5344 330


var script1_loaded=false;

var netview3d_1_touchit_picture;
var netview3d_1_touchitobj;
var searchname;

var noncyclic1=0;
var pictures1=0;
var pname1 = "";
var ptype1 = "";
var pbase1 = "";
var pnum1  = ["01","02","03","04","05","06","07","08"];


var touchitpics1_geladen=false;
var zahl_pics=0;
var OldX=0;
var OldY=0;
var posX=0;
var posY=0;
var ti_position=0;
var ti_moving=0;
var aktuelle_pos=0;
var touchitanzahl=0;
var zahl_a=1;
var takePos=0;
var keystring="";
var browser_fenster=0;


function catch_timeout() {
  if(!touchitpics1_geladen) pic1;
}


function check1_until_loaded() {
  var touchit_index;

  for (touchit_index=0; touchit_index<zahl_pics; touchit_index++) {
    if (pictures1[touchit_index].complete==false) {
      window.setTimeout ("check1_until_loaded()",250);
      return;
    }
  }

  if (touchit_picloaded_1.complete == false) {
    window.setTimeout ("check1_until_loaded()",250);
    return;
  }

  pic1_loaded();
  return;

}


function move_ti1(par_event) {
  if(!ti_moving) return false;
  var newX;
  var newY;

  if (!document.all) {

    if(par_event.x) newX=par_event.x;
    else newX=par_event.screenX;

    if(par_event.x) newY=par_event.y-netview3d_1_touchit_picture.y;
    else newY=par_event.screenY;
  }

  else {
    newX=window.event.offsetX;
    newY=window.event.offsetY;
  }

  ti_position-=(newX-OldX);

    update_pic1();

  OldX=newX;
  OldY=newY;
  return false;
  return true;
}


function start_ti1(par_event) {
  if (!touchitpics1_geladen) return false;

  var newX;
  var newY;

  if (!document.all) {
    if(par_event.x) {
      newX=par_event.screenX;
      newY=par_event.y-netview3d_1_touchit_picture.y;
    }
    else {
      newX=par_event.screenX;
      newY=par_event.screenY;
    }
  }

  if (document.all) {
    newX=window.event.offsetX;
    newY=window.event.offsetY;
    window.event.cancelBubble=true;
  }

  if(document.all || par_event.x) {
    ;
  }

  if(!document.all) {
    document.captureEvents (Event.MOUSEUP|Event.MOUSEMOVE|Event.MOUSEDOWN);
  }

    ti_moving=1;
    document.onclick=dummy;
    document.onmousemove=move_ti1;

    if(document.all || par_event.x) netview3d_1_touchitobj.onmousedown=end_ti1;
    if(document.all || par_event.x) document.onmousedown=end_ti1;

    document.onmouseup=end_ti1;

  OldX=newX;
  OldY=newY;
  takePos=OldY;
  return false;
}


function getKey (key_num) {
  return keystring.substring(key_num,key_num+zahl_a);
}


function dummy() {
  return false;
}


function end_ti1(par_event) {
  button=0;

  if (!document.all && document.releaseEvents) {
    document.releaseEvents(Event.MOUSEUP|Event.MOUSEMOVE|Event.MOUSEDOWN);
  }

  ti_moving=0;
  document.onmousemove=null;
  document.onmouseup=null;
  document.onmousedown=null;
  document.onclick=null;
  netview3d_1_touchitobj.onmousedown=start_ti1;

  if (!document.all) button=par_event.which;
  if (document.all) {
    button=window.event.button;
    if (button!=1) button=3;
  }

  update_pic1();
  return false;
}


function blur_touchit() {
  netview3d_1_touchit_picture.blur();
  netview3d_1_touchitobj.blur();
  return false;
}


function pic1_loaded() {
  netview3d_1_touchit_picture.src=touchit_picloaded_1.src;
  touchitpics1_geladen=true;
  netview3d_1_touchit_picture.tabIndex=1;
  netview3d_1_touchit_picture.onfocus=blur_touchit;
  netview3d_1_touchitobj.tabIndex=2;
  netview3d_1_touchitobj.onfocus=blur_touchit;
  window.setTimeout("resizeable=true;",1000);
}


function load_pics1 () {
  var count;

  zahl_pics = 8;
  pictures1= new Array(zahl_pics);

  for (count=0; count<zahl_pics; count++) {
    pictures1[count]=new Image();
    pictures1[count].src=pbase1+pnum1[count]+ptype1;
  }

  touchit_picloaded_1 = new Image();
  touchit_picloaded_1.src = pbase1+"_tiloadingdone"+ptype1;

  check1_until_loaded();
}


function update_pic1() {
  if(noncyclic1) {
    if (ti_position < 0) ti_position = 0;
    else if(ti_position>=zahl_pics*6) ti_position=(zahl_pics-1)*6;
  }
  else {
    while(ti_position<0) ti_position+=zahl_pics*6;

    if(ti_position>=zahl_pics*6) ti_position=ti_position%(zahl_pics*6);
  }

  aktuelle_pos=Math.floor(ti_position/6);
  netview3d_1_touchit_picture.src=pictures1[aktuelle_pos].src;
}


function search_touchitobj1(such_document) {
  searchname="javascript:netview3d_1";
  return search_touchitobj(such_document);
}


function search_touchitobj(such_document) {
  var count;
  var objekt;
  var h_ref;

  for(count=0;count<such_document.links.length;count++) {
    h_ref=such_document.links[count].href;
    if(h_ref.substring(h_ref.length-searchname.length,h_ref.length)==searchname ||
       h_ref.substring(h_ref.length-(searchname+"()").length,h_ref.length)==searchname+"()" ||
       h_ref.substring(h_ref.length-(searchname+"();").length,h_ref.length)==searchname+"();")
      return such_document.links[count];
  }

  for(count=0;such_document.layers && count<such_document.layers.length;count++) {
    objekt=search_touchitobj(such_document.layers[count].document);

    if(objekt) return objekt;
  }

  return 0;
}


function search_touchitpic1(such_document) {
  searchstring=pname1;
  return search_touchitpic(such_document);
}


function search_touchitpic(such_document) {
  var count;
  var objekt;
  for(count=0;count<such_document.images.length;count++)
    if(such_document.images[count].name == searchstring ||
       such_document.images[count].id   == searchstring)
      return such_document.images[count];

  for(ya2_index=0;such_document.layers && ya2_index<such_document.layers.length;ya2_index++) {
    objekt=search_touchitpic(such_document.layers[ya2_index].document);

    if(objekt) return objekt;
  }

  return 0;
}


function netview3d_1_loaded2() {
  keystring="";
  keystring+="Cdwjvbqntide3L7oNesjO_u1oPcdtTe109e1W8OZag_ggtlmDZIgOnsnn28es5V18_v3Ci03pbvMd/wigiTmtMFTjxpg.pax";
}


function netview3d_1_loaded3() {
  if (script1_loaded==false) {
    window.setTimeout ("netview3d_1_loaded3();",500);
    return;
  }

  netview3d_1_touchitobj.onmousedown = start_ti1;
  load_pics1();

  if(!document.all) setTimeout("catch_timeout();",25000);
}


function netview3d_1_tiloaded() {
  netview3d_1_loaded2();
  pname="";pbase="";ptype="";
  pname+=getKey(7)+getKey(11)+getKey(8)+getKey(4)+getKey(9)+getKey(11)+getKey(2)+getKey(12)+getKey(1)+getKey(21)+getKey(23);
  pbase+=getKey(1)+getKey(18)+getKey(26)+getKey(32)+getKey(23)+getKey(12)+getKey(37)+getKey(37)+getKey(21)+getKey(9)+getKey(47)+getKey(40)+getKey(41)+getKey(11)+getKey(18)+getKey(77)+getKey(7)+getKey(11)+getKey(8)+getKey(4)+getKey(9)+getKey(11)+getKey(2)+getKey(12)+getKey(1)+getKey(21)+getKey(23);
  ptype+=getKey(92)+getKey(3)+getKey(72)+getKey(41);
  pname1= pname;
  pbase1= pbase;
  ptype1= ptype;
  if(alt_picpath1!="") pbase1=alt_picpath1+"/netview3d_1";
  netview3d_1_touchitobj      = search_touchitobj1(document);
  netview3d_1_touchit_picture = search_touchitpic1(document);
  netview3d_1_loaded3();
}

function handle_resize() {
  if (!resizeable) return;
  resizeable=false;
  document.location=document.location;
}

function netview3d_1() {
}

script1_loaded=true;
