﻿	intranetpath="#intranetpath#";
	
	function createAjaxObject(){
	var ao;
	var browser = navigator.appName;
	if (browser == "Microsoft Internet Explorer"){
		ao = new ActiveXObject("Microsoft.XMLHTTP");
		}
	else{
		ao = new XMLHttpRequest(); 
		}
		return ao;
	}
	
	var http = createAjaxObject();


/*Dokument zählen und ausliefern*/
	function cAdF(docID){
			http.open('get', '/communityFiles/api/countAndDeliver.cfm?docID=' + docID);
			http.onreadystatechange = handleCAdF;
			http.send(null);
	}
		
	function handleCAdF(){
		if (http.readyState == 4){
				var response= http.responseText;
				var update = new Array();
				if (response.indexOf('|' != -1)){
					update = response.split('|');
					/*document.getElementById('divMailMessage').innerHTML = update [0];*/
					window.open(update[0],'','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1'); return false;
				}
			}
	}
	
/* Unbekannte Benutzer anzeigen */
	function showRandomUnknown(){
		http.open('get', '/communityFiles/api/sruu.cfm');
		http.onreadystatechange = handleShowRandomUnknown;
		http.send(null);
	}

	function handleShowRandomUnknown(){
		if (http.readyState == 4){
			var response= http.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				document.getElementById('randomUnknownUser').innerHTML = update [0];
			}
		}
	}



	function getPageSize() {
	     var xScroll, yScroll;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = window.innerWidth + window.scrollMaxX;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		
		if (self.innerHeight) {	// all except Explorer
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth; 
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = xScroll;		
		} else {
			pageWidth = windowWidth;
		}
		
		//return (pageWidth);
		return [pageWidth,pageHeight];
	}	


	function hideDiv(divName){
		theDivToHide=document.getElementById(divName);
		theDivToHide.style.display="none";
	}
	function showDiv(divName){
		theDivToShow=document.getElementById(divName);
		theDivToShow.style.display="block";
	}



	function showControlVisibility(theControlDiv){
		try{
			cOpendivControlVisibility.style.display="none";
		}
		catch (e){dummy=1;}

		divControlVisibility=document.getElementById(theControlDiv);
		cOpendivControlVisibility=divControlVisibility;
		divControlVisibility.style.display="block";
	}
	
	function closeControlVisibility(theControlDivToClose){
		document.getElementById(theControlDivToClose).style.display="none";
	}
	
	function setVisibilityState(fieldID,farbe){
		document.getElementById("controlVisibility_" + fieldID).style.display="none";
		document.getElementById("controlVisibilityState_" + fieldID).style.backgroundColor=farbe;
	}
	
	function showGasWasserPraxisImport(){
		document.getElementById("divGwpSuche").style.display="block";
		textSucheingabe=document.getElementById("divGwpSuche").innerHTML;
	}

	function hideGasWasserPraxisImport(){
		setDivToOverflowHidden();
		document.getElementById("divGwpSuche").innerHTML=textSucheingabe;
		document.getElementById("divGwpSuche").style.display="none";	
	}
	
	function openGasWasserPraxisImport(){
		suchbegriff=document.getElementById("suchbegriff").value;
		getCompanyData(suchbegriff);
	}
	
	/*ajax - firmendaten von gwp holen*/
		function getCompanyData(sb){
				http.open('get', '/communityFiles/api/getCompany.cfm?sb=' + sb);
				http.onreadystatechange = handleGetCompanyData;
				http.send(null);
		}
			
		function handleGetCompanyData(){
			if (http.readyState == 4){
					var response= http.responseText;
					var update = new Array();
					if (response.indexOf('|' != -1)){
						update = response.split('|');
						document.getElementById('divGwpSuche').innerHTML = update [0];
						setDivToScroll();
					}
				}
		}
	/*ENDE ajax - firmendaten von gwp holen*/

	function setCompany(title,title2,telefon,strasse,land,plz,ort){
		hideGasWasserPraxisImport();

		document.getElementById("object_unternehmen").value=title;
		document.getElementById("object_unternehmen2").value=title2;
		document.getElementById("object_land").value=land;
		document.getElementById("object_strasse").value=strasse;
		document.getElementById("object_plz").value=plz;
		document.getElementById("object_ort").value=ort;
		document.getElementById("object_telefonBusiness").value=telefon;
	}
	
	
	function setDivToScroll(){
		document.getElementById("divGwpSuche").style.overflowY="scroll";	
	}
	
	function setDivToOverflowHidden(){
		document.getElementById("divGwpSuche").style.overflowY="hidden";
	}
			
	function setSelfAdmin(){
		//document.write("resize");
	}
	
	function setExtension(mySource, myTarget){
		mediaTypeListLow="jpg,gif";
		
		mySourceField=document.getElementById(mySource);
		myTargetField=document.getElementById(myTarget);
		myFileName=mySourceField.value;
		
		findDotPos=myFileName.lastIndexOf(".") + 1;
		findEmptyPos=myFileName.indexOf(" ");
		
		userMediaType=myFileName.substr(findDotPos,3);
		userMediaTypeLow=userMediaType.toLowerCase();
		
	
		var checkList = mediaTypeListLow.search(userMediaTypeLow);
	
		if(checkList == -1){
			alert("ungueltige Erweiterung\n SIe dürfen eine Datei mit der Endung jpg oder gif hochladen.\n\n");
			mySource.clear;
			}
		else {
			myTargetField.value=userMediaTypeLow;
			}
	}	
	
	
	
