//

//  OMRON English Query

//

//  2003.03.31

//  Copyright (C) 2003 MCS All rights reserved.

//







/*************************************************************



    エリア別ポップアップメニュー項目、メールアドレスを設定



    create: 2004.03.31

    modify: 

    

    productsList    製品リスト（全エリア同一）

    countryList     国リスト

    addressList     製品、国、質問事項それぞれに対する送信

                    先を設定



*************************************************************/

var productsList = new Array( 1 );

var countryList  = new Array( 4 );

var addressList  = new Array( 4 );



// アメリカ用製品リスト

productsList['america'] = new Array(

	"Access control systems",

//	"Automated teller machines (ATMs)",

	"Automatic pass gates",

	"Automatic ticket vendors",

	"Automotive components",

	"Blood pressure monitors",

	"Boarding pass readers",

	"Body-fat monitors",

//	"Cash dispensers",

	"Control components",

//	"Credit authorisation terminals (CATs)",

//	"Electronic cash registers",

//	"Electronic money products",

//	"Face recognition",

	"Factory automation systems",

	"Hybrid card readers",

	"IC card readers",

	"Infrared therapy devices",

	"Magnetic card readers",

	"Massagers",

//	"Millimeter wave systems",

	"Modems",

	"Nebulisers",

//	"Parking systems",

	"Pedometers",

//	"Point-of-sale terminals (POS)",

	"Programmable logic controllers (PLCs)",

	"Programmable terminals (PTs)",

	"Relays",

	"RFID components",

	"Sensors",

	"Switches",

	"Temprature sensors",

	"Thermometers (home use)",

	"Timers",

//	"Traffic & road management systems",

	"Uninterruptable power supplies",

	"Vision systems",

	"Other products"

);



// アメリカ用「国」リスト

countryList['america'] = new Array(

	"U.S.A",

	"Brazil",

	"Canada",

	"Other"

);



// アメリカ用メール送信先対応リスト

addressList['america'] = {

	// Products

	"Access control systems"                : "",

//	"Automated teller machines (ATMs)"      : "7978781d2762400f91a5159130e2c24a",

	"Automatic pass gates"                  : "7978781d2762400f91a5159130e2c24a",

	"Automatic ticket vendors"              : "7978781d2762400f91a5159130e2c24a",

	"Automotive components"                 : "",

	"Blood pressure monitors"               : "21be7583416f03cff9700a2d6c4dd405",

	"Boarding pass readers"                 : "7978781d2762400f91a5159130e2c24a",

	"Body-fat monitors"                     : "21be7583416f03cff9700a2d6c4dd405",

//	"Cash dispensers"                       : "7978781d2762400f91a5159130e2c24a",

	"Control components"                    : "",

//	"Credit authorisation terminals (CATs)" : "7978781d2762400f91a5159130e2c24a",

//	"Electronic cash registers"             : "7978781d2762400f91a5159130e2c24a",

//	"Electronic money products"             : "7978781d2762400f91a5159130e2c24a",

//	"Face recognition"                      : "7978781d2762400f91a5159130e2c24a",

	"Factory automation systems"            : "",

	"Hybrid card readers"                   : "",

	"IC card readers"                       : "",

	"Infrared therapy devices"              : "21be7583416f03cff9700a2d6c4dd405",

	"Magnetic card readers"                 : "",

	"Massagers"                             : "21be7583416f03cff9700a2d6c4dd405",

//	"Millimeter wave systems"               : "7978781d2762400f91a5159130e2c24a",

	"Modems"                                : "536586678d37aee49e25c516dd630755",

	"Nebulisers"                            : "21be7583416f03cff9700a2d6c4dd405",

//	"Parking systems"                       : "7978781d2762400f91a5159130e2c24a",

	"Pedometers"                            : "21be7583416f03cff9700a2d6c4dd405",

//	"Point-of-sale terminals (POS)"         : "7978781d2762400f91a5159130e2c24a",

	"Programmable logic controllers (PLCs)" : "",

	"Programmable terminals (PTs)"          : "",

	"Relays"                                : "",

	"RFID components"                : "",

	"Sensors"                               : "",

	"Switches"                              : "",

	"Temprature sensors"                    : "",

	"Thermometers (home use)"           : "21be7583416f03cff9700a2d6c4dd405",

	"Timers"                                : "",

//	"Traffic & road management systems"     : "7978781d2762400f91a5159130e2c24a",

	"Uninterruptable power supplies"        : "",

	"Vision systems"                        : "536586678d37aee49e25c516dd630755",

	"Other products"                        : "",



	// for empty mail address

	"PRODUCTS_DEFAULT"                      : "c898c0f90b1659a3a7d7d38fe1f639ad",



	// Regarding

	"Web site"                              : "536586678d37aee49e25c516dd630755",

	"Others"                                : "536586678d37aee49e25c516dd630755",



	// Country

	"Canada"                                : "0dbd82584ca9f98dc4391e16bffef3ad"

};





