/* 2008.09.05 DEL START ※index.phpへ移動 */
//window.onload = function() {
//  sel1.make(1);
//  makeApplication();
//  makeNyukoDay();
//  makeNonyuDay();
//  chengeSend();
//};
/* 2008.09.05 DEL END ※index.phpへ移動 */

/**
 * 選択肢クラス
 */
function SelectOption(key, text, searchKeys,delKeys) {

  this.key = key;
  this.searchKeys = searchKeys; 
  this.delKeys = delKeys;
  this.disp = text;

  
  this.setOption = function() {
    this.text = text;
    this.value = text;
  };
  
  return this;
}

/**
 * セレクトボックスクラス
 */
function SelectBox(id) {
  
  /**
   * IDに対応オブジェクトを取得
   */
  function getObject() {
    var obj = document.getElementById(id);
    if(!obj.options && ( (typeof obj.length) == "number") ) {
      if(obj.length > 0) {
        obj = obj[0];
      } else {
        obj = null;
      }
    }
    return obj;
  }
  
  // オプションのリスト
  var options = [];
  
  /**
   * オプション登録
   */
  this.registOption = function(option) {
    options[options.length] = option;
  };
  
  // 子のオブジェクト
  var child = null;
  
  /**
   * 子のオブジェクトを設定
   */
  this.setChild = function(childObj) {
    child = childObj;
  };
  
   
  /**
   * キーを取得
   */
  this.getKeyByValue = function(value) {
    for(var i = 0; i < options.length; i++) {
      if(options[i].disp == value) {
        return options[i].key;
      }
    }
  };
  
  
  
  /**
   * オプション反映
   */
  this.make = function(level) {
  
    var obj = getObject();
    var key = "";
	var del = "";
    var c1;
    var c2;
    var c3;
    switch (level){
        case 1:
            key = null;
            break;
            
        case 2:
            c1 = document.getElementById("Use");
            if (c1.value == "その他"){
                key = null;
            }else{
                key = sel1.getKeyByValue(c1.value);
            }
            break;
            
        case 3:
            c1 = document.getElementById("Use");
            c2 = document.getElementById("mediaType");
//            if (c1.value == "その他"){
//                key = null;
//            }else{                
                key = sel1.getKeyByValue(c1.value) + '-' + sel2.getKeyByValue(c2.value);
//            }
            break;

        default:
            c1 = document.getElementById("Use");
            c2 = document.getElementById("mediaType");
            c3 = document.getElementById("inkType");
            if (c1.value == "その他"){
                key = null;
            }else{                
                key = sel1.getKeyByValue(c1.value) + '-' + sel2.getKeyByValue(c2.value) + '-' + sel3.getKeyByValue(c3.value);
            }
			
			if (level ==  6){
				var panel = document.getElementById("panel");
				del = sel5.getKeyByValue(panel.value);
			}else if (level ==  7){
				var flame = document.getElementById("frame");
				del = sel6.getKeyByValue(flame.value);				
			}else if(level == 8){
				var baner = document.getElementById("burnerstand");
				del = sel7.getKeyByValue(baner.value);				
			}else if(level == 10){
				var pipe = document.getElementById("burnerpipe");
				del = sel9.getKeyByValue(pipe.value);				
			}else if(level == 11){
				var p = document.getElementById("burnerpipe");
				var h = document.getElementById("sewing");
				if (h.disabled){
					del = sel9.getKeyByValue(p.value);	
				}else{
					del = sel9.getKeyByValue(p.value) + sel10.getKeyByValue(h.value);		
				}
			}else if(level == 12){
				var p = document.getElementById("burnerpipe");
				if (!p.disabled){
					del = sel9.getKeyByValue(p.value);	
				}
				var h = document.getElementById("sewing");
				if (!h.disabled){
					del = del + sel10.getKeyByValue(h.value);	
				}
				var t = document.getElementById("tape");
				if (!t.disabled){
					del = del + sel11.getKeyByValue(t.value);	
				}
				
				
			}
			if (del != ""){
				del = "(,|\)" + del + "(,|$)";
			}
			
            break;
    }
    
    if(obj) {
      // 選択肢削除
      obj.options.length = 0;
      // 表示すべき選択肢抽出
      var opt = (key != null) ? [] : options;
      if(key != null) {
        for(var i = 0; i < options.length; i++) {
          //検索キー郡の中に、渡されてきたキーが含まれていたら、表示する対象に追加
          if( (options[i].searchKeys == null) || (options[i].searchKeys.indexOf(key) >= 0) ) {
			  if (del == '' || !options[i].delKeys.match(del)){
	            opt[opt.length] = options[i];
			  }
          }
        }
      }
      // 選択肢反映
      obj.options.length = opt.length;
      if (opt.length == 0){
        obj.options[0] = new Option("　　　　　");
        obj.disabled = true;
      }else{
          obj.disabled = false;
          for(var i = 0; i < opt.length; i++) {
            opt[i].setOption.call(obj.options[i]);
          }
      }
      // 子のオブジェクトにも連鎖反映
      if(child) {
        child.make(level + 1);
      }else{	  
		chengeRope();
		chengeHatome();
	  }
    }
  };
  
  return this;
}
    

