//--- XmenuConfig.js
function WinTarget( sSrc )
{
	this.sSrc = sSrc;
}

WinTarget.prototype.createHref = function( sSrc, sText, sNavigationName, sNavigation ) 
{
	if ( sSrc == "#" )
	{ // create link to same page poping up current menu-entry
		sSrc = location + ""; // window.document.URL
		sSrc = sSrc.replace( new RegExp( sNavigationName + "=[^&]*", "" ), sNavigationName + "=" + escape( sText ) );
		if ( sSrc.indexOf( sNavigationName + "=" ) < 0 )
			sSrc = sSrc + "?" + sNavigationName + "=" + escape( sText );
	}
	return sSrc;
}

WinTarget.prototype.open = function( sText, sNavigationName, sNavigation )
{
	window.location = this.createHref( this.sSrc, sText, sNavigationName, sNavigation );
}

function NewWinTarget( sSrc, iX, iY, iWidth, iHeight )
{
	this.win = null;
	this.sSrc = sSrc;
	this.iX = iX;
	this.iY = iY;
	this.iWidth = iWidth;
	this.iHeight = iHeight;
}

NewWinTarget.prototype.open = function()
{
	var sOpts = "toolbar=yes,location=yes,status=yes,menubar=yes,resizable=yes,scrollbars=yes";

	if ( document.body && document.body.offsetWidth )
		sOpts += ",width=" + this.iWidth;
	else if ( window.innerWidth )
		sOpts += ",innerWidth=" + this.iWidth + ",";

	if ( document.body && document.body.offsetHeight )
		sOpts += ",height=" + this.iHeight
	else if ( window.innerHeight )
		sOpts += ",innerHeight=" + this.iHeight

	sOpts +=",top=" + this.iY;
	sOpts += ",left=" + this.iX;

	this.win = top.open( this.sSrc, "", sOpts );
}

function FrameTarget( sSrc, sId )
{
	this.sSrc = sSrc;
	this.sId = sId;
}

FrameTarget.prototype.open = function()
{
	var target = top.frames[ this.sId ];
	if ( target )
		target.document.location.href = this.sSrc;
}

function IframeTarget( sSrc, sId )
{
	this.sSrc = sSrc;
	this.sId = sId;
}

IframeTarget.prototype.open = function()
{
	if ( !this.ns47up )
	{
		var target = top.frames[ this.sSrc ];
		if ( target )
			target.src = this.sSrc;
	}
}
//---

//--- Debug.js
function Debug()
{	
	this.outputElementName = "debug";
	this.sText = "";
}

debug = new Debug();

Debug.prototype.writeHtml = function( iColumns, iRows )
{	
	sTextAreaHtml =
		"<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">" +
			"<tr>" +
				"<td colspan=\"3\">" +
					"<form>" +
						"<textarea type=\"text\" name=\"" + this.outputElementName + "\" id=\"debug\" cols=\"" + iColumns + "\" rows=\"" + iRows + "\">" +
						"</textarea><br>" +
						"<input type=\"button\" value=\"select all\" onClick=\"javascript:document.getElementById( 'debug' ).select()\">" +
						"<input type=\"reset\" value=\"clear\">" +
					"</form>" +
				"</td>" +
			"</tr>" +
		"</table>";	
		
	document.write( sTextAreaHtml );
}

Debug.prototype.flushBuffer = function()
{
	var outputElement = this.getOutput();
	if ( outputElement )
	{
		outputElement.value = this.sText + "\n" + outputElement.value ;
	}
}

Debug.prototype.bufferedWrite = function( sText )
{
	this.sText = sText + "\n" + this.sText;
}

Debug.prototype.write = function( sText )
{
	var outputElement = this.getOutput(); 
	if ( outputElement )
	{
		outputElement.value = sText + "\n" + outputElement.value;
	}
}

Debug.prototype.getOutput = function()
{
	var outputElement = null;
	if ( is.nn4up )
	{
		outputElement = document.forms[ "\"" + this.outputElementName + "\"" ];
	}
	else if ( is.gk || is.iewin5up || is.iemac5up || is.sf || is.op || is.kq )
	{
		outputElement = document.getElementById( this.outputElementName );
	}
	return outputElement;
}
//---
//--- Browser.js
// created by: André Dietisheim (dietisheim@sphere.ch)
// created: 2001-31-12
// modified by: André Dietisheim (dietisheim@sphere.ch)
// modified: 2004-01-28
// version: 0.8.0

function Browser( browsers ) 
{
	this.browsers = browsers;	// browser detection array
	this.createBooleans();
}

