// JavaScript Document

cookieString=document.cookie
cookieName = "SESSION_ID" + "="

if (cookieString.length>=0)
{
	i=cookieString.indexOf(cookieName)
	if (i!=-1)
	{
		i += cookieName.length
		j = cookieString.indexOf(",",i)
		
		if (j==-1)
		{
			j = cookieString.length
		}
		
		cookieValue = unescape(cookieString.substring(i,j))
	//alert(cookieValue);
	if (cookieValue != "-1" || cookieValue == "")
	{
		document.getElementById('regDiv').innerHTML = "<a href=/cgi-bin/ncommerce3/Welcome?merchant_rn="+wl_nbr+"><strong>My Auction Account</strong></a>";
		document.getElementById('space1Div').innerHTML = "<img src=http://pics1.truition.com/images/p2/wl/blank.gif width=1 height=15 />";
		document.getElementById('logDiv').innerHTML = "<a href=/cgi-bin/ncommerce3/Logoff?merchant_rn="+wl_nbr+"&url=/><img src=http://pics1.truition.com/images/p2/wl/pcr_staging/img/but_logout.gif /></a>";
		document.getElementById('space2Div').innerHTML = "<img src=http://pics1.truition.com/images/p2/wl/blank.gif width=1 height=25 />";
	}
	else
	{
		var curURL=location.href;
		var returnURL=escape(curURL);
		var theLink='/cgi-bin/ncommerce3/LogonForm?merchant_rn='+wl_nbr+'&url=' + returnURL;
		document.getElementById('regDiv').innerHTML = "<a href=/cgi-bin/ncommerce3/RegisterForm?merchant_rn="+wl_nbr+"><strong>Create Auction Account to Bid</strong></a>";
		document.getElementById('space1Div').innerHTML = "<img src=http://pics1.truition.com/images/p2/wl/blank.gif width=1 height=9 />";
		document.getElementById('logDiv').innerHTML = "<a href="+theLink+"><img src=http://pics1.truition.com/images/p2/wl/pcr_staging/img/but_login.gif /></a>";
		document.getElementById('space2Div').innerHTML = "<img src=http://pics1.truition.com/images/p2/wl/blank.gif width=1 height=18 />";
	} //logged on sesson not found		
	
	} //found SESSION_ID
	else
	{
		var curURL=location.href;
		var returnURL=escape(curURL);
		var theLink='/cgi-bin/ncommerce3/LogonForm?merchant_rn='+wl_nbr+'&url=' + returnURL;
		document.getElementById('regDiv').innerHTML = "<a href=/cgi-bin/ncommerce3/RegisterForm?merchant_rn="+wl_nbr+"><strong>Create Auction Account to Bid</strong></a>";
		document.getElementById('space1Div').innerHTML = "<img src=http://pics1.truition.com/images/p2/wl/blank.gif width=1 height=9 />";
		document.getElementById('logDiv').innerHTML = "<a href="+theLink+"><img src=http://pics1.truition.com/images/p2/wl/pcr_staging/img/but_login.gif /></a>";
		document.getElementById('space2Div').innerHTML = "<img src=http://pics1.truition.com/images/p2/wl/blank.gif width=1 height=18 />";
	} //SESSID_ID not found

} //cookieString exists