		var divserviceopen = "";
		var openservicenow = "";
		var openeddetservices = "";
		var maintimeid = 0;
		var maintimetypeid = "";
		var maindetormain = "";
		function printlist(linkid) {
			window.document.frmbook.action = "securesave.asp?linkid="+linkid;
			window.document.frmbook.submit();
		}
		function viewresize() {
			window.document.frmbook.action = "termin.asp?viewresize=small&scrolledpublic="+getScrollY()+"&resetdoing=true";
			window.document.frmbook.submit();
		}
		function viewresizebig() {
			window.document.frmbook.action = "termin.asp?viewresize=&scrolledpublic="+getScrollY()+"&resetdoing=true";
			window.document.frmbook.submit();
		}
		function actueltermin() {
			window.document.frmbook.action = "actueltermin.asp";
			window.document.frmbook.submit();
		}


		function chgsubject(subject,showtype,calledby,pathlocal,linkid) {
			window.document.frmbook.sortofdochanged.value = "true";
			if(calledby == "member"){
				window.document.frmbook.action = "termin.asp?scrolledpublic="+getScrollY()+"&resetdoing=true&showtype="+showtype+"&subject="+subject+"&actiontype=chgsubject";
			}
			else{
				window.document.frmbook.action = "/default.asp?scrolledpublic="+getScrollY()+"&resetdoing=true&showtype="+showtype+"&subject="+subject+"&actiontype=chgsubject";
			}
			window.document.frmbook.submit();
		}
		function chgdointern(dointernvalue,showtype,totdoings) {
			window.document.frmbook.action = "termin.asp?totdoings="+totdoings+"&showtype="+showtype+"&actiontype=chgdointern&dointernvalue="+dointernvalue+"&scrolledpublic="+getScrollY();
			window.document.frmbook.submit();
		}
		function chgdoingquestion(doingid,showtype,worktype,cntdoings,calledby,pathlocal,linkid) {
			window.document.frmbook.doing[cntdoings].checked = true;
			window.document.frmbook.doing[cntdoings].value = window.document.frmbook.doing[cntdoings].value.replace("mainworker","chooseworker");
			worktype = worktype.replace("mainworker","chooseworker");
			chgdoing(doingid,showtype,worktype,cntdoings,calledby,pathlocal,linkid);
		}
		function chgdoing(doingid,showtype,worktype,cntdoings,calledby,pathlocal,linkid) {
			var checktype;
			var strtarget;
			if(window.document.frmbook.doing[cntdoings].checked) {
				checktype = "check";
			}
			else {
				checktype = "uncheck";
			}
			if(calledby == "member"){
				strtarget = "termin.asp"
			}
			else{
				strtarget = "/default.asp"
			}
			if(checktype == "check") {
				if(worktype == "worker") {
					window.document.frmbook.action = strtarget+"?checktype="+checktype+"&showtype="+showtype+"&actiontype=chgdoing&chgdoingid="+doingid+"&scrolledpublic="+getScrollY();
				}
				else {
					window.document.frmbook.action = strtarget+"?checktype="+checktype+"&choosetype="+worktype+"&comesfrom=chgdoing&showtype="+showtype+"&actiontype=chgdoing&chgdoingid="+doingid+"&scrolledpublic="+getScrollY();
				}
				window.document.frmbook.submit();
			}
		}
		function chgdoing2(showtype,cntdoings,calledby,pathlocal,linkid) {
			var checktype, strtarget, strscrollshowfirst, i;
			var onechecked="false";
			if(calledby == "member"){
				strtarget = "termin.asp"
				strscrollshowfirst = "";
			}
			else{
				strtarget = "/default.asp"
				strscrollshowfirst = "scrollshowfirst";
			}
			if(parseInt(cntdoings) > 0){
				for(i=0;i<window.document.frmbook.doing.length;i++){
					if(window.document.frmbook.doing[i].checked){
						onechecked = "true";
						break;
					}
				}
			}
			else{
				onechecked = "false";
			}
			if(onechecked == "false" && window.document.frmbook.doingatt.value.split("|dog_").length <= 1){
				alert("Sie müssen zuerst eine Dienstleistung auswählen");
			}
			else{
				window.document.frmbook.doingchanged.value = "false";
				//window.document.frmbook.action = strtarget+"?sortofdochanged="+sortofdochanged+"&actiontype=chgdoing&showtype="+showtype+"&showtime=true&scrollshowfirst="+strscrollshowfirst;
				window.document.frmbook.action = strtarget+"?actiontype=chgdoing&showtype="+showtype+"&showtime=true&scrolledpublic="+getScrollY()+"&scrollshowfirst="+strscrollshowfirst;
				window.document.frmbook.submit();
			}
		}
		function godoingchanged(calledby,newdoingatt,cntdoings,doid,fromc){
			var strreplace = "";
			var strtarget = "";
			var godoingtime = "";
			var gowaittime = "";
			var godoingtime2 = "";
			if(calledby == "member"){
				strtarget = "termin.asp";
			}
			else{
				strtarget = "/default.asp";
			}
			if(window.document.frmbook.doingatt.value.split("|"+doid+"###").length > 1){
				strreplace = window.document.frmbook.doingatt.value.split("|"+doid+"###")[1].split("|")[0];
				strreplace = "|"+doid+"###" + strreplace + "|";
				window.document.frmbook.doingatt.value = window.document.frmbook.doingatt.value.replace(strreplace,"");			
			}
			if(fromc == "true" || fromc == "time" || (fromc == "false" && window.document.frmbook.doing[cntdoings].checked == true)){

				window.document.frmbook.doingatt.value = window.document.frmbook.doingatt.value + newdoingatt;
			}
			if(fromc == "true" || fromc == "time"){
				window.document.frmbook.doing[cntdoings].checked = true;
			}
			window.document.frmbook.doingchanged.value = "true";
			if(window.document.frmbook.strdotimes.value.split("|"+doid+"###").length > 1){
				strreplace = window.document.frmbook.strdotimes.value.split("|"+doid+"###")[1].split("|")[0];
				window.document.frmbook.strdotimes.value = window.document.frmbook.strdotimes.value.replace("|"+doid+"###"+strreplace+"|","");
			}
			if(window.document.frmbook.doing[cntdoings].checked == true){
				godoingtime = eval("window.document.frmbook.doingtime_"+doid).value;
				if(eval("window.document.frmbook.waittime"+doid)){
					gowaittime = eval("window.document.frmbook.waittime"+doid).value;
					if(eval("window.document.frmbook.doingtime2"+doid)){
						godoingtime2 = eval("window.document.frmbook.doingtime2"+doid).value;
					}
				}
				if(godoingtime == ""){
					godoingtime = "0";
				}
				if(godoingtime2 == ""){
					godoingtime2 = "0";
				}
				if(gowaittime == ""){
					gowaittime = "0";
					godoingtime2 = "0";
				}
				window.document.frmbook.strdotimes.value = window.document.frmbook.strdotimes.value+"|"+doid+"###"+godoingtime+"###"+gowaittime+"###"+godoingtime2+"|";

			}
			window.document.frmbook.sortofdochanged.value = "true";
			// wenn Mitarbeiter Kompetenz von Hauptdl nicht hat, dann autom. anderen wählen. Dies im Salon und öffentlich
			// nur wenn auf den gelickt wird, kommt die Frage marfie 8.11.2011
			//if(newdoingatt.split("chooselehrling").length > 1 || newdoingatt.split("chooseworker").length > 1){
			if(newdoingatt.split("chooselehrling").length > 1 || (newdoingatt.split("chooseworker").length > 1 && fromc == "true")){
				if(window.document.frmbook.doing[cntdoings].checked == true){
					window.document.frmbook.action = strtarget + "?scrolledpublic="+getScrollY()+"&actiontype=chooseworker&chgdoingid="+doid
					window.document.frmbook.submit();
				}
			}
		}
		function godoingchangeddet(calledby,detdoid,newdoingatt,cntdoings,doid,dotime,waittime,dotime2){
			var strtarget = "";
			var strwidth = "";
			var strwidth2 = "";
			var strwidth3 = "";
			if(calledby == "member"){
				strtarget = "termin.asp";
			}
			else{
				strtarget = "/default.asp";
			}
			window.document.frmbook.doing[cntdoings].checked = true;
			if(calledby == "member"){
				window.document.getElementById("doingtime_"+doid).style.visibility = "visible";		
				window.document.getElementById("waittime"+doid).style.visibility = "hidden";		
				window.document.getElementById("doingtime2"+doid).style.visibility = "hidden";		
				
				if(eval("window.document.frmbook.detdoingtime_"+detdoid).value > 84){
					strwidth = "27";
				}
				else{
					strwidth = "20"
				}
				window.document.getElementById("doingtime_"+doid).style.width = strwidth;		
				window.document.getElementById("doingtime_"+doid).style.height = "18";		
			}
			if(calledby == "member"){
				eval("window.document.frmbook.doingtime_"+doid).value = eval("window.document.frmbook.detdoingtime_"+detdoid).value;
			}
			else{
				eval("window.document.frmbook.doingtime_"+doid).value = dotime;
			}
			eval("window.document.frmbook.doingtime_"+doid).name = "doingtime_"+detdoid;
					
			if(waittime != "0" || dotime2 != "0"){
				if(calledby == "member"){
					window.document.getElementById("waittime"+doid).style.visibility = "visible";		

					if(eval("window.document.frmbook.detwaittime"+detdoid).value > 84){
						strwidth2 = "27";
					}
					else{
						strwidth2 = "20"
					}
					window.document.getElementById("waittime"+doid).style.width = strwidth2;		
					window.document.getElementById("waittime"+doid).style.height = "18";		
					if(dotime2 != "0" || waittime != "0"){
						window.document.getElementById("doingtime2"+doid).style.visibility = "visible";		
						if(eval("window.document.frmbook.detdoingtime2"+detdoid).value > 84){
							strwidth3 = "27";
						}
						else{
							strwidth3 = "20"
						}
					
						window.document.getElementById("doingtime2"+doid).style.width = strwidth3;		
						window.document.getElementById("doingtime2"+doid).style.height = "18";		
					}
				}
				if(calledby == "member"){
					eval("window.document.frmbook.waittime"+doid).value = eval("window.document.frmbook.detwaittime"+detdoid).value;
					eval("window.document.frmbook.doingtime2"+doid).value = eval("window.document.frmbook.detdoingtime2"+detdoid).value;
				}
				else{
					eval("window.document.frmbook.waittime"+doid).value = waittime;
					eval("window.document.frmbook.doingtime2"+doid).value = dotime2;
				}
				eval("window.document.frmbook.waittime"+doid).name = "waittime"+detdoid;
				eval("window.document.frmbook.doingtime2"+doid).name = "doingtime2"+detdoid;
			}
			window.document.frmbook.doingchanged.value = "true";
			openeddetservices = openeddetservices + "|" + doid + "###" + detdoid + "|";
			window.document.frmbook.doingatt.value = window.document.frmbook.doingatt.value + newdoingatt;
			
			
			window.document.getElementById("showdivservice_"+divserviceopen).style.visibility = "hidden";		
			window.document.getElementById("showdivchgtimemin").style.visibility = "hidden";
			window.document.getElementById("showdivchgtime").style.visibility = "hidden";
			
			window.document.frmbook.sortofdochanged.value = "true";
			if(newdoingatt.split("chooselehrling").length > 1 || newdoingatt.split("chooseworker").length > 1){
				godoingtime = eval("window.document.frmbook.doingtime_"+doid).value;
				gowaittime = eval("window.document.frmbook.waittime"+doid).value;
				godoingtime2 = eval("window.document.frmbook.doingtime2"+doid).value;
				if(godoingtime == ""){
					godoingtime = "0";
				}
				if(godoingtime2 == ""){
					godoingtime2 = "0";
				}
				if(gowaittime == ""){
					gowaittime = "0";
					godoingtime2 = "0";
				}
				window.document.frmbook.notimechange.value = "true";
				window.document.frmbook.strdotimes.value = window.document.frmbook.strdotimes.value+"|"+detdoid+"###"+godoingtime+"###"+gowaittime+"###"+godoingtime2+"|";
				window.document.frmbook.action = strtarget + "?scrolledpublic="+getScrollY()+"&actiontype=chooseworker&chgdoingid="+detdoid
				window.document.frmbook.submit();
			}
			else{
				window.document.frmbook.strdotimes.value = window.document.frmbook.strdotimes.value + "|" + detdoid + "###" + dotime + "###" + waittime + "###" + dotime2 + "|";
			}
		}
		function chgdoingdog(dogid,calledby,dogtime){
			//if(window.document.frmbook.doingatt.value.split("|dog_"+dogid+"###").length <= 1){
				window.document.frmbook.doingatt.value = window.document.frmbook.doingatt.value + "|dog_"+dogid+"_"+window.document.frmbook.doingatt.value.split("|dog_"+dogid+"_").length+"###mainworker***fachkraft###noatt### ###|";
			//}
			
			if(calledby == "member"){
				window.document.frmbook.action = "termin.asp?dogtime="+dogtime;
			}
			else{
				window.document.frmbook.action = "/default.asp?dogtime="+dogtime;
			}
			window.document.frmbook.submit();
		}
		function deldoingdog(dogid,calledby){
			var moredog=0,strtime="";
			window.document.frmbook.doingatt.value = window.document.frmbook.doingatt.value.replace("|dog_"+dogid+"###mainworker***fachkraft###noatt### ###|","");
			strtime = window.document.frmbook.strdotimes.value.split("|dog_"+dogid+"###")[1].split("|")[0];
			window.document.frmbook.strdotimes.value = window.document.frmbook.strdotimes.value.replace("|dog_"+dogid+"###"+strtime+"|","");
			moredog = parseInt(dogid.split("_")[1]);
			
			for(i=1;i<10;i++){
				if(window.document.frmbook.doingatt.value.split("|dog_"+dogid.split("_")[0]+"_"+(moredog+i)+"###").length > 1){
					window.document.frmbook.doingatt.value = window.document.frmbook.doingatt.value.replace("|dog_"+dogid.split("_")[0]+"_"+(moredog+i)+"###","|dog_"+dogid.split("_")[0]+"_"+((moredog+i)-1)+"###");
					window.document.frmbook.strdotimes.value = window.document.frmbook.strdotimes.value.replace("|dog_"+dogid.split("_")[0]+"_"+(moredog+i)+"###","|dog_"+dogid.split("_")[0]+"_"+((moredog+i)-1)+"###");
				}
				else{
					break;
				}
			}

			if(calledby == "member"){
				window.document.frmbook.action = "termin.asp";
			}
			else{
				window.document.frmbook.action = "/default.asp";
			}
			window.document.frmbook.submit();
			
		}
		function chgdailyview(calledby) {
			if(calledby == "member"){
				window.document.frmbook.action = "termin.asp?workerid=&actiontype=chgdoing&scrolledpublic="+getScrollY();
			}
			else{
				window.document.frmbook.action = "/default.asp?scrolledpublic="+getScrollY();
			}
			window.document.frmbook.submit();
		}
		function chgworker(workerid,showtype,calledby,pathlocal,linkid) {
			var allworker;
			if(workerid == ""){
				allworker = 1;
			}
			else {
				allworker = 7;
			}
			if(calledby == "member"){
				window.document.frmbook.action = "termin.asp?actiontype=chgdoing&allworkerweek="+allworker+"&showtype="+showtype+"&scrolledpublic="+getScrollY()+"&workerid="+workerid;
			}
			else{
				window.document.frmbook.action = "/default.asp?showtime=true&actiontype=chgdoing&allworkerweek=7&showtype="+showtype+"&scrolledpublic="+getScrollY()+"&workerid="+workerid;
			}
			window.document.frmbook.submit();
		}
		function resetall(showtype,calledby,pathlocal,linkid) {
			if(calledby == "member"){
				window.document.frmbook.action = "termin.asp?showtime=&showtype="+showtype+"&resetdoing=true&scrolledpublic="+getScrollY();
			}
			else{
				window.document.frmbook.action = "/default.asp?showtime=&showtype="+showtype+"&resetdoing=true&scrolledpublic="+getScrollY();
			}
			window.document.frmbook.submit();
		}
		function gobook(cntdoings,bookfrom,bookto,bookdate,workerid,showtype,overlaptimebook,calledby,reducestring) {
			var doexist = false;

			if(cntdoings > 1) {
				for(i=0;i<cntdoings;i++){
					if(window.document.frmbook.doing[i].checked == true){
						doexist = true;
					}
				}
			}
			else {
				if(cntdoings > 0){
					if(window.document.frmbook.doing.checked == true){
						doexist = true;
					}
				}
			}
			if(window.document.frmbook.doingatt.value == ""){
				doexist = false;
			}
			if(window.document.frmbook.doingchanged.value == "true"){
				alert("Dienstleistungen wurden ausgewählt, ohne 'Freie Termine anzeigen' zu klicken. Termine werden jetzt neu berechnet.");
				chgdoing2(showtype,cntdoings,calledby,"","");
			}
			else{	
				if(doexist == false && window.document.frmbook.doingatt.value.split("|dog_").length <= 1) {
					alert("Wählen Sie zuerst oben die gewünschte Diensleistung aus");
				}
				else {
					if(calledby == "member"){
						window.document.frmbook.action = "termin.asp?reducestring="+reducestring+"&overlaptimebook="+overlaptimebook+"&scrolledpublic="+getScrollY()+"&showtype="+showtype+"&workerid="+workerid+"&actiontype=bookcut&bookfrom="+bookfrom+"&bookto="+bookto+"&bookdate="+bookdate;
					}
					else{
						window.document.frmbook.action = "/default.asp?overlaptimebook="+overlaptimebook+"&scrolledpublic="+getScrollY()+"&showtype="+showtype+"&workerid="+workerid+"&actiontype=bookcut&bookfrom="+bookfrom+"&bookto="+bookto+"&bookdate="+bookdate;
					}
					window.document.frmbook.submit();
				}
			}
		}
		function gooff(bookfrom,bookto,bookdate,workerid,showtype,offid) {
			window.document.frmbook.action = "termin.asp?noscroll=true&showtype="+showtype+"&workeridonoff="+workerid+"&actiontype=offtime&bookfrom="+bookfrom+"&bookto="+bookto+"&bookdate="+bookdate+"&scrolledpublic="+getScrollY();
			window.document.frmbook.submit();
		}
		function makegreen(bookfrom,bookto,bookdate,workerid,showtype,offid) {
			window.document.frmbook.action = "termin.asp?oldterminid="+offid+"&noscroll=true&showtype="+showtype+"&workeridonoff="+workerid+"&actiontype=makegreen&bookfrom="+bookfrom+"&bookto="+bookto+"&bookdate="+bookdate+"&scrolledpublic="+getScrollY();
			window.document.frmbook.submit();
		}
		function edittermin(terminid,showtype,calledby) {
			if(calledby == "member"){
				window.document.frmbook.action = "termin.asp?noscroll=true&scrolledpublic="+getScrollY()+"&showtype="+showtype+"&actiontype=edittermin&terminid="+terminid;
			}
			else{
				window.document.frmbook.action = "/default.asp?scrolledpublic="+getScrollY()+"&showtype="+showtype+"&actiontype=edittermin&terminid="+terminid;
			}
			window.document.frmbook.submit();
		}
		function gosingleday(dtmday,dtmmonth,dtmyear,calledby) {
			if(calledby == "member"){
				window.document.frmbook.action = "termin.asp?allworkerweek=1&workerid=&scrolledpublic="+getScrollY()+"&showday="+dtmday+"&showmonth="+dtmmonth+"&showyear="+dtmyear;
			}
			else{
				window.document.frmbook.action = "/default.asp?allworkerweek=&workerid=&scrolledpublic="+getScrollY()+"&showday="+dtmday+"&showmonth="+dtmmonth+"&showyear="+dtmyear;
			}
			window.document.frmbook.submit();
		}
		function hidediv() {
			document.getElementById("showdiv").style.visibility = "hidden";
		}
		function hidedivid(terminid) {
			window.document.getElementById("showdiv"+terminid).style.visibility = "hidden";
		}
		var nav4 = window.Event ? true : false;

		function getScrollX() {
		  var scrOfX = 0, scrOfY = 0;
		  if( typeof( window.pageYOffset ) == 'number' ) {
		    //Netscape compliant
		    scrOfX = window.pageXOffset;
		  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		    //DOM compliant
		    scrOfX = document.body.scrollLeft;
		  } else if( document.documentElement &&
		      ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		    //IE6 standards compliant mode
		    scrOfX = document.documentElement.scrollLeft;
		  }
		  return scrOfX;
		}
		function showmoveold(e){
			var newmousex, newmousey;
			if(nav4) {
				newmousex = e.clientX+getScrollX();
				newmousey = e.clientY+getScrollY();
			}
			else {
				newmousex = window.event.clientX+getScrollX();
				newmousey = window.event.clientY+getScrollY();
			}
			document.getElementById("showdiv").style.visibility= "visible";
			document.getElementById("showdiv").style.top=newmousey;
			document.getElementById("showdiv").style.left=newmousex+10;
		}
		function showmove(e){
			var newmousex, newmousey;
			if(nav4) {
				newmousex = e.clientX+getScrollX();
				newmousey = e.clientY+getScrollY();
			}
			else {
				newmousex = window.event.clientX+getScrollX();
				newmousey = window.event.clientY+getScrollY();
			}
			document.getElementById("showdiv").style.visibility= "visible";
			document.getElementById("showdiv").style.top=newmousey;
			document.getElementById("showdiv").style.left=newmousex+10;
		}
		var delhidden = "";
		function showdetail(terminid,calledby) {
			var strclick,strhtml;
			var arrhiddenid;
			var i;

			var OffsetTop = GetPositionY(getObject('showposgreen'+terminid));
			var OffsetLeft = GetPositionX(getObject('showposgreen'+terminid));
			delhidden = delhidden + "aaa" + terminid

			arrhiddenid = delhidden.split("aaa");
			for(i=1;i<arrhiddenid.length;i++){
				hidedivid(arrhiddenid[i]);
				if(terminid != arrhiddenid[i]){
					delhidden = delhidden.replace("aaa"+arrhiddenid[i],"");
				}
			}
			strclick = "";
			//if(nav4) {
			//	document.captureEvents(Event.MOUSEMOVE);
			//}
			//if(calledby == "public"){
			//	strclick = "Klick für Reservation bei<br>";
			//}
			//strhtml = "<table onmouseover='showdetail(\""+terminid+"\",\""+type+"\",\""+info+"\",\""+nickname+"\",\""+calledby+"\");' width='145px' height='50px' bgcolor='#ffffff' style='border:1px solid #666666;'><tr><td><font style='font-size:9px'>"+strclick+nickname+"</font><br><font style='font-size:12px'>"+info+"</font>";
			//strhtml = strhtml + "</td></tr></table>";
			
			//document.getElementById("showdiv7").innerHTML = strhtml;
			
			//document.getElementById("showpos7").onmousemove=showmove;
			if(calledby == "member"){
				document.getElementById("showdiv"+terminid).style.top=OffsetTop+15;
				document.getElementById("showdiv"+terminid).style.left=OffsetLeft;
			}
			else{
				document.getElementById("showdiv"+terminid).style.top=OffsetTop;
				document.getElementById("showdiv"+terminid).style.left=OffsetLeft;
			}
			document.getElementById("showdiv"+terminid).style.visibility = "visible";				
		}
		function showchgtime(timeid,type,detormain){
			var OffsetTop = 0;
			var OffsetLeft = 0;
			var intsize = 0;


			if(maintimeid == timeid && maintimetypeid == type){
				document.getElementById("showdivchgtimemin").style.visibility = "hidden";
				document.getElementById("showdivchgtime").style.visibility = "hidden";
				maintimeid = "";
				maintimetypeid = "";
				maindetormain = "";
			}
			else{
				maintimeid = timeid;
				maintimetypeid = type;
				maindetormain = detormain;
				if(type == "doingtime"){
					if(eval("window.document.frmbook." + detormain + "doingtime_"+timeid).value > 84){
						intsize = 23
					}
					else{
						intsize = 16
					}
					OffsetTop = GetPositionY(getObject(detormain+'doingtime_'+timeid));
					OffsetLeft = GetPositionX(getObject(detormain+'doingtime_'+timeid)) + intsize;
				}
				else if(type == "waittime"){
					if(eval("window.document.frmbook." + detormain + "waittime"+timeid).value > 84){
						intsize = 23
					}
					else{
						intsize = 16
					}
					OffsetTop = GetPositionY(getObject(detormain+'waittime'+timeid));
					OffsetLeft = GetPositionX(getObject(detormain+'waittime'+timeid)) + intsize;
				}
				else if(type == "doingtime2"){
					if(eval("window.document.frmbook." + detormain + "doingtime2"+timeid).value > 84){
						intsize = 23
					}
					else{
						intsize = 16
					}
					OffsetTop = GetPositionY(getObject(detormain+'doingtime2'+timeid));
					OffsetLeft = GetPositionX(getObject(detormain+'doingtime2'+timeid)) + intsize;
				}
				document.getElementById("showdivchgtime").style.top=OffsetTop-8;
				document.getElementById("showdivchgtime").style.left=OffsetLeft;
				document.getElementById("showdivchgtime").style.visibility = "visible";
				document.getElementById("showdivchgtimemin").style.top=OffsetTop+5;
				document.getElementById("showdivchgtimemin").style.left=OffsetLeft;
				document.getElementById("showdivchgtimemin").style.visibility = "visible";
			}						
		
		}
		function plus5(){
			var strreplace="",godoingtime="",godoingtime2="",gowaittime="";
			
			if(maintimetypeid == "doingtime"){
				eval("window.document.frmbook." + maindetormain + "doingtime_"+maintimeid).value = parseInt(eval("window.document.frmbook." + maindetormain + "doingtime_"+maintimeid).value)+5
			}
			else if(maintimetypeid == "waittime"){
				eval("window.document.frmbook." + maindetormain + "waittime"+maintimeid).value = parseInt(eval("window.document.frmbook." + maindetormain + "waittime"+maintimeid).value)+5
			}
			else if(maintimetypeid == "doingtime2"){
				eval("window.document.frmbook." + maindetormain + "doingtime2"+maintimeid).value = parseInt(eval("window.document.frmbook." + maindetormain + "doingtime2"+maintimeid).value)+5
			}


			if(window.document.frmbook.strdotimes.value.split("|"+maintimeid+"###").length > 1){
				strreplace = window.document.frmbook.strdotimes.value.split("|"+maintimeid+"###")[1].split("|")[0];
				window.document.frmbook.strdotimes.value = window.document.frmbook.strdotimes.value.replace("|"+maintimeid+"###"+strreplace+"|","");
			}
			godoingtime = eval("window.document.frmbook.doingtime_"+maintimeid).value;
			if(eval("window.document.frmbook.waittime"+maintimeid)){
				gowaittime = eval("window.document.frmbook.waittime"+maintimeid).value;
				if(eval("window.document.frmbook.doingtime2"+maintimeid)){
					godoingtime2 = eval("window.document.frmbook.doingtime2"+maintimeid).value;
				}
			}
			if(godoingtime == ""){
				godoingtime = "0";
			}
			if(godoingtime2 == ""){
				godoingtime2 = "0";
			}
			if(gowaittime == ""){
				gowaittime = "0";
				godoingtime2 = "0";
			}
			window.document.frmbook.strdotimes.value = window.document.frmbook.strdotimes.value+"|"+maintimeid+"###"+godoingtime+"###"+gowaittime+"###"+godoingtime2+"|";


		}
		function plus5fix(maintimeidfix,maintimetypeidfix,maindetormainfix){
			if(maintimetypeidfix == "doingtime"){
				eval("window.document.frmbook." + maindetormainfix + "doingtime_"+maintimeidfix).value = parseInt(eval("window.document.frmbook." + maindetormainfix + "doingtime_"+maintimeidfix).value)+5
			}
			else if(maintimetypeidfix == "waittime"){
				eval("window.document.frmbook." + maindetormainfix + "waittime"+maintimeidfix).value = parseInt(eval("window.document.frmbook." + maindetormainfix + "waittime"+maintimeidfix).value)+5
			}
			else if(maintimetypeidfix == "doingtime2"){
				eval("window.document.frmbook." + maindetormainfix + "doingtime2"+maintimeidfix).value = parseInt(eval("window.document.frmbook." + maindetormainfix + "doingtime2"+maintimeidfix).value)+5
			}
		}
		function minus5(){
			var strreplace="",godoingtime="",godoingtime2="",gowaittime="";

			if(maintimetypeid == "doingtime"){
				if(parseInt(eval("window.document.frmbook." + maindetormain + "doingtime_"+maintimeid).value) > 0){
					eval("window.document.frmbook." + maindetormain + "doingtime_"+maintimeid).value = parseInt(eval("window.document.frmbook." + maindetormain + "doingtime_"+maintimeid).value)-5
				}
			}
			else if(maintimetypeid == "waittime"){
				if(parseInt(eval("window.document.frmbook." + maindetormain + "waittime"+maintimeid).value) > 0){
					eval("window.document.frmbook." + maindetormain + "waittime"+maintimeid).value = parseInt(eval("window.document.frmbook." + maindetormain + "waittime"+maintimeid).value)-5
				}
			}
			else if(maintimetypeid == "doingtime2"){
				if(parseInt(eval("window.document.frmbook." + maindetormain + "doingtime2"+maintimeid).value) > 0){
					eval("window.document.frmbook." + maindetormain + "doingtime2"+maintimeid).value = parseInt(eval("window.document.frmbook." + maindetormain + "doingtime2"+maintimeid).value)-5
				}
			}

			if(window.document.frmbook.strdotimes.value.split("|"+maintimeid+"###").length > 1){
				strreplace = window.document.frmbook.strdotimes.value.split("|"+maintimeid+"###")[1].split("|")[0];
				window.document.frmbook.strdotimes.value = window.document.frmbook.strdotimes.value.replace("|"+maintimeid+"###"+strreplace+"|","");
			}
			godoingtime = eval("window.document.frmbook.doingtime_"+maintimeid).value;
			if(eval("window.document.frmbook.waittime"+maintimeid)){
				gowaittime = eval("window.document.frmbook.waittime"+maintimeid).value;
				if(eval("window.document.frmbook.doingtime2"+maintimeid)){
					godoingtime2 = eval("window.document.frmbook.doingtime2"+maintimeid).value;
				}
			}
			if(godoingtime == ""){
				godoingtime = "0";
			}
			if(godoingtime2 == ""){
				godoingtime2 = "0";
			}
			if(gowaittime == ""){
				gowaittime = "0";
				godoingtime2 = "0";
			}
			window.document.frmbook.strdotimes.value = window.document.frmbook.strdotimes.value+"|"+maintimeid+"###"+godoingtime+"###"+gowaittime+"###"+godoingtime2+"|";


		}
		function minus5fix(maintimeidfix,maintimetypeidfix,maindetormainfix){
			if(maintimetypeidfix == "doingtime"){
				if(parseInt(eval("window.document.frmbook." + maindetormainfix + "doingtime_"+maintimeidfix).value) > 0){
					eval("window.document.frmbook." + maindetormainfix + "doingtime_"+maintimeidfix).value = parseInt(eval("window.document.frmbook." + maindetormainfix + "doingtime_"+maintimeidfix).value)-5
				}
			}
			else if(maintimetypeidfix == "waittime"){
				if(parseInt(eval("window.document.frmbook." + maindetormainfix + "waittime"+maintimeidfix).value) > 0){
					eval("window.document.frmbook." + maindetormainfix + "waittime"+maintimeidfix).value = parseInt(eval("window.document.frmbook." + maindetormainfix + "waittime"+maintimeidfix).value)-5
				}
			}
			else if(maintimetypeidfix == "doingtime2"){
				if(parseInt(eval("window.document.frmbook." + maindetormainfix + "doingtime2"+maintimeidfix).value) > 0){
					eval("window.document.frmbook." + maindetormainfix + "doingtime2"+maintimeidfix).value = parseInt(eval("window.document.frmbook." + maindetormainfix + "doingtime2"+maintimeidfix).value)-5
				}
			}
		}
		function goshowdivservice(divid,cntdoings,detreqexist){
			var OffsetTop = GetPositionY(getObject('checkboxservice_'+divid));
			var OffsetLeft = GetPositionX(getObject('checkboxservice_'+divid));
			var strreplace = "";
			var delid = "";
			window.document.getElementById("showdivchgtimemin").style.visibility = "hidden";
			window.document.getElementById("showdivchgtime").style.visibility = "hidden";
			if(window.document.frmbook.doing[cntdoings].checked == false){
				if(detreqexist != ""){
					strreplace = window.document.frmbook.doingatt.value.split("|"+detreqexist+"###")[1].split("|")[0];
					window.document.frmbook.doingatt.value = window.document.frmbook.doingatt.value.replace("|"+detreqexist+"###"+strreplace+"|","");
					strreplace = window.document.frmbook.strdotimes.value.split("|"+detreqexist+"###")[1].split("|")[0];
					window.document.frmbook.strdotimes.value = window.document.frmbook.strdotimes.value.replace("|"+detreqexist+"###"+strreplace+"|","");
					
				}
				else{
					if(openeddetservices.split("|"+divid+"###").length > 1){
						delid = openeddetservices.split("|"+divid+"###")[1].split("|")[0];
						strreplace = window.document.frmbook.doingatt.value.split("|"+delid+"###")[1].split("|")[0];
						window.document.frmbook.doingatt.value = window.document.frmbook.doingatt.value.replace("|"+delid+"###"+strreplace+"|","");					
						strreplace = window.document.frmbook.strdotimes.value.split("|"+delid+"###")[1].split("|")[0];
						window.document.frmbook.strdotimes.value = window.document.frmbook.strdotimes.value.replace("|"+delid+"###"+strreplace+"|","");					
						openeddetservices = openeddetservices.replace("|"+divid+"###"+delid+"|","");
					}
				}
				window.document.frmbook.sortofdochanged.value = "true";
			}
			else{
				document.frmbook.doing[cntdoings].checked = false;
				if(divserviceopen != ""){
					document.getElementById("showdivservice_"+divserviceopen).style.visibility = "hidden";
				}
				divserviceopen = divid;
				document.getElementById("showdivservice_"+divid).style.top=OffsetTop+19;
				document.getElementById("showdivservice_"+divid).style.left=OffsetLeft-45;
				document.getElementById("showdivservice_"+divid).style.visibility = "visible";
			}
			openservicenow = "true";
		}

		function showworkerphoto(workerid,showtype){

			if(showtype == "choosedphoto"){
				var OffsetTop = GetPositionY(getObject('imgchoosedphoto'));
				var OffsetLeft = GetPositionX(getObject('imgchoosedphoto'));
				window.document.getElementById("showworkerphoto_"+workerid).style.top=OffsetTop+56;
				window.document.getElementById("showworkerphoto_"+workerid).style.left=OffsetLeft-3;
			}
			else{
				var OffsetTop = GetPositionY(getObject('workerphoto_'+workerid));
				var OffsetLeft = GetPositionX(getObject('workerphoto_'+workerid));
				window.document.getElementById("showworkerphoto_"+workerid).style.top=OffsetTop+60;
				window.document.getElementById("showworkerphoto_"+workerid).style.left=OffsetLeft-1;
			}

			window.document.getElementById("showworkerphoto_"+workerid).style.visibility = "visible";
		}
		function hideworkerphoto(workerid){
			window.document.getElementById("showworkerphoto_"+workerid).style.visibility = "hidden";
		}


		function hidedivservice(divid){
			document.getElementById("showdivservice_"+divid).style.visibility = "hidden";
			document.getElementById("showdivchgtimemin").style.visibility = "hidden";
			document.getElementById("showdivchgtime").style.visibility = "hidden";
		}
		function hidedivservice2(){
			if(divserviceopen != ""){
				document.getElementById("showdivservice_"+divserviceopen).style.visibility = "hidden";
			}
		}
		function gopreconfirm(cntdoings,showdatefrom,workerid,hour,minute,calledby,reducestring,overlaptime,showtype) {
			var doexist = false;

			if(cntdoings > 1) {
				for(i=0;i<cntdoings;i++){
					if(window.document.frmbook.doing[i].checked == true){
						doexist = true;
					}
				}
			}
			else {
				if(cntdoings > 0){
					if(window.document.frmbook.doing.checked == true){
						doexist = true;
					}
				}
			}
			if(window.document.frmbook.doingatt.value == ""){
				doexist = false;
			}
			if(window.document.frmbook.doingchanged.value == "true"){
				alert("Dienstleistungen wurden ausgewählt, ohne 'Freie Termine anzeigen' zu klicken. Termine werden jetzt neu berechnet.");
				chgdoing2(showtype,cntdoings,calledby,"","");
			}
			else{	
				if(doexist == false && window.document.frmbook.doingatt.value.split("|dog_").length <= 1) {
					alert("Wählen Sie zuerst oben die gewünschte Diensleistung aus");
				}
				else {
					if(calledby == "public"){
						window.document.frmbook.action = "/default.asp?showtype="+showtype+"&overlaptimebook="+overlaptime+"&reducestring="+reducestring+"&scrolledpublic="+getScrollY()+"&godirect=true&radworkerid="+workerid+"&bookdate="+showdatefrom+"&actiontype=preconfirm&fromhour"+workerid+"="+hour+"&frommin"+workerid+"="+minute;
					}
					else{	
						window.document.frmbook.action = "termin.asp?showtype="+showtype+"&overlaptimebook="+overlaptime+"&reducestring="+reducestring+"&scrolledpublic="+getScrollY()+"&godirect=true&radworkerid="+workerid+"&bookdate="+showdatefrom+"&actiontype=preconfirm&fromhour"+workerid+"="+hour+"&frommin"+workerid+"="+minute;
					}
					window.document.frmbook.submit();
				}
			}
		}
		function gobookcut(cntdoings,showdatefrom,workerid,bookfrom,bookto,calledby,showtype) {
			var doexist = false;

			if(cntdoings > 1) {
				for(i=0;i<cntdoings;i++){
					if(window.document.frmbook.doing[i].checked == true){
						doexist = true;
					}
				}
			}
			else {
				if(cntdoings > 0){
					if(window.document.frmbook.doing.checked == true){
						doexist = true;
					}
				}
			}
			if(window.document.frmbook.doingatt.value == ""){
				doexist = false;
			}
			if(window.document.frmbook.doingchanged.value == "true"){
				alert("Dienstleistungen wurden ausgewählt, ohne 'Freie Termine anzeigen' zu klicken. Termine werden jetzt neu berechnet.");
				chgdoing2(showtype,cntdoings,calledby,"","");
			}
			else{	
				if(doexist == false && window.document.frmbook.doingatt.value.split("|dog_").length <= 1) {
					alert("Wählen Sie zuerst oben die gewünschte Diensleistung aus");
				}
				else {
					if(calledby == "public"){
						window.document.frmbook.action = "/default.asp?allworkerweek=&scrolledpublic="+getScrollY()+"&workerid="+workerid+"&bookdate="+showdatefrom+"&actiontype=bookcut&bookfrom="+bookfrom+"&bookto="+bookto;
					}
					else{	
						window.document.frmbook.action = "termin.asp?allworkerweek=&scrolledpublic="+getScrollY()+"&workerid="+workerid+"&bookdate="+showdatefrom+"&actiontype=bookcut&bookfrom="+bookfrom+"&bookto="+bookto;
					}
					window.document.frmbook.submit();
				}
			}
		}
		function GetPositionY(o) {
			var OffsetTop = 0;
			while (o != null) {
				OffsetTop += o.offsetTop;
				o = o.offsetParent;
			}
			return OffsetTop;
		}
		function GetPositionX(o) {
			var OffsetLeft = 0;
			while (o != null) {
				OffsetLeft += o.offsetLeft;
				o = o.offsetParent;
			}
			return OffsetLeft;
		}
