function showProduct() {
	parent.frames[2].rtop.document.src="prodhead.htm";
	parent.frames[2].rbottom.document.src="ceslc.htm";
}

function updateMenu() {
	document.location.href="prodleft.htm";	
}

function MakeArray(n) {
	this.length=n;
	return this;
}

function product(prdType, prdName, prdCategory, prdFileName) {
	this.Type = prdType;
	this.Name = prdName;
	this.Category = prdCategory;
	this.FileName = prdFileName;
}

function setHeadPage(category) {
	if(category == 1) {
		parent.frames[3].location.href = 'srchhdcl.htm';
	}
	else if(category == 2) {
		parent.frames[3].location.href = 'srchhdsj.htm';
	}
	else if(category == 3) {
		parent.frames[3].location.href = 'srchhdce.htm';
	}
	parent.frames[5].location.href = 'srchtail.htm';
}

function showClampIntroPage() {
	parent.frames[3].location.href = 'prodhead_cl.htm';
	parent.frames[4].location.href = 'clmphome.htm';
}

function showClampElementIntroPage() {
	parent.frames[3].location.href = 'prodhead_ce.htm';
	parent.frames[4].location.href = 't2en.htm';
}

function showScrewJackIntroPage() {
	parent.frames[3].location.href = 'prodhead_sj.htm';
	parent.frames[4].location.href = 'scjkhome.htm';
}

