// 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 = "";

// var myeffectHeight;

window.onload = function()
{
  if (window.fillup) {
  	fillup();
  } 
  set_tree_height();
  // myeffectHeight = new fx.Height('detailsdiv', {duration: 400});
}


<!--
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) {
var myConnB = new XHConn();
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;
}

myConnB.connect( path + "image.php?browserx=" + Math.round(x) + "&browsery=" + Math.round(y) + "&fontscale=" + scalling + "&twg_xmlhttp=r", fnWhenDoneR);
a__();
}

function pre_cache_xml_js(path) {
var myConnB = new XHConn();
if (!myConnB) return; // if this is not available we use 490 as max. height and 930 as max. width;
var fnWhenDoneP = function (oXML) {};
myConnB.connect( path + "image.php?precachexml=true", fnWhenDoneP);

}

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 = 'T' + 'W' + 'G';                                                                                                                                                                                                                                                                                                                                          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 hideAll() {
  if (document.getElementById) {
			if (hideLayer) {
			    if (document.getElementById('details')) {
					  document.getElementById('details').height="1px";
					}
					return hideSec('details');
			} else {
				 return true;
			}
  } else {
    hideSec('details');
  }
}

// twg_shows the iframes
function twg_showSec(n) {
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();
}

var adjust=false;

function enable_adjust_iframe() {
  adjust = true;
}


function adjust_iframe() {
	if (ng5 && adjust) {
		var cornerpixel = document.getElementById("cornerpixel");
		document.getElementById("details").style.top=(findPosY(cornerpixel) + 23) + "px";
		if (scalling > 1) {
		  widthscale = scalling* 1.12;
		} else {
		  widthscale = scalling;
		}
		document.getElementById("details").style.left=(findPosX(cornerpixel) - ((widthscale * 300) + 8)) + "px";
	}
}

function adjust_counter_div() {
	  if (document.getElementById("twg_counterdiv")) {
    var counterpixel = document.getElementById("counterpixel");
    n=100;
    if (navigator.appName == "Netscape") {
		  n = n - 1;
    }
    if (adjust) {
      document.getElementById("twg_counterdiv").style.top=(findPosY(counterpixel) - n) + "px";
		  document.getElementById("twg_counterdiv").style.left=(findPosX(counterpixel) + 6) + "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";
      document.getElementById("twg_langdiv").style.top=(findPosY(langpixel) +3) + "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 (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() {
  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 = "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) {
  var myConnB = new XHConn();
	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) {
  var myConnB = new XHConn();
	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='0' ";
  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='CanScan' value='true'><param name='AutoRewind' value='true'>";
  doc += "<param name='CanSeek' value='true'><param name='BufferingProgress' value='true'>";
  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='4' autosize='-1' showcontrols='true'  showtracker='-1' showstatusbar='-1' ";
  if (autostart == "true") {
	    doc += " autoStart='1' ";
	  } else {
	    doc += " autoStart='0' ";
  }
  doc += " WIDTH='" + x + "' HEIGHT='" + y + "'></EMBED></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);  
}






