function findLeft(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
		}
	}
	return curleft;
}

function findTop(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curtop += obj.offsetTop
		}
	}
	return curtop;
}

function hoverItem(item, item_class){
	item.className = item_class;
}

function showSubmenu(obj){
	document.getElementById('ul_'+obj).className='menu_ul_active';	
	var parent_top = parseInt(findTop(document.getElementById(obj)));
	parent_top -= 140;
	document.getElementById('ul_'+obj).style.top = parent_top + 'px';
	document.getElementById('ul_'+obj).style.zIndex = 1000;
}

function hideSubmenu(obj){
	document.getElementById('ul_'+obj).className='menu_ul';	
}

function fixHeight(){
    obj = document.getElementById('cont_fill');
    var top = parseInt(findTop(obj));
    var bodyHeight = parseInt(document.body.offsetHeight);
    var rightHeight = parseInt(document.getElementById('right').offsetHeight) + parseInt(document.getElementById('right').offsetTop);
    if (bodyHeight > rightHeight){
        var dif = bodyHeight - top;
        obj2 = document.getElementById('right');
    	var top2 = parseInt(findTop(obj2));
    	var dif2 = bodyHeight - top2;
    	menuBottom = document.getElementById('mbot');
    	dif2 -= parseInt(menuBottom.offsetHeight);
		disclaimer = document.getElementById('disc'); 
		dif2 -= disclaimer.offsetHeight; 
		sept = document.getElementById('septop'); 
		dif2 -= parseInt(sept.offsetHeight);
		sepb = document.getElementById('sepbot'); 
		dif2 -= parseInt(sepb.offsetHeight);
		dif2 -= 20;  	
    	document.getElementById('content_div').style.height = dif2 + 'px';
    } else {
        var dif = rightHeight - top;
    }
    obj.style.height = dif + 'px';
    document.getElementById('fill').style.height = dif + 'px';    
}
