// Generall javascript functions// Javascript getCookie functionfunction getCookie(c_name){	if (document.cookie.length>0) {  		c_start=document.cookie.indexOf(c_name + "=")		if (c_start!=-1) { 			c_start=c_start + c_name.length+1     			c_end=document.cookie.indexOf(";",c_start)    			if (c_end==-1) c_end=document.cookie.length    			return unescape(document.cookie.substring(c_start,c_end))    		}   	}	return ""}// Javascript setCookie functionfunction setCookie( name, value, path, domain, expires, secure ) {	var today = new Date();	today.setTime( today.getTime() );	if ( expires )	{		expires = expires * 1000 * 60 * 60 * 24;	}	var expires_date = new Date( today.getTime() + (expires) );	document.cookie = name + "=" +escape( value ) +	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 	( ( path ) ? ";path=" + path : "" ) + 	( ( domain ) ? ";domain=" + domain : "" ) +	( ( secure ) ? ";secure" : "" );}// Javascript deleteCookie functionfunction deleteCookie( name, path, domain ) {	if ( getCookie( name ) ) document.cookie = name + "=" +	( ( path ) ? ";path=" + path : "") +	( ( domain ) ? ";domain=" + domain : "" ) +	";expires=Thu, 01-Jan-1970 00:00:01 GMT";}// Javascript function to check if the user is logged infunction checkLogin(){	if (getCookie("wbg-usr")=="") {		var lang = getCookie('wbg-lan');		if (lang == '') { lang = 'en' };		location.href = webDbPath + "vapl/$user-login-required~" + lang;	}}// Javascript function to log a user outfunction logout() {	deleteCookie("wbg-usr", "/");	deleteCookie("wbg-usr-id", "/");	deleteCookie("wbg-usr-disp", "/");	deleteCookie("wbg-al", "/");	deleteCookie("wbg-ut", "/");	deleteCookie("wbg-lan", "/");		location.reload();}var windowHeight = 0;var windowWidth = 0;var imageHeight = 0;var imageWidth = 0;function openImageDialog() {	document.getElementById("imageDialog").style.display = "block";		if (window.innerHeight) {		imageHeight = window.innerHeight;		imageWidth = window.innerWidth;	}	else if (document.documentElement.clientHeight) {		imageHeight = document.documentElement.clientHeight;		imageWidth = document.documentElement.clientWidth;	}	else if (document.body.clientHeight) {		imageHeight = document.body.clientHeight;		imageWidth = document.body.clientWidth;	}			document.getElementById("currentImage").style.maxHeight = ( imageHeight - 130 ) + "px";		document.getElementById("currentImage").style.maxWidth = ( imageWidth - 130 ) + "px";			$("#imageDialog").dialog({	modal: true,	bgiframe: true,	position: 'top',	height: (document.getElementById("currentImage").height + 50),		width: (document.getElementById("currentImage").width + 50),		overlay: {		backgroundColor: '#000',		opacity: 0.75		}	});	$("#imageDialog").dialog("open");	}