if (window.addEventListener) {
window.addEventListener ("message", receiveSize, false);
}
else {
if (window.attachEvent) {
window.attachEvent("onmessage", receiveSize);
}
}
function appoint_init(add_element) {
var base_url = "";
base_url += "https://www.carbase.jp/";
base_url += "api/index_oiwai.html?limit=";
base_url += "&sort=
Notice: Undefined index: sort in /var/www/html/templates_c/4efda12649c1e0c0fb6c2c6e7f2ed0a8cc2b2a1a_0.file.api_oiwai_js.tpl.php on line 40
Notice: Trying to get property 'value' of non-object in /var/www/html/templates_c/4efda12649c1e0c0fb6c2c6e7f2ed0a8cc2b2a1a_0.file.api_oiwai_js.tpl.php on line 40
";
base_url += "&disp_mode=";
base_url += "&client_no=";
base_url += "&shashu_no=";
base_url += "&maker_no=";
base_url += "&category_no=";
base_url += "&special_no=";
base_url += "&ex_dough_flag=";
base_url += "&key=";
base_url += "&element_id=" + add_element;
document.getElementById(add_element).innerHTML = "
";
document.getElementById('id_prev').src = base_url;
}
function receiveSize(e) {
var cStr = e.data;
var sp = "";
var UA = navigator.userAgent;
if (
(UA.indexOf('iPhone') !== -1)//iphoneか、
|| ((UA.indexOf('Android') !== -1) && (UA.indexOf('Mobile') !== -1))
|| (UA.indexOf('Windows Phone') !== -1)
|| (UA.indexOf('BlackBerry') !== -1)
|| (UA.indexOf('iPad') !== -1)
) {
sp = "1";
};
if( cStr.indexOf("frame_height") != "-1"){
var frame_height = cStr.replace("frame_height", "") ;
//frame_height = parseInt(frame_height) + 20;
frame_height = parseInt(frame_height) * 1.4;
document.getElementById("id_prev").style.height = frame_height + "px";
}
if( cStr.indexOf("car_no") != "-1"){
$.fn.prettyPhoto();
var car_no = cStr.replace("car_no_", "");
// if( document.body.clientWidth < 1000 || sp == "1" ){
if( sp == "1" ){
//$('#pp_full_res').css('height','95%');
var detail_url = "https://www.carbase.jp/api/sp_details_ref.html?car_no=" + car_no + "&screen_width=" + document.body.clientWidth + "&pc=0&width=95%&height=100%&iframe=true";
location.href = detail_url;
$('#pp_full_res').css('height','95%');
//window.open(detail_url, "_blank");
//$.prettyPhoto.open(detail_url,'','');
}
else {
if( document.body.clientWidth < 950 ) {
var detail_url = "https://www.carbase.jp/api/sp_details_ref.html?car_no=" + car_no + "&screen_width=" + document.body.clientWidth + "&pc=1";
//location.href = detail_url;
window.open(detail_url, "_blank");
} else {
$.prettyPhoto.open('https://www.carbase.jp/api/details_oiwai.html?car_no=' + car_no + '&screen_width=' + document.body.clientWidth + "&pc=1" + '&iframe=true&width=945&height=100%','','');
}
}
}
/*
if ( cStr.indexOf("scroll_to_top") != "-1"){
this.scrollTo(0,0);
}
*/
}