window.addEvent("load",function(e){
	try 
	{
		document.execCommand("BackgroundImageCache", false, true);
	}
	catch(err) {;}
	slideW();
	onloadSlide();	
});

var count=0;
var outEl=6;
var offSet=69;
var c=0;
var MOUSE_IS_OVER=true;
var SLIDE_DIV;

function slideW()
{ 
	window.setTimeout("slideW()",80);
	//if(MOUSE_IS_OVER==true) 
	count=count+1;
	a=document.getElementById("slide").getElementsByTagName("a");
	
	if(count<91) a[0].style.width=90-count+"px";
	if(count>104)
	{
		count=0;
		a[1].style.backgroundPosition="right";
		img=document.getElementById("slide").removeChild(a[0]);
		document.getElementById("slide").appendChild(img);
	}
	if(count>90) a[0].style.marginLeft=104-count+"px";
	if(count<=10)
	{
		a[outEl].style.backgroundPosition="left";
		a[outEl].style.width=80+count+"px";
	}
	ddd=count-10;
	a[outEl+1].style.backgroundPosition="left";
	if(ddd<15 && ddd>0) 
	{
		a[outEl+1].style.marginLeft=ddd+"px";
		a[outEl+1].style.width="0px";
	}
	else
	{
		if((count-24)>0) a[outEl+1].style.width=count-24+"px";
	}
}

function news()
{
	//alert("h");
	offset=-50;
	ie=(document.all)?true:false;
	divs=document.getElementById("cont").getElementsByTagName("div");
	var isnewspage=true;
	try
	{
		startp=document.getElementById("startpage");
		test=startp.nodeName;
	}
	catch (e) {isnewspage=false;}
	
	for(i=0;i<divs.length;i++)
	{
		
		if(divs[i].className=="newsDiv")
		{
			if(isnewspage==true)
			{
				coH=document.getElementById("cont").offsetHeight;
				chH=document.getElementById("chunks").offsetHeight;
				if((chH+offset)>coH) divs[i].style.display="block";
			}
			else divs[i].style.display="block";
		}
	}
}

function normal(img)
{
	if(img.className=="akt") n="a";
	else n="n";
	var src=img.src;
	img.src=src.substring(0,src.length-5)+n+".gif";
}

function hover(img)
{
	var src=img.src;
	img.src=src.substring(0,src.length-5)+n+".gif";
}

function normalA(a)
{
	bI=a.style.backgroundImage.toString().ltrim("url(\"").rtrim("h.gif)\"");
	a.style.backgroundImage="url("+bI+"n.gif)";
	MOUSE_IS_OVER=true;
}
 
function hoverA(a)
{
	bI=a.style.backgroundImage.toString().ltrim("url(\"").rtrim("n.gif)\"");
	a.style.backgroundImage="url("+bI+"h.gif)";
	MOUSE_IS_OVER=false;
}

function onloadNav()
{
	imgs=document.getElementById("imgNav").getElementsByTagName("img");
	for(i=0;i<imgs.length;i++) 
	{
		imgs[i].onmouseout=function(e) {normal( this );};
		imgs[i].onmouseover=function(e) {hover( this );};  
		normal(imgs[i]);
	}
}
function onloadSlide()
{
	as=document.getElementById("slide").getElementsByTagName("a");
	ddd=new Array();
	for(i=0;i<as.length;i++) 
	{
		as[i].onmouseout=function(e) {normalA( this );};
		as[i].onmouseover=function(e) {hoverA( this );};  
	}
}

function chunkOver(cid)
{
	try
	{
		cid=cid.toLowerCase();
		document.getElementById(cid).style.display="block";
		divs=document.getElementById("chunks").getElementsByTagName("div");
		for(i=0;i<divs.length;i++) divs[i].style.display="none"; 
		document.getElementById(cid).style.display="block";
	}
	catch(e) {;}
}

String.prototype.rtrim = function (clist) 
{
	if (clist)
	return this.replace (new RegExp ('[' + clist + ']+$'), '');
	return this.replace (/\s+$/, '');
}

String.prototype.ltrim = function (clist) 
{
	if (clist)
	return this.replace (new RegExp ('^[' + clist + ']+'), '');
	return this.replace (/^\s+/, '');
}

String.prototype.trim = function (clist) 
{
	return this.ltrim(clist).rtrim(clist);
}

