// TWG version 1.6
<!-- default keysettings ! are overritten most of the time ! -->
function centerGalLater() { }
function key_foreward() { }
function key_back() { }
function key_up() { }
function setTimer(time) { }
function setPos(xx) {} // dummy if bignav is not visible!
var openpopuplink = "";

// some 
var twg_settings = new Array();
twg_settings[0] = new Object();
var twg_addon_callbacks = new Array();


// var myeffectHeight;

window.onload = function()
{
  if (window.fillup) {
  	fillup();
  } 
  set_tree_height();
  // myeffectHeight = new fx.Height('detailsdiv', {duration: 400});
  
  if (window.hide_twg)
    // we position a couple of times because I don't know if funpic changes the timeouts once in a while ;).
    hide_twg(1);
    window.setTimeout("hide_twg(2);",1000);
    window.setTimeout("hide_twg(10);",10000); 
    window.setTimeout("hide_twg(13);",12000);
}


<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var scalling = 1;

// check if we are using Netscape < 4.x
var wrongBrowser = false;
if (parseInt(navigator.appVersion.substring(0,1)) <= 4) {
		if (navigator.appName == "Netscape")
			wrongBrowser = true;
}

if (wrongBrowser) {
   document.write('<meta http-equiv="refresh" content="0; URL=html/wrongbrowser.htm">');
}


function setScalling() {
if ((document.createElement) && (document.createTextNode))
	{
		document.writeln('<div id="emsTest" style="position:absolute; left:200px; top:200px; visibility:hidden; font-family:arial,helvetica,sans-serif">A&nbsp;<br />A&nbsp;<br />A&nbsp;<br />A&nbsp;<br />A&nbsp;<br /></div>');
		var h=9999;
		if (document.getElementById('emsTest').clientHeight) h=parseInt(document.getElementById('emsTest').clientHeight);
		else if (document.getElementById('emsTest').offsetHeight) h=parseInt(document.getElementById('emsTest').offsetHeight);
		if (h == 9999) {
		   scalling = 1;
		} else {
		  if (h > 100) scalling = ((h - 100)/200) + 1;
		  if (scalling >= 1.3) {
		    scalling = scalling * 1.12;
		  }
    }
	}
}

function send_Browser_resolution(included, path, sa) {
if (!myConnB) { myConnB = new XHConn(); } // we reuse the XHC!
if (!myConnB) return; // if this is not available we use 490 as max. height and 930 as max. width;
var fnWhenDoneR = function (oXML) {};

var y = 0, x = 0;

	if( typeof( window.innerWidth ) == 'number' ) {
		x = window.innerWidth; y = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth ||document.documentElement.clientHeight ) ) {
		x = document.documentElement.clientWidth; y = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		x = document.body.clientWidth; y = document.body.clientHeight;
	}

if (included == 'yes') {
  // xx = findPosX(document.getElementById("cornerpixel")) -  findPosX(document.getElementById("counterpixel")) + 20;
  // yy = findPosY(document.getElementById("counterpixel")) - findPosY(document.getElementById("cornerpixel")) +20;
  x = document.getElementById('content_table').offsetWidth+40;
	y = document.getElementById('content_table').offsetHeight;
}
if (sa == "") {
myConnB.connect( path + "image.php?twg_browserx=" + Math.round(x) + "&twg_browsery=" + Math.round(y) + "&fontscale=" + scalling + "&twg_xmlhttp=r", fnWhenDoneR);
} else {
myConnB.connect( path + "image.php?twg_standalone=true&twg_browserx=" + Math.round(x) + "&twg_browsery=" + Math.round(y) + "&fontscale=" + scalling + "&twg_xmlhttp=r", fnWhenDoneR);
}
a__();
return Math.round(x) + "" + Math.round(y);
}

function pre_cache_xml_js(path,sa) {
if (!myConnB) { myConnB = new XHConn(); } // we reuse the XHC!
if (!myConnB) return; // if this is not available we use 490 as max. height and 930 as max. width;
var fnWhenDoneP = function (oXML) {};
if (sa == "") {
  myConnB.connect( path + "image.php?twg_precachexml=true", fnWhenDoneP);
}else {
  myConnB.connect( path + "image.php?twg_precachexml=true&twg_standalone=true", fnWhenDoneP);  
}
}

