$(document).ready(function(){

	$("#search_form").submit(function(){
		var query = $(this.q).val();
		
		if(query.length > 0)
		{
			search(query);
		} else {
			alert("Please enter a product model number and search again.");
		} 
		
		return false;
	});
});

function search(query)
{
	var pages = getPages();
	
	query = cleanQuery(query);
	
	redirect = pages[query];
	
	if (redirect == undefined){
		alert("Sorry, there were no matches.  Please edit your search and try again.");
	} else {
		window.location = redirect;
	}
	
}

function cleanQuery(query)
{
	query = query.replace(/-/g, "");
	query = query.toLowerCase();
	
	return query;
}

function getPages()
{
	var pages = new Array();
	pages['hte2'] = "http://www.ullman-devices.com/Inspection_Mirrors/High-tech_inspection_mirrors_HTE-2.html";
	pages['htc2'] = "http://www.ullman-devices.com/Inspection_Mirrors/High-tech_inspection_mirrors_HTC-2.html";
	pages['hts2'] = "http://www.ullman-devices.com/Inspection_Mirrors/High-tech_inspection_mirrors_HTS-2.html";
	pages['hte2lt'] = "http://www.ullman-devices.com/Inspection_Mirrors/High-tech_inspection_mirrors_HTE-2LT.html";
	pages['htc2lt'] = "http://www.ullman-devices.com/Inspection_Mirrors/High-tech_inspection_mirrors_HTC-2LT.html";
	pages['hts2lt'] = "http://www.ullman-devices.com/Inspection_Mirrors/High-tech_inspection_mirrors_HTS-2LT.html";
	pages['k2'] = "http://www.ullman-devices.com/Inspection_Mirrors/K-2series_mirror.html";
	pages['k2l'] = "http://www.ullman-devices.com/Inspection_Mirrors/K-2series_mirror.html";
	pages['k2m'] = "http://www.ullman-devices.com/Inspection_Mirrors/K-2series_mirror.html";
	pages['k2ml'] = "http://www.ullman-devices.com/Inspection_Mirrors/K-2series_mirror.html";
	pages['c2'] = "http://www.ullman-devices.com/Inspection_Mirrors/C-2series_mirror.html";
	pages['c2l'] = "http://www.ullman-devices.com/Inspection_Mirrors/C-2series_mirror.html";
	pages['c2m'] = "http://www.ullman-devices.com/Inspection_Mirrors/C-2series_mirror.html";
	pages['c2ml'] = "http://www.ullman-devices.com/Inspection_Mirrors/C-2series_mirror.html";
	pages['s2'] = "http://www.ullman-devices.com/Inspection_Mirrors/S-2series_mirror.html";
	pages['s2l'] = "http://www.ullman-devices.com/Inspection_Mirrors/S-2series_mirror.html";
	pages['a2'] = "http://www.ullman-devices.com/Inspection_Mirrors/A-2series_mirror.html";
	pages['a2m'] = "http://www.ullman-devices.com/Inspection_Mirrors/A-2series_mirror.html";
	pages['e2'] = "http://www.ullman-devices.com/Inspection_Mirrors/E-2series_mirror.html";
	pages['e2m'] = "http://www.ullman-devices.com/Inspection_Mirrors/E-2series_mirror.html";
	pages['b2'] = "http://www.ullman-devices.com/Inspection_Mirrors/B-2series_mirror.html";
	pages['a2t'] = "http://www.ullman-devices.com/Inspection_Mirrors/A-2T_pocket_inspection_mirrors.html";
	pages['e2t'] = "http://www.ullman-devices.com/Inspection_Mirrors/E-2T_pocket_inspection_mirrors.html";
	pages['b2t'] = "http://www.ullman-devices.com/Inspection_Mirrors/B-2T_pocket_inspection_mirrors.html";
	pages['a2tm'] = "http://www.ullman-devices.com/Inspection_Mirrors/A-2TM_pocket_inspection_mirrors.html";
	pages['e2tm'] = "http://www.ullman-devices.com/Inspection_Mirrors/E-2TM_pocket_inspection_mirrors.html";
	pages['b2tm'] = "http://www.ullman-devices.com/Inspection_Mirrors/B-2TM_pocket_inspection_mirrors.html";
	pages['hta2t'] = "http://www.ullman-devices.com/Inspection_Mirrors/Pocket_inspection_mirrors_HTA-2T.html";
	pages['hte2t'] = "http://www.ullman-devices.com/Inspection_Mirrors/Pocket_inspection_mirrors_HTE-2T.html";
	pages['htb2t'] = "http://www.ullman-devices.com/Inspection_Mirrors/Pocket_inspection_mirrors_HTB-2T.html";
	pages['c2x'] = "http://www.ullman-devices.com/Inspection_Mirrors/mirror_w_magnetic_base-C-2X.html";
	pages['s2x'] = "http://www.ullman-devices.com/Inspection_Mirrors/mirror_w_magnetic_base-S-2X.html";
	pages['mx'] = "http://www.ullman-devices.com/Inspection_Mirrors/mirror_w_magnetic_base.html";
	pages['htdisp'] = "http://www.ullman-devices.com/displays/HTDISP.html";
	pages['htltdisp'] = "http://www.ullman-devices.com/displays/HTLTDISP.html";
	pages['htc2lt4pk'] = "http://www.ullman-devices.com/displays/HTC-2LT4pk.html";
	pages['15xdisp'] = "http://www.ullman-devices.com/displays/15XDISP.html";
	pages['ht5dis'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool_wpowercap-HT-5DIS.html";
	pages['16'] = "http://www.ullman-devices.com/spring_claws.html";
	pages['no. 16'] = "http://www.ullman-devices.com/spring_claws.html";
	pages['#16'] = "http://www.ullman-devices.com/spring_claws.html";
	pages['17'] = "http://www.ullman-devices.com/spring_claws.html";
	pages['no. 17'] = "http://www.ullman-devices.com/spring_claws.html";
	pages['#17'] = "http://www.ullman-devices.com/spring_claws.html";
	pages['no. 1810'] = "http://www.ullman-devices.com/scribers_hooks_picks/1810-double_point_scriber.html";
	pages['1810'] = "http://www.ullman-devices.com/scribers_hooks_picks/1810-double_point_scriber.html";
	pages['#1810'] = "http://www.ullman-devices.com/scribers_hooks_picks/1810-double_point_scriber.html";
	pages['1820'] = "http://www.ullman-devices.com/scribers_hooks_picks/1820_utility_hook.html";
	pages['no. 1820'] = "http://www.ullman-devices.com/scribers_hooks_picks/1820_utility_hook.html";
	pages['#1820'] = "http://www.ullman-devices.com/scribers_hooks_picks/1820_utility_hook.html";
	pages['1830'] = "http://www.ullman-devices.com/scribers_hooks_picks/1830_pocket_scriber.html";
	pages['no. 1830'] = "http://www.ullman-devices.com/scribers_hooks_picks/1830_pocket_scriber.html";
	pages['no. sw10'] = "http://www.ullman-devices.com/scribers_hooks_picks/swinger_hook.html";
	pages['sw10'] = "http://www.ullman-devices.com/scribers_hooks_picks/swinger_hook.html";
	pages['h4w'] = "http://www.ullman-devices.com/scribers_hooks_picks/hook_n_pick_set.html";
	pages['ph4'] = "http://www.ullman-devices.com/scribers_hooks_picks/individual_hook_n_pick_set.html";
	pages['mp6'] = "http://www.ullman-devices.com/scribers_hooks_picks/MP-6_micro_hook_n_pick_set.html";
	pages['psp-4'] = "http://www.ullman-devices.com/scribers_hooks_picks/PSP-4hook_n_pick_set_w_handles.html";
	pages['chp4'] = "http://www.ullman-devices.com/scribers_hooks_picks/CHP4_hook_n_pick_set.html";
	pages['chp4l'] = "http://www.ullman-devices.com/scribers_hooks_picks/CHP4L_hook_n_pick_set.html";
	pages['chp6l'] = "http://www.ullman-devices.com/scribers_hooks_picks/CHP6L_hook_n_pick_set.html";
	pages['chp8l'] = "http://www.ullman-devices.com/scribers_hooks_picks/CHP8L_hook_n_pick_set.html";
	pages['d1'] = "http://www.ullman-devices.com/screwstarters_nutstarters/D2_slotted_screw_starter.html";
	pages['d2'] = "http://www.ullman-devices.com/screwstarters_nutstarters/D2_slotted_screw_starter.html";
	pages['d3'] = "http://www.ullman-devices.com/screwstarters_nutstarters/D2_slotted_screw_starter.html";
	pages['d4'] = "http://www.ullman-devices.com/screwstarters_nutstarters/D2_slotted_screw_starter.html";
	pages['n1'] = "http://www.ullman-devices.com/screwstarters_nutstarters/N2_slotted_screw_starter.html";
	pages['n2'] = "http://www.ullman-devices.com/screwstarters_nutstarters/N2_slotted_screw_starter.html";
	pages['n3'] = "http://www.ullman-devices.com/screwstarters_nutstarters/N2_slotted_screw_starter.html";
	pages['n4'] = "http://www.ullman-devices.com/screwstarters_nutstarters/N2_slotted_screw_starter.html";
	pages['pd9'] = "http://www.ullman-devices.com/screwstarters_nutstarters/P10_phillips_screw_starter.html";
	pages['pd10'] = "http://www.ullman-devices.com/screwstarters_nutstarters/P10_phillips_screw_starter.html";
	pages['pd11'] = "http://www.ullman-devices.com/screwstarters_nutstarters/P10_phillips_screw_starter.html";
	pages['pd12'] = "http://www.ullman-devices.com/screwstarters_nutstarters/P10_phillips_screw_starter.html";
	pages['pn9'] = "http://www.ullman-devices.com/screwstarters_nutstarters/PN-10_phillips_screw_starter.html";
	pages['pn10'] = "http://www.ullman-devices.com/screwstarters_nutstarters/PN-10_phillips_screw_starter.html";
	pages['pn11'] = "http://www.ullman-devices.com/screwstarters_nutstarters/PN-10_phillips_screw_starter.html";
	pages['pn12'] = "http://www.ullman-devices.com/screwstarters_nutstarters/PN-10_phillips_screw_starter.html";
	pages['de1'] = "http://www.ullman-devices.com/screwstarters_nutstarters/DE-1_double_ended_screw_starter.html";
	pages['de2'] = "http://www.ullman-devices.com/screwstarters_nutstarters/DE-2_double_ended_screw_starter.html";
	pages['f2'] = "http://www.ullman-devices.com/screwstarters_nutstarters/F-2_Phillips_TORX_screw_starter.html";
	pages['g2'] = "http://www.ullman-devices.com/screwstarters_nutstarters/G-2_nut_starter.html";
	pages['no. 25'] = "http://www.ullman-devices.com/socket_holders/25socket_holder_w_spring_clips.html";
	pages['25'] = "http://www.ullman-devices.com/socket_holders/25socket_holder_w_spring_clips.html";
	pages['#25'] = "http://www.ullman-devices.com/socket_holders/25socket_holder_w_spring_clips.html";
	pages['no. 35'] = "http://www.ullman-devices.com/socket_holders/35socket_holder_w_spring_clips.html";
	pages['35'] = "http://www.ullman-devices.com/socket_holders/35socket_holder_w_spring_clips.html";
	pages['#35'] = "http://www.ullman-devices.com/socket_holders/35socket_holder_w_spring_clips.html";
	pages['no. 50'] = "http://www.ullman-devices.com/socket_holders/50socket_holder_w_spring_clips.html";
	pages['50'] = "http://www.ullman-devices.com/socket_holders/50socket_holder_w_spring_clips.html";
	pages['#50'] = "http://www.ullman-devices.com/socket_holders/50socket_holder_w_spring_clips.html";
	pages['no. 75'] = "http://www.ullman-devices.com/socket_holders/75socket_holder_w_spring_clips.html";
	pages['75'] = "http://www.ullman-devices.com/socket_holders/75socket_holder_w_spring_clips.html";
	pages['#75'] = "http://www.ullman-devices.com/socket_holders/75socket_holder_w_spring_clips.html";
	pages['sh1725'] = "http://www.ullman-devices.com/socket_holders/1725socket_holder_w_spring_clips.html";
	pages['sh1735'] = "http://www.ullman-devices.com/socket_holders/1735socket_holder_w_spring_clips.html";
	pages['sh1750'] = "http://www.ullman-devices.com/socket_holders/1750socket_holder_w_spring_clips.html";
	pages['sh1775'] = "http://www.ullman-devices.com/socket_holders/1775socket_holder_w_spring_clips.html";
	pages['rc1'] = "http://www.ullman-devices.com/specialty_tools/RC-1_Piston_ring_compressor.html";
	pages['no. rc1'] = "http://www.ullman-devices.com/specialty_tools/RC-1_Piston_ring_compressor.html";
	pages['rc2'] = "http://www.ullman-devices.com/specialty_tools/RC-2_Piston_ring_compressor.html";
	pages['no. rc2'] = "http://www.ullman-devices.com/specialty_tools/RC-2_Piston_ring_compressor.html";
	pages['rct3'] = "http://www.ullman-devices.com/specialty_tools/RC-TC_Piston_ring_compressor.html";
	pages['no. rct3'] = "http://www.ullman-devices.com/specialty_tools/RC-TC_Piston_ring_compressor.html";
	pages['rc9s'] = "http://www.ullman-devices.com/specialty_tools/Single_ring_compressor_2-5.html";
	pages['rc0'] = "http://www.ullman-devices.com/specialty_tools/Single_ring_compressor_2-5.html";
	pages['rc09'] = "http://www.ullman-devices.com/specialty_tools/Single_ring_compressor_2-5.html";
	pages['rcs'] = "http://www.ullman-devices.com/specialty_tools/Single_ring_compressor_2-5.html";
	pages['no. rco'] = "http://www.ullman-devices.com/specialty_tools/Single_ring_compressor_2-5.html";
	pages['no. rco9'] = "http://www.ullman-devices.com/specialty_tools/Single_ring_compressor_2-5.html";
	pages['rcos'] = "http://www.ullman-devices.com/specialty_tools/Single_ring_compressor_1-4.html";
	pages['rco9so'] = "http://www.ullman-devices.com/specialty_tools/Single_ring_compressor_1-4.html";
	pages['sg2'] = "http://www.ullman-devices.com/specialty_tools/SG-2_Sparkplug_gauge.html";
	pages['bh2'] = "http://www.ullman-devices.com/specialty_tools/BH-2_bit_holder.html";
	pages['mg2'] = "http://www.ullman-devices.com/specialty_tools/MG-2_magnifying.html";
	pages['no. 5'] = "http://www.ullman-devices.com/specialty_tools/No5_Magnetizer.html";
	pages['5'] = "http://www.ullman-devices.com/specialty_tools/No5_Magnetizer.html";
	pages['#5'] = "http://www.ullman-devices.com/specialty_tools/No5_Magnetizer.html";
	pages['gm2'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/mega_magnetic_pickup_tool-GM-2.html";
	pages['gm2l'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/mega_magnetic_pickup_tool-GM-2L.html";
	pages['gmc2'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/mega_magnetic_pickup_tool-GMC-2.html";
	pages['ht1'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Hi-Tech_magnetic_picup_tools_w_powercap-HT-1.html";
	pages['ht2'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Hi-Tech_magnetic_picup_tools_w_powercap-HT-2.html";
	pages['ht3'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Hi-Tech_magnetic_picup_tools_w_powercap-HT-3.html";
	pages['ht5'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool_wpowercap-HT-5.html";
	pages['ht5dis'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool_wpowercap-HT-5DIS.html";
	pages['ht6'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool_wpowercap-HT-6.html";
	pages['ht2fl'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/flex_pickup_tool-HT-2FL.html";
	pages['14x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/flex_pickup_tool-14X.html";
	pages['htlp1'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/LED_lighted_inspection-HTLP-1.html";
	pages['htlp2'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/LED_lighted_inspection-HTLP-2.html";
	pages['#1'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/original_all-angle.html";
	pages['1'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/original_all-angle.html";
	pages['#2'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/original_all-angle.html";
	pages['2'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/original_all-angle.html";
	pages['no. 1'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/original_all-angle.html";
	pages['no. 2'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/original_all-angle.html";
	pages['6f'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Spring_flex_magnetic_pick-up_tool.html";
	pages['no. 6f'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Spring_flex_magnetic_pick-up_tool.html";
	pages['no.6f'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Spring_flex_magnetic_pick-up_tool.html";	
	pages['6fl'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Spring_flex_magnetic_pick-up_tool.html";
	pages['10t'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/original_pocket_telescope_pickup_tool.html";
	pages['9'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/original_pocket_pickup_tool.html";
	pages['no. 9'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/original_pocket_pickup_tool.html";
	pages['#9'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/original_pocket_pickup_tool.html";
	pages['21x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Telescope_pickup_tool.html";
	pages['#21x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Telescope_pickup_tool.html";
	pages['no. 21x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Telescope_pickup_tool.html";
	pages['21'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Telescope_pickup_tool.html";
	pages['15'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool_15X.html";
	pages['15x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool_15X.html";
	pages['no. 15'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool_15X.html";
	pages['#15'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool_15X.html";
	pages['15xor'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool_15X.html";
	pages['15xgr'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool.html";
	pages['15x orange'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool.html";
	pages['15x green'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool.html";
	pages['19x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool_19X.html";
	pages['#19x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool_19X.html";
	pages['No. 19x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool_19X.html";
	pages['19'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_telescope_pickup_tool_19X.html";
	pages['no. 4t'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_picup_tools_w_rotating_head-4T.html";
	pages['4t'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_picup_tools_w_rotating_head-4T.html";
	pages['#4t'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_picup_tools_w_rotating_head-4T.html";
	pages['no. 3'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_picup_tools_w_rotating_head-No3.html";
	pages['3'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_picup_tools_w_rotating_head-No3.html";
	pages['#3'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/pocket_picup_tools_w_rotating_head-No3.html";
	pages['8x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Pocket_magnetic_pickup_tool.html";
	pages['#8x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Pocket_magnetic_pickup_tool.html";
	pages['no. 8x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Pocket_magnetic_pickup_tool.html";
	pages['12x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Flexible_on_off_magnetic_pickup_tool.html";
	pages['#12x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Flexible_on_off_magnetic_pickup_tool.html";
	pages['no.12x'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/Flexible_on_off_magnetic_pickup_tool.html";
	pages['htk2lt'] = "http://www.ullman-devices.com/Inspection_Mirrors/HTK-2LT.html";
	pages['plp2'] = "http://www.ullman-devices.com/Magnetic_pickup_tools/PLP-2_Penlight_Pick-up_Tool.html"; 
	pages['plp2 6pk'] = "http://www.ullman-devices.com/displays/PLP2DISP.html";
	pages['plp26pk'] = "http://www.ullman-devices.com/displays/PLP2DISP.html"; 
	pages['plp26pack'] = "http://www.ullman-devices.com/displays/PLP2DISP.html"; 
	pages['plp2 6 pack'] = "http://www.ullman-devices.com/displays/PLP2DISP.html"; 
	
	return pages;
}