<!--//
function loadImage() { 
	var rollover = new Array();
	for (var i=0; i < 22 ; i++) {
		rollover[i] = new Image();
	}
}

function close_win(){
var nvua = navigator.userAgent;
if(nvua.indexOf('MSIE') >= 0){
if(nvua.indexOf('MSIE 5.0') == -1) {
top.opener = '';
}
}
else if(nvua.indexOf('Gecko') >= 0){
top.name = 'CLOSE_WINDOW';
wid = window.open('','CLOSE_WINDOW');
}
top.close();
}

function _JumpURLnewWin(url,sizeX,sizeY) 
{
  if (url != ''){
    win=window.open(url,"a","scrollbars=1,resizable=yes,width=" + sizeX + ",height=" + sizeY);
	
	scrXr = screen.width;
	scrYr = screen.height;
	win.moveTo( scrXr*0.16, scrYr*0.16 );
	win.focus()
  }
}
function _TargetWinOpen(url,sizeX,sizeY,target) 
{
  if (url != ''){
    win=window.open(url,target,"scrollbars=1,resizable=yes,width=" + sizeX + ",height=" + sizeY);
  }
}
function SelectJumpURL(obj) 
{
  url = obj.options[obj.selectedIndex].value;
  if (url != '')
  {
    window.location = url;
  }
}

function NewWinDetail(url) 
{
	window.open(url, 'photodetail', 'width=500, height=500, menubar=no, toolbar=no, scrollbars=no, location=no, status=no, resizable=no')
}

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

function smartRollover_i() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("input");
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src") != null){
				
				if(images[i].getAttribute("src").match("_rll."))
				{
					images[i].onmouseover = function() {
						this.setAttribute("src", this.getAttribute("src").replace("_rll.", "_on."));
					}
					images[i].onmouseout = function() {
						this.setAttribute("src", this.getAttribute("src").replace("_on.", "_rll."));
					}
				}
				
			}
		}
	}
}


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


function changecolor(open_ck)
{
	var gd_pno = document.getElementById('gd_pno').value;
	var gd_color = document.getElementById('gd_color').value;
	var gd_size = document.getElementById('gd_size').value;
	var url = 'http://pj28.cyberstar.co.jp/goods/getstock/';
	var pars = 'gd_color=' + gd_color + '&gd_size=' + gd_size + '&gd_pno=' + gd_pno + '&open_ck=' + open_ck;
	
	var myAjax = new Ajax.Request(
		url, 
		{
			method: 'post', 
			parameters: pars, 
			onSuccess:function(httpObj){
				if(httpObj.responseText != ''){
					$("order").innerHTML = httpObj.responseText;
				}
			},
			onFailure:function(httpObj){
				$("order").innerHTML = "エラーで読み込めませんでした";
			}
		});
	
}

//ポップアップ展開
function subWindowOpen(html, winname, w, h){
  var x = 2;
  var y = 2;

  subwin = window.open(html,winname,'resizable=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,width='+w+',height='+h+',screenX='+x+',screenY='+y+',left='+x+',top='+y);
  subwin.focus();
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function changeImg(iName,img){
	document.images[iName].src=img;
}

//タブ切り替え(ナウナビ使用) 画像名を[_select][_noselect]で保存

function seltab(bpref, hpref, id_max, selected) {
  if (! document.getElementById) return;
  for (i = 0; i <= id_max; i++) {
    if (! document.getElementById(bpref + i)) continue;
    if (i == selected) {
      document.getElementById(bpref + i).style.display= "block";
//	  document.getElementById(hpref + i).setAttribute("src", document.getElementById(hpref + i).getAttribute("src").replace("_noselect.", "_select."));

    } else {
      document.getElementById(bpref + i).style.display = "none";
//	  document.getElementById(hpref + i).setAttribute("src", document.getElementById(hpref + i).getAttribute("src").replace("_select.", "_noselect."));
    }
  }
}