Browser.prototype.createBooleans = function() 
{
	var name = navigator.appName;
	var cname = navigator.appCodeName;
	var usragt = navigator.userAgent;
	var ver = navigator.appVersion;
	for ( i = 0; i < this.browsers.length; i++ ) 
	{
		var browserArray = this.browsers[ i ]; // browsers-array

		var sCheck = browserArray[ 1 ]; // 'logical expr' that detects the browser
		var sCurrentVersion = browserArray[ 2 ]; // 'regexp' that gets current version
		var sBrand = browserArray[ 0 ]; // browser-obj 'property' (is.xx)
		var availableVersions = browserArray[ 3 ]; // 'versions' to check for

		if ( eval( sCheck ) )
		{ // browser recognized
			eval( "this." + sBrand + " = true" ); // browser-obj property (is.xx)
			var regexp, ver, sMinorVersion, sMajorVersion;
			regexp = new RegExp( sCurrentVersion );
			regexp.exec( usragt ); // parse navigator.userAgent
			var sMajorVersion = RegExp.$1;
			var sMinorVersion = RegExp.$2;

			for ( j = 0; j < availableVersions.length; j++ )
			{
				if ( parseFloat(availableVersions[ j ]) <= eval( sMajorVersion + "." + sMinorVersion ) )
				{ // upper versions
					eval( "this." + sBrand + availableVersions[ j ].substr( 0, 1 ) + availableVersions[ j ].substr( 2, 1 ) + "up = true" );
				}
				if ( parseFloat(availableVersions[ j ]) == eval( sMajorVersion + "." + sMinorVersion ) ) 
				{ /// current version
					eval( "this." + sBrand + availableVersions[ j ].substr( 0, 1 ) + availableVersions[ j ].substr( 2, 1 ) + "= true" );
				}
			}
		}
	}
}

is = new Browser ( 
[
	// Internet Explorer Windows ---
	[ "iewin",
		"cname.indexOf( 'Mozilla' ) >= 0 && name.indexOf( 'Microsoft Internet Explorer' ) >= 0 && usragt.indexOf( 'MSIE' ) >= 0 && usragt.indexOf( 'Opera' ) < 0 && usragt.indexOf( 'Windows' ) >= 0", // IE detection expression
		"MSIE.([0-9]).([0-9])",	// regexpr for version (in navigator.userAgent)
		[ "5", "5.5", "6" ] ],	// published versions
	// Internet Explorer Macintosh ---
	[ "iemac",
		"cname.indexOf( 'Mozilla' ) >= 0 && name.indexOf( 'Microsoft Internet Explorer' ) >= 0 && usragt.indexOf( 'MSIE' ) >= 0 && usragt.indexOf('Opera') < 0 && usragt.indexOf('Mac') >= 0",
		"MSIE.([0-9]).([0-9])",
		[ "5", "5.1", "5.2" ] ],
	// Gecko (Mozilla, Galeon, Firebird, Netscape >=6.x) ---
	[ "gk", 
		"cname.indexOf( 'Mozilla' ) >= 0 && name.indexOf( 'Netscape' ) >= 0 && usragt.indexOf( 'Gecko' ) >= 0 && usragt.indexOf( 'Safari' ) < 0",
		"[rv[:| ]*([0-9]).([0-9])|Galeon\/([0-9]).([0-9])]",
		[ "0.7", "0.8", "0.9", "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6" ] ],
	// Netscape Navigator ---
	[ "nn",
		"cname.indexOf( 'Mozilla' ) >= 0 && name.indexOf( 'Netscape' ) >=0 && parseInt( ver ) <= 4",
		"([0-9]).([0-9])",
		[ "4", "4.5", "4.7", "4.8" ] ],
	// Opera ---
	[ "op",
		"cname.indexOf( 'Mozilla' ) >= 0 && ( name.indexOf( 'Microsoft Internet Explorer' ) >=0 || name.indexOf( 'Opera' ) >= 0 ) && usragt.indexOf( 'Opera' ) >= 0",
		"Opera.([0-9]).([0-9])",
		[ "5", "5.1", "6", "7", "7.1", "7.2" ] ],
	// Safari ---
	[ "sf",
		"cname.indexOf( 'Mozilla' ) >= 0 && name.indexOf( 'Netscape' ) >=0 && usragt.indexOf('AppleWebKit' ) >= 0 && usragt.indexOf('Safari') >= 0",
		"AppleWebKit\/([0-9])", 
		"Konqueror\/([0-9]\.[0-9])",
		[ "48", "85" ] ],
	// Konqueror ---
	[ "kq",
		"cname.indexOf( 'Mozilla' ) >= 0 && name.indexOf( 'Konqueror' ) >= 0 && usragt.indexOf( 'Konqueror' ) >= 0",
		"Konqueror\/([0-9]).([0-9]*)",
		[ "2.2", "3", "3.1" ] ]
] );
//---

//--- XlayerParent.js
// created by: André Dietisheim (dietisheim@sphere.ch)
// created:	2001-12-20
// modified by: André Dietisheim (dietisheim@sphere.ch)
// modified: 2004-02-06
// version: 1.4.0

