function ajaxFunction(parameters,URL,handleResult,resultId) {
  var xmlHttp;
  try {    
  	// Firefox, Opera 8.0+, Safari    
  	xmlHttp=new XMLHttpRequest();    
  } catch (e) {    
  	// Internet Explorer    
  	try {      
  		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
  		}
    catch (e) { 
    	try {
    		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
    	} catch (e) {        
    		alert("Your browser does not support AJAX!");        
    	return false;        
      }      
    }    
  } 
  xmlHttp.onreadystatechange=function() {
  	if (xmlHttp.readyState==4) {
  		if (handleResult) document.getElementById(resultId).innerHTML=xmlHttp.responseText;
		//alert(xmlHttp.responseText);
  	}
  } 
  //xmlHttp.open("POST","date.php",true);
  //xmlHttp.send(null);
  xmlHttp.open('POST', URL, true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", parameters.length);
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.send(parameters);
}


function ajaxFunctionJS(parameters,URL,jsKey,param) {  
  var xmlHttp;
  try {    
  	// Firefox, Opera 8.0+, Safari    
  	xmlHttp=new XMLHttpRequest();    
  } catch (e) {    
  	// Internet Explorer    
  	try {      
  		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
  		}
    catch (e) { 
    	try {
    		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
    	} catch (e) {        
    		alert("Your browser does not support AJAX!");        
    	return false;        
      }      
    }    
  } 
  xmlHttp.onreadystatechange=function() {
  	if (xmlHttp.readyState==4) {
  		if (jsKey=="poolall" || jsKey=="eval" || jsKey=="cfilist" || jsKey=="cfdlist") refreshIdeas(); 
  		if (jsKey=="start") refreshAll(); 
  		if (jsKey=="imagepool") {
  			window.opener.updateMainImage(xmlHttp.responseText);
  	    window.close();
  	  }
  	  if (jsKey=="interest") {
  	  	//window.open("commEvalSummary.php?id="+xmlHttp.responseText, "", "width=440,height=220,left=300,top=300,dependent=yes,scrollbars=yes");
  	  }
  	  if (jsKey=="adminreload") {
  	  	window.location="idea.php?act=4&"+param;
  	  }
  	  if (jsKey=="cfdover") refreshCFD();
  	  if (jsKey=="expertreload") {
  	  	window.location = 'idea.php?id='+xmlHttp.responseText;
  	  }
  	}
  } 
  //xmlHttp.open("POST","date.php",true);
  //xmlHttp.send(null);
  xmlHttp.open('POST', URL, true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", parameters.length);
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.send(parameters);

}

function ajaxFunctionCT(parameters,URL,tabName,tabCnt,showTab) {  
  var xmlHttp;
  try {    
  	// Firefox, Opera 8.0+, Safari    
  	xmlHttp=new XMLHttpRequest();    
  } catch (e) {    
  	// Internet Explorer    
  	try {      
  		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
  		}
    catch (e) { 
    	try {
    		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
    	} catch (e) {        
    		alert("Your browser does not support AJAX!");        
    	return false;        
      }      
    }    
  }
   
  xmlHttp.onreadystatechange=function() {
  	if (xmlHttp.readyState==4) {
  		
		if (tabName=="enter" && showTab==3) {
			window.location="thankYou.php";
		} else {
			changeTab(tabName,tabCnt,showTab);
		}
	}
  } 
  //xmlHttp.open("POST","date.php",true);
  //xmlHttp.send(null);
  xmlHttp.open('POST', URL, true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", parameters.length);
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.send(parameters);

}





function submitData(showTab,ideaid,selfEval,save) {
	title=document.getElementById("title").value;
	desc=document.getElementById("description").value;
	target=document.getElementById("targetgroup").value;
	tech=document.getElementById("technology").value;
	//risk=document.getElementById("special").value;
	tabCnt=3;
	marketVal=-1;
	if (document.getElementById("marketpot_val")) marketVal=document.getElementById("marketpot_val").value;
	timeVal=-1;
	if (document.getElementById("time_val")) timeVal=document.getElementById("time_val").value;
	
	if ((title.length==0 || desc.length==0 || target.length==0 || tech.length==0) && save) {
		showErrorFields();
		//alert(unescape("Bitte f%FCllen Sie alle Felder aus!"));
		return false;
	}
	
		
	catCnt=document.getElementById("catcnt").value;
	// description
	parameters ="id="+encodeURI(ideaid);
	parameters+="&title="+encodeURIComponent(document.idea.title.value);
	parameters+="&description="+encodeURIComponent(document.idea.description.value);
	parameters+="&technology="+encodeURIComponent(document.idea.technology.value);
	parameters+="&targetgroup="+encodeURIComponent(document.idea.targetgroup.value);
	
	if (document.getElementById("edit_comment")) {
		parameters+="&editcomment="+encodeURIComponent(document.getElementById("edit_comment").value);
	}
  
	// categorization
	catTopic=0;
	if (document.getElementById("cat1id").checked) catTopic=1;
	if (document.getElementById("cat2id").checked) catTopic=2;
	if (document.getElementById("cat3id").checked) catTopic=3;
	parameters+="&topic="+encodeURI(catTopic);
	parameters+="&catcnt="+encodeURI(catCnt);
	for (var i=1; i<=catCnt; i++) {
		val=0;
		if (document.getElementById("cbcat"+i+"id").checked) val=1;
		parameters+="&cat"+i+"="+val;
	}

	parameters+="&tags="+encodeURI(document.getElementById("tags_id").value);

	/*
	// self evaluation
	if (selfEval && false) {
		tabCnt=4;
		evalCnt=document.getElementById("evalcnt").value;
		parameters+="&selfeval=1";
		parameters+="&evalcnt="+encodeURI(evalCnt);
		for (var i=1; i<=evalCnt; i++) {
			val=document.getElementById("eval_val"+i);
			key=document.getElementById("eval_key"+i);
			if (val != null) {
				if (key != null) {
					parameters+="&evalval"+i+"="+val.value;
					parameters+="&evalkey"+i+"="+key.value;
				}
			}
		}
	}*/
  //alert(parameters);
	ajaxFunctionCT(parameters,'storeIdea.php','enter',tabCnt,showTab);
  
	return true;
}


function submitCat(cnt,dir) {
	parameters ="cnt="+encodeURI(cnt);
	for (var i=0; i<cnt; i++) {
		val=0;
		if (document.getElementById("filter_"+i).checked) val=1;
		interestid=document.getElementById("filter_"+i+"_id").value;
		parameters+="&id"+i+"="+interestid;
		parameters+="&val"+i+"="+val;
	}
	parameters+="&tags="+encodeURI(document.getElementById("tags_id").value);
	//alert(parameters);
	ajaxFunction(parameters,'storeIdeaCategorization.php',false,"");
	changeTab('enter',4,2+dir);
}

function submitEval(cnt,dir) {
	parameters ="cnt="+encodeURI(cnt);
	for (var i=1; i<=cnt; i++) {
		val=document.getElementById("eval_val"+i).value;
		key=document.getElementById("eval_key"+i).value;
		parameters+="&val"+i+"="+val;
		parameters+="&key"+i+"="+key;
	}
	ajaxFunction(parameters,'storeIdeaEval.php',false,"");
	if (dir==-1) {
		changeTab('enter',4,2);
	} else {
		window.location="thankYou.php";
	}
}


function updateExplorer(exptype) {
	parameters ="ajax=true";
	parameters +="&t="+encodeURI(exptype);
	ajaxFunction(parameters,'poolExplorer.php',true,"pool_expl");
}

function delMainImage(imageName,selfEval) {
	if (confirm(unescape("Hauptbild wirklich l%F6schen?"))) {
		parameters ="filename="+encodeURI(imageName);
		parameters +="&delmain=true";
		parameters +="&ajax=true";
		parameters +="&selfeval="+encodeURI(selfEval);
		ajaxFunction(parameters,'enterIdeaDescription.php',true,"content_enter1");

		main_img_flag = false;
	}
	alert(unescape("Um das Bild wirklich zu l%F6schen, m%FCssen Sie Ihre Idee speichern"));
}

function delImage(imageName,selfEval) {
	if (confirm(unescape("Bild wirklich l%F6schen?"))) {
	  parameters ="filename="+encodeURI(imageName);
	  parameters +="&delimage=true";
	  parameters +="&ajax=true";
	  parameters +="&selfeval="+encodeURI(selfEval);
	  ajaxFunction(parameters,'enterIdeaDescription.php',true,"content_enter1");
  }
  alert(unescape("Um das Bild wirklich zu l%F6schen, m%FCssen Sie Ihre Idee speichern"));
}

function delFile(imageName,selfEval) {
	if (confirm(unescape("Datei wirklich l%F6schen?"))) {
	  parameters ="filename="+encodeURI(imageName);
	  parameters +="&delfile=true";
	  parameters +="&ajax=true";
	  parameters +="&selfeval="+encodeURI(selfEval);
	  ajaxFunction(parameters,'enterIdeaDescription.php',true,"content_enter1");
  }
  alert(unescape("Um den Anhang wirklich zu l%F6schen, m%FCssen Sie Ihre Idee speichern"));
}


function delCommentStore(id) {
	parameters ="id="+encodeURI(id);
	parameters +="&ajax=true";
	ajaxFunction(parameters,'delComment.php',false,"");
}



function ideaMasterlistAdd(id) {
	parameters ="id="+encodeURI(id);
	parameters +="&ajax=true";
	ajaxFunction(parameters,'masterListAdd.php',false,"");
}

function ideaMasterlistRem(id) {
	parameters ="id="+encodeURI(id);
	parameters +="&ajax=true";
	ajaxFunction(parameters,'masterListRem.php',false,"");
}


function updateUpload(selfEval,isMainImage) {
	if (isMainImage) {
		main_img_flag = true;
	}

	parameters ="ajax2=true";
	parameters +="&selfeval="+encodeURI(selfEval);
	ajaxFunction(parameters,'enterIdeaAttachments.php',true,"content_enter1_attachment");
}

function ideaAddToFavs(ideaid) {
	parameters ="ajax=true";
	parameters +="&ideaid="+encodeURI(ideaid);
	ajaxFunction(parameters,'addToFavs.php',false,"");
}


function updateComments(ideaid) {
	parameters ="ajax=true";
	parameters+="&ideaid="+ideaid;
	ajaxFunction(parameters,'ideaDiscussion.php',true,"content_idea2");
}


function storeInterest(ideaid,val) {
	parameters ="ideaid="+encodeURI(ideaid);
	parameters+="&val="+encodeURI(val);
	ajaxFunctionJS(parameters,'storeInterest.php',"interest","");
}


function storeIdeaLang(ideaid,lang) {
	parameters ="ideaid="+encodeURI(ideaid);
	parameters+="&lang="+encodeURI(lang);
	ajaxFunctionJS(parameters,'storeIdealang.php',"interest","");
}


function submitExpertEval(cnt,dir,userid) {
	parameters ="cnt="+encodeURI(cnt);
	parameters+="&userid="+encodeURI(userid);
	for (var i=1; i<=cnt; i++) {
		val=document.getElementById("eval_val"+i).value;
		key=document.getElementById("eval_key"+i).value;
		parameters+="&val"+i+"="+val;
		parameters+="&key"+i+"="+key;
	}
	//alert(parameters);
	ajaxFunctionJS(parameters,'storeExpertEval.php',"expertreload","");
	//window.close();
}

function updateRequest(searchString) {
	parameters ="string="+encodeURI(searchString);
	ajaxFunction(parameters,'presenterSearch.php',true,"presenterList");
}

function updateEmailRequest(searchString) {
	parameters ="string="+encodeURI(searchString);
	ajaxFunction(parameters,'emailRecipientSearch.php',true,"presenterList");
}

function updateMemberRequest(searchString) {
	parameters ="string="+encodeURI(searchString);
	ajaxFunction(parameters,'memberSearchResult.php',true,"presenterList");
}


function updateRelIdeas(tagStr) {
	parameters ="tags="+encodeURI(tagStr);
	ajaxFunction(parameters,'relIdeaResult.php',true,"rel_ideas_result");
}

function updateLinkIdeaList(searchString,ideaid) {
	parameters ="string="+encodeURI(searchString);
	parameters+="&id="+encodeURI(ideaid);
	ajaxFunction(parameters,'linkIdeaResult.php',true,"linkideas");
}

function storeLinkIdea(srcId,destId) {
	parameters ="srcid="+encodeURI(srcId);
	parameters+="&destid="+encodeURI(destId);
	ajaxFunction(parameters,'linkIdeaStore.php',false,"");
}

function delLinkIdea(srcId,destId) {
	parameters ="srcid="+encodeURI(srcId);
	parameters+="&destid="+encodeURI(destId);
	ajaxFunction(parameters,'linkIdeaDel.php',false,"");
}

function updateMemberSearchRequest(searchString) {
	parameters ="string="+encodeURI(searchString);
	ajaxFunction(parameters,'membersListSearchResult.php',true,"memberslistresult");
}



function storePresenter(userid) {
	parameters ="ajax=true";
	parameters+="&action=add";
	parameters+="&userid="+encodeURI(userid);
	ajaxFunction(parameters,'ideaPresenter.php',true,"ideaPres");
}

function delPresenter(userid) {
	parameters ="ajax=true";
	parameters+="&action=del";
	parameters+="&userid="+encodeURI(userid);
	ajaxFunction(parameters,'ideaPresenter.php',true,"ideaPres");
}

function storeManualPresenter(username,email,phone,dep) {
	parameters ="ajax=true";
	parameters+="&action=add";
	parameters+="&username="+encodeURI(username);
	parameters+="&email="+encodeURI(email);
	parameters+="&phone="+encodeURI(phone);
	parameters+="&dep="+encodeURI(dep);
	ajaxFunction(parameters,'ideaPresenter.php',true,"ideaPres");
}


function updateFavList(page) {
	parameters ="ajax=true";
	parameters+="&page="+encodeURI(page);
	ajaxFunction(parameters,'myIdeanetFavs.php',true,'favs');
}


function updateIdeaList(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'poolAllIdeas.php',true,'pool_all');
}


function updateIdeaListArch(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'poolArchIdeas.php',true,'pool_all');
}

function updateIdeaListOverview(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'poolOverview.php',true,'pool_overview');
}

