var scrollspeed=cache=1
var dataobj;
var copyobj;

var thelength;
function marqueeInitialize() {
	dataobj=document.all? document.all.verticalmarquee : document.getElementById("verticalmarquee");
	copyobj = dataobj.cloneNode(true);
	dataobj.parentNode.appendChild(copyobj);

	thelength=dataobj.offsetHeight;	
	if( thelength < 355 ) {
		thelength = 355;
	}
	dataobj.style.top=0+"px";
	copyobj.style.top=thelength-10 + "px";

	marqueeScroll();
}

function marqueeScroll(){
	dataobj.style.top=(parseInt(dataobj.style.top)-scrollspeed)+"px" 
	copyobj.style.top=(parseInt(copyobj.style.top)-scrollspeed)+"px";

	if (parseInt(dataobj.style.top)<thelength*(-1)) {
		dataobj.style.top=(thelength-20)+"px";
	}
	if (parseInt(copyobj.style.top)<thelength*(-1)) {
		copyobj.style.top=(thelength-20)+"px";
	}
	setTimeout("marqueeScroll()",20);
}

function arMenuHover( list ) {
	if ( list ) {
		if ( list[0]=='#' ) {
			var lis = document.getElementById( list.substring(1) ).getElementsByTagName("LI");
		} else {
			if ( list[0] == '.') {
				list = list.substring(1);
			}
			var uls = document.getElementsByTagName( 'UL' );
			var lis = [];
			var re = new RegExp('\\b' + list + '\\b' );
			for ( var i = uls.length-1; i>=0; i-- ) {
				if ( re.test(uls[i].className) ) {
					var newlis = uls[i].getElementsByTagName( 'LI' );
					for (var ii=newlis.length-1; ii>=0; ii--) {
						lis = lis.concat( newlis[ii] );
					}
				}
			}
		}
		for (var i=lis.length-1; i>=0; i--) {
			lis[i].onmouseover = function() {
				this.className += " menuHover";
			}
			lis[i].onmouseout = function() {
				this.className = this.className.replace(/ menuHover\b/, '');
			}
		}
	}
}
if (window.attachEvent && ( !document.documentMode || document.documentMode<8) ) {
 arMenuHover( 'menu' );
}
muze.namespace("stodt");
stodt.box = function() {
	return {
		equalheight : function() {
			var box1 = "left_content";
			var box2 = "right_content";

			var elm1 = document.getElementById(box1);
			var elm2 = document.getElementById(box2);
			if (elm1 && elm2) {
				var height1 = parseInt(elm1.offsetHeight);
				var height2 = parseInt(elm2.offsetHeight);

				var maxheight = height1 > height2 ? height1 : height2;

				elm1.style.height = maxheight + "px";
				elm2.style.height = maxheight + "px";
			}
		}
	}
}();

marqueeEvents = function() {
	var marquee = document.getElementById("verticalmarquee");
	if (marquee) {
		muze.event.attach(marquee, "mouseover", function() { scrollspeed=0; });
		muze.event.attach(marquee, "mouseout", function() { scrollspeed=cache; });
		marqueeInitialize();
	}
}


getInternetExplorerVersion = function() { // copied from http://blogs.msdn.com/b/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat(RegExp.$1);
    }
    return rv;
}


fixSfeerOpacities = function(evt) {
	var classCheck = /\bsfeer\b/;
	var divs = document.getElementsByTagName('div');
	for (var i = 0, l = divs.length; i < l; i++) {
		if (classCheck.test(divs[i].className)) {
			muze.event.attach(divs[i], 'mouseover', function(evt) {
				this.style.filter = 'alpha(opacity=70)';
			});
			muze.event.attach(divs[i], 'mouseout', function(evt) {
				this.style.filter = 'alpha(opacity=100)';
			});
		}
	}
}


muze.event.attach(window, "load", stodt.box.equalheight);
//muze.event.attach(window, "load", scrollInit);
muze.event.attach(window, "load", marqueeEvents);

var IEVersion = getInternetExplorerVersion();
if (IEVersion != -1 && IEVersion <= 8.0) {
 	muze.event.attach(window, "load", fixSfeerOpacities);
}

