//メルマガ申込み
function newwindow3(url) {
	win = window.open(url,"mail","width=620,height=620,scrollbars=1,resizable=1,location=0");
	win.focus();
}

//特定商取引に関する法律に基づく表示
function newwindow2(url) {
	win = window.open(url,"tokutei","width=500,height=600,scrollbars=0,resizable=1,location=0");
	win.focus();
}

//お気に入り機能ここから
//お気に入り登録
function newwindow100() {
	setCookie("checkCookie", "true");
	if( getCookie("checkCookie") == "true"){
		x = (screen.width  - 300) / 2;
		y = (screen.height - 150) / 2;
		str = "width=300,height=150,scrollbars=0,resizable=0,location=0,status=0,titlebar=0,top=" + x + ",left=" + y;
		win = window.open("http://www.scroll-shop.com/plaza/apl/SV?md=jump&dst=checklistentry&rtnURL=" + encodeURIComponent(location.href),"checklistentry", str);
		win.focus();
	}else{
		alert("Cookieの設定を「使用する」に変更してください。");
	}
}

//お気に入り登録(List用)
function newwindow100List(hincd, catecd, sitecd, limtdt, outletsw) {
	var categoryCd = "yyyyyy";
	//if(catecd != '') {
	//	categoryCd = catecd;
	//}
	var buildUrl = "http://www.scroll-shop.com/plaza/apl/SV?md=jump&dst=checklistentry&rtnURL=" + encodeURIComponent(location.href);
	buildUrl = buildUrl + "&hinCD=" + hincd + "&ctgryCD=" + categoryCd + "&siteCD=" + sitecd + "&limit=" + limtdt + "&entryFlg=2";
	if( outletsw != '') {
		buildUrl = buildUrl + "&outletFlg=1";
	}else{
		buildUrl = buildUrl + "&outletFlg=0";
	}
	setCookie("checkCookie", "true");
	if( getCookie("checkCookie") == "true"){
		x = (screen.width  - 300) / 2;
		y = (screen.height - 150) / 2;
		str = "width=300,height=150,scrollbars=0,resizable=0,location=0,status=0,titlebar=0,top=" + x + ",left=" + y;
		win = window.open(buildUrl,"checklistentry", str);
		win.focus();
	}else{
		alert("Cookieの設定を「使用する」に変更してください。");
	}
}

//商品チェック履歴参照
function newwindow101() {
	setCookie("checkCookie", "true");
	if( getCookie("checkCookie") == "true"){
		x = screen.width - 250;
		//win = window.open("/re_check/index.html","readinglist","width=250,height=800,scrollbars=1,resizable=1,location=0,top=1,left=" + x);
		win = window.open("http://www.scroll-shop.com/plaza/apl/SV?md=jump&dst=readinglist","readinglist","width=250,height=800,scrollbars=1,resizable=1,location=0,top=1,left=" + x);
		win.focus();
	}else{
		alert("Cookieの設定を「使用する」に変更してください。");
	}
}

//お気に入りリスト参照
function newwindow102() {
	setCookie("checkCookie", "true");
	if( getCookie("checkCookie") == "true"){
		x = screen.width - 250;
		//win = window.open("/re_list/index.html","checklist","width=250,height=800,scrollbars=1,resizable=1,location=0,top=1,left=" + x);
		win = window.open("http://www.scroll-shop.com/plaza/apl/SV?md=jump&dst=checklist&rtnURL=" + encodeURIComponent(location.href),"checklist","width=250,height=800,scrollbars=1,resizable=1,location=0,top=1,left=" + x);
		win.focus();
	}else{
		alert("Cookieの設定を「使用する」に変更してください。");
	}
}

//Cookie設定
function setCookie(key, val) {
	var tmp = key + "=" + escape(val) + ";path=/;";
    document.cookie = tmp;
}

//Cookie取得
function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3) {
    tmp1 = " " + document.cookie + ";";
    xx1 = xx2 = 0;
    len = tmp1.length;
    while (xx1 < len) {
        xx2 = tmp1.indexOf(";", xx1);
        tmp2 = tmp1.substring(xx1 + 1, xx2);
        xx3 = tmp2.indexOf("=");
        if (tmp2.substring(0, xx3) == key) {
            return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
        }
        xx1 = xx2 + 1;
    }
    return("");
}
//お気に入り機能ここまで