function updateIdeaListOwn(listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'myIdeanetIdeas.php',true,'content_profile2');
}

function updateIdeaListNew(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'poolNewIdeas.php',true,'pool_new');
}

function updateIdeaListDiscussed(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'poolDiscussed.php',true,'pool_dis');
}

function updateIdeaListFilter(listfilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&filter="+encodeURI(listfilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'poolAllIdeas.php',true,'pool_all');
}


function updateIdeaListElaboration(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'poolInEditing.php',true,'pool_elaboration');
}

function updateIdeaSearchList(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'poolSearchResult.php',true,'pool_search');
}

function updateIdeaListHP(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'poolHighPotentials.php',true,'pool_hp');
}

function updateIdeaListLastEdited(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'poolLastEdited.php',true,'pool_lastEdited');
}

function updateIdeaListEval(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=evalcurrent";
	ajaxFunction(parameters,'evaluationListCurrent.php',true,'pool_evalCurrent');
}

function updateIdeaListEvalDone(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=evalDone";
	ajaxFunction(parameters,'evaluationListDone.php',true,'pool_evalDone');
}

function updateIdeaListDis(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'poolDiscussed.php',true,'pool_dis');
}

function updateIdeaListIdeaset(set_id,list_index) {
	parameters ="ajax=true";
	parameters+="&setid="+encodeURI(set_id);
	parameters+="&list_index="+encodeURI(list_index);
	ajaxFunction(parameters,'reportingGeneratorIdeaSetValues.php',true,'report-generation-ideaset');
}

