// obj.js
// 2004 Oestreicher+Wagner Neue Medien, Muenchen


function detectBrowser() {
	var agent	=	navigator.userAgent.toLowerCase();
	this.major	=	parseInt(navigator.appVersion);
	this.minor	=	parseFloat(navigator.appVersion);
	this.ns		=	((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
	this.ns2	=	(this.ns && (this.major == 2));
	this.ns3	=	(this.ns && (this.major == 3));
	this.ns4	=	(this.ns && (this.major == 4));
	this.ns45	=	(this.ns && (this.minor >= 4.5));
	this.ns6	=	(this.ns && (this.major == 5));
	this.ns60	=	(this.ns && (this.major == 5) && (agent.indexOf("netscape6/6.0") != -1));
	this.ns61	=	(this.ns && (this.major == 5) && (agent.indexOf("netscape6/6.1") != -1));
	this.ns62	=	(this.ns && (this.major == 5) && (agent.indexOf("netscape6/6.2") != -1));
	this.ns7	=	(this.ns && (this.major >= 5) && (agent.indexOf("netscape/7") != -1));
	this.moz	=	(agent.indexOf("gecko") != -1 && (this.major >= 5) && (agent.indexOf("netscape") == -1) && (agent.indexOf("safari") == -1));
	this.ff	=	(this.ns && (this.major >= 5) && (agent.indexOf("firefox") != -1));

	this.ie		=	(agent.indexOf("msie") != -1);
	this.ie3	=	(this.ie && (this.major == 2));
	this.ie4	=	(this.ie && (this.major >= 4));
	this.ie40	=	(agent.indexOf("msie4.0")!=-1 || agent.indexOf("msie 4.0")!=-1);
	this.ie401	=	(agent.indexOf("msie4.01")!=-1 || agent.indexOf("msie 4.01")!=-1);
	this.ie45	=	(agent.indexOf("msie4.5")!=-1 || agent.indexOf("msie 4.5")!=-1);
	this.ie5	=	(agent.indexOf("msie5")!=-1 || agent.indexOf("msie 5")!=-1);
	this.ie55	=	(agent.indexOf("msie5.5")!=-1 || agent.indexOf("msie 5.5")!=-1);
	this.ie6	=	(agent.indexOf("msie6")!=-1 || agent.indexOf("msie 6")!=-1);
	this.op3	=	(agent.indexOf("opera") != -1);
	this.saf	=	(agent.indexOf("safari") != -1);
	this.win	=	(agent.indexOf("win")!=-1);
	this.win95	=	(agent.indexOf("windows95")!=-1 || agent.indexOf("windows 95")!=-1 || agent.indexOf("win95")!=-1);
	this.win98	=	(agent.indexOf("windows98")!=-1 || agent.indexOf("windows 98")!=-1 || agent.indexOf("win98")!=-1);
	this.winnt	=	(agent.indexOf("windows nt 4")!=-1 || agent.indexOf("winnt 4")!=-1 || agent.indexOf("winnt4")!=-1);
	this.w2k	=	(agent.indexOf("windows nt 5.0")!=-1 || agent.indexOf("winnt 5.0")!=-1 || agent.indexOf("winnt5.0")!=-1);
	this.wxp	=	(agent.indexOf("windows nt 5.1")!=-1 || agent.indexOf("winnt 5.1")!=-1 || agent.indexOf("winnt5.1")!=-1);
	this.mac	=	(agent.indexOf("mac")!=-1);
	this.unix	=	(agent.indexOf("x11")!=-1);
	this.w3c	=	document.documentElement;

	return this;
}

// initialize browser object
is = new detectBrowser();

var visible = (document.layers) ? "show" : "visible";
var hidden = (document.layers) ? "hide" : "hidden";
var forwardTimer = 0;


function getImgObjLay(layName,imgName) {
	if (document.layers) lay = eval("document['" + layName + "'].document.images['" + imgName + "']");	// object of the actual image embedded in DIV tags
	else lay = document.images[imgName];
}


// Exchange HTML text within div/layer tags *******************************************************
function exchangeHTML(lay,text) {
	if (ready) lay.mWriteText(text);
}


function openDIV(id,left,top,width,height,zindex,visibility,cursor,mover,mout) {
	var propCursor	= (cursor != null)  ? ' cursor:'+cursor+';' 	: '';
	var propMOver	= (mover != null) ? ((document.layers) ? ' onmouseover="'+mover+'"'	: ' onmouseover="'+mover+'"') 	: '';
	var propMOut	= (mout != null)  ? ((document.layers) ? ' onmouseout="'+mout+'"'	: ' onmouseout="'+mout+'"') 	: '';

	if (document.layers) var layer = '<layer name="'+id + '" position=absolute left='+left+' top='+top+' width='+width+' height='+height+' z-index='+zindex+' visibility='+visibility + propMOver+propMOut+'>\n';
	else var layer = '<div id="'+id+'" style="position:absolute; left:'+left+'px; top:'+top+'px; width:'+width+'px; height:'+height+'px; z-index:'+zindex+'; visibility:'+visibility+';'+propCursor+'"' + propMOver+propMOut+'>\n';

	return layer;
}

function closeDIV() {
	return (document.layers) ? "</LAYER>\n" : "</DIV>\n";
}



// ###################
function makeEventObj() {
   	this.mCursor = eCursor;
}

function eCursor(e,cursor) {
	if (document.layers)	// NS4
	{
		if (cursor.toLowerCase() == 'x') return e.pageX;
		if (cursor.toLowerCase() == 'y') return e.pageY;
	}
	else if (document.all)	// IE 4+5
	{
		if (cursor.toLowerCase() == 'x') return window.event.clientX;
		if (cursor.toLowerCase() == 'y') return window.event.clientY;
	}
	else if ((document.getElementById)&&(is.ns6))	// only NS6
	{
		if (cursor.toLowerCase() == 'x') return e.pageX;
		if (cursor.toLowerCase() == 'y') return e.pageY;
	}
}
// initialize event object
//var oEvent = new makeEventObj();

// ###################
function makeFrameLayerObj(param)
{
	this.oArgLayerObj	= new makeParamObj(makeFrameLayerObj.arguments);	// init parameters over object
	this.totalpar		= this.oArgLayerObj.mGetTotal();			// read:  total parameters
	this.id				= this.oArgLayerObj.mGetParam(1);			// read:  main layer's id
	this.frameid		= this.oArgLayerObj.mGetParam(0);			// read:  main layer's id
	this.mObject		= cssFrameObject;								// read:  row object root
	this.mObjStyle		= cssObjStyle;								// read:  row object root + style
	this.mVisible		= cssVisible;
	this.mVisibility	= cssVisible;
	this.mGetVisible	= cssGetVisible;
	this.mGetVisibility	= cssGetVisible;
	this.mWriteText		= cssWriteText;								// write: dynamically write text in a layer
	this.mLeft			= cssLeft;									// write: set layer's left position
	this.mGetLeft		= cssGetLeft;								// read:  get layer's left position
	this.mTop			= cssTop;									// write: set layer's top position
	this.mGetTop		= cssGetTop;								// read:  get layer's top position
	this.mMoveToXY		= cssMoveToXY;								// write: move layer to (x/y)
	this.mWidth			= cssWidth;									// write: set layer's width
	this.mGetWidth		= cssGetWidth;								// read:  get layer's width
	this.mHeight		= cssHeight;								// write: set layer's height
	this.mGetHeight		= cssGetHeight;								// read:  get layer's height
	this.mResizeXY		= cssResizeXY;								// write: resize layer's width and height
	this.mAlignRight	= cssAlignRight;							// write: align layer on right
	this.mAlignBottom	= cssAlignBottom;							// write: align layer on the bottom
	this.mZIndex		= cssZIndex;								// write: set layer's z-index
	this.mGetZIndex		= cssGetZIndex;								// read:  get layer's z-index
	this.mBgColor		= cssBgColor;								// write: set layer's background color
	this.mBgImage		= cssBgImage;								// write: set layer's background image
	this.mLettSpace		= cssLettSpace;								// write: set the space between letters on a layer
	this.mTextAlign		= cssTextAlign;								// write: text alignment on a layer
	this.mToolTip		= cssToolTip;								// write: transform a layer to a tooltip
	this.mClipping		= cssClipping;								// write: set the clipping
	this.mGetClip		= cssGetClip;								// read:  get the clipping
	this.mAddEvent		= cssAddEvent;								// write: attach an event to a layer
	this.mRemEvent		= cssRemEvent;								// write: remove an event attached to a layer
	this.mCursor		= cssCursor;								// write: Cursor
	return this;
}

function makeLayerObj(param)
{
	this.oArgLayerObj	= new makeParamObj(makeLayerObj.arguments);	// init parameters over object
	this.totalpar		= this.oArgLayerObj.mGetTotal();			// read:  total parameters
	this.id				= this.oArgLayerObj.mGetParam(0);			// read:  main layer's id
	this.mObject		= cssObject;								// read:  row object root
	this.mObjStyle		= cssObjStyle;								// read:  row object root + style
	this.mVisible		= cssVisible;
	this.mVisibility	= cssVisible;
	this.mGetVisible	= cssGetVisible;
	this.mGetVisibility	= cssGetVisible;
	this.mWriteText		= cssWriteText;								// write: dynamically write text in a layer
	this.mLeft			= cssLeft;									// write: set layer's left position
	this.mGetLeft		= cssGetLeft;								// read:  get layer's left position
	this.mTop			= cssTop;									// write: set layer's top position
	this.mGetTop		= cssGetTop;								// read:  get layer's top position
	this.mMoveToXY		= cssMoveToXY;								// write: move layer to (x/y)
	this.mWidth			= cssWidth;									// write: set layer's width
	this.mGetWidth		= cssGetWidth;								// read:  get layer's width
	this.mHeight		= cssHeight;								// write: set layer's height
	this.mGetHeight		= cssGetHeight;								// read:  get layer's height
	this.mResizeXY		= cssResizeXY;								// write: resize layer's width and height
	this.mAlignRight	= cssAlignRight;							// write: align layer on right
	this.mAlignBottom	= cssAlignBottom;							// write: align layer on the bottom
	this.mZIndex		= cssZIndex;								// write: set layer's z-index
	this.mGetZIndex		= cssGetZIndex;								// read:  get layer's z-index
	this.mBgColor		= cssBgColor;								// write: set layer's background color
	this.mBgImage		= cssBgImage;								// write: set layer's background image
	this.mLettSpace		= cssLettSpace;								// write: set the space between letters on a layer
	this.mTextAlign		= cssTextAlign;								// write: text alignment on a layer
	this.mToolTip		= cssToolTip;								// write: transform a layer to a tooltip
	this.mClipping		= cssClipping;								// write: set the clipping
	this.mGetClip		= cssGetClip;								// read:  get the clipping
	this.mAddEvent		= cssAddEvent;								// write: attach an event to a layer
	this.mRemEvent		= cssRemEvent;								// write: remove an event attached to a layer
	this.mCursor		= cssCursor;								// write: Cursor
	return this;
}


// object within frame
function cssFrameObject()
{
	if (document.layers)
	{
		if (this.totalpar > 1)	// ==> NS4 nested structure
		{
			var str = this.frameid;
			for (i=1;i<this.totalpar;i++)
			{
				str = str + "document['" + this.oArgLayerObj.mGetParam(i) + "'].";
			}
			return eval(str+'document[this.id]');
		}
		else
			return eval(this.frameid+'.document.layers[this.id]');
	}
	else if (document.all)
		return eval(this.frameid+'.document.all(this.id)');
	else if (document.getElementById)
		return document.getElementById(this.frameid).contentDocument.getElementById(this.id);
	else
		return null;
}


// object containing entire root to layer
function cssObject()
{
	if (document.layers)
	{
		if (this.totalpar > 1)	// ==> NS4 nested structure
		{
			var str = '';
			for (i=1;i<this.totalpar;i++)
			{
				str = str + "document['" + this.oArgLayerObj.mGetParam(i) + "'].";
			}
			return eval(str+'document[this.id]');
		}
		else
			return document.layers[this.id]
	}
	else if (document.all)
		return document.all(this.id)
	else if (document.getElementById)
		return document.getElementById(this.id)
	else
		return null;
}


// pure object with style property
function cssObjStyle()
{
	elem = this.mObject();

	if (document.layers)	// NS 4
		styledLayer = elem;
	else if (document.all)	// IE 4+5
		styledLayer = elem.style;
	else if (document.getElementById)	// NS6, IE5
		styledLayer = elem.style;

	return styledLayer;
}

// hide or show a layer
function cssVisible(mode) {
	if (mode == 1 || mode == "visible")
		option = 'visible'
	else if (mode == 0 || mode == "hidden")
		option = 'hidden'
	else
		option = 'inherit';

	//alert(this.id + this.mObjStyle().top + this.mObjStyle().height);
	this.mObjStyle().visibility = option;
}

// get visibility status
function cssGetVisible() {
	if (this.mObjStyle().visibility == visible)
		return true
	else
		return false;
}

// alter text within a layer
function cssWriteText(text) {
	if (document.layers) {
		this.mObject().document.open();
		this.mObject().document.write(text);
		this.mObject().document.close();
	
	} else if (document.all) {
		if (this.mObject() != null) this.mObject().innerHTML = text;
	
	} else if (is.saf) {
		// no DOM but supported in NS6 though!
		this.mObject().innerHTML = text;
	
	} else if (document.getElementById) {
		this.mObject().innerHTML = text;
	}
}


// move layer xpos pixels from left
function cssLeft(xpos)
{
	xpos += 'px';
	this.mObjStyle().left = xpos;
}


// get layer's left position
function cssGetLeft()
{
	return parseInt(this.mObjStyle().left);
}


// move layer ypos pixels from top
function cssTop(ypos)
{
	ypos += 'px';
	this.mObjStyle().top = ypos;
}


// get layer's top position
function cssGetTop()
{
	return parseInt(this.mObjStyle().top);
}


// move layer to (xpos,ypos)
function cssMoveToXY(xpos,ypos)
{
	this.mLeft(xpos);
	this.mTop(ypos);
}


// set layer width
function cssWidth(width)
{
	this.mObjStyle().width = width + 'px';
}


// get layer's width
function cssGetWidth()
{
	return parseInt(this.mObjStyle().width);
}


// set layer height
function cssHeight(height)
{
	this.mObjStyle().height = height + 'px';
}


// get layer's height
function cssGetHeight()
{
	return parseInt(this.mObjStyle().height);
}


// resize layer
function cssResizeXY(width,height)
{
	this.mWidth(width);
	this.mHeight(height);
}


// align layer on the right
function cssAlignRight(nsLayerWidth)
{
	if (is.ns4)
		this.mLeft(window.innerWidth - nsLayerWidth + 4)	// nsLayerWidth because NS4 does not deliver width after first load
	else if (is.ns6)
		this.mLeft(window.innerWidth - this.mGetWidth() - 14)
	else
		this.mLeft(document.body.clientWidth - this.mGetWidth());
}


// align layer on the bottom
function cssAlignBottom(nsLayerHeight)
{
	if (is.ns4)
		this.mTop(window.innerHeight - nsLayerHeight)	// nsLayerWidth because NS4 does not deliver width after first load
	else if (is.ns6)
		this.mTop(window.innerHeight - this.mGetHeight())
	else
		this.mTop(document.body.clientHeight - this.mGetHeight());
}


// set the z-index of a layer
function cssZIndex(zindex)
{
	this.mObjStyle().zIndex = zindex;
}


// get the z-index of a layer
function cssGetZIndex()
{
	return 	this.mObjStyle().zIndex;
}


// layer's background color
function cssBgColor(bgcolor)
{
	if ((document.all)||(document.getElementById))	// other but NOT NS4
	{
		this.mObjStyle().backgroundColor = bgcolor;
	}
	else if (document.layers)
	{
		this.mObjStyle().bgColor = bgcolor;	// bgColor is deprecated and only for NS4!!!
	}
}


// layer's background iamge
function cssBgImage(bgimage)
{
	if ((document.all)||(document.getElementById))	// other but NOT NS4
	{
		this.mObjStyle().background = 'url('+bgimage+')';
	}
	else if (document.layers)
	{
		this.mObjStyle().background.src = bgimage;
	}
}


// space between a text's letters in a layer
function cssLettSpace(spacing)
{
	this.mObjStyle().letterSpacing = spacing + 'px';
}


// align text in a layer
function cssTextAlign(direction)
{
	this.mObjStyle().textAlign = direction.toLowerCase();
}


// make a tooltip out of a layer
function cssToolTip(text,e,x,y)
{
	if ( (arguments.length == 2) || (arguments.length == 4) )
	{
		if (arguments.length == 2)
		{
			theBgColor   = 'background-color:#FFFF80; layer-background-color:#FFFF80; ';
			theFontColor = 'color:#000000';
		}
		if (arguments.length == 4)
		{
			theBgColor   = ' ';
			theFontColor = 'color:#FFFF80';
		}

		theStyle = 'border:10px; '+ theBgColor + theFontColor;
		theText = '<DIV STYLE="'+theStyle+'"><FONT FACE="verdana,arial" SIZE=1>&nbsp;'+text+'&nbsp;</FONT></DIV>';

		this.mWriteText(theText);
		//eval(root).eval("this.mWriteText(theText)");	// NS6 has problems with root

		if (arguments.length == 2)
		{
			this.mLeft(oMousePos.mCursor(e,'X')+10);
			this.mTop(oMousePos.mCursor(e,'Y')+10);
		}

		if (arguments.length == 4)
		{
			this.mLeft(x);
			this.mTop(y);
		}

		this.mObjStyle().visibility = 'visible';
		//var root = "top.window";
		//eval(root).eval("this.mObjStyle()").visibility = "visible";	// NS6 has problems with root
	}
	else if (arguments.length == 0)
	{
		this.mObjStyle().visibility = 'hidden';	// NS6 has problems with root
	}
	else
	{
		alert('Invalid arguments amount!\nShow tooltip: 5 arguments\nHide tooltip: 1 argument');
	}
}


// sets the clipping rectangle
function cssClipping(cliptop,clipright,clipbottom,clipleft)
{
	if ((document.all)||(document.getElementById))	// other but NOT NS4
	{
		this.mObjStyle().clip = 'rect('+cliptop+'px '+clipright+'px '+clipbottom+'px '+clipleft+'px)';
	}
	else if (document.layers)
	{
		this.mObjStyle().clip.top    = cliptop;
		this.mObjStyle().clip.right  = clipright;
		this.mObjStyle().clip.bottom = clipbottom;
		this.mObjStyle().clip.left   = clipleft;
	}
}


// gets one of the 4 coordinates of a clipping rectangle
function cssGetClip(pos)
{
	if (document.all)
	{
		if (pos.toLowerCase()=='top')
			return parseInt(this.mObject().currentStyle.clipTop)
		else if (pos.toLowerCase()=='right')
			return parseInt(this.mObject().currentStyle.clipRight)
		else if (pos.toLowerCase()=='bottom')
			return parseInt(this.mObject().currentStyle.clipBottom)
		else if (pos.toLowerCase()=='left')
			return parseInt(this.mObject().currentStyle.clipLeft);
	}
	else if ((document.getElementById)&&(is.ns6))
	{
		// NS6 return the whole rect as a string...
		var clipStr = this.mObjStyle().clip;
		// ...so I had to split up before returning a position
		clipStr		= clipStr.substring(clipStr.indexOf("(") + 1);
		top_pos		= parseInt(clipStr);
		clipStr		= clipStr.substring(clipStr.indexOf(" ") + 1);
		right_pos	= parseInt(clipStr);
		clipStr		= clipStr.substring(clipStr.indexOf(" ") + 1);
		bottom_pos	= parseInt(clipStr);
		clipStr		= clipStr.substring(clipStr.indexOf(" ") + 1);
		left_pos	= parseInt(clipStr);

		if (pos.toLowerCase()=='top')
			return parseInt(top_pos)
		else if (pos.toLowerCase()=='right')
			return parseInt(right_pos)
		else if (pos.toLowerCase()=='bottom')
			return parseInt(bottom_pos)
		else if (pos.toLowerCase()=='left')
			return parseInt(left_pos);
	}
	else if (document.layers)
	{
		if (pos.toLowerCase()=='top')
			return parseInt(this.mObject().clip.top)
		else if (pos.toLowerCase()=='right')
			return parseInt(this.mObject().clip.right)
		else if (pos.toLowerCase()=='bottom')
			return parseInt(this.mObject().clip.bottom)
		else if (pos.toLowerCase()=='left')
			return parseInt(this.mObject().clip.left);
	}
}


// add event to a layer
function cssAddEvent(eventtype,methodname)
{
	if (eventtype=='onmouseover')
		this.mObject().onmouseover = eval(methodname);
	if (eventtype=='onmouseout')
		this.mObject().onmouseout = eval(methodname);
	if (eventtype=='onmousedown')
		this.mObject().onmousedown = eval(methodname);
	if (eventtype=='onmouseup')
		this.mObject().onmouseup = eval(methodname);
	if (eventtype=='onmousemove')
		this.mObject().onmousemove = eval(methodname);
	if (eventtype=='onclick ')
		this.mObject().onclick = eval(methodname);
}


// remove event to a layer
function cssRemEvent(eventtype)
{
	if (eventtype=='onmouseover')
		this.mObject().onmouseover = '';
	if (eventtype=='onmouseout')
		this.mObject().onmouseout = '';
	if (eventtype=='onmousedown')
		this.mObject().onmousedown = '';
	if (eventtype=='onmouseup')
		this.mObject().onmouseup = '';
	if (eventtype=='onmousemove')
		this.mObject().onmousemove = '';
	if (eventtype=='onclick ')
		this.mObject().onclick = '';
}

// Cursor
function cssCursor(cursor)
{
	this.mObjStyle().cursor = cursor;
}








// ###################
function makeScreenObj() {
   	this.mGetScreenWidth	=	bwGetScreenWidth;
   	this.mGetScreenHeight	=	bwGetScreenHeight;
   	this.mGetInnerWidth		=	bwGetInnerWidth;
   	this.mGetInnerHeight	=	bwGetInnerHeight;
	return this;
}

function bwGetScreenWidth() {
	return eval(screen.availWidth);
}


function bwGetScreenHeight() {
	return eval(screen.availHeight);
}

function bwGetInnerWidth() {
	if (document.all)
		return document.body.clientWidth
	else
		return window.innerWidth;
}

function bwGetInnerHeight() {
	if (document.all)
		return document.body.clientHeight
	else
		return window.innerHeight;
}


// ###################
function makeFormObj(param)
{
	this.oArgFormObj = new makeParamObj(makeFormObj.arguments);
	this.totalpar		=	this.oArgFormObj.mGetTotal();					// read:  total parameters
	this.id				=	this.oArgFormObj.mGetParam(0);
	this.mFormObject	=	cssFormObject;
	this.mProp			=	cssProp;
	this.mReset			=	cssReset;
	this.mSubmit		=	cssSubmit;
	this.mValue			=	cssValue;
	this.mGetValue		=	cssGetValue;
	return this;
}

// object containing entire root to Form element
// when nested in a layer
function cssFormObject()
{
	if (document.layers)
	{
		if (this.totalpar > 1)	// ==> NS4 nested structure
		{
			var str = '';
			for (i=1;i<this.totalpar;i++)
			{
				str = str + "document['" + this.oArgFormObj.mGetParam(i) + "'].";
			}
			return eval(str+'document[this.id]');
		}
		else
			return document[this.id]
	}
	else if ( (document.all) || (document.getElementById) )
			return document[this.id]
	else
		return null;
}

// set or get the properties of a HTML element inside or outside a layer
function cssProp(htmlElem,arridx)
{
	// NS4:			document.divForm.document.formInside.fieldName.value
	// IE5/NS6:		document.formInside.fieldName.value

	//alert(   eval(this.mFormObject()['display'][0]).value   )
	if (arridx != null)
		return eval(this.mFormObject()[htmlElem][arridx])
	else
		return eval(this.mFormObject()[htmlElem])
}

// clear the form
function cssReset()
{
	this.mFormObject().reset();
}

// submit the form
function cssSubmit()
{
	this.mFormObject().submit();
}

// internal method to set value of an element
function cssValue(field,val)
{
	elem = this.mFormObject();
	eval(elem[field]).value = val;
}

// internal method to get value of an element
function cssGetValue(field)
{
	elem = this.mFormObject();
	return eval(elem[field]).value;
}



// ###################
function makeParamObj(param)
{
	this.paramrow	=	param;
	this.mGetTotal	=	argGetTotal;
	this.mGetParam	=	argGetParam;
	return this;
}


function argGetTotal()
{
	return this.paramrow.length;
}


function argGetParam(par_nr)
{
	return this.paramrow[par_nr];
}

// ###################
function makeURLObj(url_string)
{
	this.mGetURL			=	url_string;
	this.mGetSearchPos		=	this.mGetURL.indexOf('?');
	this.mGetURLLength		=	this.mGetURL.length;
	this.mGetSearchString	=	this.mGetURL.substring(this.mGetSearchPos + 1, this.mGetURLLength);
	this.mGetPair			=	uGetPair;
	this.mGetPairsCount		=	uGetPairsCount;
	this.mGetValue			=	uGetValue;
	return this;
}

// get the amount of pairs
function uGetPairsCount()
{
	return this.mGetSearchString.split('&').length;
}

// get a pair (key and value)
function uGetPair(pair_nr)
{
	return this.mGetSearchString.split('&')[pair_nr];
}

// get a value for a certain key
function uGetValue(keyname)
{
	var valuename = '';
	for (i=0;i<this.mGetPairsCount();i++)
	{
		if (keyname == this.mGetPair(i).split('=')[0])
			valuename = this.mGetPair(i).split('=')[1];
	}
	return valuename;
}


// ###################
function makeRootObj(aObjPath)
{
	this.path		=	aObjPath;	// array of layers
	this.mGetPath	=	pGetPath;
}

function pGetPath()
{
	if (document.layers)
	{
		var first = '';
		for (i=0;i<this.path.length;i++)
		{
			first = first + 'document.' + this.path[i] + '.';
		}
		var second = 'document';
		var fullpath = first + second;
		return eval(fullpath);
	}
	else
		return document;
}




