url = '/common/js/p/proxy';
function plan_load(dom){
  $.ajax({
    dataType: "text",
    data: {	"fname":"domtoplan","dom":dom },
    type:"POST",
    cache: true,
    url: url,
    success: function (data) {
      eval("var res = " + data);
      if(res.result == 1 && res.code != ''){
        switch(res.code){
	  case 'cws_start':	file = '/SUPPORT/contractplan/cws_start.html';	break;
	  case 'cws_biz':	file = '/SUPPORT/contractplan/cws_biz.html';	break;
	  case 'cws_premium':	file = '/SUPPORT/contractplan/cws_premium.html';	break;
	  case 'cws_marugoto':	file = '/SUPPORT/contractplan/cws_marugoto.html';	break;
	  case 'cms_lite':	file = '/SUPPORT/contractplan/cms_lite.html';	break;
	  case 'cms_free':	file = '/SUPPORT/contractplan/cms_free.html';	break;
	  case 'cms_biz':	file = '/SUPPORT/contractplan/cms_biz.html';	break;
	  case 'cms_standard':	file = '/SUPPORT/contractplan/cms_standard.html';	break;
	  case 'cms_premium':	file = '/SUPPORT/contractplan/cms_premium.html';	break;
	  case 'CWSe':	file = '/SUPPORT/contractplan/neprot_entry.html';	break;
	  case 'CWSe+':	file = '/SUPPORT/contractplan/neprot_entryplus.html';	break;
	  case 'CWSns':	file = '/SUPPORT/contractplan/neprot_nbst.html';	break;
	  case 'CWSnv':	file = '/SUPPORT/contractplan/neprot_nbnv.html';	break;
	  case 'CWSbasic':	file = '/SUPPORT/contractplan/neprot_basic.html';	break;
	  case 'CWSp':	file = '/SUPPORT/contractplan/neprot_pro.html';	break;
	  case 'CMSf':	file = '/SUPPORT/contractplan/cms_free.html';	break;
	  case 'CMSb':	file = '/SUPPORT/contractplan/cms_biz.html';	break;
	  case 'CMSp5':	file = '/SUPPORT/contractplan/cms_premium.html';	break;
	  default:	plan_loaderror();
	}
	if(file != ''){	$('#plandetail').load(file);	}
      }else{plan_loaderror();}
    },
    error: function(data){plan_loaderror();}
  });
}
function plan_loaderror(){
  tag = '<p class="pink">入力いただいたドメイン名ではご契約プランの確認が出来ませんでした。<br />' +
  '大変お手数ですが、お問い合わせページより、独自ドメイン名をご記入の上お問い合わせ下さい。</p>';
  $('#plandetail').html(tag);
}


$(function(){
  $('form#service_plan_check').submit(
    function(){
      plan_load($('input#domname').val());
      return false;
    }
  );
});