function cartPost(){
	//var url = location.href;
	//var dirDepth = url.split("/");
	//var count = dirDepth.length;
	window.open("","ifCartWindow","width=800,height=600,resizable=1");
	document.ifForm.action = "https://z103.secure.ne.jp/~z103199/secure/if_cart/neocart_top.php";
	document.ifForm.method = "GET";
	document.ifForm.target = "ifCartWindow";
	document.ifForm.encoding = "application/x-www-form-urlencoded";
	document.ifForm.submit();
	//window.close();
	return false;
}

var neocart_flag = true;
var neocart_url  = '';

function cart() {
	//ファイル名指定('neocart.php')インラインフレーム表示
	document.write('<iframe src="https://z103.secure.ne.jp/~z103199/secure/nv_cart/neocart.php" name="if01" width="168px" height="520px" style="min-height: 520px;" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" id="tracking" /></iframe>');

	neocart_flag = false;
	return;
}

function button(name, price, jan, stock){
    var reg = new RegExp(',','g');
    var price = price.replace(reg,'');
    var name = name ? name.replace(reg,escape('&'))      : '';
    var jan = jan ? jan: '';
    jan = encodeURI(jan, "UTF-8");
    var url = location.href;
    url = encodeURI(url, "UTF-8");
	if(stock == 'B') {
		document.write('<p><strong><font color="#FF0000">在庫・納期・送料などにつきましては、<br />「メール」または「お電話」にてお問合せ下さい。</font></strong></p>');
		return;
		}
	if(stock == 'C') {
		document.write('<link rel="stylesheet" type="text/css" media="screen" href="http://www.e-equal.com/css/soldout_base.css" />');
		document.write('<p class="s01"><strong><font color="#FF0000">申し分けございません。完売いたしました。</font></strong></p>');
		return;
		}
	if(stock == 'A') {
        document.write('<form name="ifForm" target="ifCartWindow">');
        document.write('<input type="hidden" name="name" value="'+name+'"><input type="hidden" name="price" value="'+price+'"><input type="hidden" name="jan" value="'+jan+'"><input type="hidden" name="url" value="'+url+'">');
        document.write('<p class="s01">個数&nbsp;<select name="lot"><option value="1" selected>1</option>');
        document.write('<option value="2">2</option>');
        document.write('<option value="3">3</option>');
        document.write('<option value="4">4</option>');
        document.write('<option value="5">5</option>');
        document.write('<option value="6">6</option>');
        document.write('<option value="7">7</option>');
        document.write('<option value="8">8</option>');
        document.write('<option value="9">9</option>');
        document.write('<option value="10">10</option></select>');
        document.write('<button onClick="cartPost();" class="title1" class="btn_st" style="background-color: #FFFFFF; border: 0px;">');
        document.write('<img src="http://www.e-equal.com/trolley/parts/cartbtn_off.gif" alt="カートに入れる" width="150" height="24" border="0" name="img1"></button></form></p>');

    return;
	}
}

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function GetHeight(Y,NAME){
	    var app = navigator.appName.charAt(0);
	    if(navigator.userAgent.indexOf('Safari') != -1){
	        document.getElementById(Y).height = parent.frames[NAME].document.body.scrollHeight + 80;
	    }else if (app == "N"){
	        document.getElementById(Y).height = parent.frames[NAME].document.height +1;
	    }
	    else{
	        document.getElementById(Y).height = parent.frames[NAME].document.body.scrollHeight + 1;
	    }
	return;
}


