<!--

// *********************************************************************
// * javascript file created by:                                       *
// *                            Perry Dorion @ Banfield-Seguin Ltd.    *
// *                            pdorion@bsl.com                        *
// *                                                                   *
// * This script builds arrays of products and arrays of criterias     *
// * for each product. These arrays are actually arrays of arrays,     *
// * and their order is very important.                                *
// * When adding a product, you must push the ar_ANSW array  into the  *
// * ar_FORM array at the same position as where you push the ar_PROD  *
// * into the ar_LIST array.                                           *
// * If you delete a product, you must remove or comment the two array *
// * blocks.                                                           *
// *********************************************************************


// Browser detection to advise the user to use Internet Explorer
if(navigator.appName != "Microsoft Internet Explorer"){
	alert("Designed for Microsoft Internet Explorer browsers. \n The result page requires Microsoft Internet Explorer browser for print capability");
}

//global variable
doc = document.IPToolForm;

// ------------------------- ANSWER ARRAY BLOCKS -------------------------

ar_FORM = new Array();

// answers for each product and all questions that are selective(not ALL for an answer)
// from the given Platform Recommendation matching GRID, the answers were converted from letters to numbers
// A = 0,  B = 1, C = 2, ... D,E = 3,4
// FOR Question 5, the answers are in pairs i.e. the first two numbers are Q5a. and Q5b. answer
// ex: 0,1,0,2,1,0
//     is
//     Q5a.option=0 and Q5b.option=1, Q5a.option=0 and Q5b.option=2, Q5a.option=1 and Q5b.option=0, ...


// array block for IP45
ar_ANSW = new Array();
ar_ANSW.Q5 = "0,0,0,1,0,0";
ar_ANSW.Q6 = "0";
ar_ANSW.Q7 = "0,1";
ar_ANSW.Q8 = "0";
ar_FORM.push(ar_ANSW);

// array block for IP60
ar_ANSW = new Array();
ar_ANSW.Q5 = "0,0,0,1,0,0";
ar_ANSW.Q6 = "0";
ar_ANSW.Q7 = "0,1";
ar_ANSW.Q8 = "0,1,2,3";
ar_FORM.push(ar_ANSW);

// array block for IP260265
ar_ANSW = new Array();
ar_ANSW.Q5 = "0,0,0,1,0,0";
ar_ANSW.Q6 = "0";
ar_ANSW.Q7 = "0,1,2";
ar_ANSW.Q8 = "0,1,2,3,4";
ar_FORM.push(ar_ANSW);


// array block for IP390
ar_ANSW = new Array();
ar_ANSW.Q5 = "0,0,0,0,1,0,0,2,0,1,0,0,1,1,0,1,2,0,2,0,0,2,1,0,2,2,0";
ar_ANSW.Q6 = "0,1";
ar_ANSW.Q7 = "0,1,2,3,4,5";
ar_ANSW.Q8 = "0,1,2,3,4";
ar_FORM.push(ar_ANSW);


// array block for IP560
ar_ANSW = new Array();
ar_ANSW.Q5 = "0,0,0,0,1,0,0,2,0,0,3,0,0,4,0,1,0,0,1,1,0,1,2,0,1,3,0,1,4,0,2,0,0,2,1,0,2,2,0,2,3,0,2,4,0,3,0,0,3,1,0,3,2,0,3,3,0,3,4,0,4,0,0,4,1,0,4,2,0,4,3,0,4,4,0";
ar_ANSW.Q6 = "0,1,2";
ar_ANSW.Q7 = "0,1,2,3,4,5";
ar_ANSW.Q8 = "0,1,2,3,4";
ar_FORM.push(ar_ANSW);

// array block for IP1220
ar_ANSW = new Array();
ar_ANSW.Q5 = "0,0,0,0,1,0,0,2,0,0,3,0,0,4,0,1,0,0,1,1,0,1,2,0,1,3,0,1,4,0,2,0,0,2,1,0,2,2,0,2,3,0,2,4,0,3,0,0,3,1,0,3,2,0,3,3,0,3,4,0,4,0,0,4,1,0,4,2,0,4,3,0,4,4,0,5,0,0,5,1,0,5,2,0,5,3,0,5,4,0";
ar_ANSW.Q6 = "0,1,2";
ar_ANSW.Q7 = "0,1,2,3,4,5";
ar_ANSW.Q8 = "0,1,2,3,4";
ar_FORM.push(ar_ANSW);

// array block for IP1260
ar_ANSW = new Array();
ar_ANSW.Q5 = "0,0,0,0,1,0,0,2,0,0,3,0,0,4,0,1,0,0,1,1,0,1,2,0,1,3,0,1,4,0,2,0,0,2,1,0,2,2,0,2,3,0,2,4,0,3,0,0,3,1,0,3,2,0,3,3,0,3,4,0,4,0,0,4,1,0,4,2,0,4,3,0,4,4,0,5,0,0,5,1,0,5,2,0,5,3,0,5,4,0";
ar_ANSW.Q6 = "0,1,2";
ar_ANSW.Q7 = "0,1,2,3,4,5";
ar_ANSW.Q8 = "0,1,2,3,4";
ar_FORM.push(ar_ANSW);

