// Basic functions code
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//Open pop up
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Shopping cart setup
function addToCart(n) {

	switch(n) {
		// Implants
		case "33_310_Implant":
		document.form1.sku.value = "IDB-N3.3-10";
		document.form1.price.value = "$90";
		document.form1.description.value = "3.3mm diameter, 10mm length dental implant";
		document.form1.jac_quantity_input.value = document.form1.ThirtyThreeMM_ThreeTen_Implant_Quantity.value;
		break;
		
		case "33_312_Implant":
		document.form1.sku.value = "IDB-N3.3-12";
		document.form1.price.value = "$90";
		document.form1.description.value = "3.3mm diameter, 12mm length dental implant";
		document.form1.jac_quantity_input.value = document.form1.ThirtyThreeMM_ThreeTwelve_Implant_Quantity.value;
		break;
		
		case "41_8_Implant":
		document.form1.sku.value = "IDB-R4.1-08";
		document.form1.price.value = "$90";
		document.form1.description.value = "4.1 mm diameter 8mm length dental implant";
		document.form1.jac_quantity_input.value = document.form1.FourtyOneMM_Eight_Implant_Quantity.value;
		break;
		
		case "41_10_Implant":
		document.form1.sku.value = "IDB-R4.1-10";
		document.form1.price.value = "$90";
		document.form1.description.value = "4.1 mm diameter 10mm length dental implant";
		document.form1.jac_quantity_input.value = document.form1.FourtyOneMM_Ten_Implant_Quantity.value;
		break;
		
		case "41_12_Implant":
		document.form1.sku.value = "IDB-R4.1-12";
		document.form1.price.value = "$90";
		document.form1.description.value = "4.1 mm diameter 12mm length dental implant";
		document.form1.jac_quantity_input.value = document.form1.FourtyOneMM_Twelve_Implant_Quantity.value;
		break;
		
		case "48_8_Implant":
		document.form1.sku.value = "IDB-W4.8-08";
		document.form1.price.value = "$90";
		document.form1.description.value = "4.8 mm diameter 8mm length dental implant";
		document.form1.jac_quantity_input.value = document.form1.FourtyEightMM_Eight_Implant_Quantity.value;
		break;
		case "48_10_Implant":
		document.form1.sku.value = "IDB-W4.8-10";
		document.form1.price.value = "$90";
		document.form1.description.value = "4.8 mm diameter 10mm length dental implant";
		document.form1.jac_quantity_input.value = document.form1.FourtyEightMM_Ten_Implant_Quantity.value;
		break;
		case "48_12_Implant":
		document.form1.sku.value = "IDB-W4.8-12";
		document.form1.price.value = "$90";
		document.form1.description.value = "4.8 mm diameter 12mm length dental implant";
		document.form1.jac_quantity_input.value = document.form1.FourtyEightMM_Twelve_Implant_Quantity.value;
		break;
		
		//Healing Caps
		case "Tall_HealingCap_01":
		document.form1.sku.value = "IDB-011-01";
		document.form1.price.value = "$25";
		document.form1.description.value = "Tall healing cap 4.1";
		document.form1.jac_quantity_input.value = document.form1.Tall_HealingCap_01_Quantity.value;
		break;
		case "Tall_HealingCap_02":
		document.form1.sku.value = "IDB-011-02";
		document.form1.price.value = "$25";
		document.form1.description.value = "Tall healing cap 4.8";
		document.form1.jac_quantity_input.value = document.form1.Tall_HealingCap_02_Quantity.value;
		break;
		case "Tall_HealingCap_03":
		document.form1.sku.value = "IDB-011-03";
		document.form1.price.value = "$25";
		document.form1.description.value = "Tall healing cap 4.1";
		document.form1.jac_quantity_input.value = document.form1.Tall_HealingCap_03_Quantity.value;
		break;
		
		case "Sulcus_Forming_Cap_Narrow":
		document.form1.sku.value = "IDB-007-01 Narrow";
		document.form1.price.value = "$25";
		document.form1.description.value = "Sulcus Forming Cap Narrow";
		document.form1.jac_quantity_input.value = document.form1.Sulcus_Forming_Cap_Narrow_Quantity.value;
		break;
		case "Sulcus_Forming_Cap_Regular":
		document.form1.sku.value = "IDB-007-03 Regular";
		document.form1.price.value = "$25";
		document.form1.description.value = "Sulcus Forming Cap Regular";
		document.form1.jac_quantity_input.value = document.form1.Sulcus_Forming_Cap_Regular_Quantity.value;
		break;
		case "Internal_Cap":
		document.form1.sku.value = "IDB-007-02";
		document.form1.price.value = "$25";
		document.form1.description.value = "Internal cap";
		document.form1.jac_quantity_input.value = document.form1.Internal_Cap_Quantity.value;
		break;
		
		//Drivers
		case "Hand_Piece_Driver":
		document.form1.sku.value = "IDB-100-02";
		document.form1.price.value = "$55";
		document.form1.description.value = "Hand Piece Driver";
		document.form1.jac_quantity_input.value = document.form1.Hand_Piece_Driver_Quantity.value;
		break;
		case "Ratchet_Driver":
		document.form1.sku.value = "IDB-100-01";
		document.form1.price.value = "$55";
		document.form1.description.value = "Ratchet Driver";
		document.form1.jac_quantity_input.value = document.form1.Ratchet_Driver_Quantity.value;
		break;
		case "Hex_Driver":
		document.form1.sku.value = "IDB-100-03";
		document.form1.price.value = "$35";
		document.form1.description.value = "1.25mm Hex Driver";
		document.form1.jac_quantity_input.value = document.form1.Hex_Driver_Quantity.value;
		break;
		
		//Abutments
		case "FiveMM_OnePiece_Solid":
		document.form1.sku.value = "IDB-1-50";
		document.form1.price.value = "$55";
		document.form1.description.value = "5.0mm One Piece Solid Abutment";
		document.form1.jac_quantity_input.value = document.form1.FiveMM_OnePiece_Solid_Quantity.value;
		break;
		case "SevenMM_OnePiece_Solid":
		document.form1.sku.value = "IDB-1-70";
		document.form1.price.value = "$55";
		document.form1.description.value = "7.0mm One Piece Solid Abutment";
		document.form1.jac_quantity_input.value = document.form1.SevenMM_OnePiece_Solid_Quantity.value;
		break;
		case "Ball_Abutment":
		document.form1.sku.value = "IDB-006-01";
		document.form1.price.value = "$55";
		document.form1.description.value = "One Piece Ball Abutment";
		document.form1.jac_quantity_input.value = document.form1.Ball_Abutment_Quantity.value;
		break;
		case "Ball_Abutment2":
		document.form1.sku.value = "IDB-006-02";
		document.form1.price.value = "$55";
		document.form1.description.value = "One Piece Ball Abutment";
		document.form1.jac_quantity_input.value = document.form1.Ball_Abutment2_Quantity.value;
		break;
		case "Retentive_Caps":
		document.form1.sku.value = "rhein83";
		document.form1.price.value = "$35";
		document.form1.description.value = "Retentive caps (4 pieces)";
		document.form1.jac_quantity_input.value = document.form1.Retentive_Caps_Quantity.value;
		break;
		case "Two_Piece_Abutment_Regular":
		document.form1.sku.value = "IDB-004-01 Regular";
		document.form1.price.value = "$85";
		document.form1.description.value = "Two Piece Abutment Regular";
		document.form1.jac_quantity_input.value = document.form1.Two_Piece_Abutment_Regular_Quantity.value;
		break;
		case "Two_Piece_Abutment_Narrow":
		document.form1.sku.value = "IDB-004-04 Narrow";
		document.form1.price.value = "$85";
		document.form1.description.value = "Two Piece Abutment Narrow";
		document.form1.jac_quantity_input.value = document.form1.Two_Piece_Abutment_Narrow_Quantity.value;
		break;
		case "0mm_Zest_Locator":
		document.form1.sku.value = "01438";
		document.form1.price.value = "$110";
		document.form1.description.value = "0mm Zest Locator Abutment";
		document.form1.jac_quantity_input.value = document.form1.ZeroMM_Zest_Locator_Quantity.value;
		break;
		case "OneMM_Zest_Locator":
		document.form1.sku.value = "01439";
		document.form1.price.value = "$110";
		document.form1.description.value = "1mm Zest Locator Abutment";
		document.form1.jac_quantity_input.value = document.form1.OneMM_Zest_Locator_Quantity.value;
		break;
		case "TwoMM_Zest_Locator":
		document.form1.sku.value = "01440";
		document.form1.price.value = "$110";
		document.form1.description.value = "2mm Zest Locator Abutment";
		document.form1.jac_quantity_input.value = document.form1.TwoMM_Zest_Locator_Quantity.value;
		break;
		case "ThreeMM_Zest_Locator":
		document.form1.sku.value = "01441";
		document.form1.price.value = "$110";
		document.form1.description.value = "3mm Zest Locator Abutment";
		document.form1.jac_quantity_input.value = document.form1.ThreeMM_Zest_Locator_Quantity.value;
		break;
		case "FourMM_Zest_Locator":
		document.form1.sku.value = "01442";
		document.form1.price.value = "$110";
		document.form1.description.value = "4mm Zest Locator Abutment";
		document.form1.jac_quantity_input.value = document.form1.FourMM_Zest_Locator_Quantity.value;
		break;
		case "FiveMM_Zest_Locator":
		document.form1.sku.value = "01443";
		document.form1.price.value = "$110";
		document.form1.description.value = "5mm Zest Locator Abutment";
		document.form1.jac_quantity_input.value = document.form1.FiveMM_Zest_Locator_Quantity.value;
		break;
		case "Zest_MPP":
		document.form1.sku.value = "LOCATOR Male Processing Package";
		document.form1.price.value = "$58";
		document.form1.description.value = "LOCATOR Male Processing Package";
		document.form1.jac_quantity_input.value = document.form1.Zest_MPP_Quantity.value;
		break;
		case "Locator_Core_Tool":
		document.form1.sku.value = "8393";
		document.form1.price.value = "$75";
		document.form1.description.value = "Zest Locator Core Tool";
		document.form1.jac_quantity_input.value = document.form1.Locator_Core_Tool_Quantity.value;
		break;
		
		//Transfer Kits & Analogs
		case "Transfer_Kit":
		document.form1.sku.value = "IDB-005-XX";
		document.form1.price.value = "$120";
		document.form1.description.value = "Transfer Kit (1 Analog, 1 Transfer Coping, 1 Coping screw, 1 Long screw)";
		document.form1.jac_quantity_input.value = document.form1.Transfer_Kit_Quantity.value;
		break;
		case "Impression_Post":
		document.form1.sku.value = "Impression_Post";
		document.form1.price.value = "$27";
		document.form1.description.value = "Impression Post";
		document.form1.jac_quantity_input.value = document.form1.Impression_Post_Quantity.value;
		break;
		case "Implant_Analog_Grey":
		document.form1.sku.value = "IDB-110-02";
		document.form1.price.value = "$25";
		document.form1.description.value = "Implant Analog Grey";
		document.form1.jac_quantity_input.value = document.form1.Implant_Analog_Grey_Quantity.value;
		break;
		case "Implant_Analog_Gold":
		document.form1.sku.value = "IDB-111-02";
		document.form1.price.value = "$25";
		document.form1.description.value = "Implant Analog Gold";
		document.form1.jac_quantity_input.value = document.form1.Implant_Analog_Gold_Quantity.value;
		break;
		case "Implant_Analog_Blue":
		document.form1.sku.value = "IDB-112-02";
		document.form1.price.value = "$25";
		document.form1.description.value = "Implant Analog Blue";
		document.form1.jac_quantity_input.value = document.form1.Implant_Analog_Blue_Quantity.value;
		break;
		case "Impression_Kit_Grey":
		document.form1.sku.value = "IDB-110-XX";
		document.form1.price.value = "$37";
		document.form1.description.value = "Impression Kit Grey";
		document.form1.jac_quantity_input.value = document.form1.Impression_Kit_Grey_Quantity.value;
		break;
		case "Impression_Kit_Gold":
		document.form1.sku.value = "IDB-111-XX";
		document.form1.price.value = "$37";
		document.form1.description.value = "Impression Kit Gold";
		document.form1.jac_quantity_input.value = document.form1.Impression_Kit_Gold_Quantity.value;
		break;
		case "Impression_Kit_Blue":
		document.form1.sku.value = "IDB-112-XX";
		document.form1.price.value = "$37";
		document.form1.description.value = "Impression Kit Blue";
		document.form1.jac_quantity_input.value = document.form1.Impression_Kit_Blue_Quantity.value;
		break;
		case "FA_4150":
		document.form1.sku.value = "IDB-101-02";
		document.form1.price.value = "$17";
		document.form1.description.value = "Full Analog, A=4.1, B=5.0";
		document.form1.jac_quantity_input.value = document.form1.FA_4150_Quantity.value;
		break;
		case "FA_4170":
		document.form1.sku.value = "IDB-101-03";
		document.form1.price.value = "$17";
		document.form1.description.value = "Full Analog, A=4.1, B=7.0";
		document.form1.jac_quantity_input.value = document.form1.FA_4170_Quantity.value;
		break;
		case "FA_4850":
		document.form1.sku.value = "IDB-101-05";
		document.form1.price.value = "$17";
		document.form1.description.value = "Full Analog, A=4.8, B=5.0";
		document.form1.jac_quantity_input.value = document.form1.FA_4850_Quantity.value;
		break;
		case "FA_4870":
		document.form1.sku.value = "IDB-101-06";
		document.form1.price.value = "$17";
		document.form1.description.value = "Full Analog, A=4.8, B=7.0";
		document.form1.jac_quantity_input.value = document.form1.FA_4870_Quantity.value;
		break;
		case "FA_5650":
		document.form1.sku.value = "IDB-101-08";
		document.form1.price.value = "$17";
		document.form1.description.value = "Full Analog, A=5.6, B=5.0";
		document.form1.jac_quantity_input.value = document.form1.FA_5650_Quantity.value;
		break;
		case "FA_5670":
		document.form1.sku.value = "IDB-101-09";
		document.form1.price.value = "$17";
		document.form1.description.value = "Full Analog, A=5.6, B=7.0";
		document.form1.jac_quantity_input.value = document.form1.FA_5670_Quantity.value;
		break;
		case "IS_B4150":
		document.form1.sku.value = "IDB102-41-50";
		document.form1.price.value = "$20";
		document.form1.description.value = "Pack of 4 impression sleeves letter designation = B, implant platform size = 4.1 mm dia., abutment length = 5.0 mm";
		document.form1.jac_quantity_input.value = document.form1.IS_B4150_Quantity.value;
		break;
		case "IS_C4170":
		document.form1.sku.value = "IDB102-41-70";
		document.form1.price.value = "$20";
		document.form1.description.value = "Pack of 4 impression sleeves letter designation = C, implant platform size = 4.1 mm dia., abutment length = 7.0 mm";
		document.form1.jac_quantity_input.value = document.form1.IS_C4170_Quantity.value;
		break;
		case "IS_E4850":
		document.form1.sku.value = "IDB102-48-50";
		document.form1.price.value = "$20";
		document.form1.description.value = "Pack of 4 impression sleeves letter designation = E, implant platform size = 4.8 mm dia., abutment length = 5.0 mm";
		document.form1.jac_quantity_input.value = document.form1.IS_E4850_Quantity.value;
		break;
		case "IS_F4870":
		document.form1.sku.value = "IDB102-48-70";
		document.form1.price.value = "$20";
		document.form1.description.value = "Pack of 4 impression sleeves letter designation = F, implant platform size = 4.8 mm dia., abutment length = 7.0 mm";
		document.form1.jac_quantity_input.value = document.form1.IS_F4870_Quantity.value;
		break;
		case "IS_H5650":
		document.form1.sku.value = "IDB102-56-50";
		document.form1.price.value = "$20";
		document.form1.description.value = "Pack of 4 impression sleeves letter designation = H, implant platform size = 5.6 mm dia., abutment length = 5.0 mm";
		document.form1.jac_quantity_input.value = document.form1.IS_H5650_Quantity.value;
		break;
		case "IS_I5670":
		document.form1.sku.value = "IDB102-56-70";
		document.form1.price.value = "$20";
		document.form1.description.value = "Pack of 4 impression sleeves letter designation = I, implant platform size = 5.6 mm dia., abutment length = 7.0 mm";
		document.form1.jac_quantity_input.value = document.form1.IS_I5670_Quantity.value;
		break;
		case "Drill_A2mm_B2mm":
		document.form1.sku.value = "IDB-103-01";
		document.form1.price.value = "$59";
		document.form1.description.value = "Drill: A = 2.0 mm, B = 2.0 mm";
		document.form1.jac_quantity_input.value = document.form1.Drill_A2mm_B2mm_Quantity.value;
		break;
		case "Drill_A28mm_B33mm":
		document.form1.sku.value = "IDB-103-02";
		document.form1.price.value = "$59";
		document.form1.description.value = "Drill: A = 2.8 mm, B = 3.3 mm";
		document.form1.jac_quantity_input.value = document.form1.Drill_A28mm_B33mm_Quantity.value;
		break;
		case "Drill_A35mm_B4mm":
		document.form1.sku.value = "IDB-103-03";
		document.form1.price.value = "$59";
		document.form1.description.value = "Drill: A = 3.5 mm, B = 4.0 mm";
		document.form1.jac_quantity_input.value = document.form1.Drill_A35mm_B4mm_Quantity.value;
		break;
		case "Drill_A42mm_B47mm":
		document.form1.sku.value = "IDB-103-04";
		document.form1.price.value = "$59";
		document.form1.description.value = "Drill: A = 4.2 mm, B = 4.7 mm";
		document.form1.jac_quantity_input.value = document.form1.Drill_A42mm_B47mm_Quantity.value;
		break;
		case "Drill_A39mm_B44mm":
		document.form1.sku.value = "IDB-103-05";
		document.form1.price.value = "$59";
		document.form1.description.value = "Drill: A = 3.9 mm, B = 4.4 mm";
		document.form1.jac_quantity_input.value = document.form1.Drill_A39mm_B44mm_Quantity.value;
		break;
		case "Drill_A46mm_B51mm":
		document.form1.sku.value = "IDB-103-06";
		document.form1.price.value = "$59";
		document.form1.description.value = "Drill: A = 4.6 mm, B = 5.1 mm";
		document.form1.jac_quantity_input.value = document.form1.Drill_A46mm_B51mm_Quantity.value;
		break;
		case "Countersink_Cutter":
		document.form1.sku.value = "IDB-104-01";
		document.form1.price.value = "$75";
		document.form1.description.value = "Countersink Cutter";
		document.form1.jac_quantity_input.value = document.form1.Countersink_Cutter_Quantity.value;
		break;
		case "Torque":
		document.form1.sku.value = "Torque";
		document.form1.price.value = "$615";
		document.form1.description.value = "Torque-Ratchet Combination Wrench by Intra-Lock";
		document.form1.jac_quantity_input.value = document.form1.Torque_Quantity.value;
		break;
		case "Ratchet":
		document.form1.sku.value = "Ratchet";
		document.form1.price.value = "$105";
		document.form1.description.value = "Ratchet";
		document.form1.jac_quantity_input.value = document.form1.Ratchet_Quantity.value;
		break;
		case "Torque_Wrench_30_NCm":
		document.form1.sku.value = "Torque_Wrench_30_NCm";
		document.form1.price.value = "$145";
		document.form1.description.value = "Torque Wrench 30 NCm";
		document.form1.jac_quantity_input.value = document.form1.Torque_Wrench_30_NCm_Quantity.value;
		break;
		case "Parallel":
		document.form1.sku.value = "IDB-105-01";
		document.form1.price.value = "$17";
		document.form1.description.value = "Parallel Pin";
		document.form1.jac_quantity_input.value = document.form1.Parallel_Pin_Quantity.value;
		break;
		
		// Drill & Driver Extension
		case "Drill_Driver_Extension":
		document.form1.sku.value = "Drill_Driver_Extension";
		document.form1.price.value = "$43";
		document.form1.description.value = "Drill and Driver Extension";
		document.form1.jac_quantity_input.value = document.form1.Drill_Driver_Extension_Quantity.value;
		break;
		
		// Surgical Kit
		case "Surgical_Kit":
		document.form1.sku.value = "Surgical_Kit";
		document.form1.price.value = "$50";
		document.form1.description.value = "Box, Surgical Kit";
		document.form1.jac_quantity_input.value = document.form1.Surgical_Kit_Quantity.value;
		break;
		
		// Spreader Kit
		case "Spreader_Kit":
		document.form1.sku.value = "Spreader_Kit";
		document.form1.price.value = "$535";
		document.form1.description.value = "Bone Spreader/Condenser Screw Kit";
		document.form1.jac_quantity_input.value = document.form1.Spreader_Kit_Quantity.value;
		break;
		
		// Training Course
		case "TrainingCourse":
		document.form1.sku.value = document.form1.Courses.value;
		if(document.form1.AGD_Membership.value == null || document.form1.AGD_Membership.value == "")
		{
			if(document.form1.Courses.value == "Two day Seminar: Basics of Oral Implantology") {
				document.form1.price.value = "$625";
			}
			else {
				document.form1.price.value = "$425";
			}
			
			document.form1.description.value = document.form1.Courses.value + " Course Date: " + document.form1.CourseDate.value;
		}
		else
		{
			if(document.form1.Courses.value == "Two day Seminar: Basics of Oral Implantology") {
				document.form1.price.value = "$465";
			}
			else {
				document.form1.price.value = "$390";
			}
			
			document.form1.description.value = document.form1.Courses.value + " Course Date: " + document.form1.CourseDate.value; + "\n" + "AGD Membership: " + document.form1.AGD_Membership.value;
		}
		document.form1.jac_quantity_input.value = "1";
		break;
			
		
		
		//Default
		default:
		break;
	}
	
	document.form1.submit();

}
