var layername;
var serviceslayer = null;
var edilayer = null;


function makename(layerid)
{

if(navigator.appName == "Netscape")
{

refname = eval("document."+layerid);

}else{ refname = eval("document.all."+layerid+".style");}

return refname;

}//end makename(layerid)



function hide(layerid)
{


if(navigator.appName == "Netscape")
{

refname = eval("document."+layerid);

}else{ refname = eval("document.all."+layerid+".style");}

	
if(refname != null)
refname.visibility = "hidden";

}


function show(layerid)
{

if(navigator.appName == "Netscape")
{

refname = eval("document."+layerid);

}else{ refname = eval("document.all."+layerid+".style");}

	
if(refname != null)
refname.visibility = "visible";


}


function roll(strid,strsrc)
{

eval("document."+strid+".src = '"+strsrc+"';");


}


function openPrintWindow()
{

if(document.applets.length==0)
{
	alert("There is no file to print.  Please login.");
	return false;
}

win2 = window.open("","","toolbar=no,width=300,height=100,resizeable=no");
win2.document.write("<html><head><title>Processing...</title></head><body>");
win2.document.write("Please be patient...</body></html>");

narr = new Array();
customername = document.applets[0].getCustomerName();
arr = document.applets[0].getPrintFile();

if(arr=="")
{
	win2.close();
	alert("There is no file to print.  Please login.");
	return false;
}


index = 0;
i=0;
lastindex=0;

while (index != -1) 
{
       
    index = arr.indexOf("~", index + 1); // start search after last match found
    narr[i] = arr.substring(lastindex,index);
    lastindex = index+1;      
    i++;

}

win2.close();

win = window.open("");
win.document.write("<html><head><title>Print Page...</title></head><body>");
win.document.write("<p><IMG border = 0 src=http://www.shannonsystems.com/top.jpg NOSEND=1></P><BR>");
win.document.write("Please go to the file menu for this window and select Print if you wish to print this page.<BR><BR>");
win.document.write("Item Cross Reference file for: "+customername+"<BR>");
win.document.write("Number of items in file: "+(narr.length-1)+"<BR>");
win.document.write("<BR><table border=1><TD>Customer item No</TD><TD>Description</TD><TD>Vendor item No</TD><TD>Vendor Description</TD><TR></TABLE>");

for(i=0;i<narr.length-1;i++)
   win.document.write("<br>"+narr[i]);    


win.document.write("</body></html>");

}


function toggle(element)
{
 if (eval(""+element+".style.display == 'none'")) 
  {
    eval(""+element+".style.display = ''");
   } else {
    eval(""+element+".style.display = 'none'");
   }
}//end toggle