function chengeRope() {
  var objRope = document.OrderEstimateForm.elements['rope'];
  var txtInk	= objRope.options[objRope.selectedIndex].text; 
  var objRopeM = document.OrderEstimateForm.elements['ropeLength'];

  if (txtInk == "有り（長さをご記入ください）") {
	objRopeM.disabled = false;
  }else {
    objRopeM.disabled = true;
    objRopeM.value = "";
  }
}

function chengeHatome() {
  var objHatome = document.OrderEstimateForm.elements['sewing'];
  var txtHatome	= objHatome.options[objHatome.selectedIndex].text; 
  var objHatomeKo = document.OrderEstimateForm.elements['sewingCount'];

  if (txtHatome == "縫製+ハトメ加工有り（ハトメ数量をご記入ください）") {
	objHatomeKo.disabled = false;
  }else {
    objHatomeKo.disabled = true;
    objHatomeKo.value = "";
  }
}

function makeApplication() {

  
  var objInk	= document.OrderEstimateForm.elements['Use'];
  var txtInk	= objInk.options[objInk.selectedIndex].text; //選択されているインクの種類

  //OSの設定
  var objOsText	= new Array(); //optionの項目(text)
  var objOsValue	= new Array(); //optionのvalue
  if (!(txtInk == "ＣＡＤ出力")) {
    objOsText[0]	= "Windows";
    objOsText[1]	= "mac";
    objOsValue[0]	= "Windows";
    objOsValue[1]	= "mac";
  }else{
    objOsText[0]	= "Windows";
    objOsValue[0]	= "Windows";
  }
  var objOs	= document.OrderEstimateForm.elements['os'].options;
  objOs.length	= 0; 
  for(i=0; i<objOsText.length; i++) {
    objOs[i] = new Option(objOsText[i]);
    objOs[i].value	= objOsValue[i];
  }
  

  //アプリケーションの設定
  var objText	= new Array(); //optionの項目(text)
  var objValue	= new Array(); //optionのvalue

  if (!(txtInk == "ＣＡＤ出力")) {
    objText[0]	= "Illustrator";
    objText[1]	= "Photoshop";
    objText[2]	= "PDF";
    objText[3]	= "Word";
    objText[4]	= "Excel";
    objText[5]	= "PowerPoint";
    objText[6]	= "DocuWorks";
    objText[7]	= "その他";
    objValue[0]	= "Illustrator";
    objValue[1]	= "Photoshop";
    objValue[2]	= "PDF";
    objValue[3]	= "Word";
    objValue[4]	= "Excel";
    objValue[5]	= "PowerPoint";
    objValue[6]	= "DocuWorks";
    objValue[7]	= "その他";
  }

  if (txtInk == "ＣＡＤ出力") {
    objText[0]	= "AutoCAD";
    objText[1]	= "JWCAD";
    objText[2]	= "V-nas";
    objText[3]	= "他 CAD DXF";
    objText[4]	= "SXF";
    objText[5]	= "SIS（bds）";
    objText[6]	= "MapInfo（tab）";
    objText[7]	= "ArcView（shp）";
    objText[8]	= "その他";
    objValue[0]	= "AutoCAD";
    objValue[1]	= "JWCAD";
    objValue[2]	= "V-nas";
    objValue[3]	= "他 CAD DXF";
    objValue[4]	= "SXF";
    objValue[5]	= "SIS（bds）";
    objValue[6]	= "MapInfo（tab）";
    objValue[7]	= "ArcView（shp）";
    objValue[8]	= "その他";
  }
  
  if (txtInk == "その他") {
    objText[0]	= "Illustrator";
    objText[1]	= "Photoshop";
    objText[2]	= "PDF";
    objText[3]	= "Word";
    objText[4]	= "Excel";
    objText[5]	= "PowerPoint";
    objText[6]	= "DocuWorks";
    objText[7]	= "AutoCAD";
    objText[8]	= "JWCAD";
    objText[9]	= "V-nas";
    objText[10]	= "他 CAD DXF";
    objText[11]	= "SXF";
    objText[12]	= "SIS（bds）";
    objText[13]	= "MapInfo（tab）";
    objText[14]	= "ArcView（shp）";
    objText[15]	= "その他";
    objValue[0]	= "Illustrator";
    objValue[1]	= "Photoshop";
    objValue[2]	= "PDF";
    objValue[3]	= "Word";
    objValue[4]	= "Excel";
    objValue[5]	= "PowerPoint";
    objValue[6]	= "DocuWorks";
    objValue[7]	= "AutoCAD";
    objValue[8]	= "JWCAD";
    objValue[9]	= "V-nas";
    objValue[10]	= "他 CAD DXF";
    objValue[11]	= "SXF";
    objValue[12]	= "SIS（bds）";
    objValue[13]	= "MapInfo（tab）";
    objValue[14]	= "ArcView（shp）";
    objValue[15]	= "その他";

  }
  var objApplication	= document.OrderEstimateForm.elements['application'].options;
  objApplication.length	= 0; 
  for(i=0; i<objText.length; i++) {
    objApplication[i]		= new Option(objText[i]);
    objApplication[i].value	= objValue[i];
  }

  makeVersion();
}