// array block for IP2255
ar_ANSW = new Array();
ar_ANSW.Q5 = "0,0,0,0,1,0,0,2,0,0,3,0,0,4,0,0,5,0,1,0,0,1,1,0,1,2,0,1,3,0,1,4,0,1,5,0,2,0,0,2,1,0,2,2,0,2,3,0,2,4,0,2,5,0,3,0,0,3,1,0,3,2,0,3,3,0,3,4,0,3,5,0,4,0,0,4,1,0,4,2,0,4,3,0,4,4,0,4,5,0,5,0,0,5,1,0,5,2,0,5,3,0,5,4,0,5,5,0,6,0,0,6,1,0,6,2,0,6,3,0,6,4,0,6,5,0,0,0,1,0,1,1,0,2,1,0,3,1,0,4,1,0,5,1,1,0,1,1,1,1,1,2,1,1,3,1,1,4,1,1,5,1,2,0,1,2,1,1,2,2,1,2,3,1,2,4,1,2,5,1,3,0,1,3,1,1,3,2,1,3,3,1,3,4,1,3,5,1,4,0,1,4,1,1,4,2,1,4,3,1,4,4,1,4,5,1,5,0,1,5,1,1,5,2,1,5,3,1,5,4,1,5,5,1,6,0,1,6,1,1,6,2,1,6,3,1,6,4,1,6,5,1";
ar_ANSW.Q6 = "0,1,2";
ar_ANSW.Q7 = "0,1,2,3,4,5";
ar_ANSW.Q8 = "0,1,2,3";
ar_FORM.push(ar_ANSW);


// ------------------------- PRODUCTS ARRAY BLOCKS -------------------------

ar_LIST = new Array();

// array block for IP45
ar_PROD = new Array();
ar_PROD.flg = true;
ar_PROD.nam = "IP45";
ar_PROD.dsc = "Nokia IP45 security appliance is a fully-integrated, feature-rich and pre-configured enterprise business-class firewall security appliance. It is designed for distributed enterprise, small and medium business and branch offices that need robust VPN connectivity and Check Point firewall protection at a low cost.";
ar_PROD.img = "IP45.jpg";
ar_LIST.push(ar_PROD);

// array block for IP60
ar_PROD = new Array();
ar_PROD.flg = true;
ar_PROD.nam = "IP60";
ar_PROD.dsc = "Nokia IP60 security platform is a fully-integrated, feature-rich and pre-configured firewall security appliance. It is designed for distributed enterprise, small and medium business and branch offices that need firewall, VPN, intrusion prevention, and antivirus technologies in a single solution, enabling businesses to provide security, central management and connectivity for remote sites at a low cost.";
ar_PROD.img = "IP60.jpg";
ar_LIST.push(ar_PROD);

// array block for IP260265
ar_PROD = new Array();
ar_PROD.flg = true;
ar_PROD.nam = "IP260265";
ar_PROD.dsc = "The disk-based Nokia IP260 and the diskless Nokia IP265 provide reliable and manageable security, ideal for small companies or branch offices that require enterprise-level robustness and features. Nokia security platforms combine market-leading Nokia hardware design and quality with best-of-breed Check Point VPN-1 software and the Nokia IPSO™ operating system.";
ar_PROD.img = "IP260265.jpg";
ar_LIST.push(ar_PROD);


// array block for IP390
ar_PROD = new Array();
ar_PROD.flg = true;
ar_PROD.nam = "IP390";
ar_PROD.dsc = "Nokia IP390 security platform is a firewall/VPN appliance combining best-of-breed Check Point VPN-1 security and manageability, with a purpose-built Nokia IPSO-based network security appliance. Nokia IP390 offers large-business performance and port headroom in a rack-dense 1RU form factor, giving customers a competitively priced, mid-range appliance with unprecedented performance and port density for this class of system.";
ar_PROD.img = "IP390.jpg";
ar_LIST.push(ar_PROD);


// array block for IP560
ar_PROD = new Array();
ar_PROD.flg = true;
ar_PROD.nam = "IP560";
ar_PROD.dsc = "Nokia IP560 security platform delivers leading technology for large businesses, enterprises, and service providers that need a high performance, high GigE port density, and a rack-dense firewall/VPN appliance. Running Check Point VPN-1, Nokia IP560 provides superior security, manageability, GigE port density and performance, giving customers a competitively priced, mid-range appliance with unprecedented performance and port headroom for this class of system.";
ar_PROD.img = "IP560.jpg";
ar_LIST.push(ar_PROD);


// array block for IP1220
ar_PROD = new Array();
ar_PROD.flg = true;
ar_PROD.nam = "IP1220";
ar_PROD.dsc = "Nokia IP1220 security platform delivers leading technology for medium/large and large business that need long-term high performance perimeter security or internal network segmentation solutions. It provides robust performance, availability and expandability with a leading dollar-per-megabit throughput. Its redundant hardware capabilities ensure reliability for top performance and network uptime.";
ar_PROD.img = "IP1220.jpg";
ar_LIST.push(ar_PROD);


// array block for IP1260
ar_PROD = new Array();
ar_PROD.flg = true;
ar_PROD.nam = "IP1260";
ar_PROD.dsc = "Nokia IP1260 is designed to support high performance traffic levels prevalent in complex network infrastructures deployed by large enterprise, service providers and data centers for mission-critical applications. The Nokia IP1260 incorporates leading technology for a resilient long-term perimeter security solution with performance for high traffic sites. It combines market-leading Firewall/VPN software with the Nokia IPSO™ secure operating system on a purpose-built and designed hardware platform.";
ar_PROD.img = "IP1260.jpg";
ar_LIST.push(ar_PROD);


// array block for IP2255
ar_PROD = new Array();
ar_PROD.flg = true;
ar_PROD.nam = "IP2255";
ar_PROD.dsc = "Nokia IP2255 enterprise security appliance is a high-performance, highly reliable network firewall for Check Point VPN-1 and Check Point VPN- 1 Power. Nokia IP2255 is designed specifically for the demanding performance, port-density requirements and enterprise security needs of carriers, service providers, e-commerce sites and enterprise data center cores.";
ar_PROD.img = "IP2255.jpg";
ar_LIST.push(ar_PROD);


