<!--
// POP UP A PREFORMATTED EMAIL MESSAGE WINDOW
function email() {
  // SET MESSAGE VALUES
  var nameto = "bvandezande";
  var at="@";
  var domain="skynet.";
  var ext="be";
  var to=nameto+at+domain+ext;
  return to;
}

function removeSuffix(name) {
	var components=name.split(" ");	
	var naam="";
	/*
	if(components.length!=2) {
		components=name.split(" - P.tif");
	}*/
	if (components.length>1) {
		naam=components[0];
	}
	else {
		
	}
	return naam;
}


/*function check() {
	var mail = document.forms[0].email.value;
	if(mail!=''||mail[0]!=' ') {
	if((mail.indexOf(".") > 0) && (mail.indexOf("@") > 0)) {
	var mail_array=mail.split("@");
	var mail_array2=mail_array[1].split(".");
	if (mail != ' ' && (mail_array.length!=2||mail.indexOf('@', 0) == -1 || mail_array[1].indexOf('.', 0) == -1)||mail_array2.length<2)
		{
			alert('The email adres you entered is not valid');
			
				document.forms[0].email.select();
				document.forms[0].email.focus();
		}
	}
else {
alert('The email adres you entered is not valid');
			
				document.forms[0].email.select();
				document.forms[0].email.focus();
		}


	}
	
}

function validate() {

var mail = document.forms[0].email.value;
	if(mail!=''||mail[0]!=' ') {
	if((mail.indexOf(".") > 2) && (mail.indexOf("@") > 0)) {
	var mail_array=mail.split("@");
	var mail_array2=mail_array[1].split(".");
	if (mail != ' ' && (mail_array.length!=2||mail.indexOf('@', 0) == -1 || mail_array[1].indexOf('.', 0) == -1)||mail_array2.length<2)
		{
			alert('The email adres you entered is not valid');
			return false;
				document.forms[0].email.select();
				document.forms[0].email.focus();
		}
	}
else {
alert('The email adres you entered is not valid');
			return false;
				document.forms[0].email.select();
				document.forms[0].email.focus();
		}


	}

 if (document.forms[0].company.value==''||document.forms[0].company.value.charAt(0)==' ') {
alert('"Company" is a mandatory field! Please retry.');
return false;
}
else if (document.forms[0].email.value==''||document.forms[0].email.value.charAt(0)==' ') {
alert('The email adres you entered is not valid');
return false;
}
else {
return true;
}
return true; //true
}


*/
function search() {
var a1429L=new Array(
"1429L02-1 - P.tif",
"1429L02-1X1 - D.tif",
"1429L02-1X1 - P.tif",
"1429L02-2 - D.tif",
"1429L02-2 - P.tif",
"1429L02-2X1 - D.tif",
"1429L02-2X1 - P.tif",
"1429L02-3 - D.tif",
"1429L02-3 - P.tif",
"1429L02-3X1 - D.tif",
"1429L02-3X1 - P.tif",
"1429L8 - D.tif",
"1429L8 - P.tif",
"1429L9 - D.tif",
"1429L9 - P.tif",
"1429L02-1 - D.tif"
);

var a2368L=new Array(
"2368L02-1AF - P.tif",
"2368LF1 - D.tif",
"2368L02-1AF - D.tif",
"2368L01-1AF - P.tif"
);

var a2939L=new Array(
"2939L01 - D.tif",
"2939L01 - D2.tif",
"2939L01 - P.tif"
);

var a934L=new Array(
"V934L01 - D.tif",
"V934L01-1-1BP - P.tif",
"V934L01-1X1 - D.tif",
"V934L01-1Xx1AF - P.tif",
"V934L02-1BP - D.tif",
"V934L02-1BP - P.tif"
);

var a95L=new Array(
"95H07 - D.tif",
"95H07 - P.tif",
"95L01 - D.tif",
"95L01 - P.tif",
"95L07 - D.tif",
"95L07 - P.tif"
);

var aE20300=new Array(
"E2.03.00...5 - D.tif",
"E2.03.00...5 - P.tif",
"E2.03.00...6 - D.tif",
"E2.03.00...6 - P.tif",
"E2.03.01...6 - D.tif",
"E2.03.01...6 - P.tif"
);

var aE20400=new Array(
"E2.04.00...5 - D.tif",
"E2.04.00...5 - P.tif",
"E2.04.00...6 - D.tif",
"E2.04.00...6 - P.tif"
);

var aE20800=new Array(
"E2.08.00 - D.tif",
"E2.08.00 - P.tif"
);

var aE24600=new Array(
"E2.46.00...5 - D.tif",
"E2.46.00...5 - P.tif",
"E2.46.00...6 - D.tif",
"E2.46.00...6 - P.tif"
);

var aV18L=new Array(
"1449L07 - D.tif",
"1449L07 - P.tif",
"ECL642.00 - D.tif",
"ECL642.00 - P.tif",
"V18L01-1 - D.tif",
"V18L01-1 - P.tif",
"V18L01-1X - P.tif",
"V18L01-1Y - D.tif",
"V18L01-1Y - P.tif",
"V18L13-1 - D.tif",
"V18L13-1 - P.tif",
"V18L45-1BP - D.tif",
"V18L13-1-2AH -D.tif",
"V18L13-2-3AC -D.tif"
);

var aV46L=new Array(
"V18L13-1-2AH - P.tif",
"V18L13-2-3AC - P.tif",
"V46L38-1-1AA - P.tif",
"V46L38-1-6AA - P.tif",
"V46L38-1-1AA - D.tif",
"V46L38-1-6AA - D.tif"
);

var aV917L=new Array(
"1449L02-1X - D.tif",
"1449L02-1X - P.tif",
"V17L12-2X - D.tif",
"V17L12-2X - P.tif",
"V917L01-1 - D.tif",
"V917L01-1 - P.tif",
"V917L01-1X - D.tif",
"V917L01-1X - P.tif",
"V917L01-1Y - D.tif",
"V917L01-1Y - P.tif",
"V917L11-1 - D.tif",
"V917L11-1 - P.tif",
"V917L12-1 - D.tif",
"V917L12-1 - P.tif",
"V951L50 - D.tif",
"V951L50 - P.tif"
);

var aV951L=new Array(
"V951L01-1Y - D.tif",
"V951L01-1Y - P.tif",
"V951L02-1 - D.tif",
"V951L02-1 - P.tif",
"V951L03-1 - D.tif",
"V951L03-1 - P.tif",
"V951L03-1X - D.tif",
"V951L03-1X - P.tif",
"V951L04-1X - D.tif",
"V951L04-1X - P.tif",
"V951L05-1X - D.tif",
"V951L05-1X - P.tif",
"V951L50 - D.tif",
"V951L50 - P.tif",
"V951L52 - D.tif",
"V951L52 - P.tif",
"V951L7 - D.tif",
"V951L7 - P.tif"
);

var aV96L=new Array(
"V95H01 - D.tif",
"V95H01 - P.tif",
"V95L01 - D.tif",
"V95L01 - P.tif"
);

var a15F=new Array(
"15S1-.-1AD - D.tif",
"15S1-.-1AD - P.tif",
"15S11-1CJ - D1.tif",
"15S11-1CJ - D2.tif",
"15S11-1CJ - D3.tif",
"T107-1 - D.tif",
"V15R13-1-1AB - D.tif",
"V15R13-1-1AB - P.tif",
"V15R14-1-1AB - D1.tif",
"V15R14-1-1AB - D2.tif"
);

var a26002700L=new Array(
"312-12 - P.tif",
"99E10-01 - D1.tif",
"99E10-01 - P1.tif",
"99N10-01A1 - D1.tif",
"99N10-01A1 - D2.tif",
"V2600-LW-7 - D2.tif",
"2600-SW - D1.tif",
"2600-sw - d3.tif",
"26R1-1 - D.tif",
"2600-SW - D2.tif",
"26R1-1 - P.tif",
"27S5-1BM - D1.tif",
"312-12 - D.tif",
"4P3 - D1.tif",
"99R10-01A1 - D1.tif",
"99R10-01A1 - P1.tif",
"AN6227-B6 -B3 - D1.tif",
"V212-12 - P.tif",
"V212-12 - PD.tif",
"V2600-LW-7 -  27S5-1BM - D1.tif",
"V2600-LW-7 - D1.tif",
"V2600-LW-7 - D3.tif",
"V26R6-1A - D.tif",
"V26R6-1A - P.tif",
"V26R6-1AF - D.tif",
"V26R6-1AF - P.tif",
"Y98-1 - D1.tif"
);

var a4002=new Array(
"214-16G - D.tif",
"214-16G - P.tif",
"214-16GN - D.tif",
"214-16GN - P.tif",
"244-16G - D.tif",
"244-16G - P.tif",
"244-16GC - D.tif",
"244-16GC - P.tif",
"4002-D - D.tif",
"4002-D - P.tif",
"4002-G-1 - D.tif",
"4002-G-1 - P.tif",
"4002-H-2 - D.tif",
"4002-H-2 - P.tif",
"4002-N-3 - D.tif",
"4002-N-3 - P.tif",
"4002-N3-B - D.tif",
"4002-N3-B - P.tif",
"4002-O-1 - D.tif",
"4002-O-1 - P.tif",
"4002-SW-SS - D1.tif",
"4002-WB - D.tif",
"4002-WB - P.tif",
"40F28 - D.tif",
"40R12-1A - D.tif",
"40R12-1A - P.tif",
"40R17-1 - D.tif",
"40R17-1 - P.tif",
"40R18-1 - D.tif",
"40R18-1 - P.tif",
"40S39 - D1.tif",
"40S39 - D2.tif",
"40S39 - D3.tif",
"40S47-C - D.tif",
"40S47-C - P.tif",
"40S5-D - D.tif",
"40S5-D - P.tif",
"R4G-2 - D1.tif",
"R4G-2 - D2.tif",
"V50R3-1 - D.tif",
"V50R3-1 - P.tif"
);

var a50F=new Array(
"50E18 - D.tif",
"50E18 - P.tif",
"50E2 - D1.tif",
"50E2 - D2.tif",
"50E2 - D3.tif",
"50E20 - D.tif",
"50E20 - P.tif",
"50E21 - D.tif",
"50E21 - P.tif",
"50E21-W - D.tif",
"50E21-W - P.tif",
"50E60 - D.tif",
"50E60 - P.tif",
"50E70 - D.tif",
"50E70 - P.tif",
"50E80 - D.tif",
"50E82 - D.tif",
"50E90 - D.tif",
"50E90 - P.tif",
"50S12 - D.tif",
"V50R4-2-1AF - D.tif",
"V50R4-2-1AF - P.tif",
"50E80 - P.tif",
"50E82 - P.tif"
);

var a50F2=new Array(
"50E19 - D.tif",
"50E2 - D1.tif",
"50E61 - D.tif",
"50E7 - D.tif",
"50E7 - P.tif",
"50E71 - D.tif",
"50E8 - D.tif",
"50E8-WG - P.tif",
"50E81 - D.tif",
"50E83 - D.tif",
"50E91 - D.tif",
"V50R3 - D.tif",
"V50R3 - P.tif"
);

var a5F=new Array(
"5R16-1-1AA - D.tif",
"5R16-1-1AA - P.tif",
"5R16-2-1AA - D.tif",
"5R16-2-1AA - P.tif",
"5R2-3 - D.tif",
"5R2-3 - P.tif",
"5S1-A - D.tif",
"5S1-A - P.tif",
"5S15 - D.tif",
"5S15 - P.tif",
"5S27 - D.tif",
"5S27 - P.tif",
"5S3-2 - D1a.tif",
"5S3-2 - D1b.tif",
"5S3-2 - D2.tif",
"5S5-C - D.tif",
"5S5-C - P.tif",
"5S7-C - D.tif",
"5S7-C - P.tif",
"5S72-5-1AA - D1a.tif",
"5S72-5-1AA - D1b.tif",
"5S72-5-1AA - D2.tif",
"5S72-6-1AA - D1a.tif",
"5S72-6-1AA - D1b.tif",
"5S72-6-1AA - D2.tif",
"5S72-9-1AA - D1a.tif",
"5S72-9-1AA - D1b.tif",
"5S72-9-1AA - D2.tif",
"V212-12N - D.tif",
"V212-12N - P.tif",
"V905R2-1AF - D.tif",
"V905R2-1AF - P.tif",
"V905R3-1AF - D.tif",
"V905R3-1AF - P.tif",
"V905S05-1AF - D1a.tif",
"V905S05-1AF - D1b.tif",
"V905S05-1AF - D2.tif"

);

var a713F=new Array(
"713S..-.AE - D1.tif",
"713S..-.AE - D2.tif",
"713S..-.AE - P1.tif",
"713S..-.AE - P2.tif"
);

var a715F=new Array(
"715R02-1BP - D.tif",
"715R02-1BP - P.tif",
"715S12 - D.tif",
"715S12 - P.tif",
"715S13 - D.tif",
"715S13 - P.tif"
);

var a716F=new Array(
"716R02 - D.tif",
"716R02 - P.tif",
"716S12 - D.tif",
"716S12 - P.tif",
"716S13 - D.tif",
"716S13 - P.tif"
);

var a717F=new Array(
"717R01-1AF - D.tif",
"717R01-1AF - P.tif",
"717S01-1AF - D.tif",
"717S01-1AF - P.tif",
"717S01-2AF - D.tif",
"717S01-2AF - P.tif",
"717W01-1K - D1.tif",
"717W01-1K - D2.tif",
"717W02-1K - D1.tif",
"717W02-1K - D2.tif",
"717W03-1K - D1.tif",
"717W03-1K - D2.tif"
);

var a991F=new Array(
"991R2 - D.tif",
"991R2 - P.tif",
"991R3-1AF - D.tif",
"991R3-1AF - P.tif",
"991S01 - D.tif",
"991S01 - P.tif",
"991S02 - D.tif",
"991S02 - P.tif",
"991S03 - D.tif",
"991S03 - P.tif",
"991S05 - D.tif",
"991S05 - P.tif",
"991S2991 - D.tif",
"991S2991-AK - D.tif",
"991W03-1AF - D1.tif",
"991W03-1AF - D2.tif",
"991W03-1AF - D3.tif",
"991W04-1BP - D1.tif",
"991W04-1BP - D2.tif",
"991W04-1BP - D3.tif",
"pp1S30 - P.tif",
"991S2991 - P.tif"
);

var a99F=new Array(
"2600-SW - D1.tif",
"2600-SW - D2.tif",
"2600-SW - D3.tif",
"99E10-01 - P.tif",
"99N10-01A1 - D1.tif",
"99N10-01A1 - D2.tif",
"99R10-01A1 - D.tif",
"99R10-01A1 - P.tif",
"99S10-A1 - D.tif",
"99S10-A1 - P.tif",
"V2600-LW-7 - D1.tif",
"V2600-LW-7 - D2.tif"
);

var aV936F=new Array(
"V936S05-3-1AA - D.tif",
"V936S05-3-1AA - P.tif",
"V936S05-4-1AA - D.tif",
"V936S05-4-1AA - P.tif",
"V936S11-3-1AA - D.tif",
"V936S11-3-1AA - P.tif",
"V936S11-4-1AA - D.tif",
"V936S11-4-1AA - P.tif"
);

var aV964L=new Array(
"V964L01-1-1AG - D.tif",
"V964L01-1-1AG - P.tif",
"V964L01-1-2AG - D.tif",
"V964L01-1-2AG - P.tif",
"V964L01-2-1AG - D.tif",
"V964L01-2-1AG - P.tif"
);

var aV965L=new Array(
"V965L1-1R1AG - D.tif",
"V965L1-1R1AG - P.tif",
"V965L1-2R1AG - D.tif",
"V965L1-2R1AG - P.tif",
"V965L23-1R1AG - D.tif",
"V965L23-1R1AG - P.tif",
"V965L23-2R1AG - D.tif",
"V965L23-2R1AG - P.tif"
);


var inventorylatches=new Array(

"1429L","2368L","2939L","934L","95L","E2.03.00",
"E2.04.00","E2.08.00","E2.46.00","V18L","V46L","V917L",
"V951L","V96L");

var inventoryqt=new Array(

"15F","2600-2700","4002","50F","50F-2","5F",
"713F","715F","716F",
"717F","991F","99F",
"V936F","V964L","V965L"
);

var theArray;
var theFiles=new Array();
var counter=0;
var counter1=0;
var counter2=0;
var theNumber;
var theType;
var correctSerie=new Boolean();
correctSerie=false;
var correctNumber=new Boolean();
var search=document.forms[0].word.value.toUpperCase();
var results1=[];
var results2=[];
	document.write('<html>');
	document.write('<head>');
	document.write('<title>Results</title>');
	document.write('<script language="JavaScript" src="headers.js"></script>');
	document.write('<div id="main">');
	if(search.length<2) {
		alert('Please specify some more characters');
		return false;
	}
	
	correctNumber=false;
	correctSerie=false;
		
	
	/******************* als men correct partnummer geeft *******************/
	
	
	//controleer of opgave=correct partnumber
	for (var i=0;i<inventorylatches.length;i++) {
		
		var iserie=inventorylatches[i];
		if(iserie.substring(0,iserie.length)==search) {
			theSerie=search;
			theType="spannverschlusse";
			correctSerie=true;
			break;
		}
		else {
		theArray=getSerial(iserie);			
		for (var j=0;j<theArray.length;j++) {
			var temp=theArray[j];				
			var prefix=removeSuffix(temp);			
			
			if(prefix.substring(0,prefix.length)==search) {
				
				theNumber=prefix;
				theSerie=inventorylatches[i];
				theType="spannverschlusse";
				//bepaal hoeveel en welke files moeten gedownload worden
				theFiles[counter]=theArray[j];				
				counter++;
				correctNumber=true;
				//break;
			}
			//if (correctNumber) break;
		}
		if (correctNumber) break;
		}		
	}
	
	if(!correctNumber) {
		for (var s=0;s<inventoryqt.length;s++) {
			var iserie=inventoryqt[s];
			if(iserie.substring(0,iserie.length)==search) {
				theSerie=search;
				theType="vierteldrehverschlusse";
				correctSerie=true;
				break;
			}
			else {
			theArray=getSerial(iserie);	
			for (var t=0;t<theArray.length;t++) {
				var temp=theArray[t];				
				var prefix=removeSuffix(temp);			
				
				if(prefix.substring(0,prefix.length)==search) {
					
					theNumber=prefix;
					theSerie=inventoryqt[s];
					theType="vierteldrehverschlusse";
					//bepaal hoeveel en welke files moeten gedownload worden
					theFiles[counter]=theArray[t];				
					counter++;
					correctNumber=true;
					//break;
				}
				//if (correctNumber) break;
			}
			if (correctNumber) break;
			}
		}		
	}
	
	
	if (correctNumber&&!correctSerie) {
		//document.write(theFiles.length);
		//document.write(' files are downloading. Please be patient. <br/>When finished, <a href="search.html">go back</a>');	
		//downloadFiles(theType, theSerie, theFiles);
		//var inventory=new Array("appel","peer","banaan", "kerktoren", "kerkje");
				
		
		location.replace("formresults.html?type="+theType+"&serie="+theSerie+"&array="+theNumber);
			
	}
	
	else if (correctSerie&&!correctNumber) {
		var place="specifynumber.html?serie="+theSerie;
		location.replace(place);
		
		
	}
	else {		
		var flag=new Boolean();
		var substr=new String();           
		flag=false;
	
		var counter1=0;
		var counter2=0;
	
		if (search.length==2) search=search+"àà";
		if (search.length==3) search=search+"à"; //stuff the criterium with extra spaces to refine the search
		
		//var inventory=new Array("appel","peer","banaan", "kerktoren", "kerkje");
	
		
		/********************matching geeft ergens een fout!!***************************************/
		
		for (var i=0;i<inventorylatches.length;i++) {
			if (matching(inventorylatches[i],search)) {
				counter1++;
				results1.push(inventorylatches[i]);
			}
	  	}
		for (var i=0;i<inventoryqt.length;i++) {
			if (matching(inventoryqt[i],search)) {
				counter2++;
				results2.push(inventoryqt[i]);
			}
	  	}
	  	/*
	  	document.write("The number you specified could not be found. Please choose one from the list below:")
	  	
  		for (var i=0;i<theSerie.length;i++) {			
				counter1++;
				results1.push(theSerie[i]);			
  		}
	  	
	*/
		if ((counter1+counter2)==0) document.write("<h2>No matches found</h2>");
		else {
			document.write("<h2>Series found: "+(counter1+counter2)+"</h2>");
			document.write("The number you specified could not be found. Please choose a serie below:<br/>");
			document.write("<ul>");
			for (var j=0;j<counter1;j++) {
				var place="specifynumber.html?serie="+results1[j];
				document.write("<li><a href=\""+place+"\">"+results1[j]+"</a></li>");
	
			}
			for (var j=0;j<counter2;j++) {
				var place="specifynumber.html?serie="+results2[j];
				document.write("<li><a href=\""+place+"\">"+results2[j]+"</a></li>");
			}
			document.write("</ul>");
		
		}
		document.write('<br/><br/>If the serie you are looking for is not in the list, please <a href="search.html">search again</a>');
	
	}
		
	document.write("</div>");
	document.write('</body>');
	document.write('</html>');
	return true;
}
function processNumber() {
	var a1429L=new Array(
"1429L02-1 - P.tif",
"1429L02-1X1 - D.tif",
"1429L02-1X1 - P.tif",
"1429L02-2 - D.tif",
"1429L02-2 - P.tif",
"1429L02-2X1 - D.tif",
"1429L02-2X1 - P.tif",
"1429L02-3 - D.tif",
"1429L02-3 - P.tif",
"1429L02-3X1 - D.tif",
"1429L02-3X1 - P.tif",
"1429L8 - D.tif",
"1429L8 - P.tif",
"1429L9 - D.tif",
"1429L9 - P.tif",
"1429L02-1 - D.tif"
);

var a2368L=new Array(
"2368L02-1AF - P.tif",
"2368LF1 - D.tif",
"2368L02-1AF - D.tif",
"2368L01-1AF - P.tif"
);

var a2939L=new Array(
"2939L01 - D.tif",
"2939L01 - D2.tif",
"2939L01 - P.tif"
);

var a934L=new Array(
"V934L01 - D.tif",
"V934L01-1-1BP - P.tif",
"V934L01-1X1 - D.tif",
"V934L01-1Xx1AF - P.tif",
"V934L02-1BP - D.tif",
"V934L02-1BP - P.tif"
);

var a95L=new Array(
"95H07 - D.tif",
"95H07 - P.tif",
"95L01 - D.tif",
"95L01 - P.tif",
"95L07 - D.tif",
"95L07 - P.tif"
);

var aE20300=new Array(
"E2.03.00...5 - D.tif",
"E2.03.00...5 - P.tif",
"E2.03.00...6 - D.tif",
"E2.03.00...6 - P.tif",
"E2.03.01...6 - D.tif",
"E2.03.01...6 - P.tif"
);

var aE20400=new Array(
"E2.04.00...5 - D.tif",
"E2.04.00...5 - P.tif",
"E2.04.00...6 - D.tif",
"E2.04.00...6 - P.tif"
);

var aE20800=new Array(
"E2.08.00 - D.tif",
"E2.08.00 - P.tif"
);

var aE24600=new Array(
"E2.46.00...5 - D.tif",
"E2.46.00...5 - P.tif",
"E2.46.00...6 - D.tif",
"E2.46.00...6 - P.tif"
);

var aV18L=new Array(
"1449L07 - D.tif",
"1449L07 - P.tif",
"ECL642.00 - D.tif",
"ECL642.00 - P.tif",
"V18L01-1 - D.tif",
"V18L01-1 - P.tif",
"V18L01-1X - P.tif",
"V18L01-1Y - D.tif",
"V18L01-1Y - P.tif",
"V18L13-1 - D.tif",
"V18L13-1 - P.tif",
"V18L45-1BP - D.tif",
"V18L13-1-2AH -D.tif",
"V18L13-2-3AC -D.tif"
);

var aV46L=new Array(
"V18L13-1-2AH - P.tif",
"V18L13-2-3AC - P.tif",
"V46L38-1-1AA - P.tif",
"V46L38-1-6AA - P.tif",
"V46L38-1-1AA - D.tif",
"V46L38-1-6AA - D.tif"
);

var aV917L=new Array(
"1449L02-1X - D.tif",
"1449L02-1X - P.tif",
"V17L12-2X - D.tif",
"V17L12-2X - P.tif",
"V917L01-1 - D.tif",
"V917L01-1 - P.tif",
"V917L01-1X - D.tif",
"V917L01-1X - P.tif",
"V917L01-1Y - D.tif",
"V917L01-1Y - P.tif",
"V917L11-1 - D.tif",
"V917L11-1 - P.tif",
"V917L12-1 - D.tif",
"V917L12-1 - P.tif",
"V951L50 - D.tif",
"V951L50 - P.tif"
);

var aV951L=new Array(
"V951L01-1Y - D.tif",
"V951L01-1Y - P.tif",
"V951L02-1 - D.tif",
"V951L02-1 - P.tif",
"V951L03-1 - D.tif",
"V951L03-1 - P.tif",
"V951L03-1X - D.tif",
"V951L03-1X - P.tif",
"V951L04-1X - D.tif",
"V951L04-1X - P.tif",
"V951L05-1X - D.tif",
"V951L05-1X - P.tif",
"V951L50 - D.tif",
"V951L50 - P.tif",
"V951L52 - D.tif",
"V951L52 - P.tif",
"V951L7 - D.tif",
"V951L7 - P.tif"
);

var aV96L=new Array(
"V95H01 - D.tif",
"V95H01 - P.tif",
"V95L01 - D.tif",
"V95L01 - P.tif"
);

var a15F=new Array(
"15S1-.-1AD - D.tif",
"15S1-.-1AD - P.tif",
"15S11-1CJ - D1.tif",
"15S11-1CJ - D2.tif",
"15S11-1CJ - D3.tif",
"T107-1 - D.tif",
"V15R13-1-1AB - D.tif",
"V15R13-1-1AB - P.tif",
"V15R14-1-1AB - D1.tif",
"V15R14-1-1AB - D2.tif"
);

var a26002700L=new Array(
"312-12 - P.tif",
"99E10-01 - D1.tif",
"99E10-01 - P1.tif",
"99N10-01A1 - D1.tif",
"99N10-01A1 - D2.tif",
"V2600-LW-7 - D2.tif",
"2600-SW - D1.tif",
"2600-sw - d3.tif",
"26R1-1 - D.tif",
"2600-SW - D2.tif",
"26R1-1 - P.tif",
"27S5-1BM - D1.tif",
"312-12 - D.tif",
"4P3 - D1.tif",
"99R10-01A1 - D1.tif",
"99R10-01A1 - P1.tif",
"AN6227-B6 -B3 - D1.tif",
"V212-12 - P.tif",
"V212-12 - PD.tif",
"V2600-LW-7 -  27S5-1BM - D1.tif",
"V2600-LW-7 - D1.tif",
"V2600-LW-7 - D3.tif",
"V26R6-1A - D.tif",
"V26R6-1A - P.tif",
"V26R6-1AF - D.tif",
"V26R6-1AF - P.tif",
"Y98-1 - D1.tif"
);

var a4002=new Array(
"214-16G - D.tif",
"214-16G - P.tif",
"214-16GN - D.tif",
"214-16GN - P.tif",
"244-16G - D.tif",
"244-16G - P.tif",
"244-16GC - D.tif",
"244-16GC - P.tif",
"4002-D - D.tif",
"4002-D - P.tif",
"4002-G-1 - D.tif",
"4002-G-1 - P.tif",
"4002-H-2 - D.tif",
"4002-H-2 - P.tif",
"4002-N-3 - D.tif",
"4002-N-3 - P.tif",
"4002-N3-B - D.tif",
"4002-N3-B - P.tif",
"4002-O-1 - D.tif",
"4002-O-1 - P.tif",
"4002-SW-SS - D1.tif",
"4002-WB - D.tif",
"4002-WB - P.tif",
"40F28 - D.tif",
"40R12-1A - D.tif",
"40R12-1A - P.tif",
"40R17-1 - D.tif",
"40R17-1 - P.tif",
"40R18-1 - D.tif",
"40R18-1 - P.tif",
"40S39 - D1.tif",
"40S39 - D2.tif",
"40S39 - D3.tif",
"40S47-C - D.tif",
"40S47-C - P.tif",
"40S5-D - D.tif",
"40S5-D - P.tif",
"R4G-2 - D1.tif",
"R4G-2 - D2.tif",
"V50R3-1 - D.tif",
"V50R3-1 - P.tif"
);

var a50F=new Array(
"50E18 - D.tif",
"50E18 - P.tif",
"50E2 - D1.tif",
"50E2 - D2.tif",
"50E2 - D3.tif",
"50E20 - D.tif",
"50E20 - P.tif",
"50E21 - D.tif",
"50E21 - P.tif",
"50E21-W - D.tif",
"50E21-W - P.tif",
"50E60 - D.tif",
"50E60 - P.tif",
"50E70 - D.tif",
"50E70 - P.tif",
"50E80 - D.tif",
"50E82 - D.tif",
"50E90 - D.tif",
"50E90 - P.tif",
"50S12 - D.tif",
"V50R4-2-1AF - D.tif",
"V50R4-2-1AF - P.tif",
"50E80 - P.tif",
"50E82 - P.tif"
);

var a50F2=new Array(
"50E19 - D.tif",
"50E2 - D1.tif",
"50E61 - D.tif",
"50E7 - D.tif",
"50E7 - P.tif",
"50E71 - D.tif",
"50E8 - D.tif",
"50E8-WG - P.tif",
"50E81 - D.tif",
"50E83 - D.tif",
"50E91 - D.tif",
"V50R3 - D.tif",
"V50R3 - P.tif"
);

var a5F=new Array(
"5R16-1-1AA - D.tif",
"5R16-1-1AA - P.tif",
"5R16-2-1AA - D.tif",
"5R16-2-1AA - P.tif",
"5R2-3 - D.tif",
"5R2-3 - P.tif",
"5S1-A - D.tif",
"5S1-A - P.tif",
"5S15 - D.tif",
"5S15 - P.tif",
"5S27 - D.tif",
"5S27 - P.tif",
"5S3-2 - D1a.tif",
"5S3-2 - D1b.tif",
"5S3-2 - D2.tif",
"5S5-C - D.tif",
"5S5-C - P.tif",
"5S7-C - D.tif",
"5S7-C - P.tif",
"5S72-5-1AA - D1a.tif",
"5S72-5-1AA - D1b.tif",
"5S72-5-1AA - D2.tif",
"5S72-6-1AA - D1a.tif",
"5S72-6-1AA - D1b.tif",
"5S72-6-1AA - D2.tif",
"5S72-9-1AA - D1a.tif",
"5S72-9-1AA - D1b.tif",
"5S72-9-1AA - D2.tif",
"V212-12N - D.tif",
"V212-12N - P.tif",
"V905R2-1AF - D.tif",
"V905R2-1AF - P.tif",
"V905R3-1AF - D.tif",
"V905R3-1AF - P.tif",
"V905S05-1AF - D1a.tif",
"V905S05-1AF - D1b.tif",
"V905S05-1AF - D2.tif"

);

var a713F=new Array(
"713S..-.AE - D1.tif",
"713S..-.AE - D2.tif",
"713S..-.AE - P1.tif",
"713S..-.AE - P2.tif"
);

var a715F=new Array(
"715R02-1BP - D.tif",
"715R02-1BP - P.tif",
"715S12 - D.tif",
"715S12 - P.tif",
"715S13 - D.tif",
"715S13 - P.tif"
);

var a716F=new Array(
"716R02 - D.tif",
"716R02 - P.tif",
"716S12 - D.tif",
"716S12 - P.tif",
"716S13 - D.tif",
"716S13 - P.tif"
);

var a717F=new Array(
"717R01-1AF - D.tif",
"717R01-1AF - P.tif",
"717S01-1AF - D.tif",
"717S01-1AF - P.tif",
"717S01-2AF - D.tif",
"717S01-2AF - P.tif",
"717W01-1K - D1.tif",
"717W01-1K - D2.tif",
"717W02-1K - D1.tif",
"717W02-1K - D2.tif",
"717W03-1K - D1.tif",
"717W03-1K - D2.tif"
);

var a991F=new Array(
"991R2 - D.tif",
"991R2 - P.tif",
"991R3-1AF - D.tif",
"991R3-1AF - P.tif",
"991S01 - D.tif",
"991S01 - P.tif",
"991S02 - D.tif",
"991S02 - P.tif",
"991S03 - D.tif",
"991S03 - P.tif",
"991S05 - D.tif",
"991S05 - P.tif",
"991S2991 - D.tif",
"991S2991-AK - D.tif",
"991W03-1AF - D1.tif",
"991W03-1AF - D2.tif",
"991W03-1AF - D3.tif",
"991W04-1BP - D1.tif",
"991W04-1BP - D2.tif",
"991W04-1BP - D3.tif",
"pp1S30 - P.tif",
"991S2991 - P.tif"
);

var a99F=new Array(
"2600-SW - D1.tif",
"2600-SW - D2.tif",
"2600-SW - D3.tif",
"99E10-01 - P.tif",
"99N10-01A1 - D1.tif",
"99N10-01A1 - D2.tif",
"99R10-01A1 - D.tif",
"99R10-01A1 - P.tif",
"99S10-A1 - D.tif",
"99S10-A1 - P.tif",
"V2600-LW-7 - D1.tif",
"V2600-LW-7 - D2.tif"
);

var aV936F=new Array(
"V936S05-3-1AA - D.tif",
"V936S05-3-1AA - P.tif",
"V936S05-4-1AA - D.tif",
"V936S05-4-1AA - P.tif",
"V936S11-3-1AA - D.tif",
"V936S11-3-1AA - P.tif",
"V936S11-4-1AA - D.tif",
"V936S11-4-1AA - P.tif"
);

var aV964L=new Array(
"V964L01-1-1AG - D.tif",
"V964L01-1-1AG - P.tif",
"V964L01-1-2AG - D.tif",
"V964L01-1-2AG - P.tif",
"V964L01-2-1AG - D.tif",
"V964L01-2-1AG - P.tif"
);

var aV965L=new Array(
"V965L1-1R1AG - D.tif",
"V965L1-1R1AG - P.tif",
"V965L1-2R1AG - D.tif",
"V965L1-2R1AG - P.tif",
"V965L23-1R1AG - D.tif",
"V965L23-1R1AG - P.tif",
"V965L23-2R1AG - D.tif",
"V965L23-2R1AG - P.tif"
);


var inventorylatches=new Array(

"1429L","2368L","2939L","934L","95L","E2.03.00",
"E2.04.00","E2.08.00","E2.46.00","V18L","V46L","V917L",
"V951L","V96L");

var inventoryqt=new Array(

"15F","2600-2700","4002","50F","50F-2","5F",
"713F","715F","716F",
"717F","991F","99F",
"V936F","V964L","V965L"
);
	var theArray;
	var theFiles=new Array();
	var counter=0;
	var counter1=0;
	var counter2=0;
	var theNumber;
	var theSerie=getSerie().toUpperCase();
	var theType;
	var correctSerie=new Boolean();
	correctSerie=false;
	var correctNumber=new Boolean();
	var search=getNumber().toUpperCase();
	var results1=[];
	var results2=[];
	if(search.length<2) {
		alert('Please specify some more characters');
		return false;
	}
	
	correctNumber=false;
	correctSerie=false;
		
	
	/******************* als men correct partnummer geeft *******************/
	
	
	
	//controleer of opgave=correct partnumber
	for (var i=0;i<inventorylatches.length;i++) {
		
		var iserie=inventorylatches[i];
		if(iserie.substring(0,iserie.length)==search) {
			theSerie=search;
			theType="spannverschlusse";
			correctSerie=true;
			break;
		}
		else {
		theArray=getSerial(iserie);			
		for (var j=0;j<theArray.length;j++) {
			var temp=theArray[j];				
			var prefix=removeSuffix(temp);			
			
			if(prefix.substring(0,prefix.length)==search) {
				
				theNumber=prefix;
				theSerie=inventorylatches[i];
				theType="spannverschlusse";
				//bepaal hoeveel en welke files moeten gedownload worden
				theFiles[counter]=theArray[j];				
				counter++;
				correctNumber=true;
				//break;
			}
			//if (correctNumber) break;
		}
		if (correctNumber) break;
		}		
	}
	
	if(!correctNumber) {
		for (var s=0;s<inventoryqt.length;s++) {
			var iserie=inventoryqt[s];
			if(iserie.substring(0,iserie.length)==search) {
				theSerie=search;
				theType="vierteldrehverschlusse";
				correctSerie=true;
				break;
			}
			else {
			theArray=getSerial(iserie);	
			for (var t=0;t<theArray.length;t++) {
				var temp=theArray[t];				
				var prefix=removeSuffix(temp);			
				
				if(prefix.substring(0,prefix.length)==search) {
					
					theNumber=prefix;
					theSerie=inventoryqt[s];
					theType="vierteldrehverschlusse";
					//bepaal hoeveel en welke files moeten gedownload worden
					theFiles[counter]=theArray[t];				
					counter++;
					correctNumber=true;
					//break;
				}
				//if (correctNumber) break;
			}
			if (correctNumber) break;
			}
		}		
	}
	
	
	if (correctNumber) {
		//downloadFiles(theType, theSerie, theFiles);			
		location.replace("formresults.html?type="+theType+"&serie="+theSerie+"&array="+theNumber);
	
	}
	
	else {
		var flag=new Boolean();
		var substr=new String();
		
		var theType="";
		var theFiles=new Array();           
		flag=false;
	
		var counter1=0;
		var counter2=0;
	
		if (search.length==2) search=search+"àà";
		if (search.length==3) search=search+"à"; //stuff the criterium with extra spaces to refine the search
		
		//var inventory=new Array("appel","peer","banaan", "kerktoren", "kerkje");
		for (var i=0;i<inventorylatches.length;i++) {
		
			var iserie=inventorylatches[i];
			if(iserie.substring(0,iserie.length)==theSerie) {				
				theType="spannverschlusse";				
				break;
			}
		}
		if(theType=="") {
			for (var i=0;i<inventoryqt.length;i++) {			
				var iserie=inventoryqt[i];
				if(iserie.substring(0,iserie.length)==theSerie) {
					
					theType="vierteldrehverschlusse";				
					break;
				}
			}
		}
		
		//show numbers for the serie that resemble the search criterium
		/*********matching geeft ergens een fout *************/
		/*
		for (var i=0;i<theSerie.length;i++) {
			if (matching(theSerie[i],search)) {
				counter1++;
				results1.push(theSerie[i]);
			}
	  	}*/
	  	var series=getSerial(theSerie);
	  	/*
	  	alert(series);
	  	for (var i=0;i<series.length;i++) {			
				counter1++;
				results1.push(theSerie[i]);			
  		}
		*/
		counter1=series.length;
		var files=[];
		var already=new Boolean();
		already=false;
		if (counter1==0) document.write("<h2>No matches found</h2>");
		else {
			
			for (var j=0;j<counter1;j++) {
				//var place="specifynumber.html?serie="+results1[j];
				var temp=series[j];				
				//var prefix=removeSuffix(temp);			
				for(var k=0;k<files.length;k++) {
					if(files[k]==removeSuffix(temp)) {
						already=true
					}
					
				}
				if(!already) files.push(removeSuffix(temp));
				already=false;
				//document.write("<li><a href=\""+"\">"+results1[j]+" onClick=\" return downloadFiles("+theType+", "+theSerie+", "+results1+");\"</a></li>");
	
			}
			document.write("<h2>Results found: "+(files.length)+"</h2>");
			document.write("The number you specified could not be found. Please make your choice between the available partnumbers for this serie:");
		
			document.write("<ul>");
			for(var i=0;i<files.length;i++) {
				document.write("<li><a href=\"formresults.html?type="+theType+"&serie="+theSerie+"&array="+files[i]+"\">"+files[i]+"</a></li>");
			}
				
			document.write("</ul>");
		
		}
		
		
		
	}

return true;
}

