﻿/* ---------------------------- */
/* XMLHTTPRequest Enable 		*/
/* ---------------------------- */
function createObject() {
	var request_type;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer"){
	request_type = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		request_type = new XMLHttpRequest();
	}
		return request_type;
}

var http = createObject();

/* -------------------------- */
/* SEARCH					 */
/* -------------------------- */
function autoLoad() {
// Set te random number to add to URL request
nocache = Math.random();
http.open('get', 'http://www.smg-studios.com/ajax/loadPortfolio.php?nocache = '+nocache);
http.onreadystatechange = autoDisplay;
http.send(null);
}
function autoDisplay() {
if(http.readyState == 4){
	var response = http.responseText;
	e = document.getElementById('portfolio');
	if(response!=""){
		e.innerHTML=response;
		e.style.display="block";
	} else {
		e.style.display="none";
	}
}
}

/* -------------------------- */
/* SEARCH					 */
/* -------------------------- */
function belmij() {
// Set te random number to add to URL request
nocache = Math.random();
http.open('get', 'http://www.smg-studios.com/ajax/belmij.php?nocache = '+nocache);
http.onreadystatechange = autoBel;
http.send(null);
}
function autoBel() {
if(http.readyState == 4){
	var response = http.responseText;
	e = document.getElementById('belmij-results');
	if(response!=""){
		e.innerHTML=response;
		e.style.display="block";
	} else {
		e.style.display="none";
	}
}
}

/* -------------------------- */
/* SEARCH					 */
/* -------------------------- */
function belmijopslaan() {
// Set te random number to add to URL request
nocache = Math.random();
http.open('get', 'http://www.smg-studios.com/ajax/belmij.php?actie=ja&nocache = '+nocache);
http.onreadystatechange = autoBelO;
http.send(null);
}
function autoBelO() {
if(http.readyState == 4){
	var response = http.responseText;
	e = document.getElementById('belmij-results');
	if(response!=""){
		e.innerHTML=response;
		e.style.display="block";
	} else {
		e.style.display="none";
	}
}
}