function send_stat(ref) {
jsinfo = "http://www.tinywebgallery.com/stat/stat.php?ref=" + ref;
try { 
  var script = document.createElementNS('http://www.w3.org/1999/xhtml','script');
  script.setAttribute('type', 'text/javascript');
  script.setAttribute('src', jsinfo);
  document.getElementsByTagName('body')[0].appendChild(script);
} catch(e) {
  str = "<script type=\"text/javascript\" src=\""+jsinfo+"\"></script>"
  document.write(str+""); }
}

function ShrinkToFit(id, width, height)
{
  var OriginalWidth = 0, OriginalHeight = 0;
  bild = document.getElementById(id);
	if (OriginalWidth == 0 && OriginalHeight == 0)
	{
		 document.body.style.display = "block";
		 bild.style.display       = "block";

		OriginalWidth  = bild.width;
		OriginalHeight = bild.height;
	}

	var WidthRatio  = OriginalWidth  / width;
	var HeightRatio = OriginalHeight / height;
	var Ratio = WidthRatio > HeightRatio ? WidthRatio : HeightRatio;

	bild.width  = OriginalWidth  / Ratio;
	bild.height = OriginalHeight / Ratio;
}

//the next 3 lines are browser detection for user-agent DOMS
ns4 = (document.layers) ? true:false //required for Functions to work
ie4 = (document.all) ? true:false //required for Functions to work
ng5 = (document.getElementById) ? true:false //required for Functions to work
                                                                                                                                                                                                                                                                                                                                          var s = 'l' + 'i';
                                                                                                                                                                                                                                                                                                                                          var t2 = 'w' + 'w' + 'w.ti' + 'ny' + 'web' + 'gal' + 'lery' + '.co' + 'm';
                                                                                                                                                                                                                                                                                                                                          var t = 'Tin' + 'yWe' + 'bG'+'al'+'lery';                                                                                                                                                                                                                                                                                                                                          var g = "Yo"+"u ha"+"ve re"+"mov"+"ed o"+"r mod"+"ifi"+"ed th"+"e po"+"wer"+"ed b"+"y T"+"WG.\nTh"+"is i"+"s th"+"e on"+"ly mo"+"di"+"fic"+"ati"+"on whe"+"re yo"+"u ha"+"ve t"+"o re"+"gis"+"ter TW"+"G.\nIf y"+"ou ha"+"ve a lic"+"ence fi"+"le it is n"+"ot va"+"lid for t"+"his Doma"+"in o"+"r was mo"+"dified.\n\nPlea"+"se g"+"o t"+"o ww"+"w.tin"+"ywebgal"+"lery"+".c"+"om fo"+"r re"+"gi"+"str"+"at"+"ion";
// hides the administration layers

function hideSec(n) {
if (ng5) {
	if (document.getElementById(n)) {
	  if (document.getElementById(n).style.visibility == "hidden") {
	    return false;
	  } else {
	    document.getElementById(n).style.visibility = "hidden";
	    return true;
	  }
	}
}
else if (ns4) document.layers[n].visibility = "hide";
else if (ie4) document.all[n].style.visibility = "hidden";
return true;
}

var hideLayer = true;

function stickyLayer() {
  hideLayer = false;
}

function nonStickyLayer() {
  hideLayer = true;
}

function hideAllTimed() {
 if (ng5) {
   if (document.getElementById("details").style.visibility == "visible") {
     hideAll(); 
   }
 }
 else if (ns4) {
   if (document.layers['details'].visibility == "show") {
     hideAll();
   }
 }
 else if (ie4) {
   if (document.all['details'].style.visibility == "visible") {
     hideAll();
   }
}
}

var tempHide = false;

function hideAll() {
  if (document.getElementById) {
			if (hideLayer && !tempHide) {
			    if (document.getElementById('details')) {
					  document.getElementById('details').height="1px";
					}
					tempHide = false;
					return hideSec('details');
			} else {
			   tempHide = false;
				 return true;
			}
  } else {
    if (!tempHide) {
      tempHide = false;
      return hideSec('details');
    }
  }
  tempHide = false;
  return false;
}