function makeVersion() {
  var objText			= new Array(); //optionの項目(text)
  var objValue			= new Array(); //optionのvalue
  var objApplication	= document.OrderEstimateForm.elements['application'];
  var txtApplication	= objApplication.options[objApplication.selectedIndex].text; //選択されている作成アプリケーション

  if (txtApplication == "Illustrator") {
    objText[0]	= "8.0";
    objText[1]	= "10.0";
    objText[2]	= "CS";
    objText[3]	= "CS2";
    objText[4]	= "CS3";
    objText[5]	= "CS4";
    objValue[0]	= "8.0";
    objValue[1]	= "10.0";
    objValue[2]	= "CS";
    objValue[3]	= "CS2";
    objValue[4]	= "CS3";
    objValue[5]	= "CS4";
  }
  else if (txtApplication == "Photoshop") {
    objText[0]	= "5.0";
    objText[1]	= "7.0";
    objText[2]	= "CS";
    objText[3]	= "CS2";
    objText[4]	= "CS3";
    objText[5]	= "CS4";
    objValue[0]	= "5.0";
    objValue[1]	= "7.0";
    objValue[2]	= "CS";
    objValue[3]	= "CS2";
    objValue[4]	= "CS3";
    objValue[5]	= "CS4";
  }
  else if (txtApplication == "PDF") {
    objText[0]	= "4.0";
    objText[1]	= "5.0";
    objText[2]	= "6.0";
    objText[3]	= "7.0";
    objText[4]	= "8.0";
    objValue[0]	= "4.0";
    objValue[1]	= "5.0";
    objValue[2]	= "6.0";
    objValue[3]	= "7.0";
    objValue[4]	= "8.0";
  }
  else if ((txtApplication == "Word") || (txtApplication == "Excel") || (txtApplication == "PowerPoint")) {
    objText[0]	= "2000";
    objText[1]	= "2002(XP)";
    objText[2]	= "2003";
    objText[3]	= "2004";
    objText[4]	= "2007";
    objValue[0]	= "2000";
    objValue[1]	= "2002(XP)";
    objValue[2]	= "2003";
    objValue[3]	= "2004";
    objValue[4]	= "2007";
  }
  else if (txtApplication == "DocuWorks") {
    objText[0]	= "4.0";
    objText[1]	= "5.0";
    objText[2]	= "6.0";
    objValue[0]	= "4.0";
    objValue[1]	= "5.0";
    objValue[2]	= "6.0";
  }
  else if (txtApplication == "AutoCAD") {
    objText[0]	= "2000";
    objText[1]	= "2002";
    objText[2]	= "2004";
    objText[3]	= "2007";
    objText[4]	= "2008";
    objValue[0]	= "2000";
    objValue[1]	= "2002";
    objValue[2]	= "2004";
    objValue[3]	= "2007";
    objValue[4]	= "2008";
  }
  else {
    objText[0]	= "その他";
    objValue[0]	= "その他";
  }

  var objVersion	= document.OrderEstimateForm['version'].options;
  objVersion.length	= 0; 
  for(i=0; i<objText.length; i++) {
    objVersion[i]		= new Option(objText[i]);
    objVersion[i].value	= objValue[i];
  }
}