// アジア用製品リスト

// productsList['asia'] = new Array(

// );



// アジア用「国」リスト

countryList['asia'] = new Array(

	"Australia",

	"India",

	"Indonesia",

	"Japan",

	"Korea",

	"Malaysia",

	"New Zealand",

	"Philippiness",

	"Singapore",

	"Thailand",

	"Vietnam",

	"Other"

);



// アジア用メール送信先対応リスト

addressList['asia'] = {

	// Products

	"Access control systems"                : "",

//	"Automated teller machines (ATMs)"      : "7978781d2762400f91a5159130e2c24a",

	"Automatic pass gates"                  : "7978781d2762400f91a5159130e2c24a",

	"Automatic ticket vendors"              : "7978781d2762400f91a5159130e2c24a",

	"Automotive components"                 : "",

	"Blood pressure monitors"               : "536586678d37aee49e25c516dd630755",

	"Boarding pass readers"                 : "7978781d2762400f91a5159130e2c24a",

	"Body-fat monitors"                     : "536586678d37aee49e25c516dd630755",

//	"Cash dispensers"                       : "7978781d2762400f91a5159130e2c24a",

	"Control components"                    : "",

//	"Credit authorisation terminals (CATs)" : "7978781d2762400f91a5159130e2c24a",

//	"Electronic cash registers"             : "7978781d2762400f91a5159130e2c24a",

//	"Electronic money products"             : "7978781d2762400f91a5159130e2c24a",

//	"Face recognition"                      : "7978781d2762400f91a5159130e2c24a",

	"Factory automation systems"            : "",

	"Hybrid card readers"                   : "",

	"IC card readers"                       : "",

	"Infrared therapy devices"              : "536586678d37aee49e25c516dd630755",

	"Magnetic card readers"                 : "",

	"Massagers"                             : "536586678d37aee49e25c516dd630755",

//	"Millimeter wave systems"               : "7978781d2762400f91a5159130e2c24a",

	"Modems"                                : "536586678d37aee49e25c516dd630755",

	"Nebulisers"                            : "536586678d37aee49e25c516dd630755",

//	"Parking systems"                       : "7978781d2762400f91a5159130e2c24a",

	"Pedometers"                            : "536586678d37aee49e25c516dd630755",

//	"Point-of-sale terminals (POS)"         : "7978781d2762400f91a5159130e2c24a",

	"Programmable logic controllers (PLCs)" : "",

	"Programmable terminals (PTs)"          : "",

	"Relays"                                : "",

	"RFID components"                : "",

	"Sensors"                               : "",

	"Switches"                              : "",

	"Temprature sensors"                    : "",

	"Thermometers (home use)"           : "536586678d37aee49e25c516dd630755",

	"Timers"                                : "",

//	"Traffic & road management systems"     : "7978781d2762400f91a5159130e2c24a",

	"Uninterruptable power supplies"        : "",

	"Vision systems"                        : "536586678d37aee49e25c516dd630755",

	"Other products"                        : "536586678d37aee49e25c516dd630755",



	// for empty mail address

	"PRODUCTS_DEFAULT"                      : "536586678d37aee49e25c516dd630755",



	// Regarding

	"Web site"                              : "536586678d37aee49e25c516dd630755",

	"Others"                                : "536586678d37aee49e25c516dd630755",



	// Country

	"Japan"                                 : "536586678d37aee49e25c516dd630755",

	"Korea"                                 : "f16cfcfc3640e9f0c7291765bfd20b81"

};





// 中国用製品リスト

