function SwapImage(strImgID, strPath)
{
	document.getElementById(strImgID).src = strPath;
}

function Popup(strUrl, strTitle, strVideo, strWidth, strHeight, strTop, strLeft)
{
	window.open(strUrl + "&Title=" + strTitle + "&Video=" + strVideo + "&Width=" + strWidth + "&Height=" + strHeight, '', "width=" + strWidth + ",height=" + strHeight + ",top=" + strTop + ",left=" + strLeft);
}

function OnKeyDown(e, btnButton)
{ 
    var intKey = -1; 

    if (e && e.which)
    {
        intKey = e.which;    // NS
    }
    else 
    {
        if (window.event && window.event.keyCode)
        {
            intKey = window.event.keyCode;  // IE
        }
    }
    
    if ((intKey == 13) && !(event.srcElement && (event.srcElement.tagName.toLowerCase() == "textarea")))
    { 
         document.getElementById(btnButton).click(); 
         return false; 
    } 

    return true; 
}

function SetFocusWhenSelect(strButtonID)
{
	document.getElementById(strButtonID).focus();
}

function OpenWebRadio()
{
	window.open("http://www.ps.be/Source/WebRadio.aspx", null, "menubar=no, status=no, scrollbars=no, menubar=no, width=370, height=170");
}

function getCookieVal(offset) 
{
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1)
		endstr=document.cookie.length;

	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) 
{
	var arg=name+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen) 
	{
		var j=i+alen;
		if (document.cookie.substring(i, j)==arg)
			return getCookieVal (j);
        i=document.cookie.indexOf(" ",i)+1;
        
        if (i==0) break;
    }
	return null;
}

function SetCookie (name, value) 
{
// un cookie a besoin d'un nom, d'une valeur, d'un nom de domaine, d'une date d'expiration
// 
	var da = new Date();
	var d=new Date(Date.parse(da)+(1000*60*60*24*365)); 
	document.cookie="données du cookies" + ";expires=" + d.toGMTString() + ";" 

	var argv=SetCookie.arguments;
	var argc=SetCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=name+"="+escape(value)+
		";expires=" + d.toGMTString() +
		"; path=/" +
		((domain==null) ? "" : ("; domain="+domain))+
		((secure==true) ? "; secure" : "");
}

function DeleteCookie (name) 
{
	var exp=new Date();
	exp.setTime (exp.getTime() - 100000);
	var cval=GetCookie (name);
	document.cookie=name+"="+cval+"; expires="+exp.toGMTString();
}