function downloadFiles(type, serie, filearray) {
	document.write(filearray.length);
	document.write(' files should start downloading.<br/><br/> If not, please click <ul>');
	var alP=new Boolean();
		var alD=new Boolean();
		var d=0;
		var p=0;
		alP=false;	
		alD=false;
	
		
	for(var i=0;i<filearray.length;i++) {
		
		var file1="http://www.freewebtown.com/anemo_eng/"+type+"/Serie%20"+serie+"/"+filearray[i];
		//alert(file1);
		window.open(file1, 'myWin'+i, 'status, width=50, height=50, screenX='+(50*i)+',screenY=550,left='+(50*i)+',top=550');
document.write('<li><a href="'+file1+'">here</a>');
if(getDP(file1)=='D') {
	
	d++; //ANDERE NAAM!!
	if(!alD) { 
		document.write(' for the drawing' );		
	}
	
	else {
		
		switch(d) {
		case 1: document.write(' for the 1st drawing' );
		break;
		case 2: document.write(' for the 2nd drawing' );
		break;
		case 3: document.write(' for the 3rd drawing' );
		break;
		default: document.write(' for the '+d+'th drawing' );
		
		}
	}
	alD=true;
	

}
else if (getDP(file1)=='P') {
	
	p++;
	if(!alP) {
		document.write(' for the picture' );
		
	}
	else {
		
		switch(p) {
		case 1: document.write(' for the 1st picture' );
		break;
		case 2: document.write(' for the 2nd picture' );
		break;
		case 3: document.write(' for the 3rd picture' );
		break;
		default: document.write(' for the '+p+'th picture' );
		
		}
	}
	alP=true;
	
}
else {};

if(i!=filearray.length-1) {
document.write(' and</li> ');
}


	}
document.write('.</ul><br/><br/>When finished, <a href="search.html">go back</a>.');
	//document.Write('choose "Save target as"');
//	mw2=window.open(file2, 'myWin2', 'status, width=50, height=50, 				screenX=100,screenY=550,left=100,top=550');
//alP=false;	
//		alD=false;
//i=0;
//j=0;
return false;
}

