function csshover(obj, bAction) {
	obj.className = (bAction?"hover":"");
}

var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isDyn = (isDOM || isIE4 || isNS4);


// compatibility for multiple browsers
function getRef( id ) {
	if (isDOM)
		return document.getElementById(id);
	if (isIE4)
		return document.all[id];
	if (isNS4)
		return document.layers[id];
}


// magnifie image
function magnifie( id, obj ) {
	var magnifier = getRef(id);
	magnifier.src = obj.src;
}


// change image
function changeImg( nav, img, arr, step ) {
	var cursor = arr[0] + step; // current + step
	var min = 1;
	var max = arr.length-1;
//	alert(step + ' ' + cursor);
	if (cursor<min||(step==0&&cursor==min)) {
		alert("Dit is de eerste foto");
	} else if (cursor>max||(step==0&&cursor==max)) {
		alert("Dit is de laatste foto");
	} else {
		arr[0] = cursor; // write new cursor value
		var changeImg = getRef(img);
		changeImg.src = arr[cursor];
		doNav( nav, arr );
//		if (cursor-step==1) {
//			document.location.href = '#bekijk-' + img;
//		}
	}
}


function doNav( nav, arr ) {
	var oBnav = getRef(nav);
	oBnav.innerHTML = arr[0] + ' / ' + (arr.length-1);
}


var a_t = "@";


function processLink() {
	var arr = arguments[0].split("|");
	var tempadrformat = "";
	tempadrformat += (arr[0].substring(1,arr[0].length) + ":ot" + "l" + "iam").split("").reverse().join("");
	tempadrformat += a_t;
	for ( var i = 1; i < arr.length; i++ ) {
		if ( i > 1 ) tempadrformat += ".";
		tempadrformat += arr[i].substring(0,arr[i].length-1);
	}
	window.location = tempadrformat;
}