//Flashファイル呼び出し//
function writeFlash( swf , width , height )
{
  var htm = ""
  htm+="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'"
  htm+="        codebase='http://download.macromedia.com/pub/shockwave/"
                    htm+="cabs/flash/swflash.cab'"
  htm+="        width   = " + width
  htm+="        height  = " + height + ">"
  htm+="<param  name    = movie value=" + swf + ">"
  htm+="<param  name    = quality value=high>"
  htm+="<param  name    = scale value=noscale>"
  htm+="<embed  src     = " + swf + " "
  htm+="        quality = high  "
  htm+="        width   = "+ width
  htm+="        height  = " + height
  htm+="		scale	= noscale"
  htm+="        type    = 'application/x-shockwave-flash' "
  htm+="        pluginspage='http://www.macromedia.com/go/getflashplayer'>"
  htm+="</embed>"
  htm+="</object>"
  
  document.write(htm)
}
//Flashファイル呼び出しここまで//

//スクロール機能//

// 最大幅
max_width = 4000;

// 一度のクリックでスクロールさせる幅
slide_wid = 800;

// スクロールピッチ
offset = 40;

// スクロールスピード
speed = 10;

x = i = 0;
function side_scroll(p) {
   if (p) { x += slide_wid; mode = 1; }
   else { x -= slide_wid; mode = 2; }
   if (x >= max_width) { mode = 0; x = 0; }
   else if (x < 0) { mode = 0; x = max_width - slide_wid; }
   if (mode) slide();
   else self.scrollTo(x,0);
}

function slide() {
   if (mode == 1) self.scrollBy(offset,0);
   else if (mode == 2) self.scrollBy(-offset,0);
   if (++i < slide_wid / offset) setTimeout("slide()",speed);
   else i = 0 ;
}

//画像ロールオーバー
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&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<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//ブックマーク登録 ここから//

function addit()
{
	window.external.AddFavorite('http://www.micosuper.com/','大きいサイズ - mico - レディース服（婦人服）のおしゃれファッションセレクトショップ通販');
}

function GoToSite(val){
  document.getElementById('kind').value=val;
  document.getElementById('AddClipsForm').submit();
}
function BrowserBookMark(){
	AddClipsUrl=decodeURIComponent('http://www.micosuper.com/');
	AddClipsTitle=decodeURIComponent('大きいサイズ - mico - レディース服（婦人服）のおしゃれファッションセレクトショップ通販');
	if (document.all){
	window.external.AddFavorite(AddClipsUrl,AddClipsTitle);
	}else if(navigator.userAgent.indexOf("Firefox") != -1){
	window.sidebar.addPanel(AddClipsTitle,AddClipsUrl,'');
	}else{window.alert('ブラウザへのお気に入り追加は、Opera/Safari等には対応しておりません。ご自身のブラウザからお気に入りへ追加下さい。');}
	//return false; 
}

//ブックマーク登録 ここまで//


//価格・在庫確認
function openWindow4() {
	win = window.open("","zaiko","width=630,height=600,scrollbars,resizable");
	win.focus();
}