function getDP(file) {
var components=file.split(".");
	
	var naam='';
	
	if (components.length>1) {
		var type=components[components.length-2].split(" ");
		if (type[type.length-1].substring(0,1)=='D')
			naam='D';
		else if (type[type.length-1].substring(0,1)=='P')
			naam='P';
		else naam='';
	}
	else {
		
	}

	return naam;
}
/*
function download(type, serie, filearray) {
	
	for(var i=0;i<filearray.length;i++) {	
		var file1="http://www.freewebtown.com/anemo_eng/"+type+"/Serie%20"+serie+"/"+filearray[i];
		//alert(file1);
		window.open(file1, 'myWin'+i, 'status, width=50, height=50, screenX='+(50*i)+',screenY=550,left='+(50*i)+',top=550');
	}
//	mw2=window.open(file2, 'myWin2', 'status, width=50, height=50, 				screenX=100,screenY=550,left=100,top=550');

return false;
}*/

function getSerial(search) {
	var theArray=new Array();
	
	var a1429L=new Array(
"1429L02-1 - P.tif",
"1429L02-1X1 - D.tif",
"1429L02-1X1 - P.tif",
"1429L02-2 - D.tif",
"1429L02-2 - P.tif",
"1429L02-2X1 - D.tif",
"1429L02-2X1 - P.tif",
"1429L02-3 - D.tif",
"1429L02-3 - P.tif",
"1429L02-3X1 - D.tif",
"1429L02-3X1 - P.tif",
"1429L8 - D.tif",
"1429L8 - P.tif",
"1429L9 - D.tif",
"1429L9 - P.tif",
"1429L02-1 - D.tif"
);

var a2368L=new Array(
"2368L02-1AF - P.tif",
"2368LF1 - D.tif",
"2368L02-1AF - D.tif",
"2368L01-1AF - P.tif"
);

var a2939L=new Array(
"2939L01 - D.tif",
"2939L01 - D2.tif",
"2939L01 - P.tif"
);

var a934L=new Array(
"V934L01 - D.tif",
"V934L01-1-1BP - P.tif",
"V934L01-1X1 - D.tif",
"V934L01-1Xx1AF - P.tif",
"V934L02-1BP - D.tif",
"V934L02-1BP - P.tif"
);

var a95L=new Array(
"95H07 - D.tif",
"95H07 - P.tif",
"95L01 - D.tif",
"95L01 - P.tif",
"95L07 - D.tif",
"95L07 - P.tif"
);

var aE20300=new Array(
"E2.03.00...5 - D.tif",
"E2.03.00...5 - P.tif",
"E2.03.00...6 - D.tif",
"E2.03.00...6 - P.tif",
"E2.03.01...6 - D.tif",
"E2.03.01...6 - P.tif"
);

var aE20400=new Array(
"E2.04.00...5 - D.tif",
"E2.04.00...5 - P.tif",
"E2.04.00...6 - D.tif",
"E2.04.00...6 - P.tif"
);

var aE20800=new Array(
"E2.08.00 - D.tif",
"E2.08.00 - P.tif"
);

var aE24600=new Array(
"E2.46.00...5 - D.tif",
"E2.46.00...5 - P.tif",
"E2.46.00...6 - D.tif",
"E2.46.00...6 - P.tif"
);

var aV18L=new Array(
"1449L07 - D.tif",
"1449L07 - P.tif",
"ECL642.00 - D.tif",
"ECL642.00 - P.tif",
"V18L01-1 - D.tif",
"V18L01-1 - P.tif",
"V18L01-1X - P.tif",
"V18L01-1Y - D.tif",
"V18L01-1Y - P.tif",
"V18L13-1 - D.tif",
"V18L13-1 - P.tif",
"V18L45-1BP - D.tif",
"V18L13-1-2AH -D.tif",
"V18L13-2-3AC -D.tif"
);

var aV46L=new Array(
"V18L13-1-2AH - P.tif",
"V18L13-2-3AC - P.tif",
"V46L38-1-1AA - P.tif",
"V46L38-1-6AA - P.tif",
"V46L38-1-1AA - D.tif",
"V46L38-1-6AA - D.tif"
);

var aV917L=new Array(
"1449L02-1X - D.tif",
"1449L02-1X - P.tif",
"V17L12-2X - D.tif",
"V17L12-2X - P.tif",
"V917L01-1 - D.tif",
"V917L01-1 - P.tif",
"V917L01-1X - D.tif",
"V917L01-1X - P.tif",
"V917L01-1Y - D.tif",
"V917L01-1Y - P.tif",
"V917L11-1 - D.tif",
"V917L11-1 - P.tif",
"V917L12-1 - D.tif",
"V917L12-1 - P.tif",
"V951L50 - D.tif",
"V951L50 - P.tif"
);

var aV951L=new Array(
"V951L01-1Y - D.tif",
"V951L01-1Y - P.tif",
"V951L02-1 - D.tif",
"V951L02-1 - P.tif",
"V951L03-1 - D.tif",
"V951L03-1 - P.tif",
"V951L03-1X - D.tif",
"V951L03-1X - P.tif",
"V951L04-1X - D.tif",
"V951L04-1X - P.tif",
"V951L05-1X - D.tif",
"V951L05-1X - P.tif",
"V951L50 - D.tif",
"V951L50 - P.tif",
"V951L52 - D.tif",
"V951L52 - P.tif",
"V951L7 - D.tif",
"V951L7 - P.tif"
);

var aV96L=new Array(
"V95H01 - D.tif",
"V95H01 - P.tif",
"V95L01 - D.tif",
"V95L01 - P.tif"
);

var a15F=new Array(
"15S1-.-1AD - D.tif",
"15S1-.-1AD - P.tif",
"15S11-1CJ - D1.tif",
"15S11-1CJ - D2.tif",
"15S11-1CJ - D3.tif",
"T107-1 - D.tif",
"V15R13-1-1AB - D.tif",
"V15R13-1-1AB - P.tif",
"V15R14-1-1AB - D1.tif",
"V15R14-1-1AB - D2.tif"
);

var a26002700L=new Array(
"312-12 - P.tif",
"99E10-01 - D1.tif",
"99E10-01 - P1.tif",
"99N10-01A1 - D1.tif",
"99N10-01A1 - D2.tif",
"V2600-LW-7 - D2.tif",
"2600-SW - D1.tif",
"2600-sw - d3.tif",
"26R1-1 - D.tif",
"2600-SW - D2.tif",
"26R1-1 - P.tif",
"27S5-1BM - D1.tif",
"312-12 - D.tif",
"4P3 - D1.tif",
"99R10-01A1 - D1.tif",
"99R10-01A1 - P1.tif",
"AN6227-B6 -B3 - D1.tif",
"V212-12 - P.tif",
"V212-12 - PD.tif",
"V2600-LW-7 -  27S5-1BM - D1.tif",
"V2600-LW-7 - D1.tif",
"V2600-LW-7 - D3.tif",
"V26R6-1A - D.tif",
"V26R6-1A - P.tif",
"V26R6-1AF - D.tif",
"V26R6-1AF - P.tif",
"Y98-1 - D1.tif"
);

var a4002=new Array(
"214-16G - D.tif",
"214-16G - P.tif",
"214-16GN - D.tif",
"214-16GN - P.tif",
"244-16G - D.tif",
"244-16G - P.tif",
"244-16GC - D.tif",
"244-16GC - P.tif",
"4002-D - D.tif",
"4002-D - P.tif",
"4002-G-1 - D.tif",
"4002-G-1 - P.tif",
"4002-H-2 - D.tif",
"4002-H-2 - P.tif",
"4002-N-3 - D.tif",
"4002-N-3 - P.tif",
"4002-N3-B - D.tif",
"4002-N3-B - P.tif",
"4002-O-1 - D.tif",
"4002-O-1 - P.tif",
"4002-SW-SS - D1.tif",
"4002-WB - D.tif",
"4002-WB - P.tif",
"40F28 - D.tif",
"40R12-1A - D.tif",
"40R12-1A - P.tif",
"40R17-1 - D.tif",
"40R17-1 - P.tif",
"40R18-1 - D.tif",
"40R18-1 - P.tif",
"40S39 - D1.tif",
"40S39 - D2.tif",
"40S39 - D3.tif",
"40S47-C - D.tif",
"40S47-C - P.tif",
"40S5-D - D.tif",
"40S5-D - P.tif",
"R4G-2 - D1.tif",
"R4G-2 - D2.tif",
"V50R3-1 - D.tif",
"V50R3-1 - P.tif"
);

var a50F=new Array(
"50E18 - D.tif",
"50E18 - P.tif",
"50E2 - D1.tif",
"50E2 - D2.tif",
"50E2 - D3.tif",
"50E20 - D.tif",
"50E20 - P.tif",
"50E21 - D.tif",
"50E21 - P.tif",
"50E21-W - D.tif",
"50E21-W - P.tif",
"50E60 - D.tif",
"50E60 - P.tif",
"50E70 - D.tif",
"50E70 - P.tif",
"50E80 - D.tif",
"50E82 - D.tif",
"50E90 - D.tif",
"50E90 - P.tif",
"50S12 - D.tif",
"V50R4-2-1AF - D.tif",
"V50R4-2-1AF - P.tif",
"50E80 - P.tif",
"50E82 - P.tif"
);

var a50F2=new Array(
"50E19 - D.tif",
"50E2 - D1.tif",
"50E61 - D.tif",
"50E7 - D.tif",
"50E7 - P.tif",
"50E71 - D.tif",
"50E8 - D.tif",
"50E8-WG - P.tif",
"50E81 - D.tif",
"50E83 - D.tif",
"50E91 - D.tif",
"V50R3 - D.tif",
"V50R3 - P.tif"
);

var a5F=new Array(
"5R16-1-1AA - D.tif",
"5R16-1-1AA - P.tif",
"5R16-2-1AA - D.tif",
"5R16-2-1AA - P.tif",
"5R2-3 - D.tif",
"5R2-3 - P.tif",
"5S1-A - D.tif",
"5S1-A - P.tif",
"5S15 - D.tif",
"5S15 - P.tif",
"5S27 - D.tif",
"5S27 - P.tif",
"5S3-2 - D1a.tif",
"5S3-2 - D1b.tif",
"5S3-2 - D2.tif",
"5S5-C - D.tif",
"5S5-C - P.tif",
"5S7-C - D.tif",
"5S7-C - P.tif",
"5S72-5-1AA - D1a.tif",
"5S72-5-1AA - D1b.tif",
"5S72-5-1AA - D2.tif",
"5S72-6-1AA - D1a.tif",
"5S72-6-1AA - D1b.tif",
"5S72-6-1AA - D2.tif",
"5S72-9-1AA - D1a.tif",
"5S72-9-1AA - D1b.tif",
"5S72-9-1AA - D2.tif",
"V212-12N - D.tif",
"V212-12N - P.tif",
"V905R2-1AF - D.tif",
"V905R2-1AF - P.tif",
"V905R3-1AF - D.tif",
"V905R3-1AF - P.tif",
"V905S05-1AF - D1a.tif",
"V905S05-1AF - D1b.tif",
"V905S05-1AF - D2.tif"

);

var a713F=new Array(
"713S..-.AE - D1.tif",
"713S..-.AE - D2.tif",
"713S..-.AE - P1.tif",
"713S..-.AE - P2.tif"
);

var a715F=new Array(
"715R02-1BP - D.tif",
"715R02-1BP - P.tif",
"715S12 - D.tif",
"715S12 - P.tif",
"715S13 - D.tif",
"715S13 - P.tif"
);

var a716F=new Array(
"716R02 - D.tif",
"716R02 - P.tif",
"716S12 - D.tif",
"716S12 - P.tif",
"716S13 - D.tif",
"716S13 - P.tif"
);

var a717F=new Array(
"717R01-1AF - D.tif",
"717R01-1AF - P.tif",
"717S01-1AF - D.tif",
"717S01-1AF - P.tif",
"717S01-2AF - D.tif",
"717S01-2AF - P.tif",
"717W01-1K - D1.tif",
"717W01-1K - D2.tif",
"717W02-1K - D1.tif",
"717W02-1K - D2.tif",
"717W03-1K - D1.tif",
"717W03-1K - D2.tif"
);

var a991F=new Array(
"991R2 - D.tif",
"991R2 - P.tif",
"991R3-1AF - D.tif",
"991R3-1AF - P.tif",
"991S01 - D.tif",
"991S01 - P.tif",
"991S02 - D.tif",
"991S02 - P.tif",
"991S03 - D.tif",
"991S03 - P.tif",
"991S05 - D.tif",
"991S05 - P.tif",
"991S2991 - D.tif",
"991S2991-AK - D.tif",
"991W03-1AF - D1.tif",
"991W03-1AF - D2.tif",
"991W03-1AF - D3.tif",
"991W04-1BP - D1.tif",
"991W04-1BP - D2.tif",
"991W04-1BP - D3.tif",
"pp1S30 - P.tif",
"991S2991 - P.tif"
);

var a99F=new Array(
"2600-SW - D1.tif",
"2600-SW - D2.tif",
"2600-SW - D3.tif",
"99E10-01 - P.tif",
"99N10-01A1 - D1.tif",
"99N10-01A1 - D2.tif",
"99R10-01A1 - D.tif",
"99R10-01A1 - P.tif",
"99S10-A1 - D.tif",
"99S10-A1 - P.tif",
"V2600-LW-7 - D1.tif",
"V2600-LW-7 - D2.tif"
);

var aV936F=new Array(
"V936S05-3-1AA - D.tif",
"V936S05-3-1AA - P.tif",
"V936S05-4-1AA - D.tif",
"V936S05-4-1AA - P.tif",
"V936S11-3-1AA - D.tif",
"V936S11-3-1AA - P.tif",
"V936S11-4-1AA - D.tif",
"V936S11-4-1AA - P.tif"
);

var aV964L=new Array(
"V964L01-1-1AG - D.tif",
"V964L01-1-1AG - P.tif",
"V964L01-1-2AG - D.tif",
"V964L01-1-2AG - P.tif",
"V964L01-2-1AG - D.tif",
"V964L01-2-1AG - P.tif"
);

var aV965L=new Array(
"V965L1-1R1AG - D.tif",
"V965L1-1R1AG - P.tif",
"V965L1-2R1AG - D.tif",
"V965L1-2R1AG - P.tif",
"V965L23-1R1AG - D.tif",
"V965L23-1R1AG - P.tif",
"V965L23-2R1AG - D.tif",
"V965L23-2R1AG - P.tif"
);


var inventorylatches=new Array(

"1429L","2368L","2939L","934L","95L","E2.03.00",
"E2.04.00","E2.08.00","E2.46.00","V18L","V46L","V917L",
"V951L","V96L");

var inventoryqt=new Array(

"15F","2600-2700","4002","50F","50F-2","5F",
"713F","715F","716F",
"717F","991F","99F",
"V936F","V964L","V965L"
);
	if ("1429L"==search) {theArray=a1429L;}
	if ("2368L"==search) {theArray=a2368L;}
	if ("2939L"==search) {theArray=a2939L;}
	if ("934L"==search) {theArray=a934L;}
	if ("95L"==search) {theArray=a95L;}
	if ("E2.03.00"==search){ theArray=aE20300;}
	if ("E2.04.00"==search){ theArray=aE20400;}
	if ("E2.08.00"==search) {theArray=aE20800;}
	if ("E2.46.00"==search) {theArray=aE24600;}
	if ("V18L"==search) {theArray=aV18L;}
	if ("V46L"==search) {theArray=aV46L;}
	if ("V917L"==search) {theArray=aV917L;}
	if ("V951L"==search) {theArray=aV951L;}
	if ("V96L"==search) {theArray=aV96L;}

	
//}
//else if (type=='vierteldrehverschlusse') {

	if ("15F"==search) {theArray=a15F;}
	if ("2600-2700"==search){ theArray=a26002700L;}
	if ("4002"==search) {theArray=a4002;}
	if ("50F"==search) {theArray=a50F;}
	if ("50F-2"==search){ theArray=a50F2;}
	if ("5F"==search) {theArray=a5F;}
	if ("713F"==search){ theArray=a713F;}
	if ("715F"==search){ theArray=a715F;}
	if ("716F"==search) {theArray=a716F;}
	if ("717F"==search) {theArray=a717F;}
	if ("991F"==search) {theArray=a991F;}
	if ("99F"==search) {theArray=a99F;}
	if ("V936F"==search){ theArray=aV936F;	}
	if ("V964L"==search) {theArray=aV964L;	}
	if ("V965L"==search) {theArray=aV965L;	}
	return theArray;
}

