
	//global variables	
	appVer = navigator.appVersion;
	NS = (navigator.appName == 'Netscape') && ((parseInt(navigator.appVersion) == 3 || parseInt(navigator.appVersion) == 4));
	MSIE = (navigator.appName == 'Microsoft Internet Explorer');
	DHTML = ((NS || MSIE) && (parseInt(navigator.appVersion) >= 4));
	MAC = (navigator.platform.indexOf("Mac") > -1);
	newWin = null;

	
	//alert (navigator.appName + " - " + navigator.appVersion); 
	//alert(DHTML);

	
    //this function swap two images.
    function swapImage(img1, img2)
    {
        document.tempImage.src = img1.src;
        img1.src = img2.src;
        img2.src = document.tempImage.src;
    }
	
	function hideBlueLayers() 
	{
		if(NS && DHTML)
		{
			for(i=0; i<document.pos.document.layers.length; i++)
			{
				document.pos.document.layers[i].visibility = "hide";
			}
		}
		
		if(MSIE && DHTML)
		{
			allDivs = document.all.tags("div");
			for(i=0; i<allDivs.length; i++)
			{
				if(allDivs(i).className =="blueLayer")
				{
					allDivs(i).style.visibility = "hidden";
				}
			}
			mushot.style.visibility = "hidden";
		}
	}
	

   
	
	function changeWhiteLayer(n)
	{
		if(NS && DHTML)
		{
			var dynlayer2 = document.pos2.document.nest2;
			//alert (dynlayer2.name);
			dynlayer2.src=n;
		}
		if(MSIE && DHTML) { 
			parent.document.ieframe2.location.href = n;
		}
	}
	
	function changeBlueLayer(n)
	{
		if(n == "home") activateTick();
		else deactivateTick();

		hideBlueLayers();
		changeWhiteLayer('blank.html');
		if(NS && DHTML)
		{
			document.pos.document.layers[n].visibility="show";
		}

		if(MSIE && DHTML) { 
			var divObj = eval(n);
			//if (MAC && divObj.id == "links") divObj.style.height = "auto";
			divObj.style.visibility = "visible";
		}
	}
	
	
	function indirectGo(fromDir, to){
		var n = to;
		if (NS){ n = fromDir + '/' + to;}
		changeWhiteLayer(n);
	}
	
///////////////////////////////////////////////////////////////////////////

	function newWinClosed()
	{
		if(typeof(newWin) == 'undefined') return true;
		if(newWin == null) return true;
		if(newWin.closed) return true;
		return false;
	}
	
	function openNewWindow(to)
	{
		var n = to;
		var featureStr = 'width=640';
			if(NS) featureStr += ',height=' + String(self.outerHeight - 100);
			featureStr += ',resizable=yes';
			featureStr += ',scrollbars=yes';
			featureStr += ',toolbar=yes';
			//featureStr += ',location=yes';
			featureStr += ',dependent=yes';
			featureStr += ',status=yes';


		if(newWinClosed())
		{
			newWin = window.open(n, 'newWindow', featureStr);
		}
		else
		{
			newWin.location = n;
		}
		newWin.focus();
	}

	function closeNewWindow()
	{
		//self.opener.focus();
		self.close();
	}
/////////////////////////////////////////////////////////////
/*<script language="javascript">
<!-- Original:  Ernst Straka (ernst.straka@central-europe.basf.org) -->
<!-- Web Site:  http://www.rs-systems.at/straka -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
*/

var l1 =   0; // left of ticker in pixel, or 0 to position relative
var t1 =   0; // top of ticker in pixel, or 0 to position relative
var w1 = 600; // width of ticker in pixel
var ie = document.all ? true : false;
var timerID = null;
var tickRunning = false;
var first = true;
var l2 = l1 + w1;
var l3 = l1 - l2;
var l = l2;


function tickinit() {
	if (ie) {
		if (l1 == 0 && t1 == 0) {
			postick = document.all['tickpos'];
			l1 = getLeft(postick);
			t1 = getTop(postick);
		}
		t1 = 450;     //top position overide
		l1 = 10;
		//ticktext.style.posTop = t1;
	}
	else {
		if (l1 == 0 && t1 == 0) {
			postick = document.anchors['tickpos'];
			l1 = postick.x;
			t1 = postick.y;
		}
		t1 = 450;     //top position overide
		l1 = 10;
		//document.ticktext.pageY = t1;
	}
	
	l2 = l1 + w1;
	l3 = l1 - l2;
	l = l2;
	activateTick();
}




function getLeft(ll) {
	if (ll.offsetParent)
		return (ll.offsetLeft + getLeft(ll.offsetParent));
	else 
		return (ll.offsetLeft);
}

function getTop(ll) {
	if (ll.offsetParent)
		return (ll.offsetTop + getTop(ll.offsetParent));
	else
		return (ll.offsetTop);
}

function tick() {
	l = l - 0.5;
	//self.status = "left: " + l;
	//if (l < l3) l = l2;   //was dissapearing too soon - manual overide with number
	if (l < -850) l = l2;
	cl = l1 - l;
	cr = l2 - l;
	if (ie) {
		ticktext.style.posLeft = l;
		ticktext.style.posTop = t1;
		ticktext.style.clip = "rect(auto "+cr+"px auto "+cl+"px)";
		if (first) ticktext.style.visibility = "visible";
	}
	else {
		document.ticktext.pageX = l;
		document.ticktext.clip.left = cl;
		document.ticktext.clip.right = cr;
		if (first) document.ticktext.visibility = "show";
	}
	first = false;
}

function activateTick(){
	if(!tickRunning){
		timerID = setInterval('tick()', 5);
		first = true;
	}
	tickRunning = true;
}

function deactivateTick() {
	clearInterval(timerID);
	if(ie) ticktext.style.visibility = "hidden";
	else document.ticktext.visibility = "hide";
	tickRunning = false;
}