function updateHPType(type) {
  parameters ="ajax=true";
	parameters+="&hp_type="+type;
	ajaxFunction(parameters,'poolHighPotentials.php',true,'pool_hp');
}


function updateDiscussionList(listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'callForDiscussionList.php',true,'cfd_list');
}


function updateIdeaListAdmin(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'ideasAll.php',true,'pool_all');
}

function updateIdeaListAdminNew(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'ideasNew.php',true,'pool_new');
}


function updateIdeaListAdminEnter(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'ideasEnter.php',true,'pool_enter');
}

function updateIdeaListAdminCfd(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'ideasCFD.php',true,'ideas_cfd');
}

function updateIdeaListAdminArch(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'ideasArch.php',true,'pool_arch');
}

function updateIdeaListAdminInact(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'ideasInact.php',true,'pool_inact');
}


function updateHpList(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	parameters+="&target=allideas";
	ajaxFunction(parameters,'poolHighPotentials.php',true,'pool_hp');
}

function updateEvalListDone(useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'evaluationListDone.php',true,'eval_done');
}

function updateEvalList(useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'evaluationListCurrent.php',true,'eval_list');
}

function updateCommEvalListToDo(useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'evaluationCommunityToDo.php', true, 'comm_todo');
}

function updateCommEvalListDone(useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'evaluationListDone.php', true, 'comm_done');
}

