function displayLogs(strMode, strDivId) {
	if (isOff(strDivId)) {
		zetEenMomentAub(true);		
		simpleRequest('main.php?action=tree_aja&aja_action=get_logs&mode='+strMode, writeInId, strDivId);
		setOn(strDivId);
	} else {
		setOff(strDivId);	
	}	
}

function displayMove(intObjId, intCurrentMenuId, intMenuId, strDivId) {
    // called from move pane
	document.getElementById(strDivId).style.visibility='visible';
	document.getElementById(strDivId).style.display='block';
	if (intMenuId==0) {		
		document.getElementById(strDivId).innerHTML='Een ogenblik, de menuboom wordt opgebouwd.';		
		simpleRequest('main.php?name=move_obj&obj_id='+intObjId+'&current_menu_id='+intCurrentMenuId+'&menu_id=' + intMenuId, writeInId , strDivId);
	} else {
		document.getElementById(strDivId).innerHTML='Een ogenblik, het menu-item wordt verplaatst.';		
		simpleRequest('main.php?name=move_obj&obj_id='+intObjId+'&current_menu_id='+intCurrentMenuId+'&menu_id=' + intMenuId, function() {window.location.href='main.php?obj_id='+intObjId} , strDivId);		
	}	
}

function displayMoveMenuItem(intCurrentMenuId, intMenuId, strDivId) {	
    // called from menu editor in tree edit
	document.getElementById(strDivId).style.visibility='visible';
	document.getElementById(strDivId).style.display='block';
	if (intMenuId==0) {		
		document.getElementById(strDivId).innerHTML='Een ogenblik, de menuboom wordt opgebouwd.';
		//debugprint('main.php?name=move_obj&obj_id='+intObjId+'&current_menu_id='+intCurrentMenuId+'&menu_id=' + intMenuId);
		simpleRequest('main.php?name=move_obj&mode=menu_editor&current_menu_id='+intCurrentMenuId+'&menu_id=' + intMenuId, writeInId , strDivId);
	} else {
		document.getElementById(strDivId).innerHTML='Een ogenblik, het menu-item wordt verplaatst.';
		//simpleRequest('main.php?name=move_obj&obj_id='+intObjId+'&current_menu_id='+intCurrentMenuId+'&menu_id=' + intMenuId, writeInId , strDivId);        
		// top.paneModel.reloadContent('eastContent3');
		simpleRequest('main.php?name=move_obj&mode=menu_editor&current_menu_id='+intCurrentMenuId+'&menu_id=' + intMenuId, function() {top.paneSplitter.reloadContent('eastContent3');document.getElementById('move_obj').style.display='none';setTimeout("window.location.reload(true)",2000);} , "");
	}
}

function displayMoveMenuItemEditTemplate(intCurrentMenuId, intMenuId, strDivId) {
    // called from edit_menu template
	document.getElementById(strDivId).style.visibility='visible';
	document.getElementById(strDivId).style.display='block';
	if (intMenuId==0) {		
		document.getElementById(strDivId).innerHTML='Een ogenblik, de menuboom wordt opgebouwd.';
		//debugprint('main.php?name=move_obj&obj_id='+intObjId+'&current_menu_id='+intCurrentMenuId+'&menu_id=' + intMenuId);
		simpleRequest('main.php?name=move_obj&mode=menu_edit_template&current_menu_id='+intCurrentMenuId+'&menu_id=' + intMenuId, writeInId , strDivId);
	} else {
		document.getElementById(strDivId).innerHTML='Een ogenblik, het menu-item wordt verplaatst.';
		//simpleRequest('main.php?name=move_obj&obj_id='+intObjId+'&current_menu_id='+intCurrentMenuId+'&menu_id=' + intMenuId, writeInId , strDivId);        
        // top.paneModel.reloadContent('eastContent3');
		simpleRequest('main.php?name=move_obj&mode=menu_edit_template&current_menu_id='+intCurrentMenuId+'&menu_id=' + intMenuId, function() {top.paneSplitter.reloadContent('eastContent3');document.getElementById('move_obj').style.display='none'} , "");
	}
}


function displaySearchResults(strZoekWoord,strDivId) {
	// urlencode??		
	zetEenMomentAub(true);	
	simpleRequest('main.php?name=search_select_obj&zoekwoord='+strZoekWoord, writeInId , strDivId);
	setOn(strDivId);
}

function writeOpsomming(xmlhttp, strDivId) {
	//alert(xmlhttp.responseText);			
	document.getElementById(strDivId).innerHTML = xmlhttp.responseText;
	zetEenMomentAub(false);
	// init sortable tables:
	sortables_init();
}

