// JavaScript Document

initPage = "home/index.php";

// es Espanyol - ca Catala - en English - ne Nederlands - de Deutsch

function SetCookie(cookieName,cookieValue,nDays){

  if (document.form1.checkbox.checked) {

   var today = new Date();

   var expire = new Date();

   if (nDays==null || nDays==0) nDays=1;

   expire.setTime(today.getTime() + 3600000*24*nDays);

   document.cookie = cookieName+"="+escape(cookieValue)+";expires="+expire.toGMTString();

  }

}

 

function ReadCookie(cookieName) {

 var theCookie=""+document.cookie;

 var ind=theCookie.indexOf(cookieName);

 if (ind==-1 || cookieName=="") return ""; 

 var ind1=theCookie.indexOf(';',ind);

 if (ind1==-1) ind1=theCookie.length; 

 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));

}

 

var resCookie=ReadCookie('bryteweb');

//alert('CO:'+resCookie);

//Espanyol
if (resCookie=='es') document.location=initPage+'?lng=es'; 
//Catala
if (resCookie=='ca') document.location=initPage+'?lng=ca'; 
//English
if (resCookie=='en') document.location=initPage+'?lng=en'; 
//Nederlands
if (resCookie=='ne') document.location=initPage+'?lng=ne'; 
//Deutsch
if (resCookie=='de') document.location=initPage+'?lng=de'; 

//sets cookie and redirects to home page with selected language
function setLanguage (mylng) {

	SetCookie("bryteweb",mylng, 30);
	
	document.location=initPage+'?lng='+mylng; 
}


//
//sets image for over or normal type
function setImage(imgName, type) {
	
	//changes src of image to over or normal
    if (document.images) {
		 if (type == "normal") {
            document.images[imgName].src = imagesNormal[imgName].src;
            return true;
        } else if (type == "over") {
            document.images[imgName].src = imagesOver[imgName].src;
            return true;
        }
    }
    return false;
}


//Hides all descriptions and shows clicked description
function showOneDescription(mylayernum, mystate) {
/*	

	*/
	if (mystate=='over') {
		hide('desc'+mylayernum);
		show('desc_over'+mylayernum);
		show('checkBox_layer');
		//for descriptions
		for (i=1;i<=5;i++) {
			hide('desc_rec'+i);	
		}
		show('desc_rec'+mylayernum);
		
		
	} else if (mystate=='out') {
		show('desc'+mylayernum);
		hide('desc_over'+mylayernum);
	}
}

