
<div id="mjointbox">

	<div class="title">
		이 위젯(<span class="b"><?php echo getFolderName($g['path_widget'].$swidget)?></span>)을 추가하시겠습니까?
	</div>
	<div class="optionrow">
		<label for="weather-city">표시 지역</label>
		<select id="weather-city" name="weather_city">
			<option value="">전국 주요지역 자동순환</option>
			<option value="서울">서울</option><option value="부산">부산</option>
			<option value="인천">인천</option><option value="대구">대구</option>
			<option value="대전">대전</option><option value="광주">광주</option>
			<option value="울산">울산</option><option value="세종">세종</option>
			<option value="수원">수원</option><option value="춘천">춘천</option>
			<option value="강릉">강릉</option><option value="청주">청주</option>
			<option value="전주">전주</option><option value="목포">목포</option>
			<option value="제주">제주</option>
		</select>
	</div>



	<div class="btnbox">
	<?php if ($isWcode == 'Y'):?>
	<input type="button" value="위젯코드" class="btnblue" onclick="widgetCode();" />
	<?php else :?>
	<input type="submit" value="위젯추가" class="btnblue" onclick="getWidgetCode();" />
	<?php endif?>
	</div>



</div>


<style type="text/css">
#mjointbox {}
#mjointbox .preview {width:200px;}
#mjointbox .wg {text-align:center;}
#mjointbox .title {border-bottom:#dfdfdf dashed 1px;padding:0 0 10px 0;margin:0 0 20px 0;}
#mjointbox .optionrow {display:flex;align-items:center;gap:12px;width:280px;padding:5px 0 12px;}
#mjointbox .optionrow label {font-weight:bold;color:#4a5568;white-space:nowrap;}
#mjointbox .optionrow select {flex:1;padding:6px;border:1px solid #cfd8e3;background:#fff;}
#mjointbox .btnbox {width:200px;padding:20px 0 0 0;}
</style>



<script type="text/javascript">
//<![CDATA[
var RB_widgetCode;
function widgetCode()
{
	var f = document.procform;
	var widgetName = "<?php echo $swidget?>";
	var city = document.getElementById('weather-city').value;
	var widgetInfo = city ? "'city'=>'"+city+"'" : "";

	RB_widgetCode = "<"+"?php "+"getWidget('"+widgetName+"',array("+widgetInfo+"))?>";
	OpenWindow('<?php echo $g['s']?>/?r=<?php echo $r?>&system=popup.widgetcode&iframe=Y');
}
function getWidgetCode()
{
	<?php if(!$option):?>
	var i;
	var 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('300px','100px','0px','0px');
	<?php endif?>

	opener.blocktitle[n] = '날씨';
	opener.blockarray[n] = "<?php echo $swidget?>";
	opener.getId('wtitle'+n).innerHTML = opener.blocktitle[n];
	top.close();
	return false;
}
//]]>
</script>