var hidebgcolor="";
var hidefontcolor="";
		function showsametermin(sametermin,color) {
			var arrsplit;
			arrsplit = sametermin.split("|");
			for(i=0;i<arrsplit.length;i++) {
				if(arrsplit[i] != "") {
					try {
						hidebgcolor = hidebgcolor + " |" + arrsplit[i] + "aaa" + window.document.getElementById("showposred"+arrsplit[i]).style.backgroundColor + "| ";
						hidefontcolor = hidefontcolor + " |" + arrsplit[i] + "aaa" + window.document.getElementById("showposred"+arrsplit[i]).style.color + "| ";
						window.document.getElementById("showposred"+arrsplit[i]).style.backgroundColor=color;
						if(color == "#000000"){
							window.document.getElementById("showposred"+arrsplit[i]).style.color="#ffffff";
						}
						else{
							window.document.getElementById("showposred"+arrsplit[i]).style.color="#000000";
						}
					}
					catch(e) {
					}	
				}
			}
		}
		function hidesametermin(sametermin) {
			var arrsplit;strcolor="";fontcolor="";
			arrsplit = sametermin.split("|");

			for(i=0;i<arrsplit.length;i++) {
				if(arrsplit[i] != "") {
					
					try {
						strcolor = hidebgcolor.split("|" + arrsplit[i] + "aaa")[1];
						strcolor = strcolor.split("|")[0];
						fontcolor = hidefontcolor.split("|" + arrsplit[i] + "aaa")[1];
						fontcolor = fontcolor.split("|")[0];

						window.document.getElementById("showposred"+arrsplit[i]).style.backgroundColor = strcolor;
						window.document.getElementById("showposred"+arrsplit[i]).style.color = fontcolor;
					}
					catch(e) {
					}
				}
			}
			hidebgcolor = "";
			hidefontcolor = "";
		}
		function getObject(obj) {
			var theObj;
	
			if (typeof obj == "string") {
				theObj = document.getElementById(obj);
				// this is bad - it works only under IE!
				//theObj = eval("document." + range + obj)
			} else {
				theObj = obj
		}
	
		return theObj
		} 
		function GetPositionY(o) {
			var OffsetTop = 0;
			while (o != null) {
				OffsetTop += o.offsetTop;
				o = o.offsetParent;
			}
			return OffsetTop;
		}
		function GetPositionX(o) {
			var OffsetLeft = 0;
			while (o != null) {
				OffsetLeft += o.offsetLeft;
				o = o.offsetParent;
			}
			return OffsetLeft;
		}