// productsList['china'] = new Array(

// );



// 中国用「国」リスト

countryList['china'] = new Array(

	"China",

	"Hong Kong",

	"Taiwan",

	"Other"

);



// 中国用メール送信先対応リスト

addressList['china'] = {

	// Products

	"Access control systems"                : "",

//	"Automated teller machines (ATMs)"      : "7978781d2762400f91a5159130e2c24a",

	"Automatic pass gates"                  : "7978781d2762400f91a5159130e2c24a",

	"Automatic ticket vendors"              : "7978781d2762400f91a5159130e2c24a",

	"Automotive components"                 : "536586678d37aee49e25c516dd630755",

	"Blood pressure monitors"               : "",

	"Boarding pass readers"                 : "7978781d2762400f91a5159130e2c24a",

	"Body-fat monitors"                     : "",

//	"Cash dispensers"                       : "7978781d2762400f91a5159130e2c24a",

	"Control components"                    : "536586678d37aee49e25c516dd630755",

//	"Credit authorisation terminals (CATs)" : "7978781d2762400f91a5159130e2c24a",

//	"Electronic cash registers"             : "7978781d2762400f91a5159130e2c24a",

//	"Electronic money products"             : "7978781d2762400f91a5159130e2c24a",

//	"Face recognition"                      : "7978781d2762400f91a5159130e2c24a",

	"Factory automation systems"            : "536586678d37aee49e25c516dd630755",

	"Hybrid card readers"                   : "536586678d37aee49e25c516dd630755",

	"IC card readers"                       : "536586678d37aee49e25c516dd630755",

	"Infrared therapy devices"              : "",

	"Magnetic card readers"                 : "536586678d37aee49e25c516dd630755",

	"Massagers"                             : "",

//	"Millimeter wave systems"               : "7978781d2762400f91a5159130e2c24a",

	"Modems"                                : "536586678d37aee49e25c516dd630755",

	"Nebulisers"                            : "",

//	"Parking systems"                       : "7978781d2762400f91a5159130e2c24a",

	"Pedometers"                            : "",

//	"Point-of-sale terminals (POS)"         : "7978781d2762400f91a5159130e2c24a",

	"Programmable logic controllers (PLCs)" : "536586678d37aee49e25c516dd630755",

	"Programmable terminals (PTs)"          : "536586678d37aee49e25c516dd630755",

	"Relays"                                : "536586678d37aee49e25c516dd630755",

	"RFID components"                : "536586678d37aee49e25c516dd630755",

	"Sensors"                               : "536586678d37aee49e25c516dd630755",

	"Switches"                              : "536586678d37aee49e25c516dd630755",

	"Temprature sensors"                    : "536586678d37aee49e25c516dd630755",

	"Thermometers (home use)"           : "",

	"Timers"                                : "536586678d37aee49e25c516dd630755",

//	"Traffic & road management systems"     : "7978781d2762400f91a5159130e2c24a",

	"Uninterruptable power supplies"        : "536586678d37aee49e25c516dd630755",

	"Vision systems"                        : "536586678d37aee49e25c516dd630755",

	"Other products"                        : "536586678d37aee49e25c516dd630755",



	// for empty mail address

	"PRODUCTS_DEFAULT"                      : "536586678d37aee49e25c516dd630755",



	// Regarding

	"Web site"                              : "536586678d37aee49e25c516dd630755",

	"Others"                                : "536586678d37aee49e25c516dd630755",



	// Country

	"Hong Kong"                             : "536586678d37aee49e25c516dd630755",

	"Taiwan"                                : "536586678d37aee49e25c516dd630755"

};





// ヨーロッパ用製品リスト

// productsList['europe'] = new Array(

// );



// ヨーロッパ用「国」リスト

countryList['europe'] = new Array(

	"Austria",

	"Belgium",

	"Czech Republic",

	"Denmark",

	"Finland",

	"France",

	"Germany",

	"Hungary",

	"Israel",

	"Italy",

	"Netherlands",

	"Norway",

	"Poland",

	"Portugal",

	"Russia",

	"Spain",

	"Sweden",

	"Switzerland",

	"Turkey",

	"U.K",

	"Other"

);



// ヨーロッパ用メール送信先対応リスト

