<!--

var bLocalTestMode = false;

// -- Browserweiche --
var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
if (!ie4 && !ns4) {
	ns4 = true;
}
var ns6 = (document.getElementById && !document.all) ? true : false;

// -- Navigationselemente setzen --
function setnav() {
  if (ie4) {
    if (parent.bottom && parent.bottomsub) {
      if (parent.bottom.setro) parent.bottom.setro();
      if (parent.bottomsub.setro) parent.bottomsub.setro();
    }
    else {
      window.setTimeout("setnav();",1000);
    }
  }
  else {
  	// Funktioniert im Netscape nur über reload

	// Kennt die URL nicht immer! (aufgrund dynamischer Erzeugung des Framesets?)
	//parent.bottomsub.location.reload();
	
	var bodyurl = String(parent.location.search);
  	bodyurl = unescape(bodyurl.substr(1, bodyurl.length-1));
  	var bottomsuburl;
  	var pos = bodyurl.search('/');
  	if (pos > -1) {
  	  bottomsuburl = '../' + 'bottom_'+bodyurl.substr(0, pos)+'.htm';
  	}
  	else {
  	  bottomsuburl = 'empty.htm';
  	}
  	parent.bottomsub.location = bottomsuburl;
  
    /*
    var myevent = new Event();
    myevent.type = parent.bottomsub.document.links[1].onmouseup;
	parent.bottomsub.document.links[1].handleEvent(myevent);
	*/
  }
}

function getpath(url) {
	var path;
	var urlstr = String(url);
	if (urlstr.length == 0) return;
	pos = urlstr.lastIndexOf("/");
	path = urlstr.substr(0,pos+1);
	return path;
}
function getfilename(url) {
	var filename;
	var urlstr = String(url);
	if (urlstr.length == 0) return;
	pos = urlstr.lastIndexOf("/");
	filename = urlstr.substr(pos+1,urlstr.length-1);
	return filename;
}

var popupWin;

// Grosses Bild in eigenem Fenster öffnen
function openbigimg(imgsrc) {
  return openbigimg1(imgsrc, 610);
}

function openbigimg1(imgsrc, defwinheight)
{
  return openbigimglnk(imgsrc, defwinheight, '', '', '');
}

function openbigimglnk(imgsrc, defwinheight, lktxt, lkurl, lkoc)
{	
  var bigimg, filename, pos, winname;
  var winheigth, wintop, winwidth, winleft;
  var mypath;
  
  if (bLocalTestMode)
  {
  	mypath="http://localhost/holz-riegler/";
  }
  else
  {
    mypath="/";
  }
  
  bigimg = new Image();
  filename = getfilename(imgsrc);
  bigimg.src = imgsrc;
  
  wintop = 25;
  winleft = 25;
  if (screen.height <= 600) {
  	winheight = 530;
  }
  else {
  	winheight = defwinheight;
  }
  winwidth = 700;

  pos = filename.indexOf('.');
  winname = filename.substr(0,pos);
  winname = winname.replace('-','');

  // Wenn Linktext, Link-URL (und ev. OnClick-Funktion) angegeben wurden:
  // imagelnk.htm oeffnen anstatt image.htm
  // Wenn Prev-Imagesrc und/oder Next-Imagesrc angegeben wurde:
  // imagenav.htm oeffnen anstatt image.htm
  if (lktxt != '' && lkurl != '')
  {
    myurl = mypath+"imagelnk.htm?"+bigimg.src;
  	myurl += '&' + escape(lktxt) + '&' + escape(lkurl) + '&' + escape(lkoc);
  }
  else
  {
  	myurl = mypath+"image.htm?"+bigimg.src;
  }
  var popupWin = window.open(myurl, winname, 'status=no,menubar=no,location=no,toolbar=no,scrollbars=yes,resizeable=yes,width='+winwidth+',height='+winheight+',top='+wintop+',left='+winleft);
  return false;
}

// Formularfenster öffnen
function openform(sQuerystring)
{
	var winheight = screen.height;
	if (winheight > 650) {
	  winheight = 650;
	  wintop = 35;
		if (ns4) {
		  winheight += 25;
		}
	}
	else {
	  winheight -= 70;
	  wintop = 30;
	}
	var popupWin = window.open('kontakt.asp?'+sQuerystring, 'kontaktbroschuere', 'status=no,menubar=no,location=no,toolbar=no,scrollbars=yes,noresizable,width=600,height='+winheight+',top='+wintop+',left=100');
	return false;
}

// Fenster für Fotoserie öffnen
function openfs(sUrl)
{
  openfs1(sUrl, 610, '');
}

// Fenster für Fotoserie öffnen - inkl. Angabe der Default-Fensterhöhe u. des Win-Names
function openfs1(sUrl, defwinheight, winname)
{
  if (winname == 'baufs' || winname == 'projekt') {
    wintop = 60;
    winleft = 60;
  }
  else if (winname == 'projektdiashow') {
    wintop = 25;
    winleft = 25;  
  }
  else if (winname == 'verkauf_lkw_techn_daten' || winname == 'infovideo') {
    wintop = 40;
    winleft = 40;
  }
  else {
  	wintop = 20;
    winleft = 20;
  }
  winwidth = 575;
  if (screen.height <= 600) {
  	winheight = 530;
  }
  else {
  	winheight = defwinheight;
  }
  winwidth = 700;

  if (winname = '')
    winname = 'fs';

  var popupWin = window.open(sUrl, winname, 'status=no,menubar=no,location=no,toolbar=no,scrollbars=no,noresizable,width='+winwidth+',height='+winheight+',top='+wintop+',left='+winleft);
  return false;
}

// -->