function makeNyukoDay() {
  var objText		= new Array(); //optionの項目(text)
  var objValue		= new Array(); //optionのvalue
  var objNyukoManth	= document.OrderEstimateForm.elements['nyukoMonth'];
  var txtNyukoManth	= objNyukoManth.options[objNyukoManth.selectedIndex].text; //選択されているデータ入稿予定日(月)

  objText[0]	= "1";
  objText[1]	= "2";
  objText[2]	= "3";
  objText[3]	= "4";
  objText[4]	= "5";
  objText[5]	= "6";
  objText[6]	= "7";
  objText[7]	= "8";
  objText[8]	= "9";
  objText[9]	= "10";
  objText[10]	= "11";
  objText[11]	= "12";
  objText[12]	= "13";
  objText[13]	= "14";
  objText[14]	= "15";
  objText[15]	= "16";
  objText[16]	= "17";
  objText[17]	= "18";
  objText[18]	= "19";
  objText[19]	= "20";
  objText[20]	= "21";
  objText[21]	= "22";
  objText[22]	= "23";
  objText[23]	= "24";
  objText[24]	= "25";
  objText[25]	= "26";
  objText[26]	= "27";
  objText[27]	= "28";
  objText[28]	= "29";
  objValue[0]	= "1";
  objValue[1]	= "2";
  objValue[2]	= "3";
  objValue[3]	= "4";
  objValue[4]	= "5";
  objValue[5]	= "6";
  objValue[6]	= "7";
  objValue[7]	= "8";
  objValue[8]	= "9";
  objValue[9]	= "10";
  objValue[10]	= "11";
  objValue[11]	= "12";
  objValue[12]	= "13";
  objValue[13]	= "14";
  objValue[14]	= "15";
  objValue[15]	= "16";
  objValue[16]	= "17";
  objValue[17]	= "18";
  objValue[18]	= "19";
  objValue[19]	= "20";
  objValue[20]	= "21";
  objValue[21]	= "22";
  objValue[22]	= "23";
  objValue[23]	= "24";
  objValue[24]	= "25";
  objValue[25]	= "26";
  objValue[26]	= "27";
  objValue[27]	= "28";
  objValue[28]	= "29";

  if ((txtNyukoManth == "4") || (txtNyukoManth == "6") || (txtNyukoManth == "9") || (txtNyukoManth == "11")) {
    objText[29]		= "30";
    objValue[29]	= "30";
  }
  else if ((txtNyukoManth == "1") || (txtNyukoManth == "3") || (txtNyukoManth == "5") || (txtNyukoManth == "7") || (txtNyukoManth == "8") || (txtNyukoManth == "10") || (txtNyukoManth == "12")) {
    objText[29]		= "30";
    objText[30]		= "31";
    objValue[29]	= "30";
    objValue[30]	= "31";
  }

  var objNyukoDay		= document.OrderEstimateForm.elements['nyukoDay'].options;
  objNyukoDay.length	= 0; 
  for(i=0; i<objText.length; i++) {
    objNyukoDay[i]			= new Option(objText[i]);
    objNyukoDay[i].value	= objValue[i];
  }
}