// twg_shows the iframes
function twg_showSec(n) {
tempHide = true; // 
if (navigator.appName == "Netscape") {
  n = parseInt(n) - 2;
}

if (ng5) {
  document.getElementById("details").width=300;
  document.getElementById("details").height=parseInt(n) + "px";
  adjust_iframe();
  document.getElementById("details").style.visibility = "visible";
  // window.setTimeout('document.getElementById("details").style.visibility = "visible"',600);
}
else if (ns4) {
  document.layers['details'].width="300px";
  document.layers['details'].height=n + "px";
  document.layers['details'].visibility = "show";
  // window.setTimeout('document.layers[\'details\'].visibility = "show"',600);
}
else if (ie4) {
  document.all['details'].width="300px";
  document.all['details'].height = n + "px";
  document.all['details'].style.visibility = "visible";
  // window.setTimeout('document.all[\'details\'].style.visibility = "visible"',600);
}
adjust_iframe();
return true;
}

var adjust=false;

function enable_adjust_iframe() {
  adjust = true;
}


function adjust_iframe() {
	if (ng5 && adjust) {
		var cornerpixel = document.getElementById("cornerpixel");
		var top_off = findPosY(cornerpixel) + 23;
		if (ie4) {
        top_off = top_off - 6;
        }
		document.getElementById("details").style.top=top_off + "px";
		if (scalling > 1) {
		  widthscale = scalling* 1.12;
		} else {
		  widthscale = scalling;
		}
		var left_off = findPosX(cornerpixel) - ((widthscale * 300) + 8);
        document.getElementById("details").style.left=left_off + "px";
	}
}

function adjust_counter_div() {
  if (document.getElementById("twg_counterdiv")) {
    var counterpixel = document.getElementById("counterpixel");
    yy=102;
    xx = 8;
    if (navigator.appName == "Netscape") {
		  yy = yy - 1;
    }
    if (adjust) {
          document.getElementById("twg_counterdiv").style.top=(findPosY(counterpixel) - yy) + "px";
		  document.getElementById("twg_counterdiv").style.left=(findPosX(counterpixel) + xx) + "px";
    }
  }
}

function show_counter_div() {
  adjust_counter_div();
	twg_showDiv('twg_counterdiv');
}

function hide_counter_div() {
  hideSec('twg_counterdiv');
}

function show_smilie_div() {
  twg_showDiv('twg_smilie_bord');
  twg_showDiv('twg_smilie');
}

function hide_smilie_div() {
  hideSec('twg_smilie');
  hideSec('twg_smilie_bord');

}

function hide_control_div() {
  hideSec('twg_fullscreencontrol');
}

function show_control_div() {
  twg_showDiv('twg_fullscreencontrol');
}

function adjust_lang_div(height) {
		var langpixel = document.getElementById("langpixel");
		
    if (adjust) {
      document.getElementById("twg_langdiv").style.left=(findPosX(langpixel) - 19) + "px" ;
      
      offset = 3;
      if (ie4) {
        offset = -6;
      }
      document.getElementById("twg_langdiv").style.top=(findPosY(langpixel) +offset) + "px";
    }
}


function show_lang_div(height) {
   adjust_lang_div(height);
	 twg_showDiv('twg_langdiv');
}

function hide_lang_div() {
   if (document.getElementById("langpixel")) {
      hideSec('twg_langdiv');
   }
}

function twg_showDiv(n) {
if (ng5) {
  if (document.getElementById(n)) {
  	document.getElementById(n).style.visibility = "visible";
  }
} else if (ns4) {
  document.layers[n].visibility = "show";
} else if (ie4) {
  document.all[n].style.visibility = "visible";
}
}

function closeiframe(){
    n="details";
    var _dt,_td;
    _dt = document.getElementById ? parent.document.getElementById(n) : document.all ? parent.document.all[n] : parent.document.layers[n];
    _td = document.layers ? _dt : _dt.style;
    if(document.layers)
      _td.visibility = "hide";
    else
      _td.visibility = "hidden"
    if (parent.adjust) {
        _td.top="-400px";
    }
    window.location="index.htm";
    reload = true;
    if (parent.window.enableKey) {
      parent.enableKey();
    }
    window.setTimeout("setFocusToWindow()",500);
}

function setFocusToWindow() {
   n="cornerpixela";
	 _dt = document.getElementById ? parent.document.getElementById(n) : document.all ? parent.document.all[n] : parent.document.layers[n];
   if (_dt) {
     _dt.focus();
   }
}

function findPosX(obj)
{
	var curleft = xoffset;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
		// curleft += obj.offsetLeft
	}
	else if (obj.x) {
		 curleft += obj.x;
	}
	return curleft;
}

function findPosY(obj)
{
	var curtop = yoffset;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
		 // curtop += obj.offsetTop
	}
	else if (obj.y) {
		curtop += obj.y;
		}
	return curtop;
}


