
// iwindow 생성
function create_iwindow(no,css){

	var tempobj=document.createElement('div');
	tempobj.setAttribute('id','TnTeIwin'+no);
	if(css) tempobj.style.cssText=css;
	tempobj.style.position='absolute';
	tempobj.style.padding='0px 0px 0px 0px';
	tempobj.style.visibility='visible';

	tempobj.innerHTML=""+
	"  <table border=0 cellpadding=0 cellspacing=0 onmouseover=set_iwindow_focus_change('"+no+"') >"+

	"    <tr id='TnTeiwinTopTr"+no+"'>"+
	"        <td width=17 height=37><img src="+this_skin+"/iwindow/immg/box1.png width=17 height=37 class='iePngFix'></td>"+
	"        <td id='TnTeiwinToptd"+no+"' valign=top height=37 style='padding-top:2;' background="+this_skin+"/iwindow/immg/box2.png class='iePngFix'>"+

	"           <table width=100% border=0 cellpadding=0 cellspacing=0><tr>"+
	"                <td onmousedown='DragResize_DN(0,event)' onmouseup='DragResize_UP()' width='99%' class='TnT_Layer_dragin'><"+it_img_tag+" src="+this_skin+"/iwindow/immg/title_default.gif border=0 id='TnTeiwintitle"+no+"' class='iePngFix' height='0' width='0' align=absmiddle>+++ ------------ +++</td>"+
	"                <td style='cursor:pointer; display:none;' onClick='TnT_layer_help()' id='TnTeiwinhelp"+no+"' valign='top'><img src="+this_skin+"/iwindow/immg/btn_quest.png width=34 height=34  class='iePngFix' onmouseover=top_btn_act(this) onmouseout=top_btn_act(this)></td>"+
	"                <td style='cursor:pointer; display:none;' onClick='iwindow_ENLARGE()' id='TnTeiwinlarge"+no+"' valign='top'><img src="+this_skin+"/iwindow/immg/btn_enlarg.png width=34 height=34 class='iePngFix' onmouseover=top_btn_act(this) onmouseout=top_btn_act(this)></td>"+
	"                <td style='cursor:pointer' onClick='iwindow_CLOSE()'  id='TnTeiwinclose"+no+"' valign='top'><img src="+this_skin+"/iwindow/immg/btn_close.png width=52 height=34  onmouseover=top_btn_act(this) onmouseout=top_btn_act(this) class='iePngFix'></td>"+
	"            </tr></table>"+

	"        </td>"+
	"        <td width=17 height=37><img src="+this_skin+"/iwindow/immg/box3.png width=17 height=37 class='iePngFix'></td>"+
	"    </tr>"+

	"    <tr id='TnTeiwin2stTr"+no+"' style='display:none'>"+
	"        <td width=17 height=17><img src="+this_skin+"/iwindow/immg/box1_1.png class='iePngFix'></td>"+
	"        <td height=17 background="+this_skin+"/iwindow/immg/box2_1.png class='iePngFix'></td>"+
	"        <td width=17 height=17><img src="+this_skin+"/iwindow/immg/box3_1.png class='iePngFix'></td>"+
	"    </tr>"+

	"    <tr>"+
	"        <td width=17 background="+this_skin+"/iwindow/immg/box4.png class='iePngFix'></td>"+
	"        <td bgcolor=#ffffff id='TnTeiwinCenter"+no+"' width=50 height=50>"+
	"                <iframe id='TnTeIwinframeid"+no+"' name='TnTeIwinframename"+no+"' frameBorder='0' scrolling='auto' width='100%' height='100%' onmouseover=drag_time_true()></iframe>"+
	"        </td>"+
	"        <td width=17 background="+this_skin+"/iwindow/immg/box5.png class='iePngFix'></td>"+
	"      </tr>"+

	"    <tr>"+
	"        <td width=17 height=17><img src="+this_skin+"/iwindow/immg/box6.png class='iePngFix'></td>"+
	"        <td height=17 background="+this_skin+"/iwindow/immg/box7.png class='iePngFix'></td>"+
	"        <td width=17 height=17><"+it_img_tag+" src="+this_skin+"/iwindow/immg/box8.png class='iePngFix' border=0 style='cursor:se-resize;' class=TnT_Layer_dragin onmousedown='DragResize_DN(1,event)' onmouseup='DragResize_UP()'></td>"+
	"    </tr>"+

	"  </table>";

	document.body.appendChild(tempobj);
	set_iwindow_focus_change(no);
}


iwinzidx=10;
tntactiwin='';
function set_iwindow_focus_change(no){
	if(tntactiwin=='TnTeIwin'+no) return;
	iwindowLAYER=document.getElementById('TnTeIwin'+no);
	iwindowTopTr=document.getElementById('TnTeiwinTopTr'+no);
	iwindowToptd=document.getElementById('TnTeiwinToptd'+no);
	HideBox_title=document.getElementById('TnTeiwintitle'+no);
	layer_help_btn=document.getElementById('TnTeiwinhelp'+no);
	layer_large_btn=document.getElementById('TnTeiwinlarge'+no);
	layer_close_btn=document.getElementById('TnTeiwinclose'+no);
	iwindowTopTr2=document.getElementById('TnTeiwin2stTr'+no);
	TntiwindowTable=document.getElementById('TnTeiwinCenter'+no);
	HideBox_id=document.getElementById('TnTeIwinframeid'+no);
	HideBox_name=eval('frames.TnTeIwinframename'+no);
	if(iwindowLAYER.style.zIndex<iwinzidx)iwindowLAYER.style.zIndex=++iwinzidx;
	tntactiwin='TnTeIwin'+no;
}

// 우.상단 버튼 onmouse over/out
function top_btn_act(img_this){
	img_this.src=(img_this.src.match(/2\.png$/))?img_this.src.replace(/2\.png$/,'.png') : img_this.src.replace(/\.png$/,'2.png');
}

// iwindow 내 스크롤바
// iwindow 출력소스(html)의 자바스크립트 에 document.write(parent.iwindow_SCROLL()); 해 줘야 적용됨
function iwindow_SCROLL(){
	return '<style type=text/css> body{'	+
	' scrollbar-face-color:			#ffffff;' +
	' scrollbar-3dlight-color:	#ffffff;' +
	' scrollbar-highlight-color:	#767B8F;' +
	' scrollbar-shadow-color:	#767B8F;' +
	' scrollbar-darkshadow-color:#ffffff;' +
	' scrollbar-track-color:		#ffffff;' +
	' scrollbar-arrow-color:		#767B8F;' +
	'}</style>';
}