/*Mail*/
	function Numsort (a, b) {
		return a - b;
	}
	
	mailReceiverIDList=new Array();
	mailReceiverTextList=new Array();
	function manageMailRecipientListSelected(receiverID){

		mailReceiverID=document.getElementById("mailRecipientID" + receiverID);
		mailReceiverText=document.getElementById("mailRecipientText" + receiverID);

		if (mailReceiverID.checked){
			mailReceiverIDList.unshift(mailReceiverID.value);	
			mailReceiverTextList.unshift(" " + mailReceiverText.value);	
		}
		else {
			for (i=0; i<=mailReceiverIDList.length; i++){
				if (mailReceiverIDList[i]==receiverID){findIndexPos=i; break;}
			}
			mailReceiverIDList.splice(findIndexPos,1);
			mailReceiverTextList.splice(findIndexPos,1);
		}

		document.getElementById("empfaengerliste").value=mailReceiverIDList;
		document.getElementById("mailRecipientListSelected").value=mailReceiverTextList;
		
	}
	
	function sendMail(){
		if (document.getElementById("empfaengerliste").value != ""){
			document.fMail.submit();
		}
		else{
			alert ("kein Empfänger angegeben");	
		}
	}
	
	function showMail(mailID){
		/*
		mailContentHTML=document.getElementById("mailContent" + mailID).innerHTML;
		document.getElementById("mailContent").innerHTML=mailContentHTML;
		document.getElementById("mailContent").style.display="block";
		*/
		
		cMailID=mailID;
		mailGelesen(mailID,1);
		location.href=("/index.cfm?cmd=mi&email=" + mailID);
	}
	
/*ajax - mailFwd*/
	function mailFwd(mid){
			document.getElementById('divMailMessage').innerHTML="bitte warten";
			http.open('get', '/communityFiles/api/mailFwd.cfm?mid=' + mid);
			http.onreadystatechange = handleMailFwd;
			http.send(null);
	}
		
	function handleMailFwd(){
		if (http.readyState == 4){
				var response= http.responseText;
				var update = new Array();
				if (response.indexOf('|' != -1)){
					update = response.split('|');
					document.getElementById('divMailMessage').innerHTML = update [0];
				}
			}
	}
/*ENDE ajax - mailFwd*/


