//
// $Id: DrundoScripts.js,v 1.1.1.1 2006/10/18 01:55:43 dscvs Exp $
//

if (document.all && window.attachEvent) window.attachEvent("onload", fixWinIE);

function fixWinIE()
{
	if((document.all.leftcol)&&(document.body.scrollHeight < document.all.leftcol.offsetHeight)) {
		document.all.leftcol.display='block';
	}
	
	if((document.all.leftcol2)&&(document.body.scrollHeight < document.all.leftcol2.offsetHeight)) {
		document.all.leftcol2.display='block';
	}
	
	if((document.all.rightcol)&&(document.body.scrollHeight < document.all.rightcol.offsetHeight)) {
		document.all.rightcol.display='block';
	}
	
	if((document.all.rightcol2)&&(document.body.scrollHeight < document.all.rightcol2.offsetHeight)) {
		document.all.rightcol2.display='block';
	}
}

function MM_openBrWindow(theURL, winName, features) { //v2.0
    window.open(theURL, winName, features);
}

// Customers showcase default page scroller
function horizScroller(opt) {
    var d = 0;
    opt.delay = opt.delay || 50;
    opt.dist = opt.dist || 2;
    opt.leftEl.onmouseover = function() { d = -opt.dist; scroll(); }
    opt.leftEl.onmouseout = function() { d = 0 }
    opt.rightEl.onmouseover = function() { d = opt.dist; scroll(); }
    opt.rightEl.onmouseout = function() { d = 0 }

    function scroll() {
        if (!d) return;
        var x = opt.contentEl.scrollLeft + d, stop = false, rightBoundary = opt.contentEl.scrollWidth - opt.contentEl.offsetWidth;
        if (x < 0) {
            addClassName(opt.leftEl, 'disabled');
            x = 0;
            stop = true;
        }
        else {
            removeClassName(opt.leftEl, 'disabled');
        }

        if (x >= rightBoundary) {
            addClassName(opt.rightEl, 'disabled');
            x = rightBoundary;
            stop = true;
        }
        else {
            removeClassName(opt.rightEl, 'disabled');
        }

        opt.contentEl.scrollLeft = x;
        if (stop) return;
        window.setTimeout(scroll, opt.delay);
    }

    function addClassName(el, className) {
        el.className = el.className.replace(new RegExp(' ?' + className + '|$'), ' ' + className);
    }

    function removeClassName(el, className) {
        el.className = el.className.replace(new RegExp(' ?' + className + '( |$)'), '$1');
    }
}
