var active;
function startclose(){
     active = window.setTimeout("closeAll()",500);
}
function stopclose(){
     if(active){
		window.clearTimeout(active);
	}
}
function expandIt(el, id, OffsX, OffsY) {
closeAll()
	var coords;
coords = {x: 0, y: 0};
		var element = $('POSER_'+id);
		while (element) {
			coords.x += element.offsetLeft;
			coords.y += element.offsetTop;
			element = element.offsetParent;
		}
coords['x']+=OffsX;
coords['y']+=OffsY;
$("el" + id + "Child").style.left=coords['x'] + "px";
$("el" + id + "Child").style.top=coords['y'] + "px";
$("el" + id + "Child").style.display="block";
$("el" + id + "Child").style.visibility="visible";

stopclose();
}

function closeAll(){
  closeAllByName("child");
}

function closeAllByName(name){
	stopclose();

	var tempColl = document.getElementsByTagName("DIV");
	for (i=0; i<tempColl.length; i++) {
		whichEl = tempColl[i];
		if (whichEl.className.indexOf(name) != -1){
			whichEl.style.visibility = "hidden";
			whichEl.style.display = "none";
		}
	}
}

function scaleContent(){
 var wH = -1;
  if (window.innerHeight) {
    wH = window.innerHeight;
  } else if (document.body.offsetHeight) {
    wH = document.body.offsetHeight;
  }
  if (wH!=-1) {
  var std_header=180;
  var std_footer=50;
  NewContentHeight=wH - std_footer;
  if(wH<521) NewContentHeight=521;
  $('ContentShell').style.height= (NewContentHeight - std_header) +"px";
  }
}
function open_function(url,width,height,options)
  {
    self.msgWindow = open(url, "Window", "width=" + width + ",height=" + height
      + ",screenX=" + (screen.width-width)/2
      + ",screenY=" + (screen.height-height)/2
      + ",dependent=yes"
      + ",left=" + (screen.width-width)/2
      + ",top=" + (screen.height-height)/2
      + options
      );
    if (self.msgWindow) {
      self.msgWindow.focus();
      if (self.msgWindow.opener == null) self.msgWindow.opener = self;
    }
  }
function get_url (url, k0 ,v0 ,k1 ,v1 ,k2 ,v2 ,k3 ,v3 ,k4 ,v4 ) 
{
  if (k0 && v0) url += "?" + k0 + "=" + escape(v0);
  if (k1 && v1) url += "&" + k1 + "=" + escape(v1);
  if (k2 && v2) url += "&" + k2 + "=" + escape(v2);
  if (k3 && v3) url += "&" + k3 + "=" + escape(v3);
  if (k4 && v4) url += "&" + k4 + "=" + escape(v4);
  return url;
}

//Event.observe(window,'load',scaleContent);
//Event.observe(window,'resize',scaleContent);