/*ajax - mailGelesen*/
	function mailGelesen(mid,gelesenFlag){
			http.open('get', '/communityFiles/api/mailGelesen.cfm?mid=' + mid + '&gF=' + gelesenFlag);
			http.onreadystatechange = handleMailGelesen;
			http.send(null);
	}
		
	function handleMailGelesen(){
		if (http.readyState == 4){
				var response= http.responseText;
				var update = new Array();
				if (response.indexOf('|' != -1)){
					update = response.split('|');
					/*document.getElementById('divMailMessage').innerHTML = update [0];*/
					if(update [0]=="1"){
						setActive();
					}
					if(update [0]=="0"){
						setInactive();
					}
				}
			}
	}
	function setActive(){
		document.getElementById("mailAbsender" + cMailID).className="mailEmpfangenZeileGelesen";
		document.getElementById("mailBetreff" + cMailID).className="mailEmpfangenZeileGelesen";
		document.getElementById("mailEmpfangen" + cMailID).className="mailEmpfangenZeileGelesen";
	}
	function setInactive(){
		document.getElementById('divMailMessage').innerHTML = "Mail als ungelesen markiert";

		document.getElementById("mailAbsender" + cMailID).className="mailEmpfangenZeileUngelesen";
		document.getElementById("mailBetreff" + cMailID).className="mailEmpfangenZeileUngelesen";
		document.getElementById("mailEmpfangen" + cMailID).className="mailEmpfangenZeileUngelesen";
	}
/*ENDE ajax - mailGelesen*/

/*ajax - mailAnswer*/
	function mailAnswer(mid){
			document.getElementById('divMailMessage').innerHTML="bitte warten";
			http.open('get', '/communityFiles/api/mailAnswer.cfm?mid=' + mid);
			http.onreadystatechange = handleMailAnswer;
			http.send(null);
	}
		
	function handleMailAnswer(){
		if (http.readyState == 4){
				var response= http.responseText;
				var update = new Array();
				if (response.indexOf('|' != -1)){
					update = response.split('|');
					document.getElementById('divMailMessage').innerHTML = update [0];
				}
			}
	}
/*ENDE ajax - mailAnswer*/

/*ajax - mailDelete*/
	function mailDelete(mid){
			cMailID=mid;
			http.open('get', '/communityFiles/api/mailDelete.cfm?mid=' + mid);
			http.onreadystatechange = handleMailDelete;
			http.send(null);
	}
		
	function handleMailDelete(){
		if (http.readyState == 4){
			var response= http.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				/*document.getElementById('divMailMessage').innerHTML = update [0];*/
				//if(update [0]=="1"){	
					//deleteMailRow(cMailID);
					document.location.href="/index.cfm?cmd=mi";
				//}
			}
		}
	}
	
	function deleteMailRow(mailID){
		document.getElementById("mailRow" + mailID).style.display="none";
		document.getElementById("mailContent").innerHTML="Mail gelöscht";
		
	}
/*ajax - ENDE mailDelete*/
/*Mail Ende*/

