// TwistBox JavaScript - (c)2005 Bernhard Barkow, creativeeyes.atfunction MM_reloadPage(init) {  //reloads the window if Nav4 resized  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}var mx, my, ml, navLyrID='navlyr', bgID='bg', mlxMin=10, mlyMin=0, dOp=.1, dtOp=50;var curQ=0, qTxt=null, qWho=null, qLyr="", qID=0;function getElem(s) { return document.getElementById(s); }function getMPosX(e) { if(e.pageX) return e.pageX; if(e.clientX) return e.clientX; }function getMPosY(e) { if(e.pageY) return e.pageY; if(e.clientY) return e.clientY; }function toggleDrag(e) {	var d=document;	if(!e) var e=window.event;	var o=(e.target)?e.target:e.srcElement;	ml=o.offsetParent;	if (typeof(ml.bbDrag)=='undefined') ml.bbDrag=false;	ml.bbDrag = !ml.bbDrag;	if(ml.bbDrag) {	 d.onmousemove=setPos; d.onmouseup=toggleDrag; }	// start drag	else { d.onmousemove=null; d.onmouseup=null; }	// end drag	BB_setVis(getElem(bgID),!ml.bbDrag);	mx=getMPosX(e); my=getMPosY(e);	setOp(ml,(ml.bbDrag)?.5:1);}function BB_setVis() { // args: object,vis=t(show)/f(hide)	var a=BB_setVis.arguments,p=a[0],v='visible';	if(p!=null) { if(p.style) p=p.style; if(!a[1]) v='hidden'; p.visibility=v }}function setPos(e) {	var x,y; if (!e) var e=window.event;	x=getMPosX(e); y=getMPosY(e);	if(typeof(x)=='undefined' || x<mlxMin) x=mlxMin;	if(typeof(y)=='undefined' || y<mlyMin) y=mlyMin;	ml.style.left=(ml.offsetLeft+x-mx)+'px';	ml.style.top=(ml.offsetTop+y-my)+'px';	mx=x; my=y;}function chkOp(o, br) {	// br=browser type 1...4  if (br==1) return (o.style.opacity != null);	else if (br==2) return (o.style.MozOpacity != null);	else if (br==3) return (o.filters != null);	else if (br==4) return (o.style.KhtmlOpacity != null)}function setOp(o, op) {	// returns true on error	if (chkOp(o,2)) o.style.MozOpacity = Math.min(op,.999);	// Mozilla bug  else if (chkOp(o,1)) o.style.opacity = op;	else if (chkOp(o,4)) o.style.KhtmlOpacity = op;	else if (chkOp(o,3)) o.filters.alpha.opacity = op*100;	else { return true } return false;}function changeOp(s, dOp) {	var o=getElem(s), b=false, c=true, tmpOp; if(typeof(o.iOp)=='undefined') o.iOp=.1;	tmpOp = o.iOp+dOp;	if (tmpOp>=1. && dOp>0) {tmpOp=1.; b=true; }	if (tmpOp<.1 && dOp<0) {tmpOp=.1; b=true; } o.iOp=tmpOp;	c=setOp(o, tmpOp); if (b || c) { BB_clearInt(o);		if (s==qLyr) { if(dOp<0) switchQuot(); }		else {			var bg=getElem('bg'); if(bg!=null) {				if (tmpOp>=1.) { if(!RegExp(/\bactive\b/).test(bg.className)) bg.className+=" active"; }				else bg.className=bg.className.replace(/[\s]?active\b/,"");	} } }}function fadeIn(s) { var o=getElem(s); if(o.iOp!=1) startFade(s,dOp);}function fadeOut(s) { startFade(s,-dOp); }function startFade(s,d) { var o=getElem(s); BB_clearInt(o);	o.fadeID=window.setInterval("changeOp('"+s+"',"+d+")",dtOp); }function BB_clearInt(o) { if (o.fadeID) { window.clearInterval(o.fadeID); o.fadeID=0; } }function iniQuot() {	var a=iniQuot.arguments; qTxt=getElem(a[0]); qWho=getElem(a[1]); qLyr=a[2]; switchQuot(); BB_setVis(getElem(qLyr),true);	if((qTxt!=null)&&(qWho!=null)) qID=window.setInterval(showNextQuot,a[3]);}function showNextQuot() { fadeOut(qLyr); }function switchQuot() {	if (curQ>=quotations.length) curQ=0;	if(qTxt) qTxt.firstChild.nodeValue=quotations[curQ++];	if(qWho) qWho.firstChild.nodeValue=quotations[curQ++];	fadeIn(qLyr);}
