<!--
var BASIC_PART;
var PARTNUMBER;
var IMGFILE;
var SHELL;
var INSERT;
var FINISH;
var CONTACT;
var KEY;
var QwikCreateWindow;

var PRODUCT_SERIES = "800";
var BASIC_PART     = "013";

var OPENCATALOGPAGE="http://www.alvatek.com/qwikcreate/mightymouse/B-15-18.pdf";
//

//----------------------------------------------------------------------------------------------------------------------

//
function QwikCreate_StartUP() {
	Display_Layer("wait");
	QwikCreate_LoadUp();
}

function QwikCreate_LoadUp() {
	Fill_Selections("Main_Layer", "Main_Layer_Select_1", "START");
	Fill_Selections("Main_Layer", "Main_Layer_Select_2", "BLANK");
	Fill_Selections("Main_Layer", "Main_Layer_Select_3", "BLANK");
	Fill_Selections("Main_Layer", "Main_Layer_Select_4", "BLANK");
	Fill_Selections("Main_Layer", "Main_Layer_Select_5", "BLANK");

	Layer_X = 50;
	Layer_Y = 140;
	document.getElementById('Header_Layer').style.left=20;
	document.getElementById('Header_Layer').style.top=20;
	document.getElementById('Main_Layer').style.left=Layer_X;
	document.getElementById('Main_Layer').style.top=Layer_Y;
	document.getElementById('Part_Number_Button').style.left=Layer_X;
	document.getElementById('Part_Number_Button').style.top=300+Layer_Y;
	Display_Layer("Header_Layer");
	Display_Layer("Main_Layer");
	Hide_Layer("wait");
}
//

//----------------------------------------------------------------------------------------------------------------------

//
function Hide_Layer (WHAT_LAYER) {
	document.getElementById(WHAT_LAYER).style.visibility="hidden";
}
function Display_Layer (WHAT_LAYER) {
	document.getElementById(WHAT_LAYER).style.visibility="visible";
}
//

//----------------------------------------------------------------------------------------------------------------------

//
function Fill_Selections(WHAT_LAYER, WHAT_SELECT, WHAT_OPTS) {
	Selections_Path="document.forms[0]." + WHAT_SELECT;

	o = new Array;
	i=0;

	if (WHAT_OPTS == "BLANK") {
		o[i++]=new Option(" ", " ");
	}
	if (WHAT_OPTS == "START") {
		o[i++]=new Option("Please Select Below","");
		o[i++]=new Option("Rear Mount Jam Nut","07");
		o[i++]=new Option("Square Flange","02");
		o[i++]=new Option("Solder Mount","03");
	}
	if (WHAT_OPTS == "FINISH") {
		o[i++]=new Option("Please Select Below","");
		//o[i++]=new Option("Aluminum, with Black Anodized Finish","C");
		//o[i++]=new Option("Aluminum, with Electroless Nickel Finish","M");
		//o[i++]=new Option("Aluminum, with Olive Drab Cadmium Finish","NF");
		//o[i++]=new Option("Aluminum, with Olive Drab Zinc-Nickel Finish","ZN");
		//o[i++]=new Option("Aluminum, with Black Zinc-Nickel Finish","ZNU");
		o[i++]=new Option("Stainless Steel, with Passivated Finish","Z1");
	}
	if (WHAT_OPTS == "INSERT") {
		o[i++]=new Option("Please Select Below","");
		o[i++]=new Option("5-3 Contacts","5-3");
		o[i++]=new Option("6-4 Contacts","6-4");
		o[i++]=new Option("6-7 Contacts","6-7");
		o[i++]=new Option("7-10 Contacts","7-10");
                o[i++]=new Option("8-13 Contacts","8-13");
		o[i++]=new Option("9-19 Contacts","9-19");
                o[i++]=new Option("10-26 Contacts","10-26");
		o[i++]=new Option("12-37 Contacts","12-37");
	}
	if (WHAT_OPTS == "CONTACT") {
		o[i++]=new Option("Please Select Below","");
		o[i++]=new Option("Pin, Solder Cup","P");
		o[i++]=new Option("Pin, PC Tail","C");
	}
	if (WHAT_OPTS == "KEY") {
		o[i++]=new Option("Please Select Below","");
		o[i++]=new Option("Normal","N");
		o[i++]=new Option("X","X");
		o[i++]=new Option("Y","Y");
		o[i++]=new Option("Z","Z");
	}

	OPTION_WIDTH=0;
	if (i==0) {
		alert("Error: that dropdown should do something, but it doesn't");
	} else {
		eval(Selections_Path+".length=o.length");

		for (i=0; i < o.length; i++) {
			eval(Selections_Path+".options[i]=o[i]");
			if (o[i].text.length>OPTION_WIDTH) {
				OPTION_WIDTH=o[i].text.length;
			}
		}
	}
	eval(Selections_Path+".width=OPTION_WIDTH");
	eval(Selections_Path+".length=o.length");
	eval(Selections_Path+".options[0].selected=true");
}
//