//global variable
doc = document.IPToolForm;

// -------------------------------------------
// ---------------- CRITERIAS ----------------
// -------------------------------------------

//   Customer Information field variables
var crt_Firstname,crt_Lastname,crt_Company,crt_Email,crt_Phone,crt_Industry,crt_Country,crt_TypeUser,crt_OptIn,crt_addressOptIn;

//   Platform field variables
var crt_Office,crt_Functionality,crt_Functionality_RAAS,crt_DSL,crt_T1E1,crt_DS3,crt_ISDN,crt_Ten_100,crt_Gig_E,crt_Ten_GigE,crt_FirewallConnections,crt_Firewall,crt_VPN,crt_Traffic,crt_Availability,crt_Redundancy,crt_Swappable,crt_Authentication,crt_other_requirements;

crt_Firstname = "";
crt_Lastname = "";
crt_Company = "";
crt_Email = "";
crt_Phone = "";
crt_Industry = "";
crt_Country = "";
crt_TypeUser = "";
crt_OptIn = "";
crt_addressOptIn = "";
crt_Office = "";
crt_Functionality = "";
crt_Functionality_RAAS = "";
crt_DSL = "";
crt_T1E1 = "";
crt_DS3 = "";
crt_ISDN = "";
crt_Ten_100 = "";
crt_Gig_E = "";
crt_FirewallConnections = "";
crt_Firewall = "";
crt_VPN = "";
crt_Traffic = "";
crt_Availability = "";
crt_Redundancy = "";
crt_Swappable = "";
crt_Authentication = "";
crt_other_requirements = "";


// -------------------------------------------------------------------------
//                             PRODUCT MATCHING
//                     Function build from the answer grid
// -------------------------------------------------------------------------
function productMatching(){
	//for every products in the list of products
	for (p=0;p<ar_LIST.length;p++){//

		//*************************************************************************
		//Q5
		flag = false;
		//for each elements (split into an array) in Question 5's answer
		ar_subFORM_Q = new Array();
		ar_subFORM_Q = ar_FORM[p].Q5.split(",");


		//the answer has multiple option such as "if A = this AND B = that OR A= this AND B= that OR ..."
		for (e=0; e<ar_subFORM_Q.length; e+=3){
			// if the criteria is equal to an element, set the flag to true
			if ((doc.Ten_100.selectedIndex == ar_subFORM_Q[e]) && (doc.Gig_E.selectedIndex == ar_subFORM_Q[e+1]) && (doc.Ten_GigE.selectedIndex == ar_subFORM_Q[e+2])){
				flag = true;
			}
		}
		//update the product flag only if it is still available(true)
		if(ar_LIST[p].flg == true){
			ar_LIST[p].flg = flag;
		}


		//*************************************************************************
		//Q6
		flag = false;
		//for each elements (split into an array) in Question 6's answer
		ar_subFORM_Q = new Array();
		ar_subFORM_Q = ar_FORM[p].Q6.split(",");

		for (e=0; e<ar_subFORM_Q.length; e++){
			// if the criteria is equal to an element, set the flag to true
			if (doc.FirewallConnections.selectedIndex == ar_subFORM_Q[e]){
				flag = true;
			}
		}
		//update the product flag only if it is still available(true)
		if(ar_LIST[p].flg == true){
			ar_LIST[p].flg = flag;
		}

		//*************************************************************************
		//Q7
		flag = false;
		//for each elements (split into an array) in Question 7's answer
		ar_subFORM_Q = new Array();
		ar_subFORM_Q = ar_FORM[p].Q7.split(",");

		for (e=0; e<ar_subFORM_Q.length; e++){
			// if the criteria is equal to an element, set the flag to true
			if (doc.Firewall.selectedIndex == ar_subFORM_Q[e]){
				flag = true;
			}
		}
		//update the product flag only if it is still available(true)
		if(ar_LIST[p].flg == true){
			ar_LIST[p].flg = flag;
		}

		//*************************************************************************
		//Q8
		flag = false;
		//for each elements (split into an array) in Question 8's answer
		ar_subFORM_Q = new Array();
		ar_subFORM_Q = ar_FORM[p].Q8.split(",");

		for (e=0; e<ar_subFORM_Q.length; e++){
			// if the criteria is equal to an element, set the flag to true
			if (doc.VPN.selectedIndex == ar_subFORM_Q[e]){
				flag = true;
			}
		}
		//update the product flag only if it is still available(true)
		if(ar_LIST[p].flg == true){
			ar_LIST[p].flg = flag;
		}
	}

}


// -------------------------------------------------------------------------
//              functions for inputing the selected criteria
//                   in the variables fields for display
// -------------------------------------------------------------------------

