
function addLoadEvent(sourcecode)
{
	var oldfunc = window.onload;
	if (typeof window.onload != 'function')
	{
		window.onload = function()
		{
			eval(sourcecode);
		};
	}
	else 
	{
		window.onload = function()
		{
			oldfunc();
			eval(sourcecode);
		};
	}
}

var popup;

function openPopup(url)
{
	if (url != "")
	{
		window.location.href = url;
	}
	return;

	if (url != "")
	{
		document.getElementById("div_layer_popup_bg").style.display = "block";
		document.getElementById("div_layer_popup_fg").style.display = "block";
		document.getElementById("iframe-popup").src = url;
	}
	else
	{
		closePopup('');
	}
}

function closePopup(url)
{
	if (url != "")
	{
		window.location.href = url;
	}
	return;

	document.getElementById("div_layer_popup_bg").style.display = "none";
	document.getElementById("div_layer_popup_fg").style.display = "none";
	document.getElementById("iframe-popup").src = "/nl/blank/";
	
	if (url == "false")
	{
		return;
	}
	else if (url != "")
	{
		window.location.href = url;
	}
	else
	{
		url = window.location.href.replace("#", "");
		window.location.href = url;
	}
}


function getCookie(name)
{
	var cookie_array = document.cookie.split("; ");
	 
    for (var x = 0; x < cookie_array.length; x++) 
    { 
        cookieParts_array = cookie_array[x].split("=");
         
        if (cookieParts_array[0] == name) 
        { 
            return cookieParts_array[1]; 
        }
    } 
	return null; 
}

function setCookie(name, value)
{
	var expdate = new Date(); 
	expdate.setTime(expdate.getTime() + 90*24*60*60*1000); 
	document.cookie = name + "=" + value + "; expires=" + expdate.toGMTString() + "; path=/";
}

function removeCookie(name) 
{
	if (getCookie(name)) 
	{
		setCookie(name, null);
		document.cookie = name + "=" + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
	}
}