//拡大画像
function openWindow3c(url) {
	win = window.open(url,"bwin","width=600,height=600,scrollbars,resizable");
	win.focus();
}
function roll1(surl)
{
	if (document.images) document.rollname1.src = surl;
}
function roll2(surl)
{
	if (document.images) document.rollname2.src = surl;
}
function roll3(surl)
{
	if (document.images) document.rollname3.src = surl;
}
function roll4(surl)
{
	if (document.images) document.rollname4.src = surl;
}
function roll5(surl)
{
	if (document.images) document.rollname5.src = surl;
}
function roll6(surl)
{
	if (document.images) document.rollname6.src = surl;
}
function roll7(surl)
{
	if (document.images) document.rollname7.src = surl;
}
function roll8(surl)
{
	if (document.images) document.rollname8.src = surl;
}
function roll9(surl)
{
	if (document.images) document.rollname9.src = surl;
}
function roll10(surl)
{
	if (document.images) document.rollname10.src = surl;
}
function roll11(surl)
{
	if (document.images) document.rollname11.src = surl;
}
function roll12(surl)
{
	if (document.images) document.rollname12.src = surl;
}
function roll13(surl)
{
	if (document.images) document.rollname13.src = surl;
}
function roll14(surl)
{
	if (document.images) document.rollname14.src = surl;
}
function roll15(surl)
{
	if (document.images) document.rollname15.src = surl;
}
function roll16(surl)
{
	if (document.images) document.rollname16.src = surl;
}
function roll17(surl)
{
	if (document.images) document.rollname17.src = surl;
}
function roll18(surl)
{
	if (document.images) document.rollname18.src = surl;
}
//
function roll19(surl)
{
	if (document.images) document.rollname19.src = surl;
}
function roll20(surl)
{
	if (document.images) document.rollname20.src = surl;
}
function roll21(surl)
{
	if (document.images) document.rollname21.src = surl;
}
function roll22(surl)
{
	if (document.images) document.rollname22.src = surl;
}
function roll23(surl)
{
	if (document.images) document.rollname23.src = surl;
}
function roll24(surl)
{
	if (document.images) document.rollname24.src = surl;
}
function roll25(surl)
{
	if (document.images) document.rollname25.src = surl;
}
function roll26(surl)
{
	if (document.images) document.rollname26.src = surl;
}
function roll27(surl)
{
	if (document.images) document.rollname27.src = surl;
}
function roll28(surl)
{
	if (document.images) document.rollname28.src = surl;
}
function roll29(surl)
{
	if (document.images) document.rollname29.src = surl;
}
function roll30(surl)
{
	if (document.images) document.rollname30.src = surl;
}


//ポップアップ

//scroll yes
function WinOpen(URL,NAME,W,H,SCR){
	document.returnValue = false;
	Win=window.open(URL,NAME,'width='+W+',height='+H+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+SCR+',resizable=yes');
	if(SCR==1){
		if(navigator.userAgent.indexOf("Mac")!=-1){
			if(bName=="M"){
				Win.resizeTo(W+15,H);
			}else{
				if(vNum < 5){
				Win.resizeTo(W,H-15);
				}
				else{
				Win.resizeTo(W+15,H+1);
				}
			}
		}else{
			if(navigator.userAgent.indexOf("Gecko")!=-1){
				Win.resizeTo(W+23,H+29);
			}else{
				switch(bName){
					case "M":Win.resizeTo(W+28,H+31);break;
					case "N":Win.resizeTo(W+16,H);break;
					case "O":Win.resizeTo(W+28,H+31);break;
					default:Win.resizeTo(W,H);
				}
			}
		Win.window.focus();
		}
	}else{  //scroll no
		Win=window.open(URL,NAME,"innerwidth='width',innerheight='height',width='+W+',height='+H+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+SCR+',resizable=yes");
		Win.window.focus();
	}
};


//画像ロールオーバー
function initRollovers() {
if (!document.getElementById) return

var aPreLoad = new Array();
var sTempSrc;
var aImages = document.getElementsByTagName('img');

for (var i = 0; i < aImages.length; i++) {
if (aImages[i].className == 'imgover') {
var src = aImages[i].getAttribute('src');
var ftype = src.substring(src.lastIndexOf('.'), src.length);
var hsrc = src.replace(ftype, '_o'+ftype);

aImages[i].setAttribute('hsrc', hsrc);

aPreLoad[i] = new Image();
aPreLoad[i].src = hsrc;

aImages[i].onmouseover = function() {
sTempSrc = this.getAttribute('src');
this.setAttribute('src', this.getAttribute('hsrc'));
}

aImages[i].onmouseout = function() {
if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
this.setAttribute('src', sTempSrc);
}
}
}
}

try{
	window.addEventListener("load",initRollovers,false);
}catch(e){
	window.attachEvent("onload",initRollovers);
}



