<div id="mjointbox">
	<div class="title">이 위젯(<span class="b"><?php echo getFolderName($g['path_widget'].$swidget)?></span>)을 추가하시겠습니까?</div>

	<form name="procform" onsubmit="return saveCheck(this);">
	<table>
	<tr>
		<td class="td1">태그 타이틀</td><td class="td2">:</td>
		<td class="td3"><input type="text" name="title" value="<?php echo htmlspecialchars($wdgvar['title']?$wdgvar['title']:'태그',ENT_QUOTES,'UTF-8')?>" size="24" class="input" /> <label><input type="checkbox" name="notuse" value="1"<?php if($wdgvar['notuse']):?> checked="checked"<?php endif?> /> 사용안함</label></td>
	</tr>
	<tr>
		<td class="td1">태그 노출수</td><td class="td2">:</td>
		<td class="td3"><select name="limit"><?php for($i=10;$i<51;$i+=5):?><option value="<?php echo $i?>"<?php if($wdgvar['limit']==$i||(!$wdgvar['limit']&&$i==25)):?> selected="selected"<?php endif?>>ㆍ<?php echo $i?>개</option><?php endfor?></select></td>
	</tr>
	<tr>
		<td class="td1">집계 기간</td><td class="td2">:</td>
		<td class="td3"><select name="term"><?php for($i=7;$i<71;$i+=7):?><option value="<?php echo $i?>"<?php if($wdgvar['term']==$i||(!$wdgvar['term']&&$i==14)):?> selected="selected"<?php endif?>>ㆍ최근 <?php echo $i?>일 이내</option><?php endfor?></select></td>
	</tr>
	</table>

	<div class="btnbox">
		<input type="button" value="미리보기" class="btngray" onclick="imgOrignWin('<?php echo $g['url_root']?>/widgets/<?php echo $swidget?>/thumb.jpg');" />
		<?php if($isWcode=='Y'):?><input type="button" value="위젯코드" class="btnblue" onclick="widgetCode();" />
		<?php else:?><input type="submit" value="<?php echo $option?'속성변경':'위젯추가'?>" class="btnblue" /><?php endif?>
	</div>
	</form>
</div>

<style type="text/css">
#mjointbox{max-width:390px;font-family:"Noto Sans KR","Malgun Gothic",sans-serif;color:#344054}
#mjointbox .title{margin:0 0 20px;padding:0 0 12px;border-bottom:1px dashed #dfe4ea;color:#202938;font-size:13px}
#mjointbox table{width:100%;border-collapse:collapse}#mjointbox td{padding:5px 0}
#mjointbox .td1{width:95px;color:#344054;letter-spacing:-1px}#mjointbox .td2{padding-right:15px;color:#c0c0c0}#mjointbox .td3{white-space:nowrap}
#mjointbox .td3 .input{box-sizing:border-box;width:230px;height:30px;padding:0 9px;border:1px solid #cfd8e3;border-radius:4px;background:#fff;color:#344054}
#mjointbox .td3 select{box-sizing:border-box;width:230px;height:30px;padding:0 7px;border:1px solid #cfd8e3;border-radius:4px;background:#fff;color:#344054}
#mjointbox .td3 label{margin-left:7px;color:#667085;font-size:11px}#mjointbox .td3 input[type=checkbox]{vertical-align:-2px}
#mjointbox .btnbox{margin:20px 0 0;padding:20px 0 0;border-top:1px dashed #dfe4ea;text-align:center}
#mjointbox .btnbox input{height:31px;margin:0 2px;padding:0 14px;border:0;border-radius:4px;color:#fff;font-weight:bold;cursor:pointer;box-shadow:none;outline:0}
#mjointbox .btnbox .btngray{background:#8a8f98}#mjointbox .btnbox .btngray:hover{background:#747b86}
#mjointbox .btnbox .btnblue{background:#20aee5}#mjointbox .btnbox .btnblue:hover{background:#0a95cf}
</style>

<script type="text/javascript">
var RB_widgetCode;
function widgetCode()
{
	var f=document.procform,widgetInfo="";
	if(f.title.value) widgetInfo+="'title'=>'"+f.title.value.replace(/'/g,"\\'")+"',";
	if(f.notuse.checked) widgetInfo+="'notuse'=>'1',";
	if(f.limit.value) widgetInfo+="'limit'=>'"+f.limit.value+"',";
	if(f.term.value) widgetInfo+="'term'=>'"+f.term.value+"',";
	RB_widgetCode="<"+"?php getWidget('<?php echo $swidget?>',array("+widgetInfo+"))?"+">";
	OpenWindow('<?php echo $g['s']?>/?r=<?php echo $r?>&system=popup.widgetcode&iframe=Y');
}
function saveCheck(f)
{
	<?php if(!$option):?>var i,n=0;for(i=0;i<opener.maxTiles;i++){if(opener.moveObject[i].style.display=='block')n=i+1;}<?php else:?>var n=<?php echo $dropfield?>;<?php endif?>
	<?php if(!$option):?>opener.createTile('310px','185px','0px','0px');<?php endif?>
	opener.blocktitle[n]='태그';
	opener.blockarray[n]="<?php echo $swidget?>,title^"+f.title.value+",notuse^"+(f.notuse.checked?'1':'')+",limit^"+f.limit.value+",term^"+f.term.value;
	opener.getId('wtitle'+n).innerHTML=opener.blocktitle[n];top.close();return false;
}
</script>
