/*
	JavaScript functions for general use.
*/

/**
	Function DisplayUrlRF - General function to display a Url on the right frame or its own subframes.
	Since the target="..." attribute on links is not available in an XHTML 1.0 Strict page, one has to use this onclick function for displaying on the right frame.
	Variables:
		Tit is the Url to be linked.
		Pag is the Page frame within the right frame.
		Lan is the actual language the application was set in.
		If Pag is blank the page is shown on the RightFrame.
 */
function DisplayUrl(fr, hr)
{
	if (fr == 'RightFrame')
	{
	top.RightFrame.location.href = hr;
	}
	if (fr == 'LeftFrame')
	{
	top.LeftFrame.location.href = hr;
	}
	if (fr == 'TopFrame')
	{
	parent.RightFrame.TopFrame.location.href = hr;
	}
	if (fr == 'MainFrame')
	{
	parent.MainFrame.location.href = hr;
	}
}

/*********************************************************
	This function allows floating images or text or menus, which move when the page is scrolled
	A <div id="divBottomRight" style="position:absolute"> must be defined in the page where one uses it.
	It could contain an link on text or image like this:
	<a href="#"><img src="<?php echo $ActiveUrl . "Images/Credits/Ape1-1-small.png"; ?>"/></a></div>
	Call like this in the page you want to use it:
		JSFX_FloatDiv("divTopLeft",       10,   10).flt();
		JSFX_FloatDiv("divTopRight", 	  -100,   10).flt();
		JSFX_FloatDiv("divBottomLeft",    10, -100).flt();
		JSFX_FloatDiv("divBottomRight", -100, -100).flt();
	Attention: The <div id="divBottomRight" style="position:absolute"> must be defined before the script call.

	* You may use this code for free on any web page provided that 
	* these comment lines and the following credit remain in the code.
	* Floating Div from http://www.javascript-fx.com
********************************************************/
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
var px = document.layers ? "" : "px";
function JSFX_FloatDiv(id, sx, sy)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};
	el.init=false;
	el.flt=function()
	{
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		if(!this.init)
		{
			this.init=true;
			this.cx = pX+this.sx;
			this.cy = pY+this.sy;
		}
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.flt()", 40);
	}
	return el;
}