function getType() {
	var sURL = window.document.URL.toString();
	var type;
	var number;
	
	if (sURL.indexOf("?") > 0)
	{
		var arrParams = sURL.split("?");
			
		var arrURLParams = arrParams[1].split("&");
		
		var arrParamNames = new Array(arrURLParams.length);
		var arrParamValues = new Array(arrURLParams.length);
		
		var i = 0;
		for (i=0;i<arrURLParams.length;i++)
		{
			var sParam =  arrURLParams[i].split("=");
			arrParamNames[i] = sParam[0];
			if (sParam[1] != "")
				arrParamValues[i] = unescape(sParam[1]);
			else
				arrParamValues[i] = "No Value";
		}
		/*
		for (i=0;i<arrURLParams.length;i++)
		{
			document.write("<br/>"+arrParamNames[i]+" = "+ arrParamValues[i]);
	
		}*/
	}
	return arrParamValues[0];
}

function getNumber() { 
	var sURL = window.document.URL.toString();
	var type;
	var number;
	
	if (sURL.indexOf("?") > 0)
	{
		var arrParams = sURL.split("?");
			
		var arrURLParams = arrParams[1].split("&");
		
		var arrParamNames = new Array(arrURLParams.length);
		var arrParamValues = new Array(arrURLParams.length);
		
		var i = 0;
		for (i=0;i<arrURLParams.length;i++)
		{
			var sParam =  arrURLParams[i].split("=");
			arrParamNames[i] = sParam[0];
			if (sParam[1] != "")
				arrParamValues[i] = unescape(sParam[1]);
			else
				arrParamValues[i] = "No Value";
		}
		/*
		for (i=0;i<arrURLParams.length;i++)
		{
			document.write("<br/>"+arrParamNames[i]+" = "+ arrParamValues[i]);
	
		}*/
	}
	return arrParamValues[1];
}