function makeNonyuDay() {
  var objText		= new Array(); //optionの項目(text)
  var objValue		= new Array(); //optionのvalue
  var objNonyuManth	= document.OrderEstimateForm.elements['deliveryMonth'];
  var txtNonyuManth	= objNonyuManth.options[objNonyuManth.selectedIndex].text; //選択されている希望納品日(月)

  objText[0]	= "1";
  objText[1]	= "2";
  objText[2]	= "3";
  objText[3]	= "4";
  objText[4]	= "5";
  objText[5]	= "6";
  objText[6]	= "7";
  objText[7]	= "8";
  objText[8]	= "9";
  objText[9]	= "10";
  objText[10]	= "11";
  objText[11]	= "12";
  objText[12]	= "13";
  objText[13]	= "14";
  objText[14]	= "15";
  objText[15]	= "16";
  objText[16]	= "17";
  objText[17]	= "18";
  objText[18]	= "19";
  objText[19]	= "20";
  objText[20]	= "21";
  objText[21]	= "22";
  objText[22]	= "23";
  objText[23]	= "24";
  objText[24]	= "25";
  objText[25]	= "26";
  objText[26]	= "27";
  objText[27]	= "28";
  objText[28]	= "29";
  objValue[0]	= "1";
  objValue[1]	= "2";
  objValue[2]	= "3";
  objValue[3]	= "4";
  objValue[4]	= "5";
  objValue[5]	= "6";
  objValue[6]	= "7";
  objValue[7]	= "8";
  objValue[8]	= "9";
  objValue[9]	= "10";
  objValue[10]	= "11";
  objValue[11]	= "12";
  objValue[12]	= "13";
  objValue[13]	= "14";
  objValue[14]	= "15";
  objValue[15]	= "16";
  objValue[16]	= "17";
  objValue[17]	= "18";
  objValue[18]	= "19";
  objValue[19]	= "20";
  objValue[20]	= "21";
  objValue[21]	= "22";
  objValue[22]	= "23";
  objValue[23]	= "24";
  objValue[24]	= "25";
  objValue[25]	= "26";
  objValue[26]	= "27";
  objValue[27]	= "28";
  objValue[28]	= "29";

  if ((txtNonyuManth == "4") || (txtNonyuManth == "6") || (txtNonyuManth == "9") || (txtNonyuManth == "11")) {
    objText[29]		= "30";
    objValue[29]	= "30";
  }
  else if ((txtNonyuManth == "1") || (txtNonyuManth == "3") || (txtNonyuManth == "5") || (txtNonyuManth == "7") || (txtNonyuManth == "8") || (txtNonyuManth == "10") || (txtNonyuManth == "12")) {
    objText[29]		= "30";
    objText[30]		= "31";
    objValue[29]	= "30";
    objValue[30]	= "31";
  }

  var objNonyuDay		= document.OrderEstimateForm.elements['deliveryDay'].options;
  objNonyuDay.length	= 0; 
  for(i=0; i<objText.length; i++) {
    objNonyuDay[i]			= new Option(objText[i]);
    objNonyuDay[i].value	= objValue[i];
  }
}

function chengeSend() {
  var objAddress			= document.OrderEstimateForm.elements['sendtoZip'];
  var objAdminDiv			= document.OrderEstimateForm.elements['sendtoPref'];
  var objCityTownVillage	= document.OrderEstimateForm.elements['sendtoAddress'];
  var objCompany			= document.OrderEstimateForm.elements['sendtoCompany'];
  var objName				= document.OrderEstimateForm.elements['sendtoName'];
  var objTel				= document.OrderEstimateForm.elements['sendtoTel'];
  var blnSend				= document.OrderEstimateForm.elements['sendto'][0].checked;

  if (blnSend) {
    objAddress.disabled = true;
    objAdminDiv.disabled = true;
    objCityTownVillage.disabled = true;
    objCompany.disabled = true;
    objName.disabled = true;
    objTel.disabled = true;
  }
  else {
    objAddress.disabled = false;
    objAdminDiv.disabled = false;
    objCityTownVillage.disabled = false;
    objCompany.disabled = false;
    objName.disabled = false;
    objTel.disabled = false;
  }
}