/*kontakte*/
	function addContact(cid,message){
			try{
				//document.getElementById("profileAddContact").style.display="none";
				document.getElementById("profileAddContact").innerHTML="<img src='../images/icons/Kontakt_hinzu.png' height='16' style='padding-right:8px;'>" + message;
				
			}
			catch(e){nothing=1;}
			cContactUUID=cid;
			http.open('get', '/communityFiles/api/addContact.cfm?cContactUUID=' + cContactUUID);
			http.onreadystatechange = handleAddContact;
			http.send(null);
	}
		
	function handleAddContact(){
		if (http.readyState == 4){
			var response= http.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				document.getElementById('addContactMessage' + cContactUUID).innerHTML = update [0];
				document.getElementById("btnAddContact" + cContactUUID).style.display="none";
				document.getElementById("btnShowProfile" + cContactUUID).style.display="none";				
			}
		}
	}
	

	function blockContact(cid){
			try{
				document.getElementById("profileBlockContact").style.display="none";
			}
			catch(e){nothing=1;}
			cContactUUID=cid;
			http.open('get', '/communityFiles/api/blockContact.cfm?cContactUUID=' + cContactUUID);
			http.onreadystatechange = handleBlockContact;
			http.send(null);
	}
		
	function handleBlockContact(){
		if (http.readyState == 4){
			var response= http.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				document.getElementById("divBlockUser" + cContactUUID).style.display="none";
				location.href="/index.cfm?cmd=c";
			}
		}
	}
	



	function showProfile(cid){
		getPageSize();
		gardine=document.getElementById("gardine");
		flyingContent=document.getElementById("flyingContent");
		flyingContent.innerHTML="<table border=0 height='100%' align='center'><tr><td valign='middle'><img src='/img/layout/bitteWarten.gif'></td></tr></table>";
		gardine.style.display="block";
		gardine.style.width=pageWidth + "px";
		gardine.style.height=pageHeight + "px";
		
		theLeft=pageWidth / 2 - 340;
		flyingContent.style.left=theLeft + "px";

		cContakt=cid;
		http.open('get', '/communityFiles/api/showProfile.cfm?cid=' + cid);
		http.onreadystatechange = handleShowProfile;
		http.send(null);

	}
		
	function handleShowProfile(){
		if (http.readyState == 4){
			var response= http.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				document.getElementById('flyingContent').innerHTML = update [0];
			}
		}
	}


	function clearSession(){
			http.open('get', '/communityFiles/api/clearSession.cfm');
			http.onreadystatechange = handleClearSession;
			http.send(null);
	}
		
	function handleClearSession(){
		if (http.readyState == 4){
			var response= http.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
			}
		}
	}

	function getSndBrkMsg(){
			http.open('get', '/communityFiles/api/getBrkMsg.cfm');
			http.onreadystatechange = handleGetSndBrkMsg;
			http.send(null);
	}
		
	function handleGetSndBrkMsg(){
		if (http.readyState == 4){
			var response= http.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				onlineFriendList=update[1];
				onlineUserList=update[2];
	
				setStatusOnline(onlineFriendList,onlineUserList);
	
				scuid=parseInt(update[3]);
				if (parseInt(update[4])==0){
					try{
					breakingMessageArea.style.display="none";
					}
					catch(e){nothing=1;}
				}
				
				if (update[0] != "" && parseInt(update[4])>0){
					//document.getElementById("sndBrkMsg_"  + scuid).innerHTML = update[0];
					manageBreakingMessage(update [0],scuid);
				}
			}
		}
	}


	function manageBreakingMessage(message,scuid){
		breakingMessageArea=document.getElementById("sndBrkMsg_"  + scuid);
		breakingMessageArea.innerHTML = message;
		if (breakingMessageArea.innerHTML.length < 10){
			breakingMessageArea.style.display="none";
		}
		else{
			breakingMessageArea.style.display="block";
			}
	}

	function setBrkMsg(msg,cuid,chatID,type){
			try{
				document.getElementById("statusOnlineChatInvitation" + cuid).style.display="none";
			}
			catch(e){nothing=1;}
				
			http.open('get', '/communityFiles/api/setBrkMsg.cfm?msg=' + msg + "&cuid=" + cuid + "&chatID=" + chatID + "&type=" + type);
			http.onreadystatechange = handleSetBrkMsg;
			http.send(null);
	}
		
	function handleSetBrkMsg(){
		if (http.readyState == 4){
			var response= http.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				document.getElementById('debugArea').innerHTML = update [0];
			}
		}
	}



	function delBrkMsg(mid){
			http.open('get', '/communityFiles/api/delBrkMsg.cfm?mid=' + mid);
			http.onreadystatechange = handleDelBrkMsg;
			http.send(null);
	}
		
	function handleDelBrkMsg(){
		if (http.readyState == 4){
			var response= http.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				//document.getElementById('debugArea').innerHTML = update [0];
				getSndBrkMsg();
			}
		}
	}

/*Gaestebucheintrag entfernen*/
	function delGuestbookComment(gbCID,ai){
			cGbCID=gbCID;
			http.open('get', '/communityFiles/api/delGuestbookComment.cfm?gbCID=' + gbCID);
			http.onreadystatechange = handleDelGuestbookComment;
			http.send(null);
	}
		
	function handleDelGuestbookComment(){
		if (http.readyState == 4){
			var response= http.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				document.getElementById('gaestebuchKommentar' + cGbCID).style.display="none";
				document.getElementById('hrGuestbook' + cGbCID).style.display="none";
			}
		}
	}