function getFileArray() {
	var sURL = window.document.URL.toString();
	var type;
	var serie;
	
	if (sURL.indexOf("?") > 0)
	{
		var arrParams = sURL.split("?");
			
		var arrURLParams = arrParams[1].split("&");
		
		var arrParamNames = new Array(arrURLParams.length);
		var arrParamValues = new Array(arrURLParams.length);
		
		var i = 0;
		for (i=0;i<arrURLParams.length;i++)
		{
			var sParam =  arrURLParams[i].split("=");
			arrParamNames[i] = sParam[0];
			if (sParam[1] != "")
				arrParamValues[i] = unescape(sParam[1]);
			else
				arrParamValues[i] = "No Value";
		}
		/*
		for (i=0;i<arrURLParams.length;i++)
		{
			document.write("<br/>"+arrParamNames[i]+" = "+ arrParamValues[i]);
	
		}*/
	}
	return arrParamValues[2];
}
	
function getSerie() { 
	var sURL = window.document.URL.toString();
	var type;
	var serie;
	
	if (sURL.indexOf("?") > 0)
	{
		var arrParams = sURL.split("?");
			
		var arrURLParams = arrParams[1].split("&");
		
		var arrParamNames = new Array(arrURLParams.length);
		var arrParamValues = new Array(arrURLParams.length);
		
		var i = 0;
		for (i=0;i<arrURLParams.length;i++)
		{
			var sParam =  arrURLParams[i].split("=");
			arrParamNames[i] = sParam[0];
			if (sParam[1] != "")
				arrParamValues[i] = unescape(sParam[1]);
			else
				arrParamValues[i] = "No Value";
		}
		/*
		for (i=0;i<arrURLParams.length;i++)
		{
			document.write("<br/>"+arrParamNames[i]+" = "+ arrParamValues[i]);
	
		}*/
	}
	return arrParamValues[0];
}
/*
function getSerie() { 
	var sURL = window.document.URL.toString();
	var serie="";
	
	if (sURL.indexOf("?") > 0)
	{
		var arrURLParams = sURL.split("?");
			
		//var arrURLParams = arrParams[1].split("&");
		
		var sParam =  arrURLParams[1].split("=");
		
		if (sParam[1] != "")
				serie = unescape(sParam[(sParam.length-1)]);
			else
				serie = "No Value";
		
		
	}
	return serie;
}*/
/*
function getNumber() { 
	var sURL = window.document.URL.toString();
	var serie="";
	
	if (sURL.indexOf("?") > 0)
	{
		var arrURLParams = sURL.split("?");
			
		//var arrURLParams = arrParams[1].split("&");
		
		var sParam =  arrURLParams[1].split("=");
		
		if (sParam[1] != "")
				serie = unescape(sParam[1]);
			else
				serie = "No Value";
		
		
	}
	return serie;
}*/

