(function(global){ global.MOvertureSS_ignore = /(?:保険|山形|チョコレート)/; })(this); (function() { this.MOvertureCM = (function() { function MOvertureCM() {} MOvertureCM.prototype.panel = ['adSide']; MOvertureCM.prototype.adPerPanel = [5]; MOvertureCM.prototype.template = ['/f/adOverture/template/defaultYDN.txt']; MOvertureCM.prototype.defaultTemplate = '/f/adOverture/template/defaultYDN.txt'; MOvertureCM.prototype.lastExecCount = 2; MOvertureCM.prototype.execCount = 0; MOvertureCM.prototype.init = function(opt, count) { var editTemplate, idx, k, num, tmp_adPerPanel, tmp_panel, tmp_template, v, val, _i, _j, _len, _len1, _ref, _ref1; if (opt == null) { opt = {}; } if (count == null) { count = 0; } for (k in opt) { v = opt[k]; this[k] = v; } tmp_panel = []; tmp_adPerPanel = []; tmp_template = []; if (this.panel.length > 1 && this.panel.length === this.template.length) { editTemplate = true; } _ref = this.panel; for (idx = _i = 0, _len = _ref.length; _i < _len; idx = ++_i) { val = _ref[idx]; if ($("#" + val).get(0)) { tmp_panel.push(val); tmp_adPerPanel.push(this.adPerPanel[idx]); if (editTemplate) { tmp_template.push(this.template[idx]); } } } this.panel = tmp_panel; this.adPerPanel = tmp_adPerPanel; if (editTemplate) { this.template = tmp_template; } _ref1 = this.adPerPanel; for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { num = _ref1[_j]; count = count + +num; } return typeof jQuery !== "undefined" && jQuery !== null ? typeof jQuery.ajax === "function" ? jQuery.ajax({ url: 'http://im.ov.yahoo.co.jp/js_flat/v2/', data: { source: this.partnerId || 'mapion_jp_cat_ctxt', ctxtId: this.ctxtId || 'test01', type: this.type || 'mapion', outputCharEnc: ("" + (this.enc || 'utf-8')).replace('utf-8', 'utf8'), maxCount: count, ctxtUrl: encodeURIComponent("" + location.protocol + "//" + location.host + location.pathname) }, dataType: 'jsonp', jsonp: 'callback', timeout: 5000, success: (function(_this) { return function(json) { return _this.show(json); }; })(this), error: (function(_this) { return function() { return _this.error(); }; })(this) }) : void 0 : void 0; }; MOvertureCM.prototype.show = function(json) { var ClickUrl, data, description, idx, label, list, num, siteHost, title, _i, _len, _ref, _ref1, _ref2, _ref3, _results; if ((json != null ? (_ref = json.Results) != null ? (_ref1 = _ref.ResultSet) != null ? _ref1.Listing : void 0 : void 0 : void 0) == null) { return this.error(); } _ref2 = json.Results.ResultSet, list = _ref2.Listing, label = _ref2.Label; list = [].concat(list); _ref3 = this.adPerPanel; _results = []; for (idx = _i = 0, _len = _ref3.length; _i < _len; idx = ++_i) { num = _ref3[idx]; data = (function() { var _j, _len1, _ref4, _ref5, _results1; _ref4 = list.splice(0, +num); _results1 = []; for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) { _ref5 = _ref4[_j], description = _ref5.description, ClickUrl = _ref5.ClickUrl, title = _ref5.title, siteHost = _ref5.siteHost; _results1.push({ descr: description, clickURL: ClickUrl, title: title, sitehost: siteHost }); } return _results1; })(); _results.push((function(_this) { return function(data, template, selector) { var helper; helper = new MAPION.tmpl.TemplateHelper(MAPION.tmpl.Template.jsmf); helper.addEventListener("onload", function(event) { $(selector).html(event.templateFunction({ ad: data, label: label })); if ((--idx) === 0) { _this.hideLoadingImg(); return typeof _this._showCallback === "function" ? _this._showCallback() : void 0; } }); return helper.compileWithURL("" + (template || _this.defaultTemplate) + "?r=" + ((1024 * Math.random()) >> 0)); }; })(this)(data, this.template[idx], "#" + this.panel[idx])); } return _results; }; MOvertureCM.prototype.error = function() { if ((this.execCount++) < this.lastExecCount) { return this.init(); } else { this.hideLoadingImg(); return typeof this._errorCallback === "function" ? this._errorCallback() : void 0; } }; MOvertureCM.prototype.hideLoadingImg = function() { var color, panel, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _results, _results1, _results2; if (this.type === "season") { _ref = this.panel; _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { panel = _ref[_i]; _results.push($("#" + panel).css({ "background": "none" })); } return _results; } else if (this.type === "beauty_map") { _ref1 = this.panel; _results1 = []; for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { panel = _ref1[_j]; color = panel === "adBeautyMap_upper_right" ? "#F9F9F9" : "#fff"; _results1.push($("#" + panel).css({ "background": "none", "background-color": color })); } return _results1; } else { _ref2 = this.panel; _results2 = []; for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { panel = _ref2[_k]; _results2.push($("#" + panel).css({ "background": "none", "background-color": "#fff" })); } return _results2; } }; MOvertureCM.prototype.showCallback = function(_showCallback) { this._showCallback = _showCallback; }; MOvertureCM.prototype.errorCallback = function(_errorCallback) { this._errorCallback = _errorCallback; }; return MOvertureCM; })(); this.MOverture = new this.MOvertureCM; }).call(this); (function() { this.MOvertureSS = (function() { function MOvertureSS() {} MOvertureSS.prototype.keywords = null; MOvertureSS.prototype.default_keywords = encodeURIComponent('住み替え'); MOvertureSS.prototype.default_encoding = 'utf-8'; MOvertureSS.prototype.ignore = window.MOvertureSS_ignore || null; MOvertureSS.prototype.panel = ['adArea']; MOvertureSS.prototype.adPerPanel = [5]; MOvertureSS.prototype.template = []; MOvertureSS.prototype.thumbnail = false; MOvertureSS.prototype.init = function(opt, count) { var k, num, v, _i, _len, _ref; if (opt == null) { opt = {}; } if (count == null) { count = 0; } for (k in opt) { v = opt[k]; this[k] = v; } if (!this.keywords) { return; } _ref = this.adPerPanel; for (_i = 0, _len = _ref.length; _i < _len; _i++) { num = _ref[_i]; count = count + +num; } return $.ajax({ url: "http://dx.mapion.co.jp/map/uc/ApiCall", data: { grp: this.grp || 'all', apiName: 'OvertureSS', ie: this.enc || 'utf-8', oe: this.enc || 'utf-8', json: 1, Partner: this.partner || 'mapion_jp_xml_search', Keywords: decodeURIComponent(this.keywords), accountFilters: this.accountFilters || 'mapion_jp', urlFilters: this.urlFilters || 'mapion_jp', termFilters: this.termFilters || 'mapion_jp', adultFilter: this.adultFilter || 'clean', mkt: this.mkt || 'jp', type: this.type || 'site1', maxCount: count, bolding: this.bolding || 'true', affilData: this.affilData || 'ip%3D203.14.212.216%26ua%3DMozilla%2F4.0+%28compatible%3B+MSIE+6.0%3B+Windows+NT+5.1%29', serveUrl: encodeURIComponent(this.serveUrl || ("http://" + location.hostname + "/")), xargs: this.xargs || void 0, hData: this.hData || void 0 }, dataType: 'jsonp', jsonp: 'callback', timeout: 5000, success: (function(_this) { return function(json) { var list, num_found, overtureCM, _ref1, _ref2; list = json != null ? (_ref1 = json.Results) != null ? (_ref2 = _ref1.ResultSet) != null ? _ref2.Listing : void 0 : void 0 : void 0; num_found = [].concat(list || []).length; if (num_found === 0) { overtureCM = new MOvertureCM(); overtureCM.count = count; overtureCM.ctxtId = 'mapion'; overtureCM.type = 'ss_fallback'; overtureCM.panel = _this.panel; overtureCM.adPerPanel = _this.adPerPanel; return overtureCM.init(); } else { return _this.show([].concat(list)); } }; })(this) }); }; MOvertureSS.prototype.show = function(list) { var ClickUrl, data, description1, description2, idx, num, siteHost, title, _i, _len, _ref, _results; _ref = this.adPerPanel; _results = []; for (idx = _i = 0, _len = _ref.length; _i < _len; idx = ++_i) { num = _ref[idx]; data = (function() { var _j, _len1, _ref1, _ref2, _results1; _ref1 = list.splice(0, +num); _results1 = []; for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { _ref2 = _ref1[_j], description1 = _ref2.description1, description2 = _ref2.description2, ClickUrl = _ref2.ClickUrl, title = _ref2.title, siteHost = _ref2.siteHost; _results1.push({ descr: description1 + description2, clickURL: ClickUrl.content, title: title, sitehost: siteHost }); } return _results1; })(); _results.push((function(_this) { return function(data, template, selector) { var helper; helper = new MAPION.tmpl.TemplateHelper(MAPION.tmpl.Template.jsmf); helper.addEventListener("onload", function(event) { $(selector).html(event.templateFunction({ ad: data })); if ((--idx) === 0) { _this.hideLoadingImg(); return typeof _this._showCallback === "function" ? _this._showCallback() : void 0; } }); template || (template = (_this.thumbnail ? "/f/adOverture/template/defaultSSwithThumb.txt" : "/f/adOverture/template/defaultSS.txt")); return helper.compileWithURL("" + template + "?r=" + ((1024 * Math.random()) >> 0)); }; })(this)(data, this.template[idx], "#" + this.panel[idx])); } return _results; }; MOvertureSS.prototype.hideLoadingImg = function() { var panel, _i, _len, _ref, _results; _ref = this.panel; _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { panel = _ref[_i]; _results.push($("#" + panel).css({ "background": "none" })); } return _results; }; MOvertureSS.prototype.showCallback = function(_showCallback) { this._showCallback = _showCallback; }; MOvertureSS.prototype.errorCallback = function(_errorCallback) { this._errorCallback = _errorCallback; }; return MOvertureSS; })(); this.MOverture = new this.MOvertureSS; }).call(this);