function checkBrowser(){
	this.ver=navigator.appVersion;
	this.dom=document.getElementById?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie55=((this.ver.indexOf("MSIE 5.5")>-1 || this.ie6) && this.dom)?1:0;
	this.ie5=((this.ver.indexOf("MSIE 5")>-1 || this.ie5 || this.ie6) && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.ie4plus=(this.ie6 || this.ie5 || this.ie4);
	this.ie5plus=(this.ie6 || this.ie5)
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5);
	return this;
}

bw = new checkBrowser();

if (!document.getElementById) {
	document.getElementById = getObjectById;
}

function getObjectById(ID) {
	var obj;
	if (bw.dom)
		return document.getElementById(ID);
	else if (bw.ie4)
		return document.all(ID);
	else if (bw.ns4)
		return eval('document.' + ID);
}

function getElementByID(ID) {
	return getObjectById(ID);
}

function PartialUpdate(name1,name11,name2,name22) {
  if (parent.getObjectById == null)
    return;
  obj1 = parent.getObjectById(name1);
  obj11 = this.getObjectById(name11);
  obj2 = parent.getObjectById(name2);
  obj22 = this.getObjectById(name22);
  if (obj1 == null)
   return;
   if (obj11 == null)
   return;
   if (obj2 == null)
   return;
   if (obj22 == null)
   return;
  obj1.innerHTML = obj11.innerHTML;
  obj2.innerHTML = obj22.innerHTML;
}

function SubmitForm(FormName) {
	var arg = arguments;
	var i = 0;
	var ConfirmQuestion = '';
	if (F = document.forms[FormName])
	{		
		for (i=0; i<arg.length; i++)
		{
			switch(arg[i])
			{
				case 'ACTION': F.action = arg[++i]; break;
				case 'TARGET': F.target = arg[++i]; break;
				case 'CONFIRM': ConfirmQuestion = arg[++i]; break;
			}
		}
		if (ConfirmQuestion != '')
		{
			if (confirm(ConfirmQuestion))
				F.submit();
		} else {
			F.submit();
		}
	}
}

// popup rollup

function showpopup(idpopup,e) {
  obj = this.getObjectById(idpopup);
  if (obj == null)
   return;
  var rightside = e.clientX + obj.offsetWidth;
  var bottomedge = document.body.clientHeight-event.clientY;
  if (rightside > document.body.clientWidth)
    obj.style.left = document.body.clientWidth - obj.offsetWidth;
  else
    obj.style.left = e.clientX;
  if (bottomedge < obj.offsetHeight)
    obj.style.top = document.body.scrollTop + e.clientY - obj.offsetHeight;
  else
    obj.style.top = document.body.scrollTop + event.clientY;
  obj.style.visibility = 'visible';
  return false;
}

function hidepopup() {
	obj = getObjectById('adr');
	if (obj == null)
   return;
  obj.style.visibility = 'hidden';
}