Common = {};

Common.window = {};

Common.send = {};

Common.window = function(){
	return {
		show : function(html, title) {

			// apple各製品対応
			//var agents = navigator.userAgent;
			//if(agents.indexOf('iPhone') > 0 || agents.indexOf('iPad') > 0 || agents.indexOf('iPod') > 0) {
			//	location.href = 'http://www.steprize.com/privacy.html';
			//}

			var el = new Ext.Window({
				title: title,
				modal: true,
				layout: 'fit',
				autoScroll:	true,
				width: 850,
				buttonAlign: 'left',
				buttons: [{
					text: '閉じる',
					minWidth: 120,
					handler: function() {
						el.close();
					}
				}]
			});

			var iframe = Ext.DomHelper.append(document.body,{
				tag: 'iframe',
				name: 'frame',
				scrolling:'yes',
				frameBorder:0,
				src: html,
				style:'width:100%;height:100%;'
			});

			var panel = new Ext.Panel({
				region: 'center',
				contentEl: iframe,
				height: 650,
				width: '100%'
			});

			el.add(panel);
			el.show();
		}
	};
}();

Common.send = function(){
	return {
		execute : function() {
			Ext.Msg.confirm('送信確認', 'この内容で送信してもよろしいですか？<br />※はいを押下するとこのまま送信されます。', function(btn){
				if (btn == 'yes'){
					var el = Ext.get('contact_form');
					el.dom.submit();
				}
			});
		}
	};
}();

