/** * 拡大用画像の設定値 * */ // 画像拡大時の背景色 var zoomBackColor = '#000000'; // 画像拡大時の背景の透明度(0〜100。100で不透明) var zoomBackAlpha = 75; // 画像の枠の色 var frameColor = '#ffffff'; // 画像の枠のサイズ var frameSize = 20; // 画像の枠の水平位置(0で中央、マイナス値で左、プラス値で右に移動) var imgHorizontal = 0; // 画像の枠の垂直位置(0で中央、マイナス値で上、プラス値で下に移動) var imgVertical = -50; function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i screen.availWidth) { pw = screen.availWidth; ovflag = true; } if (ph > screen.availHeight) { ph = screen.availHeight; ovflag = true; } if (ovflag) { var mw = window.open("" , "m_" + i, "toolbar=no,scrollbars=yes,status=yes,menubar=no,resizable=yes,width=" + pw + ",height=" + ph); } else { var mw = window.open("" , "m_" + i, "toolbar=no,scrollbars=no,status=yes,menubar=no,resizable=no,width=" + pw + ",height=" + ph); } mw.resizeTo(pw,ph); mw.document.open(); mw.document.writeln(""); mw.document.writeln(""); mw.document.writeln("間取り図"); mw.document.writeln(""); mw.document.writeln(""); mw.document.writeln(""); mw.document.writeln("

"); mw.document.writeln(""); mw.document.writeln(""); mw.document.close(); mw.focus(); } function setcookie(sName, sValue) { var days30 = 60 * 60 * 24 * 30 * 1000; today = new Date(); var ts = Date.parse(today.toUTCString()) + days30; limitdate = new Date(ts); document.cookie = sName + "=" + escape(sValue) + "; expires=" + limitdate.toGMTString() + "; path=/"; } function getcookie(sName) { var aCookie = document.cookie.split("; "); for (var i=0; i 1) { return unescape(aCrumb[1]); } return ""; } } return ""; } function getfavoritenum() { var rid = getcookie("room_id"); var ridarr = rid.split('/'); ridarr.shift(); ridarr.pop(); var count = 0; for (var key in ridarr) { if (ridarr.hasOwnProperty(key)) count++; } return count; } function setfavorite(v,u) { // 旧データの削除 document.cookie = "room_id=; expires=" + new Date().toGMTString(); document.cookie = "room_url=; expires=" + new Date().toGMTString(); var rid = getcookie("room_id"); var idstr = "/" + v + "/"; if (rid != "" && rid.indexOf(idstr) >= 0) { alert("既に登録されています"); return; } if (rid == "") { rid = "/"; } rid += v + "/"; setcookie("room_id", rid); var ustr = getcookie("room_url"); if (ustr == "") { ustr = "/"; } var re = /\+/g; ustr += u.replace(re, "#") + "/"; setcookie("room_url", ustr); // var fimg = document.createElement("IMG"); // fimg.src = "php_common/favorite.php?room_id=" + v; // $('.fa_num').each(function(){ // var num = $(this).val(); // num++; // $(this).text(num); // }); var num = getfavoritenum(); $('.fa_num').text(num); alert("お気に入りに登録しました"); anaWriteFavoriteLog( v ); } function delfavorite(v) { var rid = getcookie("room_id"); if (rid == "") { return; } var idArray = rid.split("/"); var ustr = getcookie("room_url"); var urlArray = ustr.split("/"); var newIdArray = new Array(); var newUrlArray = new Array(); var npos = 0; var delpos = -1; for (var i=1; i 0) { setcookie("room_id", "/" + newIdArray.join("/") + "/"); setcookie("room_url", "/" + newUrlArray.join("/") + "/"); } else { setcookie("room_id", ""); setcookie("room_url", ""); } alert("お気に入りから削除しました"); location.reload(); } var isMSIE = /*@cc_on!@*/false; function initialize(){ var o={},c={}; var u = location.href.split("/"); u.pop(); u.pop(); url = u.join("/")+"/"; // url = "http://" + location.host + "/"; for(i in img_obj){ o[url+img_obj[i]['src1']] = url+img_obj[i]['src2']; c[url+img_obj[i]['src1']] = i; } im=document.images; for(i=0;i= img_obj.length ){ num = 0; } var obj = img_obj[num]; // 背景 e = document.createElement('div'); e.id = "img_background"; e.style.backgroundColor = zoomBackColor; e.style.position = 'absolute'; e.style.left = '0px'; e.style.top = '0px'; if( isMSIE ){ e.style.filter = "alpha(opacity="+zoomBackAlpha+")"; } else{ e.style.opacity = zoomBackAlpha/100; } e.onclick=function(){CloseImage();}; bg['img_background']=e; // 画像枠のサイズ var framewidth = 0; var frameheight = 0; for( i in img_obj ){ framewidth = Math.max(framewidth, img_obj[i]['src2_width']); frameheight = Math.max(frameheight, img_obj[i]['src2_height']); } framewidth += frameSize*2; frameheight += frameSize*2; // 画像 var img_src = "/" + obj['src2'] + "?" + Math.random(); var left = parseInt(getBrowserWidth()+(document.body.scrollLeft || de.scrollLeft)-framewidth)/2 + imgHorizontal; var top = parseInt((document.body.scrollTop || de.scrollTop)+100) + imgVertical; e = document.createElement('div'); e.id = "img_frame"; e.style.position = 'absolute'; e.style.left = left+'px'; e.style.top = top+'px'; var p = (frameheight-obj['src2_height'])/2; if( isMSIE ){ e.innerHTML = '
' + (num+1) + '/' + img_obj.length + '
'; } else{ e.innerHTML = '
' + (num+1) + '/' + img_obj.length + '
'; } bg['img_frame']=e; // 閉じるボタン e = document.createElement('img'); e.id = "img_close"; e.style.position = 'absolute'; e.style.left = parseInt(left+framewidth-20)+'px'; e.style.top = parseInt(top)+'px'; e.style.cursor = "pointer"; e.src="/img/zoom_close.gif"; e.onclick=function(){CloseImage();}; bg['img_close']=e; var b = document.getElementsByTagName("body").item(0); for(i in bg){ b.appendChild(bg[i]); } bg['img_background'].style.height = getPageHeight(); bg['img_background'].style.width = isMSIE ? getBrowserWidth() : '100%'; } function CloseImage(){ var b = document.getElementsByTagName("body").item(0); b.removeChild(document.getElementById('img_background')); b.removeChild(document.getElementById('img_frame')); b.removeChild(document.getElementById('img_close')); } function getBrowserWidth(){ if(window.innerWidth){return window.innerWidth;} else if(de && de.clientWidth != 0){return de.clientWidth;} else if(document.body){return document.body.clientWidth;} return 0; } function getPageHeight(){ var yScroll; if(window.innerHeight && window.scrollMaxY){yScroll = window.innerHeight + window.scrollMaxY;} else if(document.body.scrollHeight > document.body.offsetHeight){yScroll = document.body.scrollHeight;} else{yScroll = document.body.offsetHeight;} return Math.max((self.innerHeight)?self.innerHeight:(de && de.clientHeight)?de.clientHeight:document.body?document.body.clientHeight:0,yScroll); }