var unicodeEscape = function(str) { if (typeof str == 'string') { var code, pref = {1: '\\u000', 2: '\\u00', 3: '\\u0', 4: '\\u'}; return str.replace(/\W/g, function(c) { return pref[(code = c.charCodeAt(0).toString(16)).length] + code; }); } else { return str; } }; var ARRAY_FOR_RRICE_RECORD=[{name:"categoryName",type:"string"},{name:"specId",type:"int"},{name:"maker",type:"string"},{name:"model",type:"string"},{name:"price",type:"int"},{name:"shop",type:"string"},{name:"shopUrl",type:"string"}];var arrayForCombination=[{name:"shop",type:"string"},{name:"shopUrl",type:"string"},{name:"sum",type:"int"},{name:"price1",type:"int"},{name:"price2",type:"int"}];Ext.ns("Ext.pp");Ext.ns("Ext.ux.grid");Ext.pp.ModelSearchForm=Ext.extend(Ext.FormPanel,{onRender:function(A,B){Ext.pp.ModelSearchForm.superclass.onRender.call(this,A,B);Ext.apply(this.getForm(),{url:this.config.url,classId:this.initialConfig.classId})},initComponent:function(){if(!this.config){this.config={url:"http://www.parts-price.com/search/searchmodel.html"}}Ext.applyIf(this,{url:this.config.url,standardSubmit:true,labelWidth:58,autoHeight:true,width:238,frame:true,collapsible:true,collapsed:true,header:true,title:"型式検索(全カテゴリ対象)",onSubmit:Ext.emptyFn,submit:function(){this.getForm().getEl().dom.submit()},buttons:[{text:"検索",handler:function(){var C=this.ownerCt;if(C.getForm().isValid()){if(C.url){C.getForm().getEl().dom.action=C.url}if(C.baseParams){for(B in C.baseParams){C.add({xtype:"hidden",name:B,value:C.baseParams[B]})}C.doLayout()}C.getForm().submit()}}}]});Ext.pp.ModelSearchForm.superclass.initComponent.call(this);this.add(new Ext.form.Hidden({name:"cmd",value:this.initialConfig.cmd}));var A=this.getComboParamArray();for(var B=0;BD){J.rec.set("price",D)}}}}});return C};this.load=function(){if(this.modelName.toUpperCase().indexOf("",0)!=-1){var E=this.modelName.toUpperCase().indexOf(">",0)+1;var D=this.modelName.toUpperCase().indexOf("");this.modelName=this.modelName.substr(E,D-E)}var C=this.getStore();C.load({params:{modelname:this.modelName},rec:this.rec})}};function searchPriceById(A){searchPrice(A,document.URL)}function searchNewItemPrice(A){searchPrice(A,"http://www.parts-price.com/search/searchmodel.html")}function searchPrice(A,B){var E=document.createElement("form");E.id="priceSearchForm";E.method="POST";E.action=B;document.body.appendChild(E);var D=document.createElement("input");D.type="hidden";D.name="specid";D.value=A;E.appendChild(D);var D=document.createElement("input");D.type="hidden";D.name="cmd";D.value="result";E.appendChild(D);var F=new Array("spec1","spec2","spec3","maker","price","model");if(typeof config!="undefined"){for(var C=0;C'+K+"";var I=new Q({shopname:K,makername:H.makername,modelname:H.modelname,shop:G,price:E[L].get("price"),difference:0,button:""});O.push(I)}P.add(O);if(!Ext.isIE6){var F=P.getSortState();if(F==undefined){F={field:"price",direction:"asc"}}P.sort(F.field,F.direction)}if(H.apiurls.length>0){var M=new Ext.pp.PriceFromApi(H.specid,H.apiurls,P);M.load()}else{var F=P.getSortState();if(F==undefined){F={field:"price",direction:"asc"}}P.sort(F.field,F.direction)}}}});return D};this.load=function(){var D=this.getStore();D.load({params:{specid:this.specId},store:this.priceStore,apiurls:this.apiUrls,specid:this.specId,makername:this.makerName,modelname:this.modelName})}};updateCombinationGrid=function(){if(combiGrid!=undefined){combiGrid.reconfigure(combiGrid.getDataStore(),new Ext.grid.ColumnModel(combiGrid.getColumnsArray()))}else{combiGrid=new Ext.pp.CombinationGrid({renderTo:"combination-list",title:"組み合わせ価格"})}};Ext.pp.CombinationGrid=Ext.extend(Ext.grid.GridPanel,{initComponent:function(){Ext.apply(this,{autoScroll:true,autoHeight:true,collapsible:true,closable:true,ds:this.getDataStore(),selModel:new Ext.grid.RowSelectionModel({singleSelect:false}),header:true,columns:this.getColumnsArray()});Ext.pp.CombinationGrid.superclass.initComponent.call(this)},getColumnsArray:function(){var C=new Array({id:"shop",header:"販売店",width:110,sortable:false,dataIndex:"shop",hideable:false,renderer:function(H,G,D,I,F,E){return D.get("shopUrl")}});var A=listGrid.getStore();for(var B=0;B2){for(var B=2;Bメール送信完了',"指定されたアドレス宛にメールを送信しました。
iPhoneで受信後,指定されたURLにアクセスしてください。");document.body.removeChild(document.getElementById("iphoneForm"))},failure:function(f,a){Ext.Msg.alert("エラー","送信に失敗しました。メールアドレスの入力からやり直してください。");document.body.removeChild(document.getElementById("iphoneForm"))}})})}}],header:true});Ext.applyIf(this,{columns:[{id:"model",header:"型式",width:200,sortable:false,dataIndex:"model",summaryType:"count",hideable:false,summaryRenderer:function(v,params,data){return"("+v+"点)"}},{header:"分類",width:10,sortable:false,dataIndex:"categoryName",hideable:true,summaryType:"count"},{header:"価格",width:80,sortable:false,dataIndex:"price",renderer:japanMoneyRenderer,hideable:false,summaryType:"sum"},{header:"販売店",width:200,sortable:false,dataIndex:"shop",hideable:false,summaryType:"onceCount",renderer:function(value,metadata,record,rowIndex,colIndex,store){return record.get("shopUrl")},summaryRenderer:function(v,params,data){return"("+v+"軒)"}}]});Ext.pp.CalculateGrid.superclass.initComponent.call(this);this.getSelectionModel().on("selectionchange",function(sm){var records=sm.getSelections();var tbar=listGrid.getTopToolbar();tbar.items.get(0).setDisabled((records.length==0))});this.getStore().on("add",function(s,recs,idx){var tbar=listGrid.getTopToolbar();tbar.items.get(1).setDisabled(false);tbar.items.get(2).setDisabled(false);if(s.getCount()>1){updateCombinationGrid()}});this.getStore().on("remove",function(s,rec,idx){var tbar=listGrid.getTopToolbar();tbar.items.get(1).setDisabled((s.getCount()==0));tbar.items.get(2).setDisabled((s.getCount()==0));if(s.getCount()>1){updateCombinationGrid()}else{if(combiGrid!=undefined){combiGrid.hide()}}});this.getStore().on("load",function(s,rec,opt){var tbar=listGrid.getTopToolbar();tbar.items.get(1).setDisabled((s.getCount()==0));tbar.items.get(2).setDisabled((s.getCount()==0));if(s.getCount()>1){updateCombinationGrid()}});this.getColumnModel().setHidden(1,true)},getReader:function(){return new Ext.data.JsonReader({root:"list"},new Ext.data.Record.create([{name:"categoryName",type:"string",mapping:"categoryname"},{name:"specId",type:"int",mapping:"specid"},{name:"maker",type:"string",mapping:"makername"},{name:"model",type:"string",mapping:"modelname"},{name:"price",type:"int",mapping:"price"},{name:"shop",type:"string",mapping:"shopname"},{name:"shopUrl",type:"string",mapping:"shopurl"}]))},getDataStore:function(){return new Ext.data.GroupingStore({reader:this.getReader(),autoLoad:true,proxy:new Ext.data.HttpProxy({url:"http://www.parts-price.com/phps/shoppinglist.php",method:"GET",nocache:true}),sortInfo:{field:"model",direction:"ASC"},groupField:"categoryName"})}});Ext.reg("calcgrid",Ext.pp.CalculateGrid); function addShoppingList(rowindex){var rec=priceGrid.getStore().getAt(rowindex);var params={};var fieldNames=new Array("shopname","makername","modelname","shop","price");params.specid=specId;for(var i=0;iお問い合わせ,ありがとうございます。
'}]});Ext.pp.ContactPanel.superclass.initComponent.call(this)}});Ext.reg("contactpanel",Ext.pp.ContactPanel);Ext.pp.ContactFormPanel=Ext.extend(Ext.FormPanel,{onRender:function(A,B){Ext.pp.ContactFormPanel.superclass.onRender.call(this,A,B);Ext.apply(this.getForm(),{url:"http://www.parts-price.com/contact.html",method:"POST"})},initComponent:function(){Ext.apply(this,{border:false,title:"お問い合わせ",region:"north",labelWidth:60,autoHeight:true,frame:true,autoScroll:true,collapsible:true,header:true,buttons:[{text:"送信",id:"contact-submit",handler:function(){var A=this.ownerCt.getForm();A.submit({success:function(C,D){var B=document.getElementById("contact-response");var E=Ext.util.JSON.decode(D.response.responseText);B.innerHTML=E.msg;C.reset()},failure:function(B,C){alert("送信できませんでした。再度送信してください。")}})}}],items:[new Ext.form.TextField({fieldLabel:"お名前",width:500,allowBlank:false,name:"Name"}),new Ext.form.TextField({fieldLabel:"e-mail",name:"email",width:500,vtype:"email",vtypeText:"メールアドレスを入力してください。"}),new Ext.form.TextArea({fieldLabel:"内容",name:"comments",width:500,height:200,grow:false,allowBlank:false}),new Ext.form.Hidden({name:"formid",value:"feedbackForm"})]});Ext.pp.ContactFormPanel.superclass.initComponent.call(this)}});Ext.reg("contactformpanel",Ext.pp.ContactFormPanel);