// JavaScript Document
function writeSwf(SRC,ID,WIDTH,HEIGHT,ALLOWSCRIPT,MENU,WMODE){
	var outStr = '';
	outStr += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + WIDTH + '" height="' + HEIGHT + '" id="' + ID + '" align="middle">\n';
	outStr += '<param name="movie" value="' + SRC + '" />\n';
	outStr += '<param name="quality" value="high" />\n';
	if(WMODE != undefined){
		outStr += '<param name="wmode" value="' + WMODE + '" />\n';
	}
	if(ALLOWSCRIPT != undefined){
		outStr += '<param name="allowScriptAccess" value="' + ALLOWSCRIPT + '" />\n';
	}
	if(MENU != undefined){
		outStr += '<param name="menu" value="' + MENU + '" />\n';
	}
	outStr += '<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" align="middle" src="' + SRC + '" width="' + WIDTH + '" height="' + HEIGHT + '" name="' + ID + '"';
	if(WMODE != undefined){
		outStr +=  ' wmode="' + WMODE + '"';
	}
	if(ALLOWSCRIPT != undefined){
		outStr +=  ' allowScriptAccess="' + ALLOWSCRIPT + '"';
	}
	if(MENU != undefined){
		outStr +=  ' menu="' + MENU + '"';
	}
	outStr += ' />\n';
	outStr += '</object>';
	document.write(outStr);
	//clipboardData.setData('Text',outStr);
}

if (window.attachEvent){
	window.attachEvent('onload',init);
}else{
	window.addEventListener('load',init,false);
}


function init(){
	obj = document.getElementById('contents');
	if(obj!=null){
		if(obj.className == 'subCategory'){
			obj_div = obj.getElementsByTagName('DIV')
			for(var i=0;i<obj_div.length;i++){
				if(obj_div[i].className.search('itemInfo')!=-1){
					obj_div[i].getElementsByTagName('DIV')[0].style.marginLeft = (obj_div[i].getElementsByTagName('IMG')[0].clientWidth+5) + 'px';
					var obj_dd = obj_div[i].getElementsByTagName('DIV')[0].getElementsByTagName('dd');
					for(var j=0;j<obj_dd.length;j++){
						if(obj_dd[j].className.search('wide')==-1){
							//alert(Number((obj_div[i].getElementsByTagName('DIV')[0].style.marginLeft).split('px')[0]))
							obj_dd[j].style.width = (490-95-Number((obj_div[i].getElementsByTagName('DIV')[0].style.marginLeft).split('px')[0])) + 'px';
						}
					}
				}
			}
		}
	}
}


function sendForm(ID){
	var p_id;
	var p_length
	if(ID=='A' || ID=='B' || ID=='C'){
		p_id = document.form1['select' + ID].value;
		p_length = 1;
	}else{
		p_id = ID;
		p_length = document.form1.quantityText.value;
	}
	document.form1.action = '/products/detail.php?product_id=' +p_id;
	document.form1.product_id.value =p_id;
	document.form1.quantity.value = p_length;
	document.form1.submit()
}

function inputCheck(type, url, mode, keyname, keyid){
	if(type=='list'){
		var n = document.form1['quantity' + keyid].value;
		if(n.match(/[^0-9]/g)){
			alert('※ 個数は数字で入力してください。')
		}else{
			fnChangeAction(url);
			fnModeSubmit(mode, keyname, keyid);
		}
	}else if(type=='item'){
		var n = document.form1['quantity'].value;
		if(n.match(/[^0-9]/g)){
			alert('※ 個数は数字で入力してください。')
		}else{
			document.form1.submit();
		}
	}else{
		void(0);
	}
}
