﻿function hid(id) {
	var div1 = dojo.byId(id);
	div2 = dojo.byId("curtain");
	if (div1 == null || div2 == null)
		return;
	hideControlDivs();
	hidBlock(id);
	hidBlock("curtain");
	changeComboVisibility('visible');
}
function hidObj(obj) {
	obj.style.display = "none";
}
function hideControlDivs(){
	hidBlock('date_time');
	calendar.hide();
	calendar49.hide();
	inbudgets='';paybudgets='';
	dojo.byId('__calendarPanel').style.position="absolute";
}
function show(id, _top) {
	blockCurtain("curtain");
	var stop = 150;
	if (_top != null)
		stop -= _top;
	var d = dojo.byId(id);
	d.style.top = (((document.body.clientHeight) / 2) - stop) + "px";
	if (window.ActiveXObject){
		var ua = navigator.userAgent.toLowerCase();
		var vir = ua.match(/msie ([\d.]+)/)[1];
		if(Number(vir)<7)
			{d.style.position="absolute"; d.style.top = (250+document.documentElement.scrollTop - stop) + "px";changeComboVisibility('hidden');changeComboVisibility('visible',d);}
		else dojo.byId('__calendarPanel').style.position="fixed";
	}
	makeDraggable(d);
	d.style.display = "block"; // dojo.byId(id).style.zIndex="6001";
}
function chkShow(_checked, _id) {
	if (_checked)
		showBlock(_id);
	else
		hidBlock(_id);
}
function viewSpan(_checked, _id) {
	if (_checked)
		dojo.byId(_id).style.display = "";
	else
		dojo.byId(_id).style.display = "none";
}
function hidBlock(_id) {
	var d = dojo.byId(_id);
	if (d != null)
		d.style.display = "none";
}
function showBlock(_id) {
	dojo.byId(_id).style.display = "block";
}
function isHid(_id) {
	if (dojo.byId(_id).style.display == "none")
		return true;
	return false;
}
function excludeshow(id, _top) {
	var stop = 150;
	if (_top != null)
		stop -= _top;
	var d = dojo.byId(id);
	d.style.left = ((document.body.clientWidth) / 2 - 200) + "px";
	d.style.top = (((document.body.clientHeight) / 2)
			+ document.documentElement.scrollTop - stop)
			+ "px";
	d.style.display = "block";
}

/* height */
// var isIE=!!window.ActiveXObject;
// var isIE6=isIE&&!window.XMLHttpRequest;
var initLeftHeight = 0;
//var hh_flag=1; 
function hh() {
	var rightDiv = document.getElementById("right");
	if (rightDiv == null) return;
//	var leftDiv=document.getElementById("left");
	var r_c = document.getElementById("right-cont");
	var rr = rightDiv.offsetHeight;
//	if (initLeftHeight == 0)
//		initLeftHeight = leftDiv.scrollHeight+25;
	if (r_c != null) {
		var child = r_c.childNodes, real = 46;
		for ( var j = 0; j < child.length; j++)
			real += child[j].offsetHeight > 0 ? child[j].offsetHeight : 0;
		rr = real>initLeftHeight?real:initLeftHeight;
		rr = rr>(r_c.offsetHeight+40)?rr:(r_c.offsetHeight+40);
	}
	if (rr > initLeftHeight) {
//		leftDiv.style.height = (rr+3) + "px";
		rightDiv.style.height = rr + "px";
	} else {
//		leftDiv.style.height = (initLeftHeight+3) + "px";
		rightDiv.style.height = initLeftHeight + "px";
	}
//	if(r_c != null&&hh_flag==1&&leftDiv.offsetHeight!=rightDiv.offsetHeight+3)
//		{setTimeout(hh,150);hh_flag++;}
//	else hh_flag=1;
}