function makePayWay() {
  var objText	= new Array(); //optionの項目(text)
  var objValue	= new Array(); //optionのvalue
  var objInquiryType	= document.OrderEstimateForm.elements['inquiryType'];
  var txtInquiryType	= objInquiryType.options[objInquiryType.selectedIndex].text; //お問合せ種類

  if (txtInquiryType == "ご注文") {
    objText[0]	= "代金引換";
    objText[1]	= "銀行振込（先払い）";
    objText[2]	= "銀行振込（後払い）/公共団体のみ";
    objText[3]	= "店頭引渡";
    objValue[0]	= "代金引換";
    objValue[1]	= "銀行振込（先払い）";
    objValue[2]	= "銀行振込（後払い）/公共団体のみ";
    objValue[3]	= "店頭引渡";
  } else {
    objText[0]	= "−";
    objValue[0]	= "−";
  }

  var objPayWay	= document.OrderEstimateForm.elements['paidWay'].options;
  objPayWay.length	= 0; 
  for(i=0; i<objText.length; i++) {
    objPayWay[i]		= new Option(objText[i]);
    objPayWay[i].value	= objValue[i];
  }
}

// 入力チェック関数
function Check() {

	var Error_Msg = "";
	
	if (document.OrderEstimateForm.elements['name'].value == ''){
		Error_Msg += '　・お名前を入力してください。\n';
	}
	
	if (document.OrderEstimateForm.elements['furigana'].value == ''){
		Error_Msg += '　・ふりがなを入力してください。\n';
	}
	
	
	if (document.OrderEstimateForm.elements['email'].value == ''){
		Error_Msg += '　・E-Mailを入力してください。\n';
	}
	
	if (document.OrderEstimateForm.elements['tel'].value == ''){
		Error_Msg += '　・電話番号を入力してください。\n';
	}

	if (document.OrderEstimateForm.elements['zip'].value == ''){
		Error_Msg += '　・郵便番号を入力してください。\n';
	} else {
	  var objZipCode = document.OrderEstimateForm.elements['zip'];
	  if (objZipCode.value.match(/[^0-9]/g)){
		// 半角数値チェック
		Error_Msg += '　・郵便番号は半角数値で入力してください。\n';
	  }
	}
	
	if (document.OrderEstimateForm.elements['address'].value == ''){
		Error_Msg += '　・市町村以下を入力してください。\n';
	}
	
	if (document.OrderEstimateForm.elements['sendto'][1].checked) {
		if (document.OrderEstimateForm.elements['sendtoZip'].value == ''){
			Error_Msg += '　・（送付先）郵便番号を入力してください。\n';
		} else if (document.OrderEstimateForm.elements['sendtoZip'].value.match(/[^0-9]/g)){
			// 半角数値チェック
			Error_Msg += '　・（送付先）郵便番号は半角数値で入力してください。\n';
		}
		if (document.OrderEstimateForm.elements['sendtoAddress'].value == ''){
			Error_Msg += '　・（送付先）市町村以下を入力してください。\n';
		}
		if (document.OrderEstimateForm.elements['sendtoName'].value == ''){
			Error_Msg += '　・送付先氏名を入力してください。\n';
		}
	}

	if (document.OrderEstimateForm.elements['Use'].value == ''){
		Error_Msg += '　・使用用途を選択してください。\n';
	}
	
	if (document.OrderEstimateForm.elements['mediaType'].value == ''){
		Error_Msg += '　・メディア種類を選択してください。\n';
	}

	if (document.OrderEstimateForm.elements['inkType'].value == ''){
		Error_Msg += '　・インクの種類を選択してください。\n';
	}

	var objsewingCount = document.OrderEstimateForm.elements['sewingCount'];
	if (objsewingCount.disabled == false && objsewingCount.value != '') {
		if (objsewingCount.value.match(/[^0-9]/g)){
			// 半角数値チェック
			Error_Msg += '　・ハトメ数(ヶ)は半角数値で入力してください。\n';
		}
	}

	var objropeLength = document.OrderEstimateForm.elements['ropeLength'];
	if (objropeLength.disabled == false && objropeLength.value != '') {
		if (isNaN(objropeLength.value)){
			// 半角数値チェック
			Error_Msg += '　・ロープ(m)は半角数値で入力してください。\n';
		}
	}

	var objshortSide = document.OrderEstimateForm.elements['shortSide'];
	if (objshortSide.value != '' && isNaN(objshortSide.value)) {
		// 半角数値チェック
		Error_Msg += '　・短辺は半角数値で入力してください。\n';
	}

	var objlongSide = document.OrderEstimateForm.elements['longSide'];
	if (objlongSide.value != '' && isNaN(objlongSide.value)) {
		// 半角数値チェック
		Error_Msg += '　・長辺は半角数値で入力してください。\n';
	}

	var objcount = document.OrderEstimateForm.elements['count'];
	if (objcount.value == ''){
		Error_Msg += '　・枚数を入力してください。\n';
	} else if (objcount.value.match(/[^0-9]/g)) {
		// 半角数値チェック
		Error_Msg += '　・枚数は半角数値で入力してください。\n';
	}

	if ((Error_Msg) != "") {
		alert("次の項目を正しく入力（選択）してください。\n\n" + Error_Msg + "\n");
		return false;
	}
	
  	return true;
}