// --------------------- for select fields---------------------
function selectVal(fld){
	tmp = "doc."+fld+".options[doc."+fld+".selectedIndex].value";
	return eval(tmp);
}
// --------------------- for checkboxes ---------------------
// --------------------- returns the value(s) ---------------------
function checkVal(obj){
	fw = "";
	virgule = "";
	obj = eval("doc."+obj);
	for (i=0;i<2;i++){
		if (obj[i].checked){
			fw = fw + virgule + obj[i].value;
			virgule = ",";
		}
	}
	return fw;
}
// --------------------- for radio buttons ---------------------
// --------------------- returns the value ---------------------
function radioVal(obj){
	fw = "none selected";
	obj = eval("doc."+obj);
	objLen = obj.length;
	for (i=0;i<objLen;i++){
		if (obj[i].checked){
			fw = i;
		}
	}
	if(fw != "none selected"){
		return obj[fw].value;
	}else{
		return fw;
	}
}
// --------------------- for radio buttons ---------------------
// -------------------- returns the position -------------------
function radioCheckVal(obj){
	fw = -99;
	obj = eval("doc."+obj);
	objLen = obj.length;
	for (i=0;i<objLen;i++){
		if (obj[i].checked){
			fw = i;
		}
	}
	return fw;
}

// -------------------------------------------------------------------------
//                          ERROR CHECKING
// -------------------------------------------------------------------------
function validate(){
	//initializing the error message
	message = "Verify the following fields:\n";



	// **************************** personal information ****************************
	//Firstname
	if(doc.Firstname.value == "")
	{
		message = message + "\n Q.1 First name";
	}
	//Lastname
	if(doc.Lastname.value == "")
	{
		message = message + "\n Q.1 Last name";
	}
	//Company
	if(doc.Company.value == "")
	{
		message = message + "\n Q.1 Company";
	}
	//Email
	if(doc.EmailAddress.value == "")
	{
		message = message + "\n Q.1 E-Mail Address";
	}
	//Phone
	if(doc.Phone.value == "")
	{
		message = message + "\n Q.1 Phone #";
	}
	// Type of Industry
	if(doc.Industry.selectedIndex == 0)
	{
		message = message + "\n Q.1 Type of Industry";
	}
	if(doc.Industry.options[doc.Industry.selectedIndex].value == "Other" && doc.OtherIndustry.value == "")
	{
		message = message + "\n Q.1 Other type of Industry?";
	}
	//Country
	if(doc.Country.selectedIndex == 0)
	{
		message = message + "\n Q.1 Country";
	}
	// TypeUser
	if(doc.TypeUser.selectedIndex == 0)
	{
		message = message + "\n Q.1 Type of User";
	}
	if(doc.TypeUser.options[doc.TypeUser.selectedIndex].value == "Other" && doc.OtherTypeUser.value == "")
	{
		message = message + "\n Q.1 Other type of User?";
	}
	//OptIn
	if(doc.OptIn[1].checked && doc.addressOptIn.value == "")
	{
		message = message + "\n Q.1 Post Mail Address";
	}


	// **************************** platform criterias ****************************
	// must check at least one radio button
	//if(!doc.FirewallUsers[0].checked  && !doc.FirewallUsers[1].checked  && !doc.FirewallUsers[2].checked  && !doc.FirewallUsers[3].checked  && !doc.FirewallUsers[4].checked  && //!doc.VPNUsers[0].checked  && !doc.VPNUsers[1].checked  && !doc.VPNUsers[2].checked  && !doc.VPNUsers[3].checked  && !doc.VPNUsers[4].checked  && !doc.VPNSites[0].checked  //&& !doc.VPNSites[1].checked  && !doc.VPNSites[2].checked  && !doc.VPNSites[3].checked  && !doc.VPNSites[4].checked)
	//{
	//	message = message + "\n Q.6 How many users will be connected to the appliance";
	//}

	// if Other is selected in Q10, must have some value in the text box
	if(doc.Traffic.options[doc.Traffic.selectedIndex].value == "Other" && doc.OtherTraffic.value == "")
	{
		message = message + "\n Q.10 Other type of Traffic";
	}

	if(message != "Verify the following fields:\n")
	{
		alert(message);
		return false;
	}else{
		return true;
	}
}

// -------------------------------------------------------------------------
//                          CRITERIA CAPTURE
// -------------------------------------------------------------------------
function recordCriteria()
{

	//Firstname
	crt_Firstname = doc.Firstname.value;
	//Firstname
	crt_Lastname = doc.Lastname.value;
	//Firstname
	crt_Company = doc.Company.value;
	//Firstname
	crt_Email = doc.EmailAddress.value;
	//Firstname
	crt_Phone = doc.Phone.value;
	//Country
	crt_Country = selectVal("Country");
	//TypeUser
	crt_TypeUser = selectVal("TypeUser");
	if(crt_TypeUser == "Other" )
	{
		crt_TypeUser = doc.OtherTypeUser.value;
	}
	//OptIn
	crt_OptIn = checkVal("OptIn");
	//addressOptIn
	if(doc.OptIn[1].checked)
	{
		crt_addressOptIn = "Post Address: " + doc.addressOptIn.value;
	}
	//Industry
	crt_Industry = selectVal("Industry");
	if(crt_Industry == "Other" )
	{
		crt_Industry = doc.OtherIndustry.value;
	}
	//Office
	crt_Office = selectVal("Office");
	//Functionality
	crt_Functionality = selectVal("Functionality");
	crt_Functionality_RAAS = doc.Functionality_RAAS.value;
	//DSL
	crt_DSL = selectVal("DSL");
	//T1E1
	crt_T1E1 = selectVal("T1E1");
	//DS3
	crt_DS3 = selectVal("DS3");
	//ISDN
	crt_ISDN = selectVal("ISDN");
	//Ten_100
	crt_Ten_100 = selectVal("Ten_100");
	//Gig_E
	crt_Gig_E = selectVal("Gig_E");
	//Ten_GigE
	crt_Ten_GigE = selectVal("Ten_GigE");
	//FirewallConnections
	crt_FirewallConnections = selectVal("FirewallConnections");
	//Firewall
	crt_Firewall = selectVal("Firewall");
	//VPN
	crt_VPN = selectVal("VPN");
	//Traffic
	crt_Traffic = selectVal("Traffic");
	if(crt_Traffic == "Other" )
	{
		crt_Traffic = doc.OtherTraffic.value
	}
	//Availability
	crt_Availability = selectVal("Availability");
	//Redundancy
	crt_Redundancy = selectVal("Redundancy");
	//Swappable
	crt_Swappable = selectVal("Swappable");
	//Authentication
	crt_Authentication = selectVal("Authentication");
	//Authentication
	crt_other_requirements = crt_other_requirements = doc.other_requirements.value
}