function matching(original, search) {

var lengthorig=original.length;
var lengthsearch=search.length;

//if big string: split in 3 parts
if (lengthsearch>8) {
	lengthsearch=correct3(lengthsearch);
	var search1=search.substring(0,lengthsearch/3);
	var search2=search.substring(lengthsearch/3,2*lengthsearch/3);
	var search3=search.substring(2*lengthsearch/3);
	if(search1==original.match(search1)||search2==original.match(search2)||search3==original.match(search3)||search==original.match(search)){
		return true;
	}
	else
		return false;
}

else {
//small string: split in 2 parts	
//	if (lengthsearch>5) { //otherwise too small word
		lengthsearch=correct2(lengthsearch); //5 characters is too small to split
		var search1=search.substring(0,lengthsearch/2);
		var search2=search.substring(lengthsearch/2);
		if(search1==original.match(search1)||search2==original.match(search2)||search==original.match(search)){
			return true;
		}
		else
			return false;
/*	}
	else { //small word: take whole word to scan
		//var part=original.match(search);
		var search1=search.substring(0,lengthsearch);
		if(search==original.match(search1)){
			alert("yes");
			return true;
		}
		else {
			alert("no");
			return false;	
		}
	}
*/		
}
/*
var orig1=original.substring(0,lengthorig/3);
var orig2=original.substring(lengthorig/3, 2*lengthorig/3);
var orig3=original.substring(2*lengthorig/3);

var search1=search.substring(0,lengthsearch/3);
var search2=search.substring(lengthsearch/3,2*lengthsearch/3);
var search3=search.substring(2*lengthsearch/3);

var orig1=original.substring(0,lengthorig/2);
var orig2=original.substring(lengthorig/2);
var search1=search.substring(0,lengthsearch/2);
var search2=search.substring(lengthsearch/2);
*/

}

function correct3(number) {
if (number%3==0) {
return number;
}
if (number%3==1) {
return (--number);
}
if(number%3==2) {
return (++number);
}
}

function correct2(number) {
//if (number<4) return number 
if (number%2==0) {
return number;
}
if (number%2==1) {
return (++number);
}

}

/////////////////////////////////////////////////////////


//-->