function ResetOrder() {

	sel1.make(1);
	document.OrderEstimateForm.elements['application'][0].selected=true;
	makeVersion();
	document.OrderEstimateForm.elements['nyukoMonth'][0].selected=true;
	makeNyukoDay();
	document.OrderEstimateForm.elements['deliveryMonth'][0].selected=true;
	makeNonyuDay();
	document.OrderEstimateForm.elements['sendto'][0].checked=true;
	chengeSend();

	document.OrderEstimateForm.elements['inquiryType'][0].selected = true;
	makePayWay();
	document.OrderEstimateForm.name.value = '';
	document.OrderEstimateForm.furigana.value = '';
	document.OrderEstimateForm.company.value = '';
	document.OrderEstimateForm.email.value = '';
	document.OrderEstimateForm.tel.value = '';
	document.OrderEstimateForm.fax.value = '';
	document.OrderEstimateForm.zip.value = '';
	document.OrderEstimateForm.elements['pref'][0].selected = true;
	document.OrderEstimateForm.address.value = '';
	document.OrderEstimateForm.sendtoZip.value = '';
	document.OrderEstimateForm.sendtoPref[0].selected = true;
	document.OrderEstimateForm.sendtoAddress.value = '';
	document.OrderEstimateForm.sendtoCompany.value = '';
	document.OrderEstimateForm.sendtoName.value = '';
	document.OrderEstimateForm.sendtoTel.value = '';
	document.OrderEstimateForm.sewingCount.value = '';
	document.OrderEstimateForm.ropeLength.value = '';
	document.OrderEstimateForm.elements['sizeForm'][0].checked = true;
	document.OrderEstimateForm.shortSide.value = '';
	document.OrderEstimateForm.longSide.value = '';
	document.OrderEstimateForm.count.value = '';
	document.OrderEstimateForm.elements['os'][0].checked = true;
	document.OrderEstimateForm.elements['version'][0].selected = true;
	document.OrderEstimateForm.elements['usePeriod'][0].selected = true;
	document.OrderEstimateForm.elements['nyukoDay'][0].selected = true;
	document.OrderEstimateForm.elements['nyukoWay'][0].selected = true;
	document.OrderEstimateForm.elements['deliveryDay'][0].selected = true;
	document.OrderEstimateForm.elements['paidWay'][0].selected = true;
	document.OrderEstimateForm.notes.value = '';

}

// リストの選択
function selectOption(itemname, key) {
	var obj = document.getElementById(itemname);
	
	if (obj.length > 0 && key != "") {
        for(var i = 0; i < obj.options.length; i++) {
          //検索キー郡の中に、渡されてきたキーが含まれていたら、表示する対象に追加
          if(obj.options[i].value == key ) {
			  	obj.options[i].selected = true;
           		break;
          }
        }
	}
}
