<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=emulateIE7">
<link href="{$BINGOTOPURL}/admin/css/common.css" rel="stylesheet" type="text/css" media="all">
<link href="{$BINGOTOPURL}/admin/css/content.css" rel="stylesheet" type="text/css" media="all">
<link href="{$BINGOTOPURL}/usr-data/modules/extMdlFormGnrtr/admin/css/imported.css" rel="stylesheet" type="text/css" media="all">
<!--[if IE ]>
<link href="{$BINGOTOPURL}/admin/css/ie.css" rel="stylesheet" type="text/css" media="all">
<![endif]-->


<link rel="stylesheet" type="text/css" href="../js/yui/build/slider/assets/skins/sam/slider.css" />
<link rel="stylesheet" type="text/css" href="../js/yui/build/colorpicker/assets/skins/sam/colorpicker.css" />
<link rel="stylesheet" type="text/css" href="../js/yui/build/container/assets/skins/sam/container.css" />
<link rel="stylesheet" type="text/css" href="../js/yui/build/fonts/fonts-min.css" />

<script type="text/javascript" src="../js/yui/build/utilities/utilities.js"></script>
<script type="text/javascript" src="../js/yui/build/slider/slider-min.js"></script>
<script type="text/javascript" src="../js/yui/build/container/container-min.js"></script>
<script type="text/javascript" src="../js/yui/build/colorpicker/colorpicker-min.js"></script>

<script type="text/javascript" src="../js/prototype.js" ></script>
<script type="text/javascript" src="../js/scriptaculous.js" ></script>
<script type="text/javascript" src="../js/window/window.js"></script>

<link href="{$BINGOTOPURL}/js/window/themes/default.css" rel="stylesheet" type="text/css"/>
<link href="{$BINGOTOPURL}/js/window/themes/alert.css" rel="stylesheet" type="text/css"/>
<link href="{$BINGOTOPURL}/js/window/themes/alphacube.css" rel="stylesheet" type="text/css"/>

<style>
{literal}
.buttons{position:absolute; top:230px;}
{/literal}
</style>

<script type="text/javascript">
<!--{literal}
function reloadParentOnClose(){
	var url = window.top.document.URL;
	window.top.location.href=url;
}

var cpwin;
var picker;
var id=1;
function showBox(title, url, width, height,sType) {
	cpwin = new Window('cpwin'+id,
				{className: "alphacube",
					title:"カラー選択",
					width:width,
					height:height,
					recenterAuto:false,
					draggable:true,
					resizable:true,
					closable:false,
					minimizable:false,
					maximizable:false
	});

	//win.getContent().innerHTML = document.getElementById("yui-picker").innerHTML;
	cpwin.getContent().innerHTML =
	'<div id="yui-picker-panel" class="yui-picker-panel">'+
	'<div class="yui-picker" id="yui-picker"></div>'+
	'<div class="buttons">'+
	'<input type="button" value="登録" onclick="setColor()">'+
	'<input type="button" value="キャンセル" onclick="cpwin.destroy()">'+
	'</div>'+
	'</div>'+
	'</div>';

	cpwin.setCloseCallback(function(){
		reloadParentOnClose();
		return true;
	});

	cpwin.setDestroyOnClose();
	cpwin.setZIndex(10001);
	cpwin.showCenter();

	this.picker = new YAHOO.widget.ColorPicker("yui-picker", {
		container: this.dialog,
		showhsvcontrols: true,
		showhexcontrols: true,
		images: {
			PICKER_THUMB: "../js/yui/build/colorpicker/assets/picker_thumb.png",
			HUE_THUMB: "../js/yui/build/colorpicker/assets/hue_thumb.png"
		}
	});

	id = id+1;
}

function setColor(){
		document.getElementById("prt_part_comment_color").value = '#' + picker.get("hex");
		cpwin.destroy();
}

function closeBox() {
	Windows.close(win.getId());
}

{/literal}-->
</script>

<script type="text/javascript">
{literal}
	window.onload=function(){
		//デフォルト場合には、パーツ種類をテキストにセットする
		if(document.getElementById("hiddenPartSubType") != null){
			refreshStyle(document.getElementById("hiddenPartSubType").value);
		}

		var hiddenCloseScriptFlg = document.getElementById("hiddenCloseScriptFlg");
		if(hiddenCloseScriptFlg != null){
			if(hiddenCloseScriptFlg.value == "1"){
				parent.closeBox();
			}
		}
	}

	function refreshStyle(sSubType)
	{
		switch(sSubType)
		{
			//パーツ種類が罫線場合、項目名と補足テキストなどを表示されていない
			case "line":
				if(document.getElementById("trLabel") != null){
			    	document.getElementById("trLabel").style.display = "none";
			    }
			    break;
			default:
			    if(document.getElementById("trLabel") != null){
			    	document.getElementById("trLabel").style.display = "";
			    }
		}
	}

	if(document.getElementById("hiddenPartSubType") != null){
		refreshStyle(document.getElementById("hiddenPartSubType").value);
	}

{/literal}
</script>
</head>
<body class="yui-skin-sam">
<div id="unitContainerMain" class="unitContainer">
	<div class="unitContentsTtl">
		<h3>パーツ追加</h3>
	</div>

	<!--contents/-->
	<form {$form.attributes}>
	<input type="hidden" value={$CLOSESCRIPTFLG} id="hiddenCloseScriptFlg">
	<input type="hidden" value={$prt_part_sub_type} id="hiddenPartSubType">
	{$form.hidden}
	<div class="unitContentsBox">
		<div class="unitFlame">
		<div class="unitFlameInner">

				<!--エラーコメント/-->
				{foreach from=$ERROR item="msg" name="err"}
				{if $smarty.foreach.err.first}
				<p class="errBox">{/if}
					{$msg}<br>
					{if $smarty.foreach.err.last}
				</p>
				{/if}
				{/foreach}
				<!--/エラーコメント-->

				<!--パーツ選択/-->
				<div class="unitContentsBase">
				<table border="0" cellpadding="0" cellspacing="0">
					<tr id="trLabel" style="border-top: 0px solid;">
						<th class="thImp">項目名</th>
						<td class="textLm">{$form.prt_part_label.html}</td>
					</tr>
					<tr>
						<th class="thImp">パーツ選択</th>
						<td class="partsAddCheck">{$form.part.html}</td>
					</tr>
				</table>
				</div>
				<!--/パーツ選択-->

				<!--button/-->
				<div class="unitContentsBtn">
					<table border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td>{$form.buttons.BTNcancel.html}</td>
							<td>{$form.buttons.BTNadd.html}</td>
						</tr>
					</table>
				</div>
				<!--/button -->

		</div>
		</div>
	</div>
	</form>
	<!--/contents-->

</div>
</body>
</html>