addressList['europe'] = {

	// Products

	"Access control systems"                : "7263a2b5e1cad79aaf0e55bae87052a3",

//	"Automated teller machines (ATMs)"      : "7978781d2762400f91a5159130e2c24a",

	"Automatic pass gates"                  : "7978781d2762400f91a5159130e2c24a",

	"Automatic ticket vendors"              : "7978781d2762400f91a5159130e2c24a",

	"Automotive components"                 : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Blood pressure monitors"               : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Boarding pass readers"                 : "7978781d2762400f91a5159130e2c24a",

	"Body-fat monitors"                     : "7263a2b5e1cad79aaf0e55bae87052a3",

//	"Cash dispensers"                       : "7978781d2762400f91a5159130e2c24a",

	"Control components"                    : "7263a2b5e1cad79aaf0e55bae87052a3",

//	"Credit authorisation terminals (CATs)" : "7978781d2762400f91a5159130e2c24a",

//	"Electronic cash registers"             : "7978781d2762400f91a5159130e2c24a",

//	"Electronic money products"             : "7978781d2762400f91a5159130e2c24a",

//	"Face recognition"                      : "7978781d2762400f91a5159130e2c24a",

	"Factory automation systems"            : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Hybrid card readers"                   : "7263a2b5e1cad79aaf0e55bae87052a3",

	"IC card readers"                       : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Infrared therapy devices"              : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Magnetic card readers"                 : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Massagers"                             : "7263a2b5e1cad79aaf0e55bae87052a3",

//	"Millimeter wave systems"               : "7978781d2762400f91a5159130e2c24a",

	"Modems"                                : "536586678d37aee49e25c516dd630755",

	"Nebulisers"                            : "7263a2b5e1cad79aaf0e55bae87052a3",

//	"Parking systems"                       : "7978781d2762400f91a5159130e2c24a",

	"Pedometers"                            : "7263a2b5e1cad79aaf0e55bae87052a3",

//	"Point-of-sale terminals (POS)"         : "7978781d2762400f91a5159130e2c24a",

	"Programmable logic controllers (PLCs)" : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Programmable terminals (PTs)"          : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Relays"                                : "7263a2b5e1cad79aaf0e55bae87052a3",

	"RFID components"                : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Sensors"                               : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Switches"                              : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Temprature sensors"                    : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Thermometers (home use)"           : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Timers"                                : "7263a2b5e1cad79aaf0e55bae87052a3",

//	"Traffic & road management systems"     : "7978781d2762400f91a5159130e2c24a",

	"Uninterruptable power supplies"        : "7263a2b5e1cad79aaf0e55bae87052a3",

	"Vision systems"                        : "536586678d37aee49e25c516dd630755",

	"Other products"                        : "7263a2b5e1cad79aaf0e55bae87052a3",



	// for empty mail address

	"PRODUCTS_DEFAULT"                      : "7263a2b5e1cad79aaf0e55bae87052a3",



	// Regarding

	"Web site"                              : "536586678d37aee49e25c516dd630755",

	"Others"                                : "536586678d37aee49e25c516dd630755"



	// Country

	// None!

};









/*************************************************************



    読み込み時にポップアップメニューを初期化



    create: 2004.03.23

    modify: 



*************************************************************/

function SetFormItemFirst() {

	MakePopupMenu( document.query.country,  countryList['america'],  "Please select a country" );

	MakePopupMenu( document.query.products, productsList['america'], "Select product category" );

}





/*************************************************************



    選択エリアごとにポップアップメニューの内容を設定



    create: 2004.03.17

    modify: 2004.03.23



*************************************************************/

function SetFormItem( area ) {

	MakePopupMenu( document.query.country,  countryList[area],  "Please select a country" );

//	MakePopupMenu( document.query.products, productsList[area], "Select product category" );

}





/*************************************************************



    ポップアップメニューを初期化



    create: 2004.03.17

    modify: 2004.03.19



*************************************************************/

function ResetFormItem() {

	SetFormItemFirst();

//	MakePopupMenu( document.query.products, "", "Please select area first" );

//	MakePopupMenu( document.query.country,  "", "Please select area first" );

}





/*************************************************************



    ポップアップメニューを設定



    create: 2004.03.17

    modify: 



*************************************************************/