function updateIofMList(listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'ideaOfTheMonthArchive.php',true,'cfia_list');
}

function updateCfdList(orderby,orderdir,useFilter,listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&order="+encodeURI(orderby);
	parameters+="&orderdir="+encodeURI(orderdir);
	parameters+="&usefilter="+encodeURI(useFilter);
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'callForDiscussionList.php',true,"cfd_list");
}

function updateCfiList(listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'callForIdeasListData.php',true,"cfi_list");
}

function updateMemberList(listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'membersListAll.php',true,"memberslistall");
}

function updateMemberListBI(listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'membersListBI.php',true,"memberslistall");
}


function updateMemberListByDate(listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'membersListNew.php',true,"memberslistnew");
}

function updateMemberListAdmin(listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'membersList.php',true,"memberslist");
}


function updateMyIdeaList(listIndex,listCnt) {
	parameters ="ajax=true";
	parameters+="&index="+encodeURI(listIndex);
	parameters+="&listcnt="+encodeURI(listCnt);
	ajaxFunction(parameters,'myIflashIdeas.php',true,"content_ideas0");
}

function updateMyEvaluationList(listIndex) {
	parameters ="ajax=true";
	parameters+="&index="+encodeURI(listIndex);
	ajaxFunction(parameters,'myIdeanetEvaluations.php',true,"content_profile3");
}

