function getRef(id){
	if(document.getElementById){
		return(document.getElementById(id));
	}else if(document.all){
		return(document.all[id]);
	}else if(document.layers){
		return(document.layers(id));
	}
	return(null);
}

function calselected(day, month, year){
	document.location = "?get_path=xnyraqre/&amp;day=" + day + "&amp;month=" + month + "&amp;year=" + year;
}

function openWindow(id){
	if(id.length < 1){
		id = 'christuskircheTermin';
	}
	window.open('about:blank', id, 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=640,height=500');
}

function styleAbbr(){
	var oldBodyText, newBodyText, reg;
	if(navigator.userAgent.indexOf('MSIE') != -1){
		oldBodyText = document.body.innerHTML;
		reg = /<abbr([^>]*)>([^<]*)<\/abbr>/ig;
		newBodyText = oldBodyText.replace(reg, '<abbr $1><span class=\"abbr\" $1>$2</span></abbr>');
		document.body.innerHTML = newBodyText;
	}
}

function documentLoaded(){
	try{
		styleAbbr();
		initializeIframeObject();
		if(getRef('index') != null){
			getRef('index').target = "christuskircheTermin";
		}
	}catch(e){
	}
	try{
		mainblockLoaded();
	}catch(e){
		//alert(e.description);
	}
}

function getSelectedValue(id){
	if((getRef(id) != null) && (getRef(id).selectedIndex != null)){
		if((getRef(id).options[getRef(id).selectedIndex].title != null) &&
			(getRef(id).options[getRef(id).selectedIndex].title.length > 0)){
			return(getRef(id).options[getRef(id).selectedIndex].title);
		}else{
			return(getRef(id).options[getRef(id).selectedIndex].text);
		}
	}else{
		return(null);
	}
}

function getSelectedIdValue(id){
	if(getRef(id).selectedIndex != null){
		var id_value = getRef(id).options[getRef(id).selectedIndex].id;
		if(id_value != null){
			id_value = id_value.replace(/.*_/, '');
			return(id_value);
		}
	}
	return(null);
}

function indexValidate(){
	return true;
}

function initializeIframeObject(){
	if(navigator.userAgent.indexOf('MSIE') != -1){
		var oPlaceHolder = getRef("fixIeObjectBug");
		if(oPlaceHolder != null){
			var objectElement = oPlaceHolder.getElementsByTagName("object")[0];
			objectElement.style.display = "none";
			var iframeElement = document.createElement("iframe");
			iframeElement.className = objectElement.className;
			iframeElement.src = objectElement.data;
			iframeElement.height = objectElement.height;
			iframeElement.width = objectElement.width;
			if(iframeElement.style.setAttribute != null){
				iframeElement.style.setAttribute("border", "0px solid inherit");
				iframeElement.style.setAttribute("height", "400px");
				iframeElement.style.setAttribute("min-height", "400px! important");
				iframeElement.style.setAttribute("min-width", "600px! important");
				iframeElement.style.setAttribute("width", "600px! important");
			}
			oPlaceHolder.appendChild(iframeElement);
		}
	}
}

function zeige(url, name, width, height){
	var mbar, sbar, tbar, lbar;
	var base = document.getElementsByTagName('base');
	mbar = sbar = tbar = lbar = 'no';
	width = width + 50;
	height = height + 50;
	if(base && base[0] && base[0].href){
		url = document.getElementsByTagName('base')[0].href + url;
	}
	window.open(url, name, 'resizable=yes,scrollbars=yes,status='+sbar+',toolbar='+tbar+',location='+lbar+',menubar='+mbar+',height='+height+',width='+width);
}

/* Get rid of the pre-text search in inputs */
function onFocusCheckEntry(which, cont, colorChange) {
	if((cont != "dummy") && (which.value == cont)){
		which.value = "";
	}
}

function onBlurCheckEntry(which, cont, colorChange){
	if((cont != "dummy") && (which.value == "")){
		which.value = cont;
	}
}
 

