



		/* user_pref("signed.applets.codebase_principal_support", true); */

		var MSIE  = false;
		var DOM2  = false;

		/* ------------------------------------------------------------------------------------------
		 */
		if (navigator.appName.substr(0,9) == 'Microsoft') {
			MSIE = true;

			scrollSpeed = 2;
		}
		else if (navigator.appName.substr(0,8) == 'Netscape') {
			DOM2 = true;

			scrollSpeed = 1;
		}
		else
			scrollSpeed = 1;

//		alert('loaded into: ' + self.location);

		/* ------------------------------------------------------------------------------------------
		 */
//		var dock = null;
//		var fram = new Array();

		function getObj(id) {
//			alert(this);
//			alert(this.document);

//			if (document != null)
				return (/*dock = */this.document).getElementById(id);
//			return dock.getElementById(id);
		}

		function getFrm(id) {
//			if (window.frames[id].getObj + '' == 'undefined')
//				window.frames[id].getObj = getObj;
			if (this.frames[id] != null)
				return (/*fram[id] = */this.frames[id]);
//			return fram[id];
		}

		/* ------------------------------------------------------------------------------------------
		 */
		function checkWHStyle(img) {
			if ((img.style.left   != null) && (img.style.left  != '') &&
				(img.style.right  != null) && (img.style.right != '') &&
				(img.style.width  != null) && (img.style.width != '') &&
				(img.style.width.indexOf('%') != -1))
				if (MSIE == false)
					img.style.width = null;

			if ((img.style.top    != null) && (img.style.top    != '') &&
				(img.style.bottom != null) && (img.style.bottom != '') &&
				(img.style.height != null) && (img.style.height != '') &&
				(img.style.height.indexOf('%') != -1))
				if (MSIE == false)
					img.style.height = null;
		}

		function setAlpha(id, path) {
			var img = getObj(id);

			if (img != null)
				if (MSIE == true) {
					img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + path + "');";
					img.src = "pics/trans.gif";
				}
				else {
					checkWHStyle(img);
					img.src = path;
				}			resizeWindow(whtWin, 600, height);

			return img;
		}

		function setAlphaScale(id, path) {
			var img = getObj(id);

			if (img != null)
				if (MSIE == true) {
					img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + path + "', sizingMethod='scale');";
					img.src = "pics/trans.gif";
				}
				else {
					checkWHStyle(img);
					img.src = path;
				}

			return img;
		}

		/* ------------------------------------------------------------------------------------------
		 */
		function measureFrameWidth(frmid) {
			var fobj = getFrm(frmid);
			var frmw;

			if (fobj != null) {
				if (MSIE == true) {
					if (fobj.document != null)
						if (fobj.document.body != null)
							frmw = fobj.document.body.scrollWidth;
				}
				else {
					/* first scroll completly down */
					fobj.scrollBy( 10000000, 0);

					/* measure the offset and add the height */
					frmw  = fobj.innerWidth - 1;
					frmw += fobj.pageXOffset;

					/* last scroll completly up */
					fobj.scrollBy(-10000000, 0);
				}
			}

			return frmw;
		}

		function measureFrameHeight(frmid) {
			var fobj = getFrm(frmid);
			var frmh;

			if (fobj != null) {
				if (MSIE == true) {
					if (fobj.document != null)
						if (fobj.document.body != null)
							frmh = fobj.document.body.scrollHeight;
				}
				else {
					/* first scroll completly down */
					fobj.scrollBy(0,  10000000);

					/* measure the offset and add the height */
					frmh  = fobj.innerHeight - 1;
					frmh += fobj.pageYOffset;

					/* last scroll completly up */
					fobj.scrollBy(0, -10000000);
				}
			}

			return frmh;
		}

		function offsetXFrame(frmid) {
			var fobj = getFrm(frmid);
			var frmo;

			if (fobj != null) {
				if (MSIE == true) {
					if (fobj.document != null)
						if (fobj.document.body != null)
							frmo = fobj.document.body.scrollLeft;
				}
				else
					frmo = fobj.pageXOffset;
			}

			return frmo;
		}

		function offsetYFrame(frmid) {
			var fobj = getFrm(frmid);
			var frmo;

			if (fobj != null) {
				if (MSIE == true) {
					if (fobj.document != null)
						if (fobj.document.body != null)
							frmo = fobj.document.body.scrollTop;
				}
				else
					frmo = fobj.pageYOffset;
			}			resizeWindow(whtWin, 600, height);

			return frmo;
		}

		/* ------------------------------------------------------------------------------------------
		 */
		function rethinkSize(frmid) {
			var cobj = getObj('content');
			var nobj = getObj('nav_left');
			var iWidth, iHeight;

			if (MSIE == true) {
				iWidth  = document.body.clientWidth ;
				iHeight = document.body.clientHeight; }
			else {
				iWidth  = window.innerWidth  - 2;
				iHeight = window.innerHeight - 2; }

			 /*if (frmh <= iHeight) fobj.style.height = '100%';*/
			cobj.style.height = '0px';
			nobj.style.height = '0px';

			var crmh = measureFrameHeight('content');
			var nrmh = measureFrameHeight('nav_left');
			var frmh = Math.max(crmh, nrmh);

			 /*if (frmh <= iHeight) fobj.style.height = '100%';*/
			cobj.style.height = frmh + 'px';
			nobj.style.height = frmh + 'px';
		}

		/* ------------------------------------------------------------------------------------------
		 */
		function setChr(character) {
			var pobj = this.getObj('pge'); if (pobj == null) pobj = this.getFrm('list').getObj('pge');
			var cobj = this.getObj('chr'); if (cobj == null) cobj = this.getFrm('list').getObj('chr');
			var fobj = this.getObj('frm'); if (fobj == null) fobj = this.getFrm('list').getObj('frm');

			if (cobj != null)
				cobj.value = character;
			if (pobj != null)
				pobj.value = 0;

			if (fobj != null)
				fobj.submit();
		}

		function setSrt(sorting) {
			var sobj = this.getObj('srt'); if (sobj == null) sobj = this.getFrm('list').getObj('srt');
			var dobj = this.getObj('dir'); if (sobj == null) dobj = this.getFrm('list').getObj('dir');
			var fobj = this.getObj('frm'); if (fobj == null) fobj = this.getFrm('list').getObj('frm');

			if (sobj != null) {
				sobj.value = sorting;
				if (dobj.value == 'ASC')
					dobj.value = 'DESC';
				else
					dobj.value = 'ASC';
			}
			if (fobj != null)
				fobj.submit();

			return false;
		}

		function setSrtFld(sorting, field) {
			var lobj = this.getObj('fld'); if (lobj == null) lobj = this.getFrm('list').getObj('fld');
			var fobj = this.getObj('frm'); if (fobj == null) fobj = this.getFrm('list').getObj('frm');

			if (lobj != null)
				if (lobj.value != field)
					lobj.value = field;
				else
					return setSrt(sorting);

			if (fobj != null)
				fobj.submit();

			return false;
		}

		function setPge(page) {
			var pobj = this.getObj('pge'); if (pobj == null) pobj = this.getFrm('list').getObj('pge');
			var fobj = this.getObj('frm'); if (fobj == null) fobj = this.getFrm('list').getObj('frm');

			if (pobj != null)
				pobj.value = page;

			if (fobj != null)
				fobj.submit();

			return false;
		}

		/* -----------------------------------------------------------
		 */
		function confirmDelete(msg, jump) {
			if (confirm(msg) == true) {
				if (jump != null)
					self.location = jump;

				return true;
			}

			return false;
		}

		function confirmListDelete(msg, id, ty, oo) {
			if (confirmDelete(msg, null) == true) {
				getObj('op').value = 'delete';
				getObj('id').value = id;
				getObj('ty').value = ty;

				getObj('frm').submit();
			}
		}

		/* -----------------------------------------------------------
		 */
		function reloadInfo(preferation) {
			if ((preferation != null) &&
				(getFrm(preferation) != null))
				getFrm(preferation).getObj('frm').submit();
			else
			if ((parent != null) &&
				(parent.getFrm('info') != null))
				parent.getFrm('info').getObj('frm').submit();
			else
			if (getFrm('info') != null)
				getFrm('info').getObj('frm').submit();
		}

		/* -----------------------------------------------------------
		 */
		function reloadList(preferation) {
			if ((preferation != null) &&
				(getFrm(preferation) != null))
				getFrm(preferation).getObj('frm').submit();
			else
			if ((parent != null) &&
				(parent.getFrm('list') != null))
				parent.getFrm('list').getObj('frm').submit();
			else
			if (getFrm('list') != null)
				getFrm('list').getObj('frm').submit();
		}

		/* -----------------------------------------------------------
		 * convert a digit to 2-character numbers, signed or unsigned
		 */
		function d2num(num, signed) {
			num = Math.ceil(num);
			var sign = (signed == true ? (num < 0 ? '-' : '+') : '');
			num = Math.abs(num);
			if (num < 10)
				return sign + '0' + num;
			return sign + '' + num;
		}

		/* -----------------------------------------------------------
		 * a collection of all the open windows
		 */
		var sprWin = window;
		var whtWin = null; var lstY = 0;
		var prfWin = null;
		var malWin = null;
		var nteWin = null;
		var tolWin = null;
		var edtWin = null;

		function resizeWindow(aWin, width, height) {
			return;

			/* non-MSIE, resize don't make outer sizes */
			if (MSIE != true) {
				aWin.outerWidth = width;
				aWin.outerWidth = height;
			}
			else
				aWin.resizeTo(width, height);
		}

		function centerWindow(aWin, width, height) {
			swidth  = width;
			sheight = height;
			if (screen != null) {
				if ((screen.width  != null) &&
					(screen.height != null)) {
					swidth  = screen.width;
					sheight = screen.height;
				}
			}
			else if (Screen != null) {
				if ((Screen.width  != null) &&
					(Screen.height != null)) {
					swidth  = Screen.width;
					sheight = Screen.height;
				}
			}

			aWin.moveTo((swidth  - width ) >> 1,
						(sheight - height) >> 1);
		}

		function whatWindow(url, height) {
			whtWin = window.open(url, 'what', 'dependent=yes,width=600,height=' + height + ',location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no');
			whtWin.sprWin = this.sprWin;
			sprWin.whtWin = this.whtWin;

			resizeWindow(whtWin, 600, height);
			centerWindow(whtWin, 600, height);
		}

		function prefWindow(url) {
			prfWin = window.open(url, 'pref', 'dependent=yes,width=500,height=500,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no');
			prfWin.sprWin = this.sprWin;
			sprWin.prfWin = this.prfWin;

			resizeWindow(prfWin, 500, 500);
			centerWindow(prfWin, 500, 500);
		}

		function mailWindow(url) {
			malWin = window.open(url, 'mail', 'dependent=yes,width=500,height=500,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no');
			malWin.sprWin = this.sprWin;
			sprWin.malWin = this.malWin;

			resizeWindow(malWin, 500, 500);
			centerWindow(malWin, 500, 500);
		}

		function noteWindow(url) {
			nteWin = window.open(url, 'note', 'dependent=yes,width=500,height=500,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no');
			nteWin.sprWin = this.sprWin;
			sprWin.nteWin = this.nteWin;

			resizeWindow(nteWin, 500, 500);
			centerWindow(nteWin, 500, 500);
		}

		function toolWindow(url) {
			tolWin = window.open(url, 'tool', 'dependent=yes,width=500,height=500,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no');
			tolWin.sprWin = this.sprWin;
			sprWin.tolWin = this.tolWin;

			resizeWindow(tolWin, 500, 500);
			centerWindow(tolWin, 500, 500);
		}

		function editWindow(url) {
			edtWin = window.open(url, 'edit', 'dependent=yes,width=500,height=500,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no');
			edtWin.sprWin = this.sprWin;
			sprWin.edtWin = this.edtWin;

			resizeWindow(edtWin, 500, 500);
			centerWindow(edtWin, 500, 500);
		}

		function logoutWindow() {
			if (sprWin == window) {
				if (whtWin != null) whtWin.close();
				if (prfWin != null) prfWin.close();
				if (malWin != null) malWin.close();
				if (nteWin != null) nteWin.close();
				if (tolWin != null) tolWin.close();
				if (edtWin != null) nfoWin.close();

				window.open('logout.php?op=logout', 'logout', 'dependent=no,width=1,height=1,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
			}
		}
