// JavaScript Document

// browser detection:
var ua = navigator.userAgent;
var ns = (navigator.appName.toLowerCase().indexOf("netscape")!=-1)?1:0;
var ns4 = (document.layers)?1:0;
var ns6 = (document.getElementById && ns)?1:0;
var mac = (navigator.userAgent.toLowerCase().indexOf("mac")!=-1)?1:0;
var macie4 = (mac && !ns && parseInt(ua.substr(ua.indexOf("MSIE")+4,2)) <= 4)?1:0;
var macie = (mac && !ns)?1:0;


var contH="100%"
var contW="100%"
function GetContentH(){
	if (ns) {
				contH=window.innerHeight	
				contW=parseInt(window.innerWidth-680)/2
			}
	else
			{				
				contH=document.body.clientHeight
				contW=parseInt((document.body.clientWidth-680))/2
			}
}

FixNSWindow();
function FixNSWindow() {
	if (ns6 || ns && (parseInt(navigator.appVersion) == 4)) {
		if (typeof document.NS == 'undefined') document.NS = new Object;
		if (typeof document.NS.NS_scaleFont == 'undefined') {
			document.NS.FixCssInNS = new Object;
			document.NS.FixCssInNS.initWindowWidth = window.innerWidth;
			document.NS.FixCssInNS.initWindowHeight = window.innerHeight;
		}
		window.onresize = FixCssInNS;
	}
}
function FixCssInNS() {
	if (document.NS.FixCssInNS.initWindowWidth != window.innerWidth || document.NS.FixCssInNS.initWindowHeight != window.innerHeight) document.location = document.location;
}
ReloadWindow();
function ReloadWindow(){if (!ns) setTimeout("window.onresize=new Function('window.location.reload()')",200);}


function grow1(w)
{
				obj = document.getElementById("DivId1");
				obj.style.height=253;
				obj.style.left=w;
				obj.style.top=110;
				obj.style.visibility="visible";
				
				if (document.getElementById("scroll1"))
				{
					obj = document.getElementById("scroll1");
					obj.style.visibility="hidden";
				}
}

function grow2(w)
{
				obj = document.getElementById("DivId3");
				obj.style.height=253;
				obj.style.left=w;
				obj.style.top=110;
				obj.style.visibility="visible";
				
				if (document.getElementById("scroll1"))
				{
					obj = document.getElementById("scroll1");
					obj.style.visibility="hidden";
				}
}

function disp1()
{
	obj1 = document.getElementById("DivId1");
	obj3 = document.getElementById("DivId3")
	obj1.style.visibility="hidden";
	
	if (document.getElementById("scroll1"))
	{ 
		if(obj3.style.visibility!="visible")
		{
			objs = document.getElementById("scroll1");
			objs.style.visibility="visible";
		}
	}
}

function disp2()
{
	obj1 = document.getElementById("DivId1");
	obj3 = document.getElementById("DivId3");
	obj3.style.visibility="hidden";
	
	if (document.getElementById("scroll1"))
		{ 
			if(obj1.style.visibility!="visible")
			{
				objs = document.getElementById("scroll1");
				objs.style.visibility="visible";
			}
		}
}


var text = new Array("images/text11_1.gif","images/text11.gif",
"images/text22_2.gif","images/text22.gif",
"images/text33_3.gif","images/text33.gif");

function rotateText(i)
{
	if (parseInt(i)==parseInt(text.length))
	{i=0;}
	
	document.getElementById('rot').innerHTML="<img src="+ text[i] +"><br><img src='images/line.gif' vspace='11'><br><img src="+ text[i+1] +">";
	i=parseInt(i)+2
	window.setTimeout("rotateText("+ i +")",6000);
}

var nstabil = 'start'
var direction = '0'

function allert(n)
{
	if(n!=nstabil){return;}
	
	if (n==nstabil)
	{
		if(direction=='0')
		{
			scrollUpp();
			window.setTimeout("allert('start')",1);
		}
		else
		{
			 if (direction=='1')
			{
				scrollDown();
				window.setTimeout("allert('start')",1);
			}
		}
	}
}

function scrollDown()
{
	obj = document.getElementById("scroll2");
	if (parseInt(obj.style.top)!=0)
	{
		obj.style.top = parseInt(obj.style.top) + 1;
	}
}

function scrollUpp()
{
	obj = document.getElementById("scroll2");
	if (parseInt(obj.style.top)!=-260)
	{
		obj.style.top = parseInt(obj.style.top) -1;
	}
}