/*
 * JavaScript Library
 * www.kanzlei-hessel.de
 *
 * author: Bernd Höhner
 * date  : 2007-11-28T00:00:00+00:00
 *
 * tab = 4
 */

/////////////////////////////////////////////////
// stores, wheather and which animation is running
var anim  = new Array();

/////////////////////////////////////////////////
// dark and light arrows image objects
var pdark  = new Image(); pdark.src = fl+"pfeildark.gif";
var plight = new Image(); plight.src= fl+"pfeillight.gif";

/////////////////////////////////////////////////
// exchange image at location [what] with n_pix or h_pix
// n_pix and h_pix have to be specified in hosting html-file
function swap( how, what ) {
	if ( how == 1 ) {
		anim[what] = 1;
		document.images[what+offset].src = h_pix[what].src;
		window.setTimeout("set_anim("+what+",0 )",100);
	} else {
		if ( anim[what]==0 ) {
			anim[what] = 1;
			document.images[what+offset].src = n_pix[what].src;
			// reset animation flag 100 ms later
			window.setTimeout("set_anim("+what+",0)",100);
		} else window.setTimeout("delayed_close("+what+")",300);
	}
}

/////////////////////////////////////////////////
// exchange image at location [what] with n_pix[enew] or h_pix[enew]
function swappic(how,what,enew) {
	if (how == 1) {
		document.images[what+offset].src = h_pix[enew].src;
	} else {
		document.images[what+offset].src = n_pix[enew].src;
	}
}

/////////////////////////////////////////////////
// exchange arrow
function spfeil(how, what) {
	if (how == 1) {
		document.images[what].src = plight.src;
	} else {
		document.images[what].src = pdark.src;
	}
}

/////////////////////////////////////////////////
// change animation flag
function set_anim(what , fl) {
	anim[what] = fl;
}

/////////////////////////////////////////////////
// reset other direction
function delayed_close(what) {
	document.images[what+offset].src = n_pix[what].src;
}

function getWebmasterPost(){
  var name  = "Master";
  var sendto = "kanzlei" + "-hessel"
  + "." + "de"
  +"?"+"sub"
  +"ject=Webanfrage";
  var prefix = "mail"
  + "to:";
  var mailid = "webmaster" + String.fromCharCode( 64 ) + sendto;
  /*variant 1*/ document.write("<a href='"+prefix + mailid +"'><img src=\"img/post_web.png\" class=\"email\" valign=bottom border=0 ></a>");
  ///*variant 2*/ document.write("<a href='"+prefix + mailid +"'>"+name+"</a>");
}

function getInfoPost(){
  var name  = "Info";
  var sendto = "kanzlei" + "-hessel"
  + "." + "de"
  +"?"+"sub"
  +"ject=Infoanfrage";
  var prefix = "mail"
  + "to:";
  var mailid = "info" + String.fromCharCode( 64 ) + sendto;
  /*variant 1*/ document.write("<a href='"+prefix + mailid +"'><img src=\"img/post_info.png\" class=\"email\" valign=bottom border=0 ></a>");
  ///*variant 2*/ document.write("<a href='"+prefix + mailid +"'>"+name+"</a>");
}
      