if (document.cookie.indexOf("uniqueid=") == -1) {
        var uniqueid = "uniqueid=" + (Math.floor(Math.random()*9999999999999)).toString(36);
        uniqueid += "; path=/";
        document.cookie=uniqueid;
}

function online(handle,prefix) {
    var countPic = new Image();
    var countDate = new Date();
    var pre = "uniqueid=";
    var start = document.cookie.indexOf("uniqueid=");
    var unique = "";
    if (start > -1) {
            var end = document.cookie.indexOf(";", start + pre.length);
            if (end == -1) {
                    end = document.cookie.length;
            }
            unique = unescape(document.cookie.substring(start + pre.length, end));
    }
    var picName = prefix+"/usertrack"+handle+"/"+Math.round(countDate.getTime()/1000)+"_"+Math.round(Math.random()*9999999999999)+"_"+unique+".gif";
    countPic.src = picName;
    // alert(picName);
}

function jumpTo(nameform,namelem) {
	var FormObj = document.forms[nameform].elements[namelem];
	var nr = FormObj.selectedIndex;
	var hyperref = FormObj.options[nr].value;
	if (hyperref.indexOf("-1") == -1 && hyperref.substring(0,1) == "/") {
		document.location.href=hyperref;
	}
}

	function BildWechsel(Bildname,Bildobjekt) {
		window.document.images[Bildname].src = Bildobjekt;
	}

	function makeBar(what,nr) {
		kriterium = document.getElementById('cticons'+nr).style.clip;
		if (kriterium == "rect(0px 525px 40px 0px)") {
			slideBar(525,nr,"left");
		}
		else {
			slideBar(44,nr,"right");
		}
	}

	function slideBar(what,nr,dir) {
		document.getElementById("opener"+nr).style.visibility="hidden";
		if (dir == "left") { what = what-37; }
		if (dir == "right") { what = what+37; }
		if (what >= 44 && what <= 525) {
			document.getElementById('cticons'+nr).style.clip="rect(0px "+what+"px 40px 0px)";
			self.setTimeout("slideBar("+what+",'"+nr+"','"+dir+"')",1);
		}
		else {
			if (what == 7) {
				document.getElementById("opener"+nr).style.visibility="visible";
			}
		}
	}

	function openOpener(page,ctobid,what,ctsite,prefix,anc) {
		if (checkOpener()) {
			self.opener.document.location.href=prefix+"/ctadmin/"+page+"?ctobid="+ctobid+"&"+what+"="+ctsite;
			self.opener.top.frames['leftFrame'].document.location.href=prefix+"/ctadmin/tree.jsp?ctobid="+anc+"&ctsite="+ctsite+"#"+anc;
			self.opener.focus();
		}
	}

	function checkOpener() {
		if (self.opener.closed == false) { return true; }
		else {
			alert("This action cannot be performed!\nReason: Opening window has been closed!");
			return false;
		}
	}

	function moveMe(what,ob1,ob2,prefix) {
		if (checkOpener()) {
			self.opener.document.location.href=prefix+"/ctadmin/list.jsp?"+what+"="+ob1+"&ctobid="+ob2;
			self.document.location.reload();
			self.focus();
		}
	}

	function setCookie(what,val) {
		document.forms[what].elements['myCookie'].value=val;
		document.forms[what].submit();
	}

	function askMe(what2,what,prefix) {
		if (checkOpener()) {
			var elem =(what==what2)?"page":"page element";
			var asking =window.confirm("Do you really wish to delete this "+elem+"?");
			if (asking == true) self.opener.document.location.href=prefix+"/ctadmin/list.jsp?ctobid="+what+"&ctdelete="+what2;
			self.location.reload();
			self.focus();
		}
	}