function storeNotifications(user_id, own_ideas, watchlist_ideas, comments_innovator, comments_watchlist, comments_commentator, frequency, lang) {
	parameters ="user_id="+encodeURI(user_id);
	parameters+="&changes_own_ideas="+encodeURI(own_ideas);
	parameters+="&changes_watchlist_ideas="+encodeURI(watchlist_ideas);
	parameters+="&comments_innovator="+encodeURI(comments_innovator);
	parameters+="&comments_watchlist="+encodeURI(comments_watchlist);
	parameters+="&comments_commentator="+encodeURI(comments_commentator);
	parameters+="&frequency="+encodeURI(frequency);
	parameters+="&lang="+encodeURI(lang);
	ajaxFunction(parameters,'storeNotifications.php',true,"store-notification-settings-result");
}

function storeVisitor(target_id,viewer) {
	parameters ="id="+encodeURI(target_id);
	parameters+="&type=user";
	parameters+="&visitor="+encodeURI(viewer);
	ajaxFunction(parameters,'storeVisitor.php',false,"");
}

function storeIdeaVisitor(target_id,viewer) {
	parameters ="id="+encodeURI(target_id);
	parameters+="&type=idea";
	parameters+="&visitor="+encodeURI(viewer);
	ajaxFunction(parameters,'storeVisitor.php',false,"");
}

function storeProfileData(parameters) {
	ajaxFunction(parameters,'myIdeanetShowProfile.php',true,"content_profile0");
	alert(unescape("%C4nderungen gespeichert"));
}

function delUserImage(userid) {
	parameters ="userid="+encodeURI(userid);
	parameters +="&ajax=true";
	parameters +="&delimage=true";
	ajaxFunction(parameters,'myIdeanetShowProfile.php',true,"content_profile0");
}

function delPickIdea(ideaid,userid) {
	parameters ="ideaid="+encodeURI(ideaid);
	parameters +="&userid="+encodeURI(userid);
	parameters +="&ajax=true";
	ajaxFunction(parameters,'delPickUser.php',false,"");
}




function updateInterestFilter(interest_id,ok) {
	parameters ="ajax=true";
	parameters+="&interest_id="+interest_id;
	newval="0";
	if (ok) newval="1";
	parameters+="&newval="+newval;
	ajaxFunctionJS(parameters,'updateInterestFilter.php',currentPool,"");	
}

function updateStateFilter(state_id,ok) {
	parameters ="ajax=true";
	parameters+="&state_id="+state_id;
	newval="0";
	if (ok) newval="1";
	parameters+="&newval="+newval;
	ajaxFunctionJS(parameters,'updateStateFilter.php',currentPool,"");	
}

function updateAdminStateFilter(state_id,ok) {
	parameters ="ajax=true";
	parameters+="&state_id="+state_id;
	newval="0";
	if (ok) newval="1";
	parameters+="&newval="+newval;
	ajaxFunctionJS(parameters,'updateAdminStateFilter.php',"poolall","");	
}


function updateDateFilter(fDay,fMon,fYear,tDay,tMon,tYear) {
	parameters ="ajax=true";
	parameters+="&fDay="+encodeURI(fDay);
  parameters+="&fMon="+encodeURI(fMon);
  parameters+="&fYear="+encodeURI(fYear);
  parameters+="&tDay="+encodeURI(tDay);
  parameters+="&tMon="+encodeURI(tMon);
  parameters+="&tYear="+encodeURI(tYear);
	ajaxFunctionJS(parameters,'updateDateFilter.php',currentPool,"");	
}


