// for elements that depend on JavaScript
document.write("<style type='text/css'>");
document.write(".b_requiresJsInline {display: inline;}");
document.write(".b_requiresJsBlock {display: block;}");
document.write(".b_requiresJsListItem {display: list-item;}");
document.write("</style>");

if (document.getElementById) {
    document.write("<style type='text/css'>");
    document.write(".b_blocktoggle {display: none}");
    document.write("</style>");
    var shown = new Array();
}

function blocktoggle(i) {
    if (document.getElementById) {
        shown[i] = (shown[i]) ? false : true;
        currentdisplay = (shown[i]) ? 'block' : 'none';
        var checkelementexist = document.getElementById('b_blocktoggle'+i);
        if (checkelementexist) {
            checkelementexist.style.display = currentdisplay;
        }
    }
}

function blockdisplay(i) {
    if (document.getElementById){
        if (document.getElementById("b_blockdisplay"+i)) {
            for ( j = 1; j < 1000; j++ ) {
                if (document.getElementById('b_blockdisplay' + j)) {document.getElementById('b_blockdisplay' + j).style.display = 'none';}
                else {j = 1000;}
            }
            if (i) {document.getElementById("b_blockdisplay"+i).style.display = 'block';}
        }
    }
}    

function showDiv (el, div, alignX, alignY) {
	if (document.getElementById){
    	var i = document.getElementById(el);
		var c = document.getElementById(div);
        if (c.style.display != "block"){
			var l=0; var t=0;
            aTag = i;
            do {
                aTag = aTag.offsetParent;
                l += aTag.offsetLeft;
                t += aTag.offsetTop;
            } while (aTag.offsetParent && aTag.tagName != 'body');
	        var left =  i.offsetLeft + l;
    	    var top = i.offsetTop + t + i.offsetHeight + 2;
			if (alignX == 'left' && c.style.width){
				left = left - parseInt(c.style.width);
			}
			if (alignY == 'top' && c.style.height){
				top = top - parseInt(c.style.height) -25;
			}
		    c.style.position = "absolute";
        	c.style.left = left+'px';
	        c.style.top = top+'px';
			c.style.display = "block";
		} else {
			c.style.display="none";
		}
	}
}

function hideDiv (div)
{
	if (document.getElementById)
	{
		var c = document.getElementById(div);
		c.style.display="none";
	}
}