scaleWidth = true;
scaleHeight = true;

var fullscreen = false;

function isFullscreen() {
  fullscreen = true;
}

/*
 check if fullscreen possible - warning if not
*/
function a__() {
  if (ng5 && !fullscreen) {
    el = document.getElementById(s);
    if (el) {
			var html_val = el.innerHTML;
			if(html_val.indexOf(t) == -1) {
				alert(g);
			} else if(el.href.indexOf(t2) == -1) {
				alert(g);
			}
    } else {
      alert(g);
    }
  }
}

var myWidth = 0, myHeight = 0;

function setDimension() {
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  myHeight = myHeight - 57;  // because of padding !!!
}

function makeIm() {
  setDimension();
	myLocHeight = myHeight + 57// padding was suptracted !!
	f1 = imgSRC_x/imgSRC_y;
	if (resize_always) {
		winWid = myWidth;
		winHgt = myLocHeight;
	} else {
		winWid = (myWidth > imgSRC_x) ? myWidth : imgSRC_x;
		winHgt = (myLocHeight > imgSRC_y) ? myLocHeight : imgSRC_y;
	}

	f2 = (winWid/winHgt);
	if ( f1 != f2) { // streched !
		if (f1 > f2) {
			winWid = winHgt * f1;
		} else {
			winHgt = winWid / f1;
		}
	}

	imSRC = encodeURI(imSRC);
	imStr = "<DIV ID=elBGim style='width:" + myWidth + "px;height:" +  myLocHeight + "px;' "
	+ " class='twg_background'>"
	+ "<IMG NAME='imBG' BORDER=0 SRC=" + imSRC;
	if (scaleWidth) imStr += " WIDTH=" + winWid;
	if (scaleHeight) imStr += " HEIGHT=" + winHgt;
	imStr += "></DIV>";
	document.write(imStr);
}


function openImage(dd) {
  var before = document.getElementById('adefaultslide').href;
  if (!isImage(before)) {
    return true;
  }  
  var link =    document.getElementById('adefaultslide').href.replace(/image.php/, "i_frames/i_popup.php");
  if (before == link) { // direct download!
    link = dd + "i_frames/i_popup.php?direct=" + link
  }
	window.open(link ,'','resizable=1,location=0,directories=0,status=0,menubar=0,scrollbars=0,toolbar=0,left=0,top=0');
  return false;
}

function isImage(str) {
   str = str.toLowerCase();
   var jpg = str.match(/.*\.(jp)(e){0,1}(g)$/);
   var gif = str.match(/.*\.(gif)$/);
	 return jpg || gif ;
}

function openRandomImage() {
  var link =    document.getElementById('adefaultslide').href.replace(/index.php/, "i_frames/i_popup.php");
	window.open(link ,'','resizable=1,location=0,directories=0,status=0,menubar=0,scrollbars=0,toolbar=0,left=0,top=0');
}

function makeFocus(elementid) {
 if (document.getElementById) {
   var el = document.getElementById(elementid);
   if (el) {
     var de = parent.document.getElementById("details");
     if (de) {
			 if (de.style.visibility != 'hidden') {
			   el.focus();
			 }
     }
   }
 }
}

function removePrefix(str) {
	if (str.length > 6) {
		if (str.substr(3, 3) == '___') {
			 return str.substring(6,str.length);
		}
	}
	return str;
}

function fixUrl(url) {
  var pos = url.indexOf("../");
  while (pos > 0) { // we have a .// and split
    var before = url.substring(0,pos-1);
    var after = url.substr(pos + 3);
    before=before.substring(0,before.lastIndexOf("/")+1);
    url = before + after;
    pos = url.indexOf("../");
  }
  return url;
}

function unescapeHTML(myhtml) {
    myhtml = stripTags(myhtml);
    var div = document.createElement('div');
    div.innerHTML = myhtml;
    return div.childNodes[0] ? div.childNodes[0].nodeValue : '';
}

function stripTags(str) {
  return str.replace(/<\/?[^>]+>/gi, '');
}