function activateFilter(id,state) {
	parameters ="ajax=true";
	parameters+="&filter="+id;
	newval="0";
	if (state) newval="1";
	parameters+="&state="+newval;
  document.getElementById("filter"+(id-1)+"a").checked=state;
	document.getElementById("filter"+(id-1)).checked=state;
	ajaxFunctionJS(parameters,'activateFilter.php',currentPool,"");	
}


function showTagIdeaList(tag,index,limit) {
	parameters ="ajax=true";
	parameters+="&tag="+encodeURI(tag);
	parameters+="&index="+encodeURI(index);
	parameters+="&limit="+encodeURI(limit);
	ajaxFunction(parameters,'poolTagCloudResultAjax.php',true,"tagideas");
}


function setIdeaImage(Folder,imagename) {
	parameters ="folder="+encodeURI(Folder);
	parameters+="&filename="+encodeURI(imagename);
	parameters+="&ajax=true";
	ajaxFunctionJS(parameters,'imagePoolSetImage.php',"imagepool","");
}


function updatePfIdeas(id,action) {
	parameters ="ajax=true";
	parameters+="&target=pf";
	parameters+="&id="+encodeURI(id);
	parameters+="&action="+encodeURI(action);
	//alert(parameters);
	ajaxFunction(parameters,'poolPortfolio.php',true,"pool_pf");
}


function archIdeaStore(ideaid) {
	parameters ="ideaid="+encodeURI(ideaid);
	ajaxFunction(parameters,'ideaArch.php',false,"");
}


function ideaSetDiscussion(ideaid,val) {
	parameters ="ideaid="+encodeURI(ideaid);
	parameters+="&val="+encodeURI(val);
	ajaxFunctionJS(parameters,'ideaSetDiscussion.php',"adminreload","id="+ideaid);
}

function ideaSetEvaluation(ideaid,val) {
	parameters ="ideaid="+encodeURI(ideaid);
	parameters+="&val="+encodeURI(val);
	ajaxFunctionJS(parameters,'ideaSetEvaluation.php',"adminreload","id="+ideaid);
}

function updateDiscussionUser(searchString) {
	parameters ="string="+encodeURI(searchString);
	ajaxFunction(parameters,'discussionUserResult.php',true,"result");
}


function updateEvaluationUser(searchString) {
	parameters ="string="+encodeURI(searchString);
	ajaxFunction(parameters,'evaluationUserResult.php',true,"result");
}

function adminUpdateTags(cnt) {
	parameters="tags="+encodeURI(document.getElementById("tags_id").value);
	ajaxFunction(parameters,'admin/storeTags.php',false,"");
	alert(unescape("%C4nderungen gespeichert"));
}

function adminUpdateIdeaType(cnt) {
	cat = document.getElementsByName("idea_type"); 
	parameters = ""; 
	for(i=0; i<cat.length; i++){
		// alert(cat[i].value); 
		if(cat[i].checked == true){
			parameters+="cats[]=" +cat[i].value + "&";
		}

	}
	ajaxFunction(parameters,'admin/storeIdeaTypes.php',false,"");
	alert(unescape("%C4nderungen gespeichert"));
}

function updateIdeaAuth(idea,index) {
	parameters ="idea="+encodeURI(idea);
	parameters+="&val="+encodeURI((index+1));
	//alert(parameters);
	ajaxFunction(parameters,'admin/updateIdeaAuth.php',false,"");
	alert(unescape("Berechtigung wurde ge%E4ndert!"));
}


function makeIdeaOfMonth(id) {
	parameters ="id="+encodeURI(id);
	ajaxFunction(parameters,'admin/updateIdeaOfMonth.php',false,"");
	alert(unescape("%C4nderungen gespeichert"));
	document.getElementById("iom1").style.display="none";
	document.getElementById("iom2").style.display="block";
}

function updatePortfolioAjax(xVal,yVal) {
	parameters ="ajax=true";
	parameters+="&xval="+encodeURI(xVal);
	parameters+="&yval="+encodeURI(yVal);
	ajaxFunction(parameters,'poolPortfolio.php',true,'pool_pf');
}


function launchScheduler() {
	parameters ="ajax=true";
	ajaxFunction(parameters,"scheduler.php",false,'');
}

function launchCleanCache() {
	parameters ="ajax=true";
	ajaxFunction(parameters,"cleanCache.php",false,'');
}

