function write_to_field(code)
{
 var found = false;
 var i =0;
 while ((found == false) && (i < document.form1.elements.length))
  {i = i + 1
   if (document.form1.elements[i].name == code)
     { 
      found = true;
      document.form1.elements[i].value = parent.item_quan(code);
     }
  }
}

function Loc_additem(code,price,desc,url)
{
 self.parent.additem(code,price,desc,url);
 write_to_field(code)
}

function Loc_subitem(code,price,desc,url)
{
self.parent.subitem(code,price,desc,url);
write_to_field(code)
}

function eclShoPic(who,tlt)   {
   // var now = new Date();
   // var uaid = now.getTime() % Math.floor(8640000 - Math.random()*1000);

	dWin = window.open('')	
	dWin.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">')
	dWin.document.write("<html><title>" + tlt + "</title><body background=bg_moderate.gif><form name=flog><div align=center><table border=0><tr><td align=center>")
	dWin.document.write("<b><font size=+1>" + tlt + "</b><BR><BR>")

	dWin.document.write('</td></tr><tr><td align=center>')
	dWin.document.write('<p><img src=' + who +' border=0 alt=></p>')
	
	dWin.document.write('<input type="button" name=btnClose value="Close Picture Window" onClick="javascript:window.close()">')						
	dWin.document.write('<!-- Bottom ID -->')
	dWin.document.write('<div align=center><P>')
	dWin.document.write('<FONT FACE=Verdana, Helvetica, Arial SIZE=1><HR SIZE=1><DIV ALIGN=CENTER>')
	dWin.document.write('&copy; 2002 ECL Publications - All Rights Reserved - www.eclpublications.com')

	dWin.document.write("</td></tr></form></body></html>")
	dWin.document.flog.btnClose.focus()
	dWin.document.close();  
}

	function ssSelBtn()	{
		var timerID = 0
		var o = parent.frames["main"].document.form1.cmdSelectSS
		var v = o.tag
		if (v == 1)	{
			o.tag = 0
			o.className = "ssb2"
		}	else	{
			o.tag = 1
			o.className = "ssb1"
		}
		timerID = setTimeout("ssSelBtn()",1000)
	}