function displayOpsomming(intObjTypeId, strZoekWoord, strDivId,strArchive, intSubSiteId, strAjaAction) {	
	zetEenMomentAub(true);	
	// alert('main.php?archive='+strArchive+'&zoekwoord='+strZoekWoord+'&for_obj_type_id='+intObjTypeId+'&mode=opsomming&action=tree_aja&this_subsite_id='+intSubSiteId+'&aja_action='+strAjaAction);
	simpleRequest('main.php?archive='+strArchive+'&zoekwoord='+strZoekWoord+'&for_obj_type_id='+intObjTypeId+'&mode=opsomming&action=tree_aja&this_subsite_id='+intSubSiteId+'&aja_action='+strAjaAction, writeOpsomming,  strDivId);	
}

function displaySubsites(strMode, strDivId) {
	if (isOff(strDivId)) {
		simpleRequest('main.php?mode='+strMode+'&action=tree_aja&aja_action=get_subsites', writeInId,  strDivId);
		setOn(strDivId);
	} else {
		setOff(strDivId);	
	}
}

function displayObjTypes(strMode, strSubsiteId,strObjTypes, strDivId) {
	if (isOff(strDivId)) {
		simpleRequest('main.php?mode='+strMode+'&action=tree_aja&aja_action=get_objtypes&obj_types='+strObjTypes + '&subsite_id=' + strSubsiteId, writeInId,  strDivId);
		setOn(strDivId);
	} else {
		setOff(strDivId);	
	}
}

function displayConfigs(strMode, strDivId) {
	if (isOff(strDivId)) {
		simpleRequest('main.php?mode='+strMode+'&action=tree_aja&aja_action=get_configs', writeInId,  strDivId);
		setOn(strDivId);
	} else {
		setOff(strDivId);	
	}
}

function displayContentObjType(strMode, strSubsiteId, strObjType, strDivId) {			
	if (isOff(strDivId)) {
		zetEenMomentAub(true);
		//alert('main.php?mode=".$strMode."&action=tree_aja&aja_action=get_objtype&obj_type='+strObjType+'&subsite_id=' + strSubsiteId);
		simpleRequest('main.php?mode='+strMode+'&action=tree_aja&aja_action=get_objtype&obj_type='+strObjType+'&subsite_id=' + strSubsiteId, writeInId,  strDivId);
		setOn(strDivId);
	} else {
		setOff(strDivId);	
	}
}

function displayFolder(strDirOffset, strDivId, strMode) {
	
	if (isOff(strDivId)) {		
		zetEenMomentAub(true);			
		simpleRequest('main.php?action=tree_aja&mode='+strMode+'&aja_action=get_folder&folder_offset='+strDirOffset, writeInId, strDivId);		
		setOn(strDivId);
	} else {		
		setOff(strDivId);	
	}
}


function displaySubmenu(strMode, strId, strDivId, strFormName) {
	// alert(strFormName);
	if (isOff(strDivId)) {
		zetEenMomentAub(true);
		//alert('main.php?mode=".$strMode."&action=tree_aja&aja_action=get_objtype&obj_type='+strObjType+'&subsite_id=' + strSubsiteId);
		simpleRequest('main.php?mode='+strMode+'&form_name='+strFormName+'&action=tree_aja&aja_action=get_submenu&menu_id='+strId, writeInId,  strDivId);
		setOn(strDivId);
	} else {
		setOff(strDivId);	
	}
}

function displayIppContent(strUrl) {	
	simpleRequest(strUrl, writeInId,  'ipp_content');
}


function displayPrikbord(offSetId) {	
	simpleRequest('main.php?action=tree_aja&aja_action=get_prikbord&offset='+offSetId, setPrikbord);
}

function toggleIcon(strId) {
	try {
		objIcon = document.getElementById(strId)
		if (objIcon.src.indexOf('plus')>0) {
			setTimeout("objIcon.src='images/default/buttons/min.gif'",100);
		}else {
			setTimeout("objIcon.src='images/default/buttons/plus.gif'",100);
		}
	} catch(e) {
	}
}

function ObjectDisplay(obj_id) {
	this.obj_id = obj_id;
	this.name='[unknown]';
		
	this.getName = function () { 
		this.name='[unknown]';		
		synchronousSimpleRequest('main.php?name=get_obj_name&obj_id='+this.obj_id,this.getNamePhaseII,this);		
		return this.name;
	};

	this.getNamePhaseII = function(xmlhttp,calledUponObj) {
		calledUponObj.name=xmlhttp.responseText;		
	};
}
