﻿var browser = new Browser();function SetFocus(controlName) {	var col = document.getElementById(controlName);		if (col != null) {		col.focus();	}}function PopUpControl(op) {    var div = (document.getElementById) ?        document.getElementById("popupContainer") : ((document.all) ?        document.all["popupContainer"] : null);        if (op == 'hide') {        div.style.display = 'none';    } else {        div.style.display = '';    }}function findPosX(obj) {
	var curleft = 0;
	
	if(obj.offsetParent) {
		while(1) {
			curleft += obj.offsetLeft;
			if(!obj.offsetParent) {
				break;
			}
			
			obj = obj.offsetParent;
		}
	} else if(obj.x) {
		curleft += obj.x;
	}
	
	return curleft;
}

function findPosY(obj) {
	var curtop = 0;
	
	if(obj.offsetParent) {
		while(1)
		{
			curtop += obj.offsetTop;
			if(!obj.offsetParent) {
				break;
			}
			obj = obj.offsetParent;
		}
	} else if(obj.y) {
		curtop += obj.y;
	}
	return curtop;
}

function Browser() {

  var ua, s, i;

  this.isIE    = false;
  this.isNS    = false;
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}
