/*======================================================

100219エディテcommon.js　！改変時日付変更のこと！

========================================================*/
//基本部
function MM_openBrWindow(theURL,winName,WW,WH,SCB) { //v2.0
  var Features = 'status=no,directories=no,menubar=no,resizable=no,toolbar=no,scrollbars=' + SCB + ',width=' + WW + ',height=' + WH;
  subWin_a = window.open(theURL,winName,Features);
  subWin_a.focus()
}

function openNewWin(url, name, w, h) {
	var newWin;
	var options = "toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=yes";
	newWin = window.open(url, name,"width=" + w + ",height=" + h + options);
	newWin.focus();
}

function showLAYER(idName) { 
	if (document.getElementById) {
		if (document.getElementById(idName).style.display == "none") {
			document.getElementById(idName).style.display = "inline" ;
		}
	}
	else if (document.all) {
		if (document.all(idName).style.display == "none") {
			document.all(idName).style.display = "inline" ;
		}
	}
}

function hideLAYER(idName) {
	if (document.getElementById) {
		document.getElementById(idName).style.display = 'none' ;
	}
	else if (document.all) {
		document.all(idName).style.display = 'none' ;
	}
}

document.writeln("<style type='text/css'><!--")
if (navigator.appVersion.indexOf("Win")!=-1) {
  document.write("#editer #topbrand ul li,#editer #topitem ul li,#editer #toprecommend ul li,#editer #toprecommend .topics ul li,#editer #toprecommend .pickup a {font-size: 11px !important; }");
}
document.writeln("--></style>");


//ロールオーバー

function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}



//ポップアップ

function openNewWin(url, name, w, h) {
	var newWin;
	var options = "toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes";
	newWin = window.open(url, name,"width=" + w + ",height=" + h + options);
	newWin.focus();
}




//汎用クッキー読み出し
function getCookie(key){
    tmp=document.cookie+";";
    tmp1=tmp.indexOf(key, 0);

    if(tmp1!=-1){
        tmp=tmp.substring(tmp1,tmp.length);
        start=tmp.indexOf("=",0)+1;
        end=tmp.indexOf(";",start);
        return(unescape(tmp.substring(start,end)));
    }
    return("");
}


//汎用クッキー書き込み（有効期限変化バージョン
//dayが空だったときのみ、dateが有効
//date書式　"99/12/31 23:59:59"なとdate関数に準拠
function setCookie(key,val,day,date) {
    tmp=key+"="+escape(val)+";";
	if(day != ""){
	    exp=new Date();
    	exp.setTime(exp.getTime()+1000*60*60*24*day);
	} else {
	    exp=new Date(date);
	}
    tmp+="expires= "+ exp.toGMTString();
    document.cookie=tmp;
}


//indexメインタブ
function putTabArea(tabNum){
	setCookie('EDITER_tabNum',tabNum,360,'')
//	alert(document.cookie);
}


//送料無料のポップアップ

function m_pop1(){
	window.open('http://www.bellemaison.jp/pc/guide/bm_first.html#p04','pop01','width=700,height=650,resizable=yes,scrollbars = yes');
}
