/* ◇ EC Navi - JavaScript - APOS - カテゴリ別PRバナー - 2010/04/30 - kenny ◇ */


// *** APOS カテゴリ別PRバナー - CSS
document.writeln('<style type="text/css"><!--');
document.writeln('#bc_rectangle {margin-bottom: 10px; text-align: center;}');
document.writeln('#bc_rectangle div.title {text-align: left;}');
document.writeln('#bc_rectangle p.image {width: 120px; margin: 8px auto; padding: 1px; border: solid 1px #D9D9D9;}');
document.writeln('#bc_rectangle p.image img {width: 120px; height: 60px; border: 0;}');
document.writeln('#bc_rectangle p.text {margin-bottom: 4px; text-align: center; font: 12px/16px "ＭＳ ゴシック", "Osaka−等幅", "Osaka-Mono", monospace;}');
document.writeln('--></style>');


// *** APOS カテゴリ別PRバナー - 表示
function kakaku_category_pr(json){
	for(var i = 0; i < json.dataval.length; i++){
		var P = json.dataval[i];
		var is_shop_id = (P.shop_id) ? true : false;
		document.write('<div id="bc_rectangle" class="gn_side">');
		document.write('<div class="title"><h2>PR</h2></div>');
		document.write('<p class="image">');
		document.write('<a target="' + P.text1_target + '" href="' + P.banner1_link + '"><img src="' + P.banner1 + '" /></a>');
		document.write('</p>');
		document.write('<p class="text">');
		document.write('<a target="' + P.text1_target + '" href="' + P.banner1_link + '">' + P.desc.replace('[BR]', '<br />') + '</a>');
		document.write('</p>');
		var condition  = (is_shop_id) ? "100円で" : P.condition;
		var point      = (is_shop_id) ? kakaku_category_pr_fixed_point(P.shop_id) : P.point;
		var point_unit = (is_shop_id) ? "pts." : P.point_unit;
		if ((is_shop_id && parseInt(point) > 0) || (!is_shop_id && condition)) {
			document.write('<p style="text-align: center; margin-bottom: 5px;">');
			document.write('<span style="vertical-align: middle; margin-right: 3px;">');
			document.write('<img style="width: 12px; height: 12px;" src="http://kakaku.ecnavi.jp.eimg.jp/cimg/icon/coin/icon_12_coin.gif" />');
			document.write('</span>');
			document.write('<span style="vertical-align: middle; font-family: "ＭＳ Ｐゴシック","ヒラギノ角ゴ Pro W3","Hiragino Kaku Gothic Pro","Osaka",sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">');
			document.write(condition + '<span style="color: rgb(209, 0, 0); font-family: Verdana,Arial,Helvetica,sans-serif;"><span>' + point + '</span>' + point_unit + '</span>');
			document.write('</span>');
			document.write('</p>');
		}
		document.write('</div>');
	}
}

function kakaku_category_pr_fixed_point(shop_id) {
	var point = 0;
	$.ajax({
		type: "GET",
		url: "/global/shop_point/fixed_point.php?shop_id="+shop_id,
		async: false,
		success: function(data) {
			point = data;
		}
		});
	return point;
}

/* EOF */