function showSearchResults() {
	productList = new MakeArray(0);
	productList[1] = new product("CES-DMC", "Downhold Milling Clamp", "Clamp", "cesdmc.htm");
	productList[2] = new product("CES-LC", "Lever Clamp", "Clamp", "ceslc.htm");
	productList[3] = new product("CES-TPC", "Thick Plate Clamp", "Clamp", "cestpc.htm");
	productList[4] = new product("CES-CTC", "Composite Taper Clamp", "Clamp", "cesctc.htm");
	productList[5] = new product("CES-SC", "Slot Clamp", "Clamp", "cessc.htm");
	productList[6] = new product("CES-SHC-MINI", "Stepless Height Clamp - Mini", "Clamp", "cesshc.htm");
	productList[7] = new product("CES-SHC-MAXI", "Stepless Height Clamp - Maxi", "Clamp", "cesshc.htm");
	productList[8] = new product("T1-FSC", "Flat Strap Clamp", "Clamp", "t1fsc.htm");
	productList[9] = new product("T1-UC", "U Clamp", "Clamp", "t1uc.htm");
	productList[10] = new product("T1-SC", "Slotted Clamp", "Clamp", "t1sc.htm");
	productList[11] = new product("T1-TC", "Table Clamp", "Clamp", "t1tc.htm");
	productList[12] = new product("T1-DEC", "Double Ended Clamp", "Clamp", "t1dec.htm");
	productList[13] = new product("T1-GNC", "Goose Neck Clamp", "Clamp", "t1gnc.htm");
	productList[14] = new product("T1-PC", "Plain Clamp", "Clamp", "t1pc.htm");
	productList[15] = new product("T1-PTMC", "Pressing Tool / Milling Clamp", "Clamp", "t1ptmc.htm");
	productList[16] = new product("CES-SJLN", "With Ring Type Locknut", "Screw Jack", "cessjln.htm");
	productList[17] = new product("CES-50SF", "", "Screw Jack", "ces50sf.htm");
	productList[18] = new product("CES-50DF", "", "Screw Jack", "ces50df.htm");
	productList[19] = new product("CES-70DF", "", "Screw Jack", "ces70df.htm");
	productList[20] = new product("CES-90DF", "", "Screw Jack", "ces70df.htm");
	productList[21] = new product("CES-SBSJ", "", "Screw Jack", "cessbsj.htm");
	productList[22] = new product("CES-BBLN", "", "Screw Jack", "cesbbln.htm");
	productList[23] = new product("CES-SCL", "", "Screw Jack", "cesscl.htm");
	productList[24] = new product("CES-STSB", "", "Screw Jack", "cesstsb.htm");
	productList[25] = new product("BBLP", "Locating Plate", "Screw Jack", "bblp.htm");
	productList[26] = new product("BBHP", "Height Block", "Screw Jack", "bblp.htm");
	productList[27] = new product("T2-EN", "Extension Nut", "Clamping Element", "t2en.htm");
	productList[28] = new product("T2-TN", "T Nut", "Clamping Element", "t2tn.htm");
	productList[29] = new product("T2-RTN", "Rhombus T Nut", "Clamping Element", "t2rtn.htm");
	productList[30] = new product("T2-HN", "Hex Nut", "Clamping Element", "t2hn.htm");
	productList[31] = new product("T2-CS", "Clamping Stud", "Clamping Element", "t2cs.htm");
	productList[32] = new product("T2-TB", "Forged T Bolt", "Clamping Element", "t2tb.htm");
	productList[33] = new product("T3-CWN", "C Washer", "Clamping Element", "t3cwn.htm");
	productList[34] = new product("T3-PW DIN", "Plain Washer (Thick) DIN 6340", "Clamping Element", "t3pwdin.htm");
	productList[35] = new product("T3-SWCS", "Spherical Washer with Conical Seat", "Clamping Element", "t3swcs.htm");
	productList[36] = new product("T3-SHP", "Supporting Height Plates", "Clamping Element", "t3shp.htm");
	productList[37] = new product("T3-USB", "Universal Serrated Blocks", "Clamping Element", "t3usb.htm");
	productList[38] = new product("T1-SSC", "Serrated Strap Clamp", "Clamping Element", "t1ssc.htm");
	productList[39] = new product("T1-MCH", "Mould Clamp with Heavy Support Bolt", "Clamp", "t1mch.htm");
	productList[40] = new product("T1-QC", "Quick Clamp", "Clamp", "t1qc.htm");
	productList[41] = new product("T1-PMC", "Press Mould Clamp", "Clamp", "t1pmc.htm");
	productList[42] = new product("T2P-CSX", "Clamping Stud with Hex for Spanner Operation", "Clamping Element", "t2pcsx.htm");
	productList[43] = new product("T2P-C9FR", "Clamping Stud with Annular Ring and Spanner Flat Section", "Clamping Element", "t2pc9fr.htm");
	productList[44] = new product("T2P-CSFR", "Clamping Stud with Annular Ring and Spanner Flat Section", "Clamping Element", "t2pc9fr.htm");
	productList[45] = new product("T2P-C9SF", "Clamping Stud with Spanner Flat Section", "Clamping Element", "t2pc9sf.htm");
	productList[46] = new product("T2P-CSAF", "Clamping Stud with Spanner Flat Section", "Clamping Element", "t2pc9sf.htm");
	productList[47] = new product("T2-FHN", "Flanged Hex Nut (Collar Nut)", "Clamping Element", "t2fhn.htm");
	productList[48] = new product("T3-SBE", "Self-Aligning Ball Element", "Clamping Element", "t3sbe.htm");
	productList[49] = new product("T3-SSB", "Smooth Sliding Block", "Clamping Element", "t3ssb.htm");
	productList.length = 49;
	
	searchResult = new MakeArray(0);
	var j = 1;
	
	for (i = 1; i <= productList.length; i++) {
		prdType = new String(productList[i].Type);
		prdType = prdType.toLowerCase();
		prdName = new String(productList[i].Name);
		prdName = prdName.toLowerCase();
		prdCategory = new String(productList[i].Category);
		prdCategory = prdCategory.toLowerCase();
		if(document.all) {
			searchString = searchForm.searchString.value;
		}
		else {
			searchString = document.forms[0].searchString.value;
		}
		searchString = searchString.toLowerCase();
		
		if (prdType.indexOf(searchString) > -1 || prdName.indexOf(searchString) > -1 || prdCategory.indexOf(searchString) > -1) {
			searchResult[j] = i;
			j += 1;
			searchResult.length += 1;
		}
	}
	
	var msg = ""
	msg = msg + "<head>"
	msg = msg + "<script language='JavaScript' src='srchcode.js'>"
	msg = msg + "</script>"
	msg = msg + "<link rel='stylesheet' type='text/css' href='tisa.css'>"
	msg = msg + "<base target='_self'>"
	msg = msg + "<style> BODY { scrollbar-3dlight-color: #666666; scrollbar-arrow-color: #000000; scrollbar-base-color: #CDCDCD; "
	msg = msg + "scrollbar-darkshadow-color: #666666; scrollbar-face-color: #CDCDCD; scrollbar-highlight-color: #CDCDCD; "
	msg = msg + "scrollbar-shadow-color: #666666; scrollbar-track-color: #AAAAAA; } </style> </head>"
	msg = msg + "<body topmargin='0' leftmargin='3' marginwidth='3' marginheight='0' bgcolor='#969696'>"
	msg = msg + "<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='487' id='AutoNumber1' bgcolor='#969696' height='100%'>"
	msg = msg + "<tr><td width='10' valign='top' background='images/ltile.gif'><p align='center' style='text-align: center'>"
	msg = msg + "<img border='0' src='images/ltile.gif' width='10' height='13'></td><td width='473' valign='top'><div align='center'><center>"
	msg = msg + "<table border='1' bordercolor='#333333' cellpadding='3' cellspacing='0' style='border-collapse: collapse' width='468' id='AutoNumber2' height='300'>"
	msg = msg + "<tr><td colspan='3'><img border='0' src='images/spacer.gif' width='1' height='1'></td></tr>"
	
	if (searchResult.length > 0)
	{
		msg = msg + "<tr class='lightrow'><td class='srchrslthead'>Product Type</td><td class='srchrslthead'>Product Name</td><td class='srchrslthead'>Product Category</td></tr>"
		for (i = 1; i <= searchResult.length; i++) {
			j = searchResult[i];
			
			msg = msg + "<tr class='whiterow'><td><p class='default'>"
			switch(productList[j].Category) {
				case 'Clamp':
					msg = msg + "<a class='product' target='_self' onClick='setHeadPage(1)' href='"; break;
				case 'Screw Jack':
					msg = msg + "<a class='product' target='_self' onClick='setHeadPage(2)' href='"; break;
				case 'Clamping Element':
					msg = msg + "<a class='product' target='_self' onClick='setHeadPage(3)' href='"; break;
			}
			msg = msg + productList[j].FileName
			msg = msg + "'>"
			msg = msg + productList[j].Type
			msg = msg + "</a>"				
			msg = msg + "</p></td><td><p class='default'>"
			msg = msg + productList[j].Name
			msg = msg + "</p></td><td><p class=''default'>"
			msg = msg + productList[j].Category
			msg = msg + "</p></td></tr>"
		}
	
		for(k=1; k<=11-i;k++) {
			msg = msg + "<tr class='whiterow'><td><p class='default'>&nbsp;</p></td><td><p class='default'>&nbsp;</p></td><td><p class='default'>&nbsp;</p></td></tr>"
		}  
	}
	else {
			msg = msg + "<tr class='whiterow'><td class='speccolhead' colspan='3'><p class='boldpara'>"
			msg = msg + "No Matches Found"
			msg = msg + "</p></td></tr>"
		for(k=1; k<=8; k++) {
			msg = msg + "<tr class='whiterow'><td colspan='3'><p class='default'>&nbsp;</p></td></tr>"
		}  
	}
	
	msg = msg + "</table></center></div></td><td width='5' valign='top' background='images/rtile.gif' align='right'>&nbsp;</td></tr></table></body>"


	parent.frames[3].location.href = "srchhead.htm";
	parent.frames[5].location.href = "prodtail.htm";	
	srcwin=parent.frames[4].self;
	srcwin.document.open();
	srcwin.document.write(msg);
	srcwin.document.close();
}
