function update_links(list_data)
{
Linksel=document.all.LINKS;
Linksel.options[0].selected=true;
while (Linksel.length > 1)
{
Linksel.options[1] = null;
}
linkarray=list_data.split('~')
if (linkarray.length < 2)
{
	Linksel.options[1] = null;
	Linksel.size=1;
	Linksel.options[0]=new Option ("none","none");
}
else
{
	Linksel.size=(linkarray.length - 1) /2;
	var rep_counter=0
	for (var i=0; i < linkarray.length -1 ; i=i+2)
	{
		Linksel.options[rep_counter] = new Option (linkarray[i+1],linkarray[i]);
		rep_counter++ 
	}
}
}

function howmany_links()
{
	Linksel=document.all.LINKS;
	link_val='';
	link_counter = 0;
	if (Linksel.options[0].text != 'none')
	{
	for (var i = 0; i <= Linksel.size; i++)
	{
		if (Linksel.options[i].selected)
		{
			if (Linksel.options[i].text != 'none')
			{
				if (link_counter != 0)
				{
					link_val=link_val + ','
				}
				link_val=link_val + Linksel.options[i].value 
				link_counter++;
			}
		}
	}	
	}
	return link_val;
}
function display_search()
{
url="../../../lumbermens/credit_search.htm";
searchwin=window.open(url, "Credit_Center", "width=400,height=200,resizable,scrollbars");
}


function print_credit()
{
if (document.all.lLCANUMBER.value != '' || document.all.COMPANYNAME.value != '' || document.all.OFFICER.value != '')
{
if (Nnum=rs.fields('LCANUMBER').value != ' ')
{
links=howmany_links();
Nnum=rs.fields('LCANUMBER').value;
//alert(links);
CustNum= document.all.MEMBERNUMBER.value;
url='/scripts/uiiis.dll/credit_services/credit_start?LCANUMBER='+ Nnum + '&MEMBERNUMBER='+ CustNum + '&MEMBERNAME=' + escape(document.all.MEMBERNAME.value) + '&CUSTLINKS=' + links;
ntowindow=window.open(url,"New_NTO","Width=640,height=480,resizable,scrollbars,menubar");
DATA_TABLE.rows[(DATA_LIST.recordset.AbsolutePosition - 1) % 9 +1].style.backgroundColor = 'yellow';
DATA_LIST.onrowenter = HandleRowEnter;
rs=DATA_LIST.recordset;  Status.innerHTML = rs.absolutePosition+' of '
+rs.recordCount;
}
else
{
	alert('You must first find a record with the Begin Search button')
	document.credit_summary.COMPANYNAME.focus();
}
}
else
{
	alert('You must first find a record with the Begin Search button')
		document.credit_summary.COMPANYNAME.focus();
}
}

function set_url(go_to_url)
{
go_to_url = go_to_url + '&MEMBERNUMBER=' + document.all.MEMBERNUMBER.value + 
'&NOTICE=' + document.all.NOTICE.value;
//rs=DATA_LIST.recordset;  
foobar=200;
if (foobar == 100)
{
	alert('This Page MUST be RELOADED before a find can be done!')
	window.location.reload();
}
else
{
DATA_LIST.DataURL=go_to_url;
DATA_LIST.reset();
}
}


function closeout()
{
if (!searchwin.closed)
{
searchwin.window.close();
}
}
 
 

function businessresearchcredit()
{
mem_num = document.all.MEMBERNUMBER.value;
mem_nam = document.all.USERNAME.value;
url='/scripts/uiiis.dll/credit_services/businesscredit_request_form'
document.credit_summary.action=url;
document.credit_summary.submit();
}


function researchcredit()
{
mem_num = document.all.MEMBERNUMBER.value;
mem_nam = document.all.USERNAME.value;
url='/scripts/uiiis.dll/credit_services/credit_request_form'
document.credit_summary.action=url;
document.credit_summary.submit();
}

function initialize() 
{
 rs=DATA_LIST.recordset;  
 Status.innerHTML = rs.absolutePosition+" of "
 +rs.recordCount;
document.all.lLCANUMBER.value = '';
document.all.COMPANYNAME.value='';
document.all.OFFICER.value='';

}