function XlayerParent( sLayerId, sImg, sDesc, iWidth, iHeight, sContent )
{
	// static var --------
	if( !XlayerParent.prototype.instances ) XlayerParent.prototype.instances = new Array();
	XlayerParent.prototype.instances[ XlayerParent.prototype.instances.length ] = this;
	this.sId = this.create( sLayerId, sImg, sDesc, iWidth, iHeight )
}

XlayerParent.prototype.create = function( sLayerId, sImg, sDesc, iWidth, iHeight )
{
	this.sParentLayerId = sLayerId;
	this.sParentLayerXlayerId = sLayerId + "Xlayer"

	var sLayer = "";
	var content_str = '';

	// BUGFIX BY ANDRE, init var!
	sContent = ""
	if ( sImg )
		sContent = '<img src="' + sImg + '" width="' + iWidth + '" height="' + iHeight + '" border="0" >';
	else if ( sDesc )
		sContent = sDesc;

	// nn4up ----------
	if ( is.nn4up )
	{
		var sLayer = '<ilayer id="' + sLayerId + '" top=0 left=0 width=' + iWidth + ' height=' + iHeight + ' >' + ( ( sContent )? sContent : "" ) + '</ilayer>';
		document.write( sLayer );
		return sLayerId;
	}

	// iewin5up, iemac5up, gk --------
	else if ( is.iewin5up || is.iemac5up || is.gk || is.sf || is.kq3up || is.op6up )
	{
		var sLayer = '<div id="' + sLayerId + '" style="position:relative; width: ' + iWidth + 'px; height: ' + iHeight + 'px; ">'  + ( ( sContent )? sContent : "" ) + '</div>';
		document.write( sLayer );
		return sLayerId;
	}
	else
	{
		return null;
	}
}

XlayerParent.prototype.getLayer = function( sLayerId )
{
	var layer = null;

	if ( sLayerId )
	{	// id supplied
		if ( is.iewin5up || is.iemac5up || is.gk || is.sf || is.kq3up || is.op6up )
			return document.getElementById( sLayerId );
		else if ( is.nn4up )
			return document.layers[ sLayerId ];
	}
	else if ( !sLayerId )
	{	// null supplied
		if ( is.iewin5up || is.iemac5up || is.gk || is.sf || is.kq3up || is.op6up )
			return document.body;
		else if ( is.nn4up )
			return window;
	}
}


XlayerParent.prototype.getX = function( layer )
{
	var x = 0;

	if ( is.nn4up )
	{
		if ( layer != window )			
			x = layer.pageX;
	}
	else if ( is.gk || is.iemac5up || is.iewin5up || is.sf || is.kq3up || is.op6up )
	{
		if ( layer != document.body )
		{
			currentX = 0;
			object = layer;
			while ( object )
			{
				currentX += object.offsetLeft;
				object = object.offsetParent;
			}
			x = currentX;
		}

		if ( is.iemac5up )
			x += parseInt( "0" + document.body.currentStyle.marginLeft, 10  );

	}
	return x;
}


XlayerParent.prototype.getY = function( layer )
{
	var y = 0;

	if ( is.nn4up )
	{
		if ( layer != window )  y = layer.pageY;
	}
	else if ( is.gk || is.iewin || is.iemac5up || is.sf || is.kq3up || is.op6up )
	{
		if ( layer != document.body )
		{
			currentY = 0;
			object = layer;
			while ( object )
			{
				currentY += object.offsetTop;
				object = object.offsetParent;
			}
			y = currentY;
		}
		if ( is.iemac5up )
			y += parseInt( "0" + document.body.currentStyle.marginTop, 10  );
	}

	return y;
}


XlayerParent.prototype.getW = function( layer )
{
	var w = 0;

	if ( is.nn4up )
	{
		if ( layer == window )
			return window.innerWidth;
		else
			return layer.clip.width;
	}
	else if ( is.gk || is.iemac5up || is.sf || is.kq3up || is.op6up )
	{
		if ( layer == document.body )
			return window.innerWidth;
		else
			return layer.offsetWidth;
	}
	else if ( is.iewin5up )
	{
		if ( layer == document.body )
			return document.body.clientWidth;
		else
			return layer.offsetWidth;
	}
}


XlayerParent.prototype.getH = function( layer )
{
	var h = 0;

	if ( is.nn4up )
	{
		if ( layer == window )
			return window.innerHeight;
		else
			return layer.clip.height;
	}
	else if ( is.gk || is.iemac5up || is.sf || is.kq3up || is.op6up )
	{
		if ( layer == document.body )
			return window.innerHeight;
		else
			return layer.offsetHeight;
	}
	else if ( is.iewin5up )
	{
		if ( layer == document.body )
			return document.body.clientHeight;
		else
			return layer.offsetHeight;
	}
}
//---
