<!--
/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expiredays]  Expiration days of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expiredays, path, domain, secure)
{
if(expiredays){
	var expireDate = new Date();
	expireDate.setTime(expireDate.getTime() + (expiredays * 24 * 3600 * 1000));
}

    document.cookie= name + "=" + escape(value) +
        ((expiredays) ? "; expires=" + expireDate.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

/**
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function deleteCookie(name, path, domain)
{
    if (getCookie(name))
    {
        document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}


function searchCookie(name){
	lang=getCookie(name);
	if (lang != null) {
		queryString = "";
		if(typeof error != 'undefined'){
    		queryString = "?e="+ error;
    	}
    	if(typeof referer != 'undefined'){
    		queryString += ((queryString == "")?"?":"&referer=")+ referer;
    	}
		window.location.href= lang +"/" + queryString;
	}
}

function write_mail(mail, domain){
	document.write("<a href='mailto:"+ mail +"@"+domain+"'>"+ mail +"@"+ domain+"</a>");
}

function CreateBookmarkLink() {

 title = document.title;

 url = document.location;

	if (window.sidebar) { // Mozilla Firefox Bookmark
		alert("please hit CTRL+D to add a bookmark");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
 }

/**
* Open a popup window
*/
function screenshot(url, stitle){
	imgWin=window.open(url,'','location=0,resizable=1,status=0,scrollbars=1');
	imgWin.focus();
}
/**
* drop down box script
*/
var cancelHide = false;

function doCancelHide(){
	cancelHide = true;
}

function showGroupSitesItems(){
	if(document.getElementById("selectGroupSitesItems").style.display != "block"){
		document.getElementById("selectGroupSitesItems").style.display = "block";
		doCancelHide();
	}else{
		hideGroupSitesItems();
	}
}

function hideGroupSitesItems(){

	if (document.getElementById("selectGroupSitesItems") != null){
	if(!cancelHide){

			document.getElementById("selectGroupSitesItems").style.display = "none";

	}else{
		cancelHide = false;
	}
	}
}

function showGroupSitesItems2(){
	if(document.getElementById("selectGroupSitesItems").style.display != "block"){
		document.getElementById("selectGroupSitesItems").style.display = "block";
	}
}

function hideGroupSitesItems2(){
	if (document.getElementById("selectGroupSitesItems") != null){
			document.getElementById("selectGroupSitesItems").style.display = "none";
	}
}

document.onclick = hideGroupSitesItems;

function hop(anchor) { document.location.href = '#'+anchor }

/**
* AJAX POPUP SCREEN
*/
var map = new Object();
map['nl_BE'] = "<br><br><center><b>Bezig met laden ...</b><br><br><img src='/global/template/images/ajax/LoadingProgressBar.gif'></center>";
map['fr_BE'] = "<br><br><center><b>Loading ...</b><br><br><img src='/global/template/images/ajax/LoadingProgressBar.gif'></center>";
map['fr_FR'] = "<br><br><center><b>Loading ...</b><br><br><img src='/global/template/images/ajax/LoadingProgressBar.gif'></center>";
map['en_UK'] = "<br><br><center><b>Loading ...</b><br><br><img src='/global/template/images/ajax/LoadingProgressBar.gif'></center>";

function ajaxpage(url, containerid, outercontainerid, modelBackground, language){
	document.getElementById(containerid).innerHTML = map[language];
	document.getElementById(containerid).style.height = "100px";
	document.getElementById(containerid).style.width = "220px";
	document.getElementById(containerid).style.top = "-50px";
	document.getElementById(containerid).style.marginLeft = "-110px";
	document.getElementById(modelBackground).style.display="";
	document.getElementById(outercontainerid).style.display="";

	var page_request = false
	if (window.XMLHttpRequest) // if Mozilla, Safari etc
		page_request = new XMLHttpRequest()
	else if (window.ActiveXObject){ // if IE
		try {
			page_request = new ActiveXObject("Msxml2.XMLHTTP")
		} catch (e){
			try{
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}catch (e){}
		}
		}else
			return false
		page_request.onreadystatechange=function(){
		loadpage(page_request, containerid, outercontainerid)
	}
	page_request.open('GET', url, true)
	page_request.send(null)
}

function loadpage(page_request, containerid, outercontainerid){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
		document.getElementById(outercontainerid).style.display="none";
		document.getElementById(outercontainerid).style.display="";
		document.getElementById(containerid).style.height = "500px";
		document.getElementById(containerid).style.width = "720px";
		document.getElementById(containerid).style.top = "-250px";
		document.getElementById(containerid).style.marginLeft = "-360px";
		document.getElementById(containerid).innerHTML=page_request.responseText
		document.getElementById(outercontainerid).style.display="";
	}
}

function closeAjax(containerid, outercontainerid, modelBackground){
	document.getElementById(outercontainerid).style.display = "none";
	document.getElementById(modelBackground).style.display = "none";
	document.getElementById(containerid).innerHTML = "";
}

function showInputPanel(){
	document.getElementById("inputPanel").style.display = 'block';
}

function toggleLayer( whichLayer )
{
  var elem, vis, image;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;

  image = document.getElementById("toggle_img");
  image.src = "/global/template/images/icons/toggle_minus.png";

  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
	  vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  	  image.src = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'/global/template/images/icons/toggle_plus.png':'/global/template/images/icons/toggle_minus.png';
	  vis.display = (vis.display==''||vis.display=='block')?'none':'block';

}

-->
