MS_marked_fields = function(id, obj, day, days, ncolor, hcolor, inuse) {

	obj = document.getElementById(obj);

	if(obj.firstpressid == undefined) {
		
		if(!inuse) {
		
			obj.firstpressid = id;
			obj.firstpressday = day;
			document.getElementById(id).style.backgroundColor = hcolor;
			
		} else {
		
			alert('Dieser Tag ist schon belegt!');
		}
		
	} else {
	
		if(!inuse) {
	
			for(x=1; x<=days; ++x) {

				document.getElementById('tag_'+x).style.backgroundColor = ncolor;
			}

			if(obj.firstpressid == id) {

				obj.firstpressid = undefined;
				obj.firstpressday = undefined;
				document.getElementById(id).style.backgroundColor = ncolor;

			} else {

				for(x=obj.firstpressday; (obj.firstpressday<day) ? x<=day : x>=day;  (obj.firstpressday<day) ? ++x : --x) {

					document.getElementById('tag_'+x).style.backgroundColor = hcolor;
				}
			}
		
		} else {
		
			alert('Dieser Tag ist schon belegt!');
		}
	}
};

MS_layer_show = function(id, objStatus, styleOpt) {

	var obj = (document.layers && id!=undefined) ? document.layers[id] :
		  ((document.getElementById && id!=undefined) ? document.getElementById(id) : false);

	if(typeof(obj)=="object" && obj!=null) {

		obj.layerstatus = (obj.layerstatus==undefined) ?
				  ((objStatus) ? false : true) :
				  ((obj.layerstatus) ? false : true);

		if(styleOpt == "visibility") {
		
			(document.layers) ?
			(obj.visibility = (obj.layerstatus) ? "show" : "hide") :
			((document.getElementById) ? (obj.style.visibility = (obj.layerstatus) ? "visible" : "hidden") : "");
		
		} else if(styleOpt == "display") {

			(document.getElementById) ? (obj.style.display = (obj.layerstatus) ? "block" : "none") : "";
		}
	}
};