function shownewsticker()
{
	nt=document.getElementById("newsticker");
	list=nt.getElementsByTagName("li");
	if (list)
	{
		setelement=list[0];
		nextactive=false;
		for (var i=0;i<list.length;i++)
		{
			if (nextactive)
			{
				setelement=list[i];
				nextactive=false;
			}
			else
			if (list[i].className=="active")
			{
				list[i].className="";
				nextactive=true;				
			}
		}
		setelement.className="active";
	}
	window.setTimeout("shownewsticker()",3000);
	
}

function resizetobrowser()
{
	chheight=document.body.offsetHeight;
	//alert(chheight+":");

}

var navmenus=[];


function attachtreeclick(id)
{
	var navigation=document.getElementById(id);
	$("#"+id+" li.nourl > a").click(
		function() {$(this).parent().toggleClass("menuselect");return false;}
	)
	
	
}

function attachmenu(id)
{
	if (id)
	{
	navigation=document.getElementById(id);
	items=navigation.getElementsByTagName("li");
	for(var i=0;i<items.length;i++)
	{
		if(items[i].parentNode==navigation)
		{
			items[i].onmouseover=
				function ()
				{
					try
					{
					$addClass(this,"hover");document.getElementById('container').className='hideinput';
					}
					catch(err)
					{
					}
				}
			items[i].onmouseout=
				function ()
				{
					try
					{
					$removeClass(this,"hover");document.getElementById('container').className='';
					}
					catch(err)
					{
					}
				}
		}
	}
        }
	else
	for(var i=0;i<navmenus.length;i++)
	{
		switch(navmenus[navmenus[i]])
		{
			case "treeclick":
				attachtreeclick(navmenus[i]);
				break;

			default:
				attachmenu(navmenus[i]);
				break;
		}
	}
}




function $sel(sel)
{
    if (typeof(sel)=="string")
    return document.getElementById(sel);
    return sel;
}
function $addClass(sel,classname)
{
    if ($hasClass(sel,classname)) return ;
    $(sel).className=$(sel).className+" "+classname;
    
}
function $hasClass(sel,classname)
{
    var found=false;
    $(sel).className.replace(/[^\s\t\n\ ]+/ig,function($1) {if ($1==classname) found=true;})
    return found;
}
function $removeClass(sel,classname)
{
    if (!$hasClass(sel,classname)) return ;
    $(sel).className=$(sel).className.replace(/[\s\ ]*([^\s\t\n\ ]+)/ig,function($1,$2) {if ($2==classname) return "";else return $1;})
}
function $show(sel)
{
    $(sel).style.display="";
}
function $hide(sel)
{
    $(sel).style.display="none";
}
function $parent(sel,tagname)
{
    var el=$(sel);
    tagname=String(tagname).toUpperCase();
    while(el.parentNode)
    {
        if (String(el.parentNode.tagName).toUpperCase()==tagname)
            return el.parentNode;
        el=el.parentNode;
    }
    return null;
}

function $child(sel,index,tagname)
{
    var childnodes=$(sel).childNodes;
    if (!tagname)
        return childnodes[index];
    tagname=String(tagname).toLowerCase();
    for (var i=0;i<childnodes.length;i++)
    {
        if (String(childnodes[i].tagName).toLowerCase()==tagname)
        {
            index--;
            if (index<0)
                return childnodes[i];
        }
    }
    return null;
}


function $child(sel,index,tagname)
{
    var childnodes=$(sel).childNodes;
    if (!tagname)
        return childnodes[index];
    tagname=String(tagname).toLowerCase();
    for (var i=0;i<childnodes.length;i++)
    {
        if (String(childnodes[i].tagName).toLowerCase()==tagname)
        {
            index--;
            if (index<0)
                return childnodes[i];
        }
    }
    return null;
}



function hidesite(config)
	{
		if(!$.browser.msie || ($.browser.msie &&  $.browser.version >= 7))
		{
			config=config || {};
			//alert(document.scrollTop);
			var height=$(window).height();
			var width=$(window).width();
			var bwidth=$(document).width();
			var bheight=$(document).height();
			if (height<bheight) height=bheight;
			if (width<bwidth) width=bwidth;
			
			
			$("body").prepend("<div id=\"fader\" style=\"display:none\"></div>");
			$("div#fader").css(
				{
					backgroundColor:config.color || "#055",
					width:width+"px",
					height:height+"px",
					zIndex:99999,
					display:"block",
					position:"absolute",
					left:"0px",
					top:"0px",
					opacity:"0"
				}
				);
			
			
			$("div#fader").fadeTo("slow","0.4",function () {$("div#fader").bind("mousedown",function(){stopsitehide()}) });
			
			
			$(window).bind("focus",function() {stopsitehide()});
		}
	}
	function stopsitehide()
	{
		$("div#fader").stop();
		$(window).unbind("focus");
		$("div#fader").unbind("click");
		$("div#fader").fadeTo("fast","0",function() {$("div#fader").remove();}) 
		
	}