function MakePopupMenu( popupMenu, list, text ) {

	var i, len;



	len = list.length;

	popupMenu.options.length = len + 1;



	popupMenu.options[0].value = "";

	popupMenu.options[0].text  = text;



	for ( i = 0; i < len; ++i ) {

		popupMenu.options[i + 1].value = list[i];

		popupMenu.options[i + 1].text  = list[i];

	}

	popupMenu.options[0].selected = true;

}





/*************************************************************



    選択内容と仕様に従って送信先メールアドレスを返す



    create: 2004.03.24

    modify: 



*************************************************************/

function SetMailAddress( areaObj, countryObj, regardingObj, productsObj ) {

	var index;

	var area, country, regarding, products;

	var isDebug = 0;



	index = GetSelectIndexOfRadio( areaObj );

	if ( index == -1 ) {

		window.alert( "Plese select area." );

		return false;

	}

	area = areaObj[index].value;



	index = countryObj.selectedIndex;

	if ( index == 0 ) {

		window.alert( "Plese select a country." );

		countryObj.focus();

		return false;

	}

	country = countryObj[index].value;



	index = GetSelectIndexOfRadio( regardingObj );

	if ( index == -1 ) {

		window.alert( "Plese select regarding." );

		return false;

	}

	regarding = regardingObj[index].value;



	index = productsObj.selectedIndex;

	if ( regarding == "products" && index == 0 ) {

		window.alert( "Plese select product." );

		productsObj.focus();

		return false;

	}

	products = productsObj[index].value;





	if ( document.query.userName.value == '' ) {

		window.alert( "Please enter your name." );

		document.query.userName.focus();

		return false;

	}



//	if ( document.query.tel.value == '' ) {

//		window.alert( "Please enter your telephone number." );

//		document.query.tel.focus();

//		return false;

//	}



	if ( document.query.eMail.value == '' ) {

		window.alert( "Please enter your e-mail address." );

		document.query.eMail.focus();

		return false;

	}



	if ( document.query.eMail.value.indexOf('@') == -1 ) {

		window.alert( "The e-mail address you entered appears not to be correct." );

		document.query.eMail.focus();

		return false;

	}



	if ( document.query.subject.value == '' ) {

		window.alert( "Please indicate what title best describes your inquiry." );

		document.query.subject.focus();

		return false;

	}



	if ( document.query.inquiry.value == '' ) {

		window.alert( "Please enter the question you would like to ask." );

		document.query.inquiry.focus();

		return false;

	}





	// 「質問事項」が "Web site" または "Others" なら、それぞれのアドレスを設定。

	if ( regarding == "Web site" || regarding == "Others" ) {

		document.query.mailAddress.value = addressList[area][regarding];

	}



	// 「質問事項」が "Products" で、選択した製品にメールアドレスがあれば、そのアドレスを設定。

	else if ( addressList[area][products] != "" ) {

			document.query.mailAddress.value = addressList[area][products];

	}



	// 「質問事項」が "Products" で、選択した製品にメールアドレスがなければ（「質問事項」の項目が増えた場合は修正が必要）、

	else {

		// 特定の「国」であれば、設定されたメールアドレスを、

		if ( country == "Canada" || country == "Japan" || country == "Korea" || country == "Hong Kong" || country == "Taiwan" ) {

			document.query.mailAddress.value = addressList[area][country];

		}

		// そうでなければ、デフォルトのメールアドレスを設定。

		else {

			document.query.mailAddress.value = addressList[area]["PRODUCTS_DEFAULT"];

		}

	}



	if ( isDebug ) {

		window.alert(

						"AREA: " + area + "\n" +

						"COUN: " + country + "\n" +

						"REGA: " + regarding + "\n" +

						"PROD: " + products + "\n" +

						"mail: " + addressList[area][products] + "\n" +

						"\n" +

						"SEND: " + document.query.mailAddress.value

					);

//		return false;

	}

}





/*************************************************************



    ラジオボタン選択インデックスを返す



    create: 2004.03.17

    modify: 



*************************************************************/

function GetSelectIndexOfRadio( radioItem ) {

	var i, len;



	len = radioItem.length;

	for ( i = 0; i < len; ++i ) {

		if ( radioItem[i].checked == true ) {

			return i;

		}

	}



	return -1;

}
