7c0b4b5689dd6bb8197d89c241418187779fe313e018d020358c789d9f879a2e

Source Code:

/**
 * DMM PartsRequest Library
 *
 * Copyright 2012, DMM.com
 */
var dmmUtility = dmmUtility || {};

dmmUtility.replaceHost = function(url) {
    return url.replace("www.dmm.co.jp", location.hostname);
};

var browseRecommend = {};

function switchOrientationi3(targetid) {
    var orientation = window.orientation;
    
    var len=$('.item').size()
    
    var cnt = len < 3 ? '2.5' : '2';
    var over = len < 3 ? 'over_off' : 'over_on';
    var dots = len < 3 ? 'dots_off' : 'dots_on';
    
    if (orientation == 0) {
        new Swipe(document.getElementById(targetid),cnt,over,dots);
    } else {
        new Swipe(document.getElementById(targetid),cnt,over,dots);
    }
};

if(window.location.href.indexOf('dmm.co.jp') > 0) {
    var domain = 'co.jp';
} else {
    var domain = 'com';
}
var recommendsCallUrl = '//www.dmm.' + domain + '/service/digitalapi/browserecommend/-/recommends_call/';

browseRecommend.loadRecommend = function(target, params) {
    var url = dmmUtility.replaceHost('//www.dmm.co.jp/service/digitalapi/browserecommend/-/recommends_call/');
    $.post(url, params, function(data) {
        $(target).html(data);
    });
}

browseRecommend.loadItemToItem = function(target, params) {
    var url = dmmUtility.replaceHost(recommendsCallUrl);
    $.post(url, params, function(data) {
        $(target).html(data),$(".page-detail").addClass("loaded");
        switchOrientationi3('slider7');
        $(window.onorientationchange).bind('load',switchOrientationi3);

    });
};

browseRecommend.loadUserToItem = function(target, params) {
    var url = dmmUtility.replaceHost(recommendsCallUrl);
    $.post(url, params, function(data) {
        $(target).html(data),$(".page-detail").addClass("loaded");
        switchOrientationi3('slider8');
        $(window.onorientationchange).bind('load',switchOrientationi3);

    });
};

browseRecommend.loadUserToGenre = function(target, params) {
    var url = dmmUtility.replaceHost(recommendsCallUrl);
    $.post(url, params, function(data) {
        $(target).html(data),$(".page-detail").addClass("loaded");
        switchOrientationi3('slider9');
        $(window.onorientationchange).bind('load',switchOrientationi3);
    });
};

browseRecommend.loadMutualLink = function(target, params) {
    var url = dmmUtility.replaceHost('//www.dmm.co.jp/misc/-/mutual-link/ajax-index/=/cid=' + encodeURIComponent(params['content_id']) + '/service=' +  encodeURIComponent(params['service']) + '/shop=' + encodeURIComponent(params['shop']) + '/');
    $.get(url, function(data) {
        if (data) {
            $(target).html(data).show();
        }
    });
};

browseRecommend.loadDetailTag = function(target, params) {
    var url = dmmUtility.replaceHost('//www.dmm.co.jp/tag/-/view/ajax-index/');
    $.post(url, params, function(data) {
        $(target).html(data);
    });
};

browseRecommend.loadAlsoBought = function(target, params) {
	var url = dmmUtility.replaceHost('//www.dmm.co.jp/misc/-/recommend/ajax-also-bought/=/cid=' + encodeURIComponent(params['cid']) + '/service=' + encodeURIComponent(params['service']) + '/shop=' + encodeURIComponent(params['shop']) + '/');
	$.post(url, params, function(data) {
        $(target).html(data),$(".page-detail").addClass("loaded");
        switchOrientation()
        $(window.onorientationchange).bind('load',switchOrientation);
        
        function switchOrientation() {
            var orientation = window.orientation;
            
            var len=$('.item').size()
            
            var cnt = len < 3 ? '2.5' : '2';
            var over = len < 3 ? 'over_off' : 'over_on';
            var dots = len < 3 ? 'dots_off' : 'dots_on';
            
            if (orientation == 0) {
                new Swipe(document.getElementById('also_bought'),cnt,over,dots);
            } else {
                new Swipe(document.getElementById('also_bought'),cnt,over,dots);
            }
        };
    });
};