//this writes an e-mail link on the footer
function h5d489ee87c8e830043a0dccf0af4bd40()
{
	var s='oxfldq1sulfrsC|dkrr1fr1xn';
	var r='';
	for(i=0;i<s.length;i++)
	{
		var n=s.charCodeAt(i);
		if(n>=8364)
		{n=128;}
		r+=String.fromCharCode(n-3);
	}
	var a = document.getElementById('emailLucian');
	if(a!=null)
		a.setAttribute('href','mailto:' + r + '?subject=vizitator gallobelgic');
}
//this function removes white spaces at the begining and the ending of a string
function trim(string)
{
	var posToDelete = 0;
	while(string[posToDelete] == " ")
		++posToDelete;
	var newString = string.substr(posToDelete);
	posToDelete = newString.length-1;
	while(newString[posToDelete] == " ")
		--posToDelete;
	return newString.substr(0,posToDelete+1);
}
//this function sets the value of the named cookie variable to to the given value
function setCookie(Name,value)
{
// 	alert(value);
	document.cookie = Name+"="+escape(value);
// 	alert(getCookie(Name));
}
//tis function returns the value of the specified named cookie variable
function getCookie(Name)
{
    var search = Name + "=";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search);
        if (offset != -1) {
            offset += search.length;
            end = document.cookie.indexOf(";", offset);
            if (end == -1) { end = document.cookie.length; }
            return unescape(document.cookie.substring(offset, end));
        }
    }
    return null;
}
function onLoad()
{   return;
	var level1 = getCookie("level1");
	var level2 = getCookie("level2");
	if(level1 == null)
	{//first time on the website
		setCookie("level1",window.location);
		return;
	}
	if(level1 == window.location)
	{//user refreshed the page
		yScroll = getCookie("yScroll");
		xScroll = getCookie("xScroll");
		scrollTo(xScroll,yScroll);
	}
	else if(level2 !=null && level2 == window.location)
	{//user returned to previous page
		yScroll = getCookie("yScroll");
		xScroll = getCookie("xScroll");
		prevyScroll = getCookie("prevyScroll");
		prevxScroll = getCookie("prevxScroll");
		setCookie("prevyScroll",yScroll);
		setCookie("prevxScroll",xScroll);
		setCookie("level2",level1);
		
		setCookie("yScroll",prevyScroll);
		setCookie("xScroll",prevxScroll);
		setCookie("level1",window.location);
		scrollTo(prevxScroll,prevyScroll);
	}
	else if(level2 == null)
	{//user went to a new location
		setCookie("level1",window.location);
		setCookie("level2",level1);
		yScroll = getCookie("yScroll");
		xScroll = getCookie("xScroll");
		setCookie("prevyScroll",yScroll);
		setCookie("prevxScroll",xScroll);
	}
	else
	{//user went to a second new location
		yScroll = getCookie("yScroll");
		xScroll = getCookie("xScroll");
		setCookie("prevyScroll",yScroll);
		setCookie("prevxScroll",xScroll);
		setCookie("level2",level1);
		setCookie("level1",window.location);
	}
}
window.onscroll = function ()
{
	var yScroll;
    var xScroll;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		yScroll = window.pageYOffset;
		xScroll = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	}
	setCookie("yScroll",yScroll);
	setCookie("xScroll",xScroll);
}
if(window.addEventListener)
	window.addEventListener("load",onLoad,false);
else if(window.attachEvent)
	window.attachEvent("onload",onLoad);
else
	window.load = onLoad;

//this object handles updates of the values of a drop down list according to a specific value 
function updateValues(table,givencolumn,givenvalue,column,target)
{
	this.table = table;//the table where the data needs to be taken from
	this.givencolumn = givencolumn;//the column for which the value is given
	this.givenvalue = givenvalue;//the value which affects the results
	this.column = column;//the column from which the values are needed
	this.mytarget = target;//the element which will take the new values
		
	this.renew = function (table,givencolumn,givenvalue,column,target)
			{
				this.table = table;
				this.givencolumn = givencolumn;
				this.givenvalue = givenvalue;
				this.column = column;
				this.mytarget = target;
			}
	
	this.getValues = function ()
			{
				if(this.givenvalue == null || this.table == null || this.table == "" || this.mytarget == null)
					return;
				this.mytarget.setAttribute("disabled","disabled");
				while(this.mytarget.hasChildNodes())
					this.mytarget.removeChild(this.mytarget.firstChild);
				var request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
				request += "<REQUEST TYPE=\"valuelist\">\n";
				request += "\t<TABLE>" + this.table+ "</TABLE>\n";
				request += "\t<GIVENCOLUMN>" + this.givencolumn+ "</GIVENCOLUMN>\n";
				request += "\t<GIVENVALUE>" + this.givenvalue+ "</GIVENVALUE>\n";
				request += "\t<COLUMN>" + this.column+ "</COLUMN>\n";
				request += "</REQUEST>\n";
				if(ajaxSendXMLtoPHP)
					ajaxSendXMLtoPHP("handleRequests.php",request,this.updateValues,this.mytarget);
			}
	this.updateValues = function(obj,XML)
			{
				if( XML == null)
					return;	
				var values = XML.getElementsByTagName("VALUE");
				var valueText;
				var selected;
				var option;
				for(var i=0;i<values.length;++i)
				{
					if(values[i].textContent !=null)
						valueText =  values[i].textContent;
					else
						valueText = values[i].text;
					if(trim(valueText) == "") valueText = "none";
					if(values[i].hasAttribute)
						selected = values[i].hasAttribute("SELECTED");
					else
						selected = (values[i].getAttribute("SELECTED")==null);
					option = document.createElement("option");
					option.setAttribute("value",valueText);
					option.appendChild(document.createTextNode(valueText));
					if(selected)
						option.setAttribute("selected","selected");
					obj.appendChild(option);
				}
				obj.removeAttribute("disabled");
			}
}
var update=null;

function onClassChange(value,targetid)
{
	var mytarget = document.getElementById(targetid);
	if(update==null)
		update = new updateValues('lookup_classes','class',value,'sub_class',mytarget);
	else
		update.renew('lookup_classes','class',value,'sub_class',mytarget);
	update.getValues();
}
function onSiteType1Change(value,targetid)
{
	var mytarget = document.getElementById(targetid);
	if(update==null)
		update = new updateValues('lookup_site_type','type_1',value,'type_2',mytarget);
	else
		update.renew('lookup_site_type','type_1',value,'type_2',mytarget);
	update.getValues();
}