function getCookie(cookieName){
	var search = cookieName + '=';
	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 updateIcon( cookiename, date )
{
    d = new Date( date ).getTime();

    d_lastvisit = getCookie( cookiename );

    if( d_lastvisit == null || d > d_lastvisit )
    {
//        document.write( '<img src=/images/forum_box_new.gif>' );
        document.write( '<img src="/images/icon02.png" width="32" height="32" border="0" alt="" title=""/>' );
    }
    else
    {
//        document.write( '<img src=/images/forum_box.gif>' );
        document.write( '<img src="/images/icon01.png" width="32" height="32" border="0" alt="" title=""/>' );
    }
}

function setDate( )
{
    document.cookie = "d=" + ((new Date).getTime() - 600000 ) + "; expires=1-Jan-2020 00:00:00;";
}

function sort(form, sel) 
{
    addr = sel.options[sel.selectedIndex].value;
    window.location.href = addr; 
}

function refresh_capt()
{
    document.getElementById('imgcapt').src = "entry.php?action=forum_captcha&" + Math.random();
}

