
var timeout;
var timeoutScroll;
var object;

//Sa ma kk in toti indienii prosti care au facut ie6!!!!!

function ie6_suxx()
{
    //alert(object.className);
    object.className = object.className.replace(/li_hover/,"");
}

var sbaTimeout = 0;

function ie6_suxxx()
{
    //alert('aaa');
    if (sbaTimeout) clearTimeout(sbaTimeout);

    document.getElementById('status_container').style.display = "none";

    if(document.documentElement.scrollTop + document.documentElement.clientHeight < document.body.clientHeight + 20)
    	document.getElementById('status_container').style.top = parseInt(document.documentElement.scrollTop + document.documentElement.clientHeight) + "px";

	sbaTimeout = setTimeout("statusBarAppear()",100);
}

function statusBarAppear()
{
	new Effect.Appear($('status_container'),{duration:1});
}

function ie6_sux()
{
	var browserName = navigator.appName;
	var browserVer  = parseInt(navigator.appVersion);

	if (browserName == "Microsoft Internet Explorer" &&
		vIE()  <  7)
	{
	    //zindex bug
	    document.getElementById("header").style.zIndex = '1001';

	    //position:fixed bug
	    //setInterval ('ie6_suxxx()', 100);
	    //window.onscroll = ie6_suxxx;

	    //menu li:hover bug
		var pmenu = document.getElementById("menu");
		for (var x=0; x<pmenu.childNodes.length; x++)
		{
			var node = pmenu.childNodes[x];
			if (node.nodeName=="LI")
			{
				node.onmouseover=function() {
				    if (timeout) clearTimeout(timeout);

				    if (object!=this && typeof(object) == "object")
				    {
				        object.className = object.className.replace(/li_hover/,"");
				    }

				    this.className = this.className.replace(" li_hover","");
					this.className+=" li_hover";
				}
				node.onmouseout=function() {
				    object  = this;
				    timeout = setTimeout('ie6_suxx()',100);
				}
			}
		}

		var pmenu = document.getElementById("menu_action_toggle");

		if (pmenu)
		{
    		for (var x=0; x<pmenu.childNodes.length; x++)
    		{
    			var node = pmenu.childNodes[x];
    			if (node.nodeName=="LI")
    			{
    				node.onmouseover=function() {
    				    if (timeout) clearTimeout(timeout);

    				    if (object!=this && typeof(object) == "object")
    				    {
    				        object.className = object.className.replace(/li_hover/,"");
    				    }

    				    this.className = this.className.replace(" li_hover","");
    					this.className+=" li_hover";
    				}
    				node.onmouseout=function() {
    				    object  = this;
    				    timeout = setTimeout('ie6_suxx()',100);
    				}
    			}
    		}
		}
	}
}

function vIE(){return (navigator.appName=='Microsoft Internet Explorer')?parseFloat((new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]):-1;}
function moveChatWindow()
{
    var browserName = navigator.appName;
	var browserVer  = parseInt(navigator.appVersion);

	if (browserName == "Microsoft Internet Explorer" &&
		vIE()  <  7)
	{
	    ie6_suxxx();
	}
}

Event.observe(window, 'load',  moveChatWindow, false);
Event.observe(window, 'scroll',  moveChatWindow, false);
Event.observe(window, 'load', ie6_sux, false);