//----------------------------------------------------------------------------------------------------------------------

//
function Form_Change(caller) {
	if ((QwikCreateWindow)&&(!QwikCreateWindow.closed)) {
		QwikCreateWindow.close();
	}

	if (caller.options) {
		OPTION_VAL=caller.options[caller.selectedIndex].value;
		OPTION_TXT=caller.options[caller.selectedIndex].text;
	}
	
	GOTO_URL=0;

	// -- IF GOING TO A DIFFERENT WEBSITE
	if (OPTION_VAL.indexOf("http://") == 0) {
		Hide_Layer("Header_Layer");
		Hide_Layer("Main_Layer");
		Hide_Layer("Part_Number_Button");
		Display_Layer("wait");
		window.open(OPTION_VAL, "_top");
		GOTO_URL=1;
	}

	// -- IF GOING TO A DIFFERNT PAGE, SAME SITE
	if (OPTION_VAL.indexOf(":")==0) {
		Hide_Layer("Header_Layer");
		Hide_Layer("Main_Layer");
		Hide_Layer("Part_Number_Button");
		Display_Layer("wait");
		TOGO_URL=OPTION_VAL.substring(1)+".html";
		window.open(TOGO_URL, "_top");
		GOTO_URL=1;
	}
	if (!GOTO_URL) {
		if (caller.name=="Main_Layer_Select_1") {
			SHELL = OPTION_VAL;
			SHELL_NAME = OPTION_TXT;
			Fill_Selections("Main_Layer", "Main_Layer_Select_2", "FINISH");
		}
		if (caller.name=="Main_Layer_Select_2") {
			FINISH = OPTION_VAL;
			FINISH_NAME = OPTION_TXT;
			Fill_Selections("Main_Layer", "Main_Layer_Select_3", "INSERT");
		}
		if (caller.name=="Main_Layer_Select_3") {
			INSERT = OPTION_VAL;
			INSERT_NAME = OPTION_TXT;
			Fill_Selections("Main_Layer", "Main_Layer_Select_4", "CONTACT");
		}
		if (caller.name=="Main_Layer_Select_4") {
			CONTACT = OPTION_VAL;
			CONTACT_NAME = OPTION_TXT;
			Fill_Selections("Main_Layer", "Main_Layer_Select_5", "KEY");
		}
		if (caller.name=="Main_Layer_Select_5") {
			KEY = OPTION_VAL;
			KEY_NAME = OPTION_TXT;
			Display_Layer("Part_Number_Button");
		}
	}

	PARTNUMBER = PRODUCT_SERIES + "-" + BASIC_PART + "-" + SHELL + FINISH + INSERT + CONTACT + KEY;

	if ((KEY)&&(CONTACT)&&(INSERT)&&(FINISH)&&(SHELL)) {
		Display_Layer("Part_Number_Button");
	} else {
		Hide_Layer("Part_Number_Button");
	}
}
//

//----------------------------------------------------------------------------------------------------------------------