// -------------------------------------------------------------------------
//                  PRODUCTS RECOMMENDED SEPARATED IN COMMAS
// -------------------------------------------------------------------------
function getProducts(){
	var strProducts = '';
	for (var p=0;p<ar_LIST.length;p++){
		//check if the product is valid for the selected criteria
		if (ar_LIST[p].flg){
			// display with the image on the left in its own cell
			if (strProducts == ''){
				strProducts += ar_LIST[p].nam;
			}else{
				strProducts += ',' + ar_LIST[p].nam;
			}
		}
	}
	//alert(strProducts);
	return strProducts;
}

// -------------------------------------------------------------------------
//                          RESULT PAGE WRITING
// -------------------------------------------------------------------------
function writePage()
{
	var fullPageString = "";
	var strProducts = getProducts();

	//var Comments = (document.forms[0].elements[13].value);

	var formValidation="<SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\">function contactFormSubmit(){var blnOk = true; if (!document.forms[0]){alert('Form not found on this  page.'); blnOk = false;} if (blnOk) {if (document.forms[0].elements['FirstName']){if (document.forms[0].elements['FirstName'].value == ''){alert('Please enter your first name.'); blnOk = false; }}else{alert('First name not found.'); blnOk = false;}} if (blnOk) { if (document.forms[0].elements['LastName']) { if(document.forms[0].elements['LastName'].value == '') {alert('Please enter your last name.'); blnOk = false;}}else { alert('Last name not found.'); blnOk = false; } } if (blnOk) {if (document.forms[0].elements['CompanyName']){if (document.forms[0].elements['CompanyName'].value == ''){alert('Please enter your Company Name.'); blnOk = false; }}else{alert('Company name not found.'); blnOk = false;}} if (blnOk) { if (document.forms[0].elements['EmailAddress']) { if (document.forms[0].elements['EmailAddress'].value == '') { alert('Please enter your email address dammit.'); blnOk = false; } }else { alert('Email address not found.'); blnOk = false; } } if (blnOk) { if (document.forms[0].elements['Phone']) {if (document.forms[0].elements['Phone'].value == '') { alert('Please enter your Phone Number.');blnOk = false; } }else { alert('Phone number not found.'); blnOk = false; } } if (blnOk) {if (document.forms[0].elements['Country']){if (document.forms[0].elements['Country'].value == ''){alert('Please enter Country.'); blnOk = false; }}else{alert('Country name not found.'); blnOk = false;}}  if (blnOk) { switch (document.forms[0].elements['Country'].value) { case 'USA': document.forms[0].elements['00N00000005VgkF'].value = 'Americas'; break; case 'Canada': document.forms[0].elements['00N00000005VgkF'].value = 'Americas'; break; case 'Antigua': document.forms[0].elements['00N00000005VgkF'].value = 'Americas'; break; case 'Argentina': document.forms[0].elements['00N00000005VgkF'].value = 'Americas'; break; case 'Australia': document.forms[0].elements['00N00000005VgkF'].value = 'APAC'; break;  case 'Austria': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA'; break; case 'Barbados': document.forms[0].elements['00N00000005VgkF'].value = 'Americas'; break; case 'Belgium': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA'; break; case 'Bermuda': document.forms[0].elements['00N00000005VgkF'].value = 'Americas';  break; case 'Brazil': document.forms[0].elements['00N00000005VgkF'].value = 'Americas'; break; case 'Chile': document.forms[0].elements['00N00000005VgkF'].value = 'Americas';  break; case 'China': document.forms[0].elements['00N00000005VgkF'].value = 'APAC';  break; case 'Colombia': document.forms[0].elements['00N00000005VgkF'].value = 'Americas';  break; case 'Croatia': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Cyprus':  document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Czech Repulic': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Denmark': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break;  case 'Dominican Republic': document.forms[0].elements['00N00000005VgkF'].value = 'Americas';  break; case 'Finland': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'France': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Germany': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Greece': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Hong Kong': document.forms[0].elements['00N00000005VgkF'].value = 'APAC'; break; case 'Hungary': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Iceland':  document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'India':  document.forms[0].elements['00N00000005VgkF'].value = 'APAC';  break; case 'Indonesia': document.forms[0].elements['00N00000005VgkF'].value = 'APAC';  break;  case 'Ireland': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Israel': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Italy':  document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break;  case 'Japan':  document.forms[0].elements['00N00000005VgkF'].value = 'APAC';  break; case 'Malaysia':  document.forms[0].elements['00N00000005VgkF'].value = 'APAC';  break; case 'Malta': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Mexico':  document.forms[0].elements['00N00000005VgkF'].value = 'Americas';  break; case 'Netherlands': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'New Zealand': document.forms[0].elements['00N00000005VgkF'].value = 'APAC';  break; case 'Norway': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Pakistan':  document.forms[0].elements['00N00000005VgkF'].value = 'APAC';  break; case 'Peru': document.forms[0].elements['00N00000005VgkF'].value = 'Americas';  break; case 'Philippines':  document.forms[0].elements['00N00000005VgkF'].value = 'APAC';  break; case 'Poland': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Portugal': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Russia': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Saudi Arabia':  document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Singapore':  document.forms[0].elements['00N00000005VgkF'].value = 'APAC';  break; case 'Slovenia':  document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break;  case 'South Africa': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'South Korea': document.forms[0].elements['00N00000005VgkF'].value = 'APAC';  break;  case 'Spain': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Sweden': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA'; break; case 'Switzerland': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'Taiwan': document.forms[0].elements['00N00000005VgkF'].value = 'APAC'; break; case 'Thailand': document.forms[0].elements['00N00000005VgkF'].value = 'APAC'; break; case 'Turkey': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break; case 'United Arab Emirates': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA';  break;case 'United Kingdom': document.forms[0].elements['00N00000005VgkF'].value = 'EMEA'; break; case 'Venezuela': document.forms[0].elements['00N00000005VgkF'].value = 'Americas'; break;default: document.forms[0].elements['00N00000005VgkF'].value = 'Americas'; break;} if(document.forms[0].elements['Comments'].value == '') { document.forms[0].elements['description'].value = '" + strProducts + "'; }else { if ('" + strProducts + "' != '') {document.forms[0].elements['description'].value = document.forms[0].elements['Comments'].value + ' - " + strProducts + "';} }  document.forms[0].submit();} }</SCRIPT>";

var contactForm = "<form name=\"Platform Tool - March 2004\" action=\"http://now.eloqua.com/f.asp\"><!--Start special hidden tags --><input type=\"hidden\" name=\"description\" value=\"\"><input type=hidden name=\"oid\" value=\"00D00000000hhbG\"><input type=\"hidden\" name=\"00N00000005VgkF\" value=\"Americas\"> <input type=\"hidden\" name=\"00N00000005V1aM\" value=\"Website\"><input type=\"hidden\" name=\"00N00000005V1fP\" value=\"Website\"> <input type=\"hidden\" name=\"00N00000005ZDeN\" value=\"Eloqua Request for contact on the recommendation from the IP Platform Tool\"><input type=\"hidden\" name=\"00N00000006OGuf\" value=\"Eloqua IP Platform Tool\"> <input type=\"hidden\" name=\"00N00000006OQFD\" value=\"NES Web\"><input type=\"hidden\" name=\"00N00000005JWri\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N00000005K98O\" value=\"Unknown\"><input type=\"hidden\" name=\"00N00000005K99X\" value=\"Unknown\"><input type=\"hidden\" name=\"00N00000005K9Ay\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N00000005K9Cj\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N00000005K9E7\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N00000005K9LA\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N00000005JX5C\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N30000000c4Zo\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N30000000cXOy\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N00000005K8um\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N00000005K8vu\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N00000005K900\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N00000005K90d\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N00000005K91u\" value=\"Unknown\"><input type=\"hidden\" name=\"00N00000005K94a\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N00000005K965\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N00000005K972\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N30000000c4Zv\" value=\"Unknown\"> <input type=\"hidden\" name=\"00N30000000cXP3\" value=\"Unknown\"><!--End special hidden tags --><input type=\"hidden\" name=\"elqFormName\" value=\"PlatformTool_contact\"><input type=\"hidden\" name=\"elqSiteID\" value=\"196\"><input type=\"hidden\" name=\"elqDefaultTargetURL\" value=\"\"><input type=\"hidden\" name=\"elqPost\" value=\"\"><input type=\"hidden\" name=\"elq\" value=\"<span class=eloquaemail>recipientid</span>\"><table border=\"0\" bgcolor=\"#FFFFFF\" cellspacing=\"2\" cellpadding=\"2\"><tr><td colspan=\"2\"><b><font size=\"3\">Let us contact you</font></b><a name=\"contactform\"></a><br><br><br></td></tr><tr><td valign=\"top\"><font color=\"#000000\" size=\"2\" face=\"Arial, Helvetica, sans-serif\"> First Name: </font></td><td><input type=\"text\" name=\"FirstName\" value=\"" +  crt_Firstname + "\"></td></tr><tr><td valign=\"top\"><font color=\"#000000\" size=\"2\" face=\"Arial, Helvetica, sans-serif\"> Last Name: </font></td><td><input type=\"text\" name=\"LastName\" value=\"" + crt_Lastname + "\"></td></tr><tr><td valign=\"top\"><font color=\"#000000\" size=\"2\" face=\"Arial, Helvetica, sans-serif\"> Company Name: </font></td><td><input type=\"text\" name=\"CompanyName\" value=\"" + crt_Company + "\"></td></tr><tr><td valign=\"top\"><font color=\"#000000\" size=\"2\" face=\"Arial, Helvetica, sans-serif\"> Email Address: </font></td><td><input type=\"text\" name=\"EmailAddress\" value=\"" + crt_Email + "\"></td></tr><tr><td valign=\"top\"><font color=\"#000000\" size=\"2\" face=\"Arial, Helvetica, sans-serif\"> Phone: </font></td><td><input type=\"text\" name=\"Phone\" value=\"" + crt_Phone + "\"></td></tr><tr><td valign=\"top\"><font color=\"#000000\" size=\"2\" face=\"Arial, Helvetica, sans-serif\"> Country: </font></td><td><input name=\"Country\" type=\"text\" id=\"Country\" value=\"" + crt_Country + "\"></td></tr><tr><td valign=\"top\"><font color=\"#000000\" size=\"2\" face=\"Arial, Helvetica, sans-serif\"> Comments: </font></td><td><textarea name=\"Comments\" rows=\"8\" cols=\"40\"></textarea></td></tr><tr><td colspan=\"2\" align=\"center\"><input type=\"button\" value=\"Submit\" onClick=\"contactFormSubmit();\"></td></tr></table></form><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>";


	var topPageString = "<html><head><title>Nokia Enterprise Solutions Firewall / IP VPN Platform Recommendation Tool</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><link href=\"http://forms.nokiaforbusiness.com/content/styles2\" rel=\"stylesheet\" type=\"text/css\"><link href=\"http://usa.nokia.com/css/style_r50_70.css\" rel=\"stylesheet\" type=\"text/css\"><link href=\"http://usa.nokia.com/css/style_r50_ES_hd_ft_20.css.css\" rel=\"stylesheet\" type=\"text/css\"><link href=\"http://usa.nokia.com/css/style_r50_ES_37.css\" rel=\"stylesheet\" type=\"text/css\"><link href=\"../css/nokia_styles2.css\" rel=\"stylesheet\" type=\"text/css\">" + formValidation + "</head><body><div class=\"es_top_container\"><div class=\"es_header_container\"><ul class=\"es_search_listitems\"><li class=\"first\">You are here.&nbsp;<a href=\"http://www.nokia-platformtool.com/scripts/main.htm\">Nokia Firewall / IP VPN Platform Recommendation Tool</a></li></ul><br><a href=\"http://usa.nokia.com\"><img src=\"http://usa.nokia.com/pics/logo_nokia_115_40_1.gif\" alt=\"Nokia\" border=\"0\"/></a><img src=\"../images/platform_hdr_2006.jpg\" width=\"600\" height=\"94\" border=\"0\"><img class=\"es_header_nfb_logo\" src=\"http://usa.nokia.com/pics/nfb_logo_1.gif\"></div><div class=\"es_topnavi_container\"><ul class=\"es_1st_lvl\">            <li class=\"first\"><a href=\"http://www.nokia-platformtool.com/scripts/main.htm\">Nokia Firewall / IP VPN Platform Recommendation Tool</a></li><li></li></ul><ul class=\"es_2nd_lvl\"></ul></div><div class=\"es_bottom_container\"><div class=\"es_content_container\"><div class=\"flexContainer\" id=\"p186542\"><div class=\"flexContainer\" id=\"p186543\"><div class=\"es_tsr_body low_margin\"><p class=\"es_editorial_crop\"><table border=0 cellspacing=0 cellpadding=5 bgcolor=\"#FFFFFF\" width=720><tr><td style=\"padding-bottom: 5px;\"><p class=\"font-size:14pt;\"><strong>Platforms That Meet Your Criteria.</strong></p><p>Following are an estimate of Nokia IP Security Platforms that meet your criteria. To find detailed platform configuration for your needs, please contact your Nokia representative or select the box below to have a local Nokia representative contact you.</p><p><input type=\"checkbox\" value=\"yes\" name=\"nokiarepcontact\"> Yes, Please have a Nokia representative contact me</p><p>Email Address: <input type=\"text\" name=\"EmailAddress\" value=\"" + crt_Email + "\"></p><p><input type=\"button\" value=\"Submit\" onClick=\"contactFormSubmit();\"></p></td></tr><tr><td><br><table width=100% border=0 cellspacing=4 cellpadding=0>";

	var productPortionString = "";

	var summaryString = "</td></tr></table></td></tr></table><table width=618 border=0 cellspacing=3 cellpadding=3><tr><td width=100% valign=middle bgcolor=#CCCCCC><b><span class=\"font-size:14pt;\">Your Criteria.</b></span><br></td></tr></table><table width=618 border=0 cellspacing=0 cellpadding=0><tr><td><table width=100% border=0 cellspacing=3 cellpadding=3><tr><td>";

var bottomPageString = "</table></td></tr></table></td></tr><tr><td bgcolor=#DDDDDD><img border=0 src=\"../images/spacer.gif\" width=1 height=1></td></tr><tr><td bgcolor=#DDDDDD><img border=0 src=\"../images/spacer.gif\" width=1 height=1 ></td></tr></table></div><div class=\"es_footer_container\"><ul class=\"es_footer\"><li><a href=\"http://europe.nokia.com/location\" target=\"_blank\">Other Nokia sites</a></li><li><a href=\"http://www.nokia.com/aboutnokia\" target=\"_blank\">About Nokia</a></li><li><a href=\"http://usa.nokia.com/siteterms_es_nam\">Site terms</a></li><li><a href=\"http://usa.nokia.com/privacypolicy_es_nam\">Privacy policy</a></li></ul><p>Copyright &copy;2007 Nokia. All rights reserved.</p></div></body></html><script language=\"JavaScript\" src=\"../js/functions.js\" ></script><SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\" SRC=\"http://www.nokia.com/ipsecurity/elqNow/elqCfg.js\"></SCRIPT><SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\" SRC=\"http://www.nokia.com/ipsecurity/elqNow/elqImg.js\"></SCRIPT></body></html>";

	//for every products in the list of products
	for (p=0;p<ar_LIST.length;p++){
		//check if the product is valid for the selected criteria
		if (ar_LIST[p].flg){
			// display with the image on the left in its own cell
			productPortionString = productPortionString + "<tr><td rowspan=3 valign=top><img border=\"0\" src=\"../products/" + ar_LIST[p].img + "\"></td><td valign=top><b>" + ar_LIST[p].nam + "</b></td></tr><tr><td valign=top>" + ar_LIST[p].dsc + "</td></tr><tr><td valign=top><a href=\"../docs/" + ar_LIST[p].nam + "_data_NA.PDF\"  target=\"top\">View Specifications (Americas)<br><a href=\"../docs/" + ar_LIST[p].nam + "_data_EMEA.PDF\"  target=\"top\">View Specifications (EMEA)<br><a href=\"../docs/" + ar_LIST[p].nam + "_data_APAC.PDF\"  target=\"top\">View Specifications (APAC)<br></td></tr><tr><td valign=top colspan=2><hr></td></tr>";

			// display with the image on the right, image and text in one cell
			//productPortionString = productPortionString + "<tr><td colspan=2><img align=\"left\" hspace=\"10\" vspace=\"5\" src=\"../products/" + ar_LIST[p].img + "\"><b>" + ar_LIST[p].nam + "</b><br>" + ar_LIST[p].dsc + "<br><br><a href=\"" + ar_LIST[p].lnk + "\">View Specifications</a></td></tr><tr><td valign=top colspan=2><hr></td></tr>";
		}
	}

	//put in a no product meessage if none are meeting the user's criteria
	if(productPortionString == ""){
		productPortionString = "<tr><td valign=top colspan=2>Your criteria resulted in no configurable model of a Nokia security device.  You may want to review your criteria and try again.<br><div align=right><a href=\"javascript:history.back();\"><strong>Go back to the form.</strong></a></div><br>&nbsp;</td></tr>";
	}else{
			productPortionString = productPortionString + "<tr><td align=right valign=top colspan=2><a href=\"javascript:history.back();\"><strong>Go back to the form.</strong></a></td></tr>";
	}

	//Q1
	summaryString = summaryString + "<p><b>Q1.Customer Information:</b><ul><li>Firstname: <em>" + crt_Firstname + "</em></li><li>Lastname: <em>" + crt_Lastname + "</em></li><li>Company: <em>" + crt_Company + "</em></li><li>E-Mail: <em>" + crt_Email + "</em></li><li>Phone: <em>" + crt_Phone + "</em></li><li>Industry Type: <em>" + crt_Industry + "</em></li><li>Country: <em>" + crt_Country + "</em></li><li>Type of User: <em>" + crt_TypeUser + "</em></li><li>Opt-In: <em>" + crt_OptIn + "<br />" + crt_addressOptIn + "</em></li></ul><br>";
	//Q2
	summaryString = summaryString + "<p><b>Q2.Type of office</b>: <em>" + crt_Office + "</em><br>";
	//Q3
	summaryString = summaryString + "<p><b>Q3.Type of security functionality needed</b>: <em>" + crt_Functionality + "</em><br>";
	//Q3a
	// if Other is selected in Q1, must have some value in the text box
	if(doc.Functionality.selectedIndex >1)
	{
		summaryString = summaryString + "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Remote Access Authentication Server required?</b>: <em>" + crt_Functionality_RAAS + "</em><br>";
	}
	//Q4
	summaryString = summaryString + "<p><b>Q4.Type and quantity of External Connections required at the site:</b><ul><li>DSL or Cable Modem: <em>" + crt_DSL + "</em></li><li>T1/E1: <em>" + crt_T1E1 + "</em></li><li>DS3: <em>" + crt_DS3 + "</em></li><li>Other: <em>" + crt_ISDN + "</em></li></ul><br>";
	//Q5
	summaryString = summaryString + "<p><b>Q5.Type and quantity of Internal Connections required at the site:</b><ul><li>10/100: <em>" + crt_Ten_100 + "</em></li><li>Gig-E: <em>" + crt_Gig_E + "</em></li><li>10 GigE: <em>" + crt_Ten_GigE + "</em></li></ul><br>";
	//Q6
	summaryString = summaryString + "<b>Q6.Required Firewall Connections</b>: <em>" + crt_FirewallConnections + "</em><br><br>";
	//Q7
	summaryString = summaryString + "<b>Q7.Required Firewall throughput</b>: <em>" + crt_Firewall + "</em><br><br>";
	//Q8
	summaryString = summaryString + "<p><b>Q8.Required VPN throughput</b>: <em>" + crt_VPN + "</em><br><br>";
	//Q9
	summaryString = summaryString + "<p><b>Q9.Type of traffic will be processed by the appliance</b>: <em>" + crt_Traffic + "</em><br>";
	//Q10
	summaryString = summaryString + "<p><b>Q10.Type of High Availability is required</b>: <em>" + crt_Availability + "</em><br>";
	//Q11
	summaryString = summaryString + "<p><b>Q11.Hardware redundancy needed</b>: <em>" + crt_Redundancy + "</em><br>";
	//Q12
	summaryString = summaryString + "<p><b>Q12.Hot-swappable components needed</b>: <em>" + crt_Swappable + "</em><br>";
	//Q13
	summaryString = summaryString + "<p><b>Q13.Type of authentication required</b>: <em>" + crt_Authentication + "</em><br>";
	//Q14
	summaryString = summaryString + "<p><b>Q14.Other requirements needed for deployment?</b>: <em>" + crt_other_requirements + "</em><br>&nbsp;";

	productPortionString = productPortionString + "<tr><td colspan=2>" + summaryString + "</td></tr>"


	fullPageString = topPageString + productPortionString + bottomPageString;
	document.write(fullPageString)
		return false;
}


// -------------------------------------------------------------------------
//                          MAIN FUNCTION
// -------------------------------------------------------------------------
function processForm()
{
	if(validate()){
		recordCriteria();
		productMatching();
		writePage();
	}else{
		return false;
	}
}
//-->