<!--
function checkParam()
{
	if(window.location.search != "")
	{
		myParams = window.location.search;
		myParams = myParams.slice(1);       // remove ?
		myParamArray = myParams.split("&");

		// TODO: find the right parameter -> assume 0
		myValue = unescape(myParamArray[0].split("=")[1]);

		// search for part to be highlighted in name, part number, EAN or item number
		found = 0;
		var i;
		for (i=1; i<=PartsName.length; i++)
		{
			if (unescapeString(PartsName[i]) == unescapeString(myValue))
			{
				found = 1;
				break;
			}
		}
		if (!found)
		{
			for (i=1; i<=PartsNumber.length; i++)
			{
				if (unescapeString(PartsNumber[i]) == unescapeString(myValue))
				{
					found = 1;
					break;
				}
			}
		}
		if (!found)
		{
			for (i=1; i<=PartsEAN.length; i++)
			{
				if (unescapeString(PartsEAN[i]) == unescapeString(myValue))
				{
					found = 1;
					break;
				}
			}
		}
		if (!found)
		{
			for (i=1; i<=PartsHs.length; i++)
			{
				if (unescapeString(PartsHs[i]) == unescapeString(myValue))
				{
					found = 1;
					break;
				}
			}
		}

		// show part if found
		if (found)
		{
			ShowObject(PartsHs[i]);
		}
	}
}


function look4part(val)
{
	if (val == "")
		location.self;
	for (i=1; i<=PartsName.length; i++)
		if (PartsName[i] == val)
		{
			add2cart(i);
			break;
		}
	return;
}


function goToAssembly(id)
{
	/* change navigation frames if necessary */
	var navigation = parent.nav;
	if (navigation == null)
		navigation = parent.parent.nav;
	if (navigation != null && navigation.location.href.indexOf(PartsNav[id]) == -1)
		navigation.location.href = PartsNav[id];
	/* show new assembly */
	self.location.href = PartsRef[id];				
	return;
}


function writeFstLine(name)
{
	var start = "<center><table>";
	var cart = "";
	var fst_line = "";
	var snd_line = "";
	var end = "</table></center>";
	var found = 0;
	var j = 0;

        /* Ausgabe fuer den NS */
	if (navigator.appName.indexOf("Netscape") != -1)
	{
		for (i=1; i<=PartsHs.length; i++)
		{
			if (PartsOrd[i] == 1)
				j++;
			if ((PartsHs[i] == name) && (PartsOrd[i] == 1))
			{
				/* composition of part description */
				document.menu.artid.value = PartsNumber[i];
				document.menu.artname.value = PartsName[i];
				found = 1;
				break;
			}
		}
		if (found == 0)
		{
			document.menu.artid.value = "";
			document.menu.artname.value = "";
		}
	}
}

var lastSelectedRowArray = new Array();
var lastSelectedRowStyleArray = new Array() ;

function hiliteAndScrollRow(id)
{
	var elem;
	var newRowIndex = -1; 
	/* aus iso.js */
	for (i=1; i<PartsHs.length; i++)
	{
		if (PartsHs.length == 2)  // one part only
			elem = document.show.ShowDetails;
		else
			elem = document.show.ShowDetails[i-1];
		if (elem.value == id)
		{
			elem.checked = true;
			// IE: scroll in table && highlight the line (scroll only when not visible)
			if (document.all)
			{
				// sophisticated scrolling
				var row = elem.parentElement;
				while (row.nodeName != "TR")
					row = row.parentElement;
			
				var rowPos = row.offsetTop;
				var rowEnd = rowPos + row.clientHeight;
				// scroll only when selected element is not visible in div
				if (partstableDIV.scrollTop > rowPos) 
				{
					// scroll up (selected element will be on top of the div)
					partstableDIV.scrollTop = rowPos; 
				}
				else if (partstableDIV.scrollTop + partstableDIV.clientHeight < rowEnd)
				{
					// scroll down (selected element will be the last shown in the div)
					partstableDIV.scrollTop = rowEnd - partstableDIV.clientHeight; 
				}
			
				if (newRowIndex == -1) //restore old styles of previous selections
				{
					// IE: switch style of part's table row (should be parentElement's(TD) parentElement(TR)
					for (j=0; j<lastSelectedRowArray.length; j++)
					{
						if ( (lastSelectedRowArray[j] > -1) && (PartsHs.length > 2) )
							document.show.ShowDetails[lastSelectedRowArray[j]].parentElement.parentElement.className=lastSelectedRowStyleArray[j];
						lastSelectedRowArray[j] = -1;
					}					
				}				
				newRowIndex += 1;
				lastSelectedRowArray[newRowIndex] = i-1;
				lastSelectedRowStyleArray[newRowIndex] = elem.parentElement.parentElement.className;
				elem.parentElement.parentElement.className="selectedPartRow";
				elem.parentElement.parentElement.border=1;
			}
		}
	}
	return newRowIndex > -1;
}

var neuesFenster;

function showHist(txt,css)
{
	if (neuesFenster)
		neuesFenster.close();
	neuesFenster = window.open('about:blank','hist','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=250,height=200');

	// stop processing when window cannot be created to prevent javascript error
	if (neuesFenster == null)
		return;

	neuesFenster.document.write("<html><head><title>History</title>\n");
	neuesFenster.document.write("<link rel='stylesheet' type='text/css' href='"+css+"'>\n");
	neuesFenster.document.write("</head>\n<body>\n");
	var ampersand_char = 0;
	for (i=0; i<txt.length-1;i++)
	{
		if (txt.charAt(i) == '&')
			ampersand_char = 1;
		if (txt.charAt(i) == '<')
			neuesFenster.document.write("&lt;");
		else if (txt.charAt(i) != ';')
			neuesFenster.document.write(txt.charAt(i));
		else
		{
			if ((txt.charAt(i) == ';') && (ampersand_char == 1))
			{
				neuesFenster.document.write(txt.charAt(i));
				ampersand_char = 0;
			}
			else
				neuesFenster.document.write("<br>");
		}
	}
	neuesFenster.document.write("\n<CENTER><FORM><INPUT TYPE='BUTTON' class='button' VALUE='" + str_close + "' onClick='window.close()'></FORM></CENTER>");
	neuesFenster.document.write("</body></html>");
	neuesFenster.focus();
}
//-->