/*Gruppenartikel entfernen*/
	function delGroupArticleComment(gbCID,ai){
			try{
				document.getElementById('editButton' + gbCID).style.display='none';	
				document.getElementById('deleteButton' + gbCID).style.display='none';	
			}
			catch(e){}
			cGbCID=gbCID;
			http.open('get', '/communityFiles/api/delGroupArticleComment.cfm?gbCID=' + gbCID);
			http.onreadystatechange = handleDelGroupArticleComment;
			http.send(null);
	}
		
	function handleDelGroupArticleComment(){
		if (http.readyState == 4){
			var response= http.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				document.getElementById('gaestebuchKommentar' + cGbCID).style.display="none";
				document.getElementById('hrGuestbook' + cGbCID).style.display="none";
			}
		}
	}




	/*Online status setzen*/

	//onlineUserListe=new Array();		
	function setStatusOnline(tmpFriendList, tmpOnlineUserList){
		
		if(tmpFriendList){
			//erstmal alle auf Offline
			onlineFriendList=tmpFriendList.split(",");
			for (i=0; i<onlineFriendList.length; i++){
				checkUserID=parseInt(onlineFriendList[i]);
				try{
					document.getElementById("statusOnline" + checkUserID).innerHTML="<font style='color:red'>Offline</font>";
					document.getElementById("statusOnlineChatInvitation" + checkUserID).style.display="none";				
					}
				catch (e){}
			}
		}

		if (tmpOnlineUserList){
			//document.getElementById("debugArea").innerHTML=tmpOnlineUserList;
			onlineUserList=tmpOnlineUserList.split(",");
			for (i=0; i<onlineUserList.length; i++){
				checkUserID=parseInt(onlineUserList[i]);
				try{
					document.getElementById("statusOnline" + checkUserID).innerHTML="<font style='color:green; font-weight:bold;'>Online</font>";
					document.getElementById("statusOnlineChatInvitation" + checkUserID).style.display="block";
					}
				catch (e){}
			}
		}
	}
	
	function openChatOverInvitation(chatID){
		location.href="/index.cfm?cmd=vcoi&chatID=" + chatID;
	}
	
	
	
	
	
	
	function connectToChat(chatID) {
	    //thisMovie("videoConference").goHome();
	    location.href="/index.cfm?cmd=vcoi&chatID=" + chatID;
	}
	
	function thisMovie(movieName) {
	    if (navigator.appName.indexOf("Microsoft") != -1) {
	        return window[movieName]
	    }
	    else {
	        return document[movieName]
	    }
	}
		
	function cTheC(commentID){
		document.getElementById("kommentierenButton" + commentID).style.display="none";
		document.getElementById("reCommentDiv" + commentID).innerHTML=document.getElementById("profileCommentEditor").innerHTML;
		document.getElementById("profileCommentEditor").innerHTML="";
		document.getElementById("parentID").value=commentID;
		document.getElementById("divTrace").style.display="none";
	}
	
	function cTheA(commentID){
		document.getElementById("kommentierenButton" + commentID).style.display="none";
		document.getElementById("profileCommentEditor").style.display="block";
		location.href="#newCommentArea";
	}
	
	function showEditComment(commentID){
		document.getElementById('forumKommentarEdit' + commentID).style.display='block';
		document.getElementById('forumKommentar' + commentID).style.display='none';
		document.getElementById('editButton' + commentID).style.display='none';	
	}

	function showEditCommentForum(commentID){
		document.getElementById('forumKommentarEdit' + commentID).style.display='block';
		document.getElementById('editButton' + commentID).style.display='none';	
		document.getElementById('deleteButton' + commentID).style.display='none';	
	}
	
	
	
	
	/*activity*/
	
	function getActivity(){
		try{
		httpActivity.open('get', '/ajax/getActivityOfNetwork.cfm');
		httpActivity.onreadystatechange = handleGetActivity;
		httpActivity.send(null);
		}
		catch(e){}
	}
		
	function handleGetActivity(){
		if (httpActivity.readyState == 4){
			var response= httpActivity.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				document.getElementById('activityContent').innerHTML = update [0];
			}
		}
	}
	
	
	
	timeToReload=15000;
	timerstate="off";
	changeTimerState('on');

	
	function setActivity(textfeld,parentObject,parentID,iLikeIt){
		changeTimerState('off');
		try{activityText=document.getElementById(textfeld).value;}
		catch(e){activityText="I like";}
		/*alert(activityText);*/
		httpActivity.open('get', '/ajax/setActivity.cfm?activityText=' + encodeURIComponent(activityText) + '&parentObject=' + parentObject + '&parentID=' + parentID + '&iLikeIt=' + iLikeIt);
		httpActivity.onreadystatechange = handleSetActivity;
		httpActivity.send(null);
	}
		
	function handleSetActivity(){
		if (httpActivity.readyState == 4){
			var response= httpActivity.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				/*document.getElementById('activityContent').innerHTML = update [0];*/
				if(parseInt(update[0]) < 1){alert(update[0]);}
				try{
					userInput=0;
					document.getElementById("activityText").value="";/*was machst du gerade*/
					document.getElementById("div_activityText").style.height="50px";
				}catch(e){}
				
				
				
				changeTimerState('on');
				getActivity();
			}
		}
	}
	
	
	function setUnlike(parentObject,parentID){
		changeTimerState('off');
		httpActivity.open('get', '/ajax/unlike.cfm?parentObject=' + parentObject + '&parentID=' + parentID);
		httpActivity.onreadystatechange = handleSetUnlike;
		httpActivity.send(null);
	}
		
	function handleSetUnlike(){
		if (httpActivity.readyState == 4){
			var response= httpActivity.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				/*document.getElementById('activityContent').innerHTML = update [0];*/
				if(parseInt(update[0]) < 1)
				changeTimerState('on');
				getActivity();
			}
		}
	}
	
	function delComment(theID){
		changeTimerState('off');
		httpActivity.open('get', '/ajax/delComment.cfm?id=' + theID);
		httpActivity.onreadystatechange = handleDelComment;
		httpActivity.send(null);
	}
		
	function handleDelComment(){
		if (httpActivity.readyState == 4){
			var response= httpActivity.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				/*document.getElementById('activityContent').innerHTML = update [0];*/
				/*alert(update[0]);*/
				if(parseInt(update[0]) < 1)
				changeTimerState('on');
				getActivity();
			}
		}
	}


	function delArticle(theID){
		changeTimerState('off');
		httpActivity.open('get', '/ajax/delArticle.cfm?id=' + theID);
		httpActivity.onreadystatechange = handleDelArticle;
		httpActivity.send(null);
	}
		
	function handleDelArticle(){
		if (httpActivity.readyState == 4){
			var response= httpActivity.responseText;
			var update = new Array();
			if (response.indexOf('|' != -1)){
				update = response.split('|');
				/*document.getElementById('activityContent').innerHTML = update [0];*/
				/*alert(update[0]);*/
				if(parseInt(update[0]) < 1)
				changeTimerState('on');
				getActivity();
			}
		}
	}


	function userTextFocus(theTextfield){
		changeTimerState('off');
		at=document.getElementById(theTextfield);
		at.style.height="69px";
		dAT=document.getElementById("div_" + theTextfield);
		dAT.style.height="120px";
	}
	function userTextBlur(){
		at.style.color="#CCC";
		/*dAT.style.height="35px";*//*Button wird nicht ausgloest*/
	}
	userInput=0;
	function userTextOKD(saveButton){
		document.getElementById(saveButton).style.display="block";
		at.style.color="#000";
		if(userInput==0){
			try{
				at.text="";
			}catch(e){};
			try{
				at.value="";
			}catch(e){};
		userInput=1;
		}

	}
	
	function showPK(theDiv){
		changeTimerState('off');
		pkState=document.getElementById(theDiv).style.display;

		if (pkState == 'none'|| pkState == ''){
			document.getElementById(theDiv).style.display="block";
		}
		else{
			document.getElementById(theDiv).style.display="none";
		}
		
	}
	
	function showLiker(theDiv){
		document.getElementById(theDiv).style.display="block";
		changeTimerState('off');
	}
	function hideLiker(theDiv){
		document.getElementById(theDiv).style.display="none";
		changeTimerState('on');
	}
	
	function changeTimerState(state){
		if(state=="on" && timerstate=="off"){
			window.timerForReloadActivity=setInterval("getActivity()",timeToReload);
			timerstate="on";
			/*alert("timer: on");*/
		}
		if(state=="off"){
			clearInterval(window.timerForReloadActivity);
			timerstate="off";							
			/*alert("timer: off");*/
		}
		dummy=1;
		
	}	