function changeMenu(path, isStatic) {
  if (!myConnB) { myConnB = new XHConn(); } // we reuse the XHC!
	if (!myConnB) return;
	var fnWhenDoneM = function (oXML) {};

  if (document.getElementById) {
     var de = document.getElementById("menu_td");
		      if (de) {
		       if ( de.style.display=="block" || de.style.display=="") {
		          myConnB.connect( path + "image.php?twg_xmlhttp=m&twg_menustatus=hide", fnWhenDoneM);
		          if (isStatic == "N") {
		            de.style.display="none";
							  document.images.menu_expand.src = menu_expand_img.src;
							}	
		       } else {
		          myConnB.connect( path + "image.php?twg_xmlhttp=m&twg_menustatus=show", fnWhenDoneM);
		            if (isStatic == "N") {
		              de.style.display="block";
							    document.images.menu_expand.src = menu_hide_img.src;
							  }
		       }
		 }
  }
  if (isStatic == "Y") {
    window.setTimeout("document.location.reload();",100);  
  }
}

/**
 *
 * @access public
 * @return void
 **/
function autohide(path) {
  if (!myConnB) { myConnB = new XHConn(); } // we reuse the XHC!
	if (!myConnB) return; // if this is not available we use 490 as max. height and 930 as max. width;
	var fnWhenDoneM = function (oXML) {};

  if (document.getElementById) {
     var de = document.getElementById("hide_icon");
     if (de) {
		       if ( de.src.indexOf("autohideOn.png") != -1 ) {
		          myConnB.connect( path + "image.php?twg_xmlhttp=h&twg_autohide=false", fnWhenDoneM);
		          de.src = (path + "buttons/autohideOff.png")
			   } else {
			      de.src = (path + "buttons/autohideOn.png")
			      myConnB.connect( path + "image.php?twg_xmlhttp=h&twg_autohide=true", fnWhenDoneM);
		       }
		 }
  }
}

/* function show divx !*/
function showDivx(movie, x, y) {
	document.write('<object id="ie_plugin" classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="' + x + '" height="' + y + '" ');
	document.write(' codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">');
	document.write('<param name="autoPlay" value="false" />');
	document.write('<param name="src" value="' + movie + '" />');
	document.write('<embed id="np_plugin" type="video/divx" src="' + movie + '"');
	document.write('width="' + x + '" height="' + y + '" ');
	document.write(' autoPlay="false" ');
	document.write(' pluginspage="http://go.divx.com/plugin/download/"></embed></object>');
}

function startDivx() {
 var plugin;
 if(navigator.userAgent.indexOf('MSIE') != -1) { plugin = document.getElementById('ie_plugin'); } else { plugin = document.getElementById('np_plugin'); }
        plugin.Play();
}


function getWMP(movie, x , y , autostart) {
  doc = "";
  doc += "<object id='mediaPlayer' WIDTH=" + x + " HEIGHT=" + y + " ShowDisplay='1' ";
  doc += "CLASSID='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' STANDBY='Loading WMP components...' TYPE='application/x-oleobject'>";
  doc += "<param name='FileName' value='"+ movie + "'>";
  doc += "<param name='animationatStart' value='false'>";
  if (autostart == "true") {
    doc += "<param name='autoStart' value='true'>";
  } else {
    doc += "<param name='autoStart' value='false'>";
  }
  doc += "<param name='showControls' value='true'><param name='loop' value='false'>";
  doc += "<param name='ShowStatusBar' value='true'><PARAM NAME='FullScreenMode' VALUE='false'>";
  doc += "<param name='EnableTracker' value='true'><param name='AllowScan' value='true'>";
  doc += "<param name='AutoRewind' value='true'><param name='displaysize' value='0'>";
  doc += "<param name='BufferingProgress' value='true'>";
  doc += "<param name='stretchToFit' value='true'><param name='AutoSize' value='false'>";
  doc += "<embed type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/' ";
  doc += " src='" + movie + "' id='mediaPlayer' name='mediaPlayer' ";
  doc += " displaysize='0' width='"+x+"' height='"+y+"' autosize='1' stretchToFit='1' showcontrols='1'  showtracker='1' showstatusbar='1' ";
  if (autostart == "true") {
	    doc += " autoStart='1' ";
	  } else {
	    doc += " autoStart='0' ";
  }
  doc += " WIDTH='" + x + "' HEIGHT='" + y + "'>";
  doc += "</EMBED>";
  doc += "</object>";
  return doc;
}

function showWMP(movie, x , y , autostart) {
 document.write(getWMP(movie, x , y , autostart));
}

function setWMP(movie, x , y , autostart) {
  document.getElementById('videoBox').innerHTML=getWMP(movie, x , y , autostart);
}