//
function QwikCreatePartNumber() {

if (SHELL=="07") {
	IMGFILE = "800-013-07.gif";
} else if (SHELL=="02") {
	IMGFILE = "800-013-02.gif";	
} else {
	IMGFILE = "800-013-03.gif";	
}

	if ((QwikCreateWindow)&&(!QwikCreateWindow.closed)) {
		QwikCreateWindow.close();
	}
	QwikCreateWindow=window.open('','','resizable=yes,scrollbars=yes,width=770,height=600');
	//
	QwikCreateWindow.document.write("<HTML><TITLE>QwikCreate - Part Number: ",PARTNUMBER,", Glenair Inc.</TITLE><BODY BGCOLOR=WHITE><CENTER><IMG SRC='http://www.alvatek.com/qwikcreate/mca/imgs/banner_air.jpg'>\n");
	QwikCreateWindow.document.write("<TABLE WIDTH=640 BORDER=0 CELLPADDING=5 CELLSPACING=0><TR VALIGN=TOP><TD COLSPAN=2><CENTER><BR><FONT FACE='TAHOMA' SIZE=5><B>Part Number: ",PARTNUMBER,"</B></FONT><BR>\n");
	QwikCreateWindow.document.write("<img src='imgs/"+ IMGFILE +"'><br>");
	QwikCreateWindow.document.write("</TD></TR>\n");
	QwikCreateWindow.document.write("<TR VALIGN=TOP><TD COLSPAN=2><FONT FACE='TAHOMA' SIZE=2>\n");
	//QwikCreateWindow.document.write("Basic Part: ",BASIC_PART_NAME,"<br><br>\n");
	QwikCreateWindow.document.write("Shell Style: ",SHELL_NAME,"<br>\n");
	QwikCreateWindow.document.write("Shell Material/Finish: ",FINISH_NAME,"<br>\n");
	QwikCreateWindow.document.write("Shell Size/Insert Arrangement: ",INSERT_NAME,"<br>\n");
	QwikCreateWindow.document.write("Contact Type: ",CONTACT_NAME,"<br>\n");
	QwikCreateWindow.document.write("Shell Key Position: ",KEY_NAME,"<br>\n");
	

	//QwikCreateWindow.document.write("<br>Metric dimensions (mm) are in parentheses <br>\n");
	//QwikCreateWindow.document.write("<br>Consult factory for sizes not shown <br>\n");
	//QwikCreateWindow.document.write("<br>Tubing shown for reference only. <br>\n");

	QwikCreateWindow.document.write("<br></TD></TR>");
	QwikCreateWindow.document.write("<TR><TD COLSPAN=2 ALIGN=CENTER><FONT FACE='TAHOMA' SIZE=2>\n");
	QwikCreateWindow.document.write("<INPUT TYPE='BUTTON' VALUE='Open Catalog Page' onClick=window.open('",OPENCATALOGPAGE,"','temppage','toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,width=750,height=600')> &nbsp &nbsp &nbsp \n");
	QwikCreateWindow.document.write("");
	QwikCreateWindow.document.write("<INPUT TYPE='BUTTON' VALUE='Quote' onClick=window.open('../../pages/search_results.php?searchtype=b&search=yes&query=",PARTNUMBER,"','temppage','toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,width=700,height=600')>  &nbsp &nbsp &nbsp ");
	QwikCreateWindow.document.write((window.print)?("<INPUT TYPE='BUTTON' VALUE='Print' onClick='window.print()'>"):("<FONT FACE=TAHOMA SIZE=2>CTRL+P (PC) or CMD+P (Mac) to Print</FONT>")," &nbsp &nbsp &nbsp <INPUT TYPE='BUTTON' VALUE='Close' onClick='self.close()'></FORM></TD></TR></TABLE><BR>\n");
	QwikCreateWindow.document.write("</BODY></HTML>\n");


	QwikCreateWindow.document.close()
	windowopen=1;
}
//

//----------------------------------------------------------------------------------------------------------------------

