// These functions provide effects for the lofi (HTML/NON-Flash) version
function toggleCategory(name) {
	var showDiv = document.getElementById(name);
	if (showDiv.style.display == 'none') {
		showDiv.style.display = 'inline';
	} else showDiv.style.display = 'none';
}
function loadPage(pid) {
	// Start HTTP request
	if (window.XMLHttpRequest) { // Mozilla, Safari, ...
    	http_request = new XMLHttpRequest();
	} else if (window.ActiveXObject) { // IE
    	http_request = new ActiveXObject("Microsoft.XMLHTTP");
	}
	http_request.onreadystatechange = showContent;
	http_request.open('GET', 'inc/lofi_ajax.php?action=page&pid='+pid, true);
	http_request.send(null);
}
function loadGallery(gid) {
	// Start HTTP request
	if (window.XMLHttpRequest) { // Mozilla, Safari, ...
    	http_request = new XMLHttpRequest();
	} else if (window.ActiveXObject) { // IE
    	http_request = new ActiveXObject("Microsoft.XMLHTTP");
	}
	http_request.onreadystatechange = showContent;
	http_request.open('GET', 'inc/lofi_ajax.php?action=gallery&gid='+gid, true);
	http_request.send(null);
}
function showContent() {
	var galDiv = document.getElementById('content');
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			galDiv.innerHTML = http_request.responseText;
			galDiv.style.display = 'inline';
		} else {
			alert('There was a problem with the request.');
		}
	}
}
function galleryImage(img) {
	var imgPath = 'gallery/'+img;
	var img = document.getElementById('currentImage');
	img.src = imgPath;
}
function toggleContact() {
	var showDiv = document.getElementById('contactForm');
	if (showDiv.style.display == 'none') {
		showDiv.style.display = 'inline';
	} else showDiv.style.display = 'none';
}
function toTop(id) {
	document.getElementById(id).scrollTop=0;
}
defaultStep=1;
step=defaultStep;
function scrollDivDown(id) {
	document.getElementById(id).scrollTop+=step
	timerDown=setTimeout("scrollDivDown('"+id+"')",10)
}

function scrollDivUp(id) {
	document.getElementById(id).scrollTop-=step
	timerUp=setTimeout("scrollDivUp('"+id+"')",10)
}

function toBottom(id) {
	document.getElementById(id).scrollTop=document.getElementById(id).scrollHeight
}

function toPoint(id) {
	document.getElementById(id).scrollTop=100
}