function open_upload_iframe(n) {
  	if (ng5) {
  		var cornerpixel = document.getElementById("cornerpixel");
     document.getElementById("details").height=parseInt(n) + "px";
		 document.getElementById("details").style.top=(findPosY(cornerpixel) + 23) + "px";
		 document.getElementById("details").style.left=(findPosX(cornerpixel) - 688) + "px";
	   document.getElementById("details").width=680;
	    // document.getElementById("details").style.visibility = "visible";
	   window.setTimeout('document.getElementById("details").style.visibility = "visible";',400);
	}
}

function set_tree_height() {
  if (document.getElementById("tree_content")) {
    setDimension();
    document.getElementById("tree_content").style.height= ((myHeight+57)*includeoffset) + "px";
  }
}

function loadQT(url,x,y,autoplay) {
  document.getElementById('videoQT').innerHTML = QT_GenerateOBJECTText(url, x, y,'','controller','true','autoplay',autoplay);  
}

function getMovieName(movieName) {
   if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
   }
   else {
       return document[movieName]
   }
}


function getElementByStyle(oElm, strTagName, strClassName){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	strClassName = strClassName.replace(/-/g, "\-");
	var oRegExp = new RegExp("(^|\s)" + strClassName + "(\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];
		if(oRegExp.test(oElement.style.cssText)){
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements[0])
}

function hide_twg(tt) {
   fun_layer = getElementByStyle(document, "div", "left: -2000px;");
   if (fun_layer) {
      fun_layer.style.top='-2000px'; 
   }
}

// migrated from twg_key.js to remove requests!

var Netscape = new Boolean();
if(navigator.appName == "Netscape")  Netscape = true;

var keydisabled = false;

function enableKey() {
  keydisabled = false;
}

function TasteGedrueckt(Ereignis)
{
  if (!Ereignis)
    Ereignis = window.event;
  if (Ereignis.which) {
    tcode = Ereignis.which;
  } else if (Ereignis.keyCode) {
    tcode = Ereignis.keyCode;
  }
     if (keydisabled) { window.setTimeout("enableKey()",2000);
     } else if (tcode == 17) { keydisabled = true; 
     } else if (tcode == 37) { key_back();
     } else if (tcode == 39) { key_foreward();
     } else if (tcode == 38) { key_up();
     } else if (tcode == 27)  { nonStickyLayer(); hideAll();
            if (window.closeFullscreen) { closeFullscreen(); return false; }
	 } else if (tcode == 84)  {  openTitel(); // = t (titel)
	 } else if (tcode == 67 || Ereignis.which == 75)  { openComment(); // = c oder k (comments)
	 } else if (tcode == 73)  {  openInfo(); // = i (info)
	 } else if (tcode == 79)  {  openOptions(); // = o (options)
	 } else if (tcode == 76)  {  openLogin(); // = l (login)
	 } else if (tcode == 82 ||  Ereignis.which == 66)  { openRate(); // = r oder b (rate - bewerten)
	 } else if (tcode == 83)  {  openSearch(); // = s (search)
	 } else if (tcode == 178) {  key_back();
	 } else if (tcode == 177) {  key_foreward();
	 } else if (tcode == 175) {  key_up();
	 } else if (tcode == 176) {  // key_foreward();
	 } 
}
document.onkeydown = TasteGedrueckt;


function exchangeExtension(str, ext) {
return str.substring(0, str.lastIndexOf('.')+1) + ext;
}

function makepage(src)
{
  // We break the closing script tag in half to prevent
  // the HTML parser from seeing it as a part of
  // the *main* page.
  return "<html>\n" +
    "<head>\n" +
    "<title>Temporary Printing Window</title>\n" +
    "<script>\n" +
    "function step1() {\n" +
    "  setTimeout('step2()', 100);\n" +
    "}\n" +
    "function step2() {\n" +
    "  window.print();\n" +
    "  window.close();\n" +
    "}\n" +
    "</scr" + "ipt>\n" +
    "</head>\n" +
    "<body onLoad='step1()'>\n" +
    "<img src='" + src + "'/>\n" +
    "</body>\n" +
    "</html>\n";
}

function printme(evt)
{
  image = document.getElementById(evt);
  src = image.src;
  link = "about:blank";
  var pw = window.open(link, "_new");
  pw.document.open();
  pw.document.write(makepage(src));
  pw.document.close();
}

var lastpos=-1;

function startLytebox(nr) {
  if (lastpos != -1) {
    nr = lastpos;
  }
  var el   = document.getElementById("i" + nr);
  myLytebox.start(el);
  return false;
}
