// JavaScript Document
var allready_loading = false;
function get_splitter(){
	if(document.getElementById('ajax_loader') && document.getElementById('ajax_loader_content')){
		//var scroll_pos = f_scrollTop();
		//document.getElementById('ajax_loader').style.top = scroll_pos+'px';
		document.getElementById('ajax_loader').style.display = '';
		document.getElementById('ajax_loader').innerHTML = document.getElementById('ajax_loader_content').innerHTML;
	}
	var myajax=ajaxpack.ajaxobj
	var myfiletype=ajaxpack.filetype
	if(myajax.readyState == 4){
		if(myajax.status==200 || window.location.href.indexOf("http") == -1){
			if(myfiletype=="txt"){
				var inhoud_split = myajax.responseText.split('<!--splitter-->');			
				if(document.getElementById(inhoud_split[0])){
					document.getElementById(inhoud_split[0]).innerHTML = inhoud_split[1];
				}
				if(document.getElementById('ajax_loader')){
					document.getElementById('ajax_loader').innerHTML = '';
					document.getElementById('ajax_loader').style.display = 'none';
				}
				allready_loading = false;
			}
		}
	}
	
	
}
function get_content(){
	if(document.getElementById('ajax_loader') && document.getElementById('ajax_loader_content')){
		//var scroll_pos = f_scrollTop();
		//document.getElementById('ajax_loader').style.top = scroll_pos+'px';
		document.getElementById('ajax_loader').style.display = '';
		document.getElementById('ajax_loader').innerHTML = document.getElementById('ajax_loader_content').innerHTML;
	}
	var myajax=ajaxpack.ajaxobj
	var myfiletype=ajaxpack.filetype
	if(myajax.readyState == 4){
		if(myajax.status==200 || window.location.href.indexOf("http") == -1){
			if(myfiletype=="txt"){
				var main_split 		= myajax.responseText.split('<!--main_splitter-->');
				var content_id 		= main_split[0].split(']]][[[');
				var content_value 	= main_split[1].split(']]][[[');
				
				for(i=0; i<content_id.length; i++){	
					if(document.getElementById(content_id[i])){
						document.getElementById(content_id[i]).innerHTML = content_value[i];
					}
				}
				if(document.getElementById('ajax_loader')){
					document.getElementById('ajax_loader').innerHTML = '';
					document.getElementById('ajax_loader').style.display = 'none';
				}
				allready_loading = false;
			}
		}
	}
		
}
function processGetPost(){
	var myajax=ajaxpack.ajaxobj
	var myfiletype=ajaxpack.filetype
	if(myajax.readyState == 4){
		if(myajax.status==200 || window.location.href.indexOf("http") == -1){
			if(myfiletype=="txt"){
				var inhoud_split = myajax.responseText.split('<!--splitter-->');
				if(document.getElementById(inhoud_split[0])){
					document.getElementById(inhoud_split[0]).innerHTML = inhoud_split[1];
				}
				allready_loading = false;
			}
		}
	}
	
}
function open_klap_01(veld1,veld2,method){
	if(document.getElementById(veld1) && document.getElementById(veld2)){
		if(method == 'open'){
			document.getElementById(veld1).style.display = 'none';
			document.getElementById(veld2).style.display = '';
		} else {
			document.getElementById(veld1).style.display = '';
			document.getElementById(veld2).style.display = 'none';
		}
	}
}
function ajax(div,include,vars){
	//alert(div+','+include+','+vars);
	if(!allready_loading){
		allready_loading = true;
		if(document.getElementById(div)){
			//document.getElementById(div).innerHTML = '';
		}
		ajaxpack.getAjaxRequest('get_content.php', 'div_id='+div+'&include='+include+vars, get_content, 'txt');	
	}
}
function ajax2(div,include,div2,include2,vars){
	if(!allready_loading){
		allready_loading = true;
		//if(document.getElementById(div)){
			//document.getElementById(div).innerHTML = '';
		//}
		//if(document.getElementById(div2)){
			//document.getElementById(div2).innerHTML = '';
		//}
		ajaxpack.getAjaxRequest('get_content.php', 'div_id='+div+'&div_id2='+div2+'&include='+include+'&include2='+include2+vars+'&gc_p=2', get_content, 'txt');	
	}
}