function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

try{
	document.execCommand("BackgroundImageCache",false,true);
}catch(err){}

function main_logo_url(){
	top.location.href="http://"+MainSiteURL;
}

//ºê¶ó¿ìÀú ¸í
user_app_name = "";

if(new RegExp(/Firefox/).test(navigator.userAgent)){ 
	user_app_name = "FF";
}else if(new RegExp(/Netscape/).test(navigator.userAgent)){ 
	user_app_name = "NS";
}else if(new RegExp(/MSIE/).test(navigator.userAgent)){ 
	user_app_name = "IE"; 
}else if(new RegExp(/Opera/).test(navigator.userAgent)){ 
	user_app_name = "OP"; 
}else if(new RegExp(/Chrome/).test(navigator.userAgent)){ 
	user_app_name = "CH"; 
}



//ÀÌ¹ÌÁöÁÖÀ§¿¡ Á¡¼±¾ø¾Ö±â
function bluring(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 


function MakeFlash(Url,Width,Height){ 
		document.writeln("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"" + Width + "\" height=\"" + Height + "\">"); 
		document.writeln("<param name=\"movie\" value=\"" + Url + "\">"); 
		document.writeln("<param name=\"quality\" value=\"high\" />"); 
		document.writeln("<param name=\"wmode\" value=\"transparent\">");
		document.writeln("<param name=\"allowScriptAccess\" value=\"always\">");
		document.writeln("<param name=\"base\" value=\".\">");
		document.writeln("<embed src=\"" + Url + "\" base=\".\"  wmode=\"transparent\" quality=\"high\" pluginspage=\"http://www.adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + Width + "\" height=\"" + Height + "\" allowScriptAccess=\"always\">"); 
		document.writeln("</object>"); 
}


function Related_url() {
	var uid = new Date().getTime();
	var myindex = document.urlForm.location_01.selectedIndex;
	str = new String(document.urlForm.location_01.options[myindex].value);
	strarray = str.split(/\,/);
	if (strarray[0] == "_blank")
	{
		window.open(strarray[1], uid, "");
	}else{
		location.href = strarray[1];
	}
	myindex = 0;
	document.urlForm.location_01.options[0].selected = true;
}

function movie(width,height,movie_name) {
	var movie_tag ="";
	movie_tag ='<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" ';
	movie_tag +='id="OCX1" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" vspace="0" hspace="0">';
	movie_tag +='            <param name="width" value="'+width+'">';
	movie_tag +='            <param name="height" value="'+height+'">';
	movie_tag +='            <param name="autoStart" value="1">';
	movie_tag +='            <param name="rate" value="1">';
	movie_tag +='            <param name="balance" value="0">';
	movie_tag +='            <param name="currentPosition" value="0">';
	movie_tag +='            <param name="playCount" value="1">';
	movie_tag +='            <param name="currentMarker" value="0">';
	movie_tag +='            <param name="invokeURLs" value="true">';
	movie_tag +='            <param name="volume" value="100">';
	movie_tag +='            <param name="mute" value="false">';
	movie_tag +='            <param name="uiMode" value="full">';
	movie_tag +='            <param name="stretchToFit" value="true">';
	movie_tag +='            <param name="windowlessVideo" value="false">';
	movie_tag +='            <param name="enabled" value="true">';
	movie_tag +='            <param name="enableContextMenu" value="false">';
	movie_tag +='            <param name="fullScreen" value="false">';
	movie_tag +='            <param name="enableErrorDialogs" value="false">';
	movie_tag +='            <param name="Filename" value="'+movie_name+'">';
	movie_tag +='            <param name="ShowControls" value="0">';
	movie_tag +='            <param name="EnableContextMenu" value="false">';
	movie_tag +='            <param name="ShowDisplay" value="false">';
	movie_tag +='            <param name="ShowPositionControls" value="false">';
	movie_tag +='            <param name="SendErrorEvents" value="true">';
	movie_tag +='            <param name="SendKeyboardEvents" value="false">';
	movie_tag +='            <param name="SendMouseClickEvents" value="false">';
	movie_tag +='            <param name="SendMouseMoveEvents" value="false">';
	movie_tag +='            <param name="SendPlayStateChangeEvents" value="true">';
	movie_tag +='</object>';
	document.write(movie_tag);
}


/* ****************************************************************************
* ÇÔ ¼ö ¸í : ÆË¾÷·¹ÀÌ¾î , hidden_div_t2k,setCookie_t2k,Cookie_Check_t2k
* ***************************************************************************/
function hidden_div_t2k(obj_olt,C_Type)
{
	eval("document.all."+obj_olt+".style.display='none';");
	if(C_Type=="C"){
		eval("setCookie_t2k('"+obj_olt+"', 'done' ,1 );")
	}
}

function hidden_pop_t2k(obj_olt,C_Type)
{
	if(C_Type=="C"){
		eval("setCookie_t2k('"+obj_olt+"', 'done' ,1 );")
	}
	window.close();
}

function setCookie_t2k( name, value, expiredays ){
	
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function Cookie_Check_t2k(obj_olt,LN){
	cookiedata = document.cookie;
	if(eval("cookiedata.indexOf('"+obj_olt+"=done') < 0") ){
		eval("var Off_X = "+obj_olt+".offsetWidth/2;");
		eval("var Off_Y = "+obj_olt+".offsetHeight/2;");
		var _x = (document.body.clientWidth/2 + document.body.scrollLeft) - Off_X + LN;
		
		if(user_app_name=="FF"){
			eval("document.getElementById('"+obj_olt+"').style.left=_x +'px';");
			eval("document.getElementById('"+obj_olt+"').style.top=_y +'px';");
		}else{
			eval("document.getElementById('"+obj_olt+"').style.pixelLeft=_x;");
			eval("document.getElementById('"+obj_olt+"').style.pixelTop=_y;");
		}

	}else{
		eval("document.all."+obj_olt+".style.display='none';");
	}
}

function Cookie_Check_ttm(obj_olt,LN,TN){
	cookiedata = document.cookie;
	if(eval("cookiedata.indexOf('"+obj_olt+"=done') < 0") ){
		eval("var Off_X = "+obj_olt+".offsetWidth/2;");
		eval("var Off_Y = "+obj_olt+".offsetHeight/2;");
		var _x = (document.body.clientWidth/2 + document.body.scrollLeft) - Off_X + LN;
		var _y = (document.body.clientHeight/2 + document.body.scrollTop) - Off_Y + TN;
		if(user_app_name=="FF"){
			eval("document.getElementById('"+obj_olt+"').style.left=_x +'px';");
			eval("document.getElementById('"+obj_olt+"').style.top=_y +'px';");
		}else{
			eval("document.getElementById('"+obj_olt+"').style.pixelLeft=_x;");
			eval("document.getElementById('"+obj_olt+"').style.pixelTop=_y;");
		}
		eval("document.getElementById('"+obj_olt+"').style.display='block';");
	}else{
		eval("document.all."+obj_olt+".style.display='none';");
	}
}

function Cookie_Check_ttm_Popup(obj_olt,src,name,width,height,top,left){
	cookiedata = document.cookie;
	if(eval("cookiedata.indexOf('"+obj_olt+"=done') < 0") ){
		window.open(src,name,'width='+width+',height='+height+',top='+top+',left='+left+'');	
	}
}

function Cookie_Check_nomove(obj_olt){
	cookiedata = document.cookie;
	if(eval("cookiedata.indexOf('"+obj_olt+"=done') < 0") ){
		eval("document.getElementById('"+obj_olt+"').style.display='';");
	}else{
		eval("document.all."+obj_olt+".style.display='none';");
	}
}


//À©µµ¿ì »õÃ¢ ¿­±â
function fnWinOpen(width,height,left,top,name,url,scroll,obj){
	if (left!=''){
		LeftPosition	= left;
	}else{
		LeftPosition	= (screen.width)?(screen.width-width)/2:100;
	}

	if (top!=''){
		TopPosition		= top;
	}else{

		TopPosition		= (screen.height)?(screen.height-height)/2:100;
	}

	winprops		= 'width='+width+', height='+height+', top='+TopPosition+', left='+LeftPosition+' scrollbars='+scroll+', toolbar=no';
	if(obj){
		window.open('',name, winprops);	
		obj.target		= name;
		obj.action		= url;
		obj.submit();
		return;
	}else{
		window.open(url,name, winprops);	
	}
}

//À©µµ¿ì »õÃ¢ ¿­±â
function fnWinOpen3(width,height,left,top,name,url,scroll,obj,resize){
	if (left!=''){
		LeftPosition	= left;
	}else{
		LeftPosition	= (screen.width)?(screen.width-width)/2:100;
	}

	if (top!=''){
		TopPosition		= top;
	}else{

		TopPosition		= (screen.height)?(screen.height-height)/2:100;
	}

	winprops		= 'width='+width+', height='+height+', top='+TopPosition+', left='+LeftPosition+' scrollbars='+scroll+', toolbar=yes, resizable='+resize;
	if(obj){
		window.open('',name, winprops);	
		obj.target		= name;
		obj.action		= url;
		obj.submit();
		return;
	}else{
		window.open(url,name, winprops);	
	}
}

//À©µµ¿ì »õÃ¢ ¿­±â
function fnWinOpen4(width,height,left,top,name,url,scroll,obj,resize){
	if (left!=''){
		LeftPosition	= left;
	}else{
		LeftPosition	= (screen.width)?(screen.width-width)/2:100;
	}

	if (top!=''){
		TopPosition		= top;
	}else{

		TopPosition		= (screen.height)?(screen.height-height)/2:100;
	}

	winprops		= 'width='+width+', height='+height+', top=0, left=0 scrollbars='+scroll+', toolbar=yes,channelmode=0, directories=1, location=1, menubar=yes, status=yes, titlebar=yes, resizable='+resize;
	if(obj){
		window.open('',name, winprops);	
		obj.target		= name;
		obj.action		= url;
		obj.submit();
		return;
	}else{
		window.open(url,name, winprops);	
	}
}



//À©µµ¿ì »õÃ¢ ¿­±â
function fnWinOpen3(width,height,left,top,name,url,scroll,obj,resize){
	if (left!=''){
		LeftPosition	= left;
	}else{
		LeftPosition	= (screen.width)?(screen.width-width)/2:100;
	}

	if (top!=''){
		TopPosition		= top;
	}else{

		TopPosition		= (screen.height)?(screen.height-height)/2:100;
	}

	winprops		= 'width='+width+', height='+height+', top='+TopPosition+', left='+LeftPosition+' scrollbars='+scroll+',channelmode=0, directories=1, location=1, menubar=yes, status=yes, titlebar=yes toolbar=yes, resizable='+resize;
	if(obj){
		window.open('',name, winprops);	
		obj.target		= name;
		obj.action		= url;
		obj.submit();
		return;
	}else{
		window.open(url,name, winprops);	
	}
}


function fnWinOpen2(width,height,name,url,scroll,obj){
	LeftPosition	= (screen.width)?(screen.width-width)/2:100;
	TopPosition		= (screen.height)?(screen.height-height)/2:100;
	winprops		= 'width='+width+', height='+height+', top=-1000, left=-1000 scrollbars='+scroll+', toolbar=no';
	window.open('',name, winprops);	
	obj.target		= name;
	obj.action		= url;
	obj.submit();
	return;
}

function fnWinOpenzip(width,height,left,top,name,url,scroll,obj){
	LeftPosition	= (screen.width)?(screen.width-width)/2:100;
	TopPosition		= (screen.height)?(screen.height-height)/2:100;
	winprops		= 'width='+width+', height='+height+', top=-1000, left=-1000 scrollbars='+scroll+', toolbar=no';
	window.open(url,name, winprops);
//	obj.target		= name;
//	obj.action		= url;
//	obj.submit();
//	return;
}


function viewImage(theSrc){
	var varObj
	url="/include_09/view.html?src="+theSrc
	varObj = (parent.dialogArguments)?parent.dialogArguments.window:window;
	var ObjFcs = varObj.open(url,"view","width=200,height=200,scrollbars=yes,left=5,top=5");
	ObjFcs.focus();
}


