// JavaScript Document


function jumpToEditMode() {
	document.location.href="index.php?login=start&menuid="+menuid;
}

function getkey(keyStroke) {
	eventChooser = event.keyCode;
	if (eventChooser==20) jumpToEditMode();
}

function tickInit() {
	
	if (editmode=="") {	
		document.onkeypress=getkey;
	}
	document.onresize=centerMe;
	centerMe();
}

function centerMe() {
	if (document.documentElement && document.documentElement.offsetHeight) {
		bodyHeight=parseInt(document.documentElement.offsetHeight);
		bodyWidth=parseInt(document.documentElement.offsetWidth);
	}
	else if (document.body) {
		bodyHeight=parseInt(document.body.offsetHeight);
		bodyWidth=parseInt(document.body.offsetWidth);
	}

	if (document.getElementById('bgdiv') && document.getElementById('topmenu')) {
		 if (getY(document.getElementById('bgdiv'))>=0-300) {
			// document.getElementById('bgdiv').style.top=parseInt((bodyHeight-getH(document.getElementById('bgdiv')))/2)+"px";
			// document.getElementById('topmenu').style.top=parseInt((bodyHeight-getH(document.getElementById('bgdiv')))/2)+"px";
			document.getElementById('bgdiv').style.left=parseInt((bodyWidth-getW(document.getElementById('bgdiv')))/2)+"px";
			document.getElementById('wrapper').style.left=parseInt((bodyWidth-getW(document.getElementById('bgdiv')))/2)+"px";
		 }
		document.getElementById('bgdiv').style.visibility="visible";
		document.getElementById('topmenu').style.visibility="visible";

	}

}

var ie=document.all;
var nn6=document.getElementById&&!document.all;
var activeMuze;
function showMuze(objID) {
	backMe();
	if (obj=document.getElementById(objID)) {
		obj.style.display="inline";
		document.getElementById(objID+"active").style.display="inline";
		document.getElementById(objID+"active").oldtop=parseInt(d(objID+"active").offsetTop);
		//document.getElementById(objID+"active").style.top=parseInt(d(objID+"active").offsetTop)+30+"px";
		activeMuze=obj;
	}
}

function backMe() {
	if (activeMuze) {
		document.getElementById(activeMuze.id+"active").style.display="none";
		activeMuze.style.display="none";

		//document.getElementById(activeMuze.id+"active").style.top=document.getElementById(activeMuze.id+"active").oldtop+"px";
	}
}

jQuery(document).ready(function() {
    if (editmode!='content') {
    jQuery(".picasa_album").each(function(){
	var album = jQuery.trim($(this).text());
	if (album!='') album = '.';	
	$(this).EmbedPicasaGallery('werkplaatslamuze',{	
		loading_animation: 'css/loading.gif',
		size: 144,
		msg_loading_list: 'Albums laden',
		msg_back: 'Terug naar het overzicht'
    	});	
    });
	}
});



