function ds_getel(id) {
	return document.getElementById(id);
}

// Get the left and the top of the element.
function ds_getleft(el) {
	var tmp = el.offsetLeft;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetLeft;
		el = el.offsetParent;
	}
	return tmp;
}
function ds_gettop(el) {
	var tmp = el.offsetTop;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetTop;
		el = el.offsetParent;
	}
	return tmp;
}

// Output Element
var ds_oe = ds_getel('ds_calclass');
// Container
var ds_ce = ds_getel('ds_conclass');
var element;
function ds_sh1(t,id,mes,god,id_sobe) {
   
	jQuery('#resultt').html('<img src=images/16.gif width="26" height="26" alt="loader">');
if(id=="close"){
  //var url = "blank.php";
  document.getElementById("resultt").style.display="none";
  }
  else{
  document.getElementById("resultt").style.display="block";
	var url = "calend_read.php?id="+id+"&mes="+mes+"&god="+god+"&id_sobe="+id_sobe;
	
	jQuery('#resultt').load(url);
		the_left = ds_getleft(t);
	the_top = ds_gettop(t) + t.offsetHeight;
	ds_ce.style.left = the_left + 'px';
	ds_ce.style.top = the_top + 'px';

	element=document.getElementById("resultt")
	element.style.top=the_top-50 + 'px';
	element.style.left=the_left-200 + 'px';
element.style.border='1px solid #666';

// Hide the calendar.

	return false;
	}
}
function close(e)
{
var targ;
if (!e)
  {
  var e=window.event;
  }
if (e.target)
  {
  targ=e.target;
  }
else if (e.srcElement)
  {
  targ=e.srcElement;
  }
if (targ.nodeType==3) // defeat Safari bug
  {
  targ = targ.parentNode;
  }
var tname;
tname=targ.tagName;

if(tname=="DIV" || tname=="IMG"){
document.getElementById("resultt").style.display="none";
}
}
