//=============================
//º¸¾È
//==============================
var sHttpHost = "http://" + location.host;
var sFullHref = location.href;
var sLocationPath = sFullHref.replace(sHttpHost,"");
var isSelfMode = false;


/**
 ÇÁ·¹ÀÓÀÌ ¹þ°ÜÁö¸é °­Á¦·Î ¾º¿öÁØ´Ù.
*****************************************
try {
	if (top==self&&!isSelfMode) {
		try {
			if (opener.name) {
				isSelfMode = true;
			}
		} catch(e1) { }
		
		try {
			isSelfMode = IS_SELF_MODE;
		} catch(e2) { }
		
		if (!isSelfMode) {			
			top.location.replace("/?h="+escape(sLocationPath));
		}
	}
} catch(e) {
	
}**/
//================================

//F5¸±·Îµå½Ã ÆäÀÌÁö°íÁ¤
document.onkeydown = function() { 
	if (event.keyCode == 116) 
	{ 		
		event.keyCode = 505; 
	} 
	if (event.keyCode == 505) 
	{ 
		location.reload(); 
		return false; 
	} 
} 
//====================================

function winLoad(addFunc)
{
	window.onload = function()
	{
		if(addFunc != null)
		{
			eval(addFunc) ;
		}
	}
}

//ID°´Ã¼ 
function $(element) {
	if (arguments.length > 1) 
	{
		for (var i = 0, elements = [], length = arguments.length; i < length; i++)
		{
			elements.push($(arguments[i]));
		}
		return elements;
	}
	if (typeof element == 'string')
	{
		element = document.getElementById(element);
	}
	
	return element;
}

//CapsLock ÄÑÁüÃ¼Å©
function checkCapsLock() 
{
	//var pwd = document.getElementById("NidLogin").pw.value.length;
	//if (pwd > 0) return;
	var e = event;
	var myKeyCode = 0;
	var myShiftKey = false;
	
	if ( document.all ) 
	{// Internet Explorer 4+
		myKeyCode=e.keyCode; 
		myShiftKey=e.shiftKey;
	} 
	else if ( document.layers ) 
	{// Netscape 4
		myKeyCode=e.which;  
		myShiftKey=( myKeyCode == 16 ) ? true : false;
	} 
	else if ( document.getElementById ) 
	{ // Netscape 6
		myKeyCode=e.which; 
		myShiftKey=( myKeyCode == 16 ) ? true : false;
	}
	
	if ( ( myKeyCode >= 65 && myKeyCode <= 90 ) && !myShiftKey ) 
	{
		setCapslockInfoOn();
		
	} 
	else if ( ( myKeyCode >= 97 && myKeyCode <= 122 ) && myShiftKey ) 
	{
		setCapslockInfoOn();		
	}
	else
	{
		setCapslockInfoOff();
	}
}

function setCapslockInfoOn()
{
	img = "<img src='../common_image/capslock_wanted.gif' border=0>";
	obj = document.getElementById('capsDiv');
	if(!obj)
	{
		obj = document.createElement("div");
		obj.id = "capsDiv";
		document.body.appendChild(obj);
	}
	
	obj.innerHTML = img ;
	
	sX		= screen.width;
	sY		= screen.height;
	width	= obj.scrollWidth;
	height	= obj.scrollHeight;
	dotX	= (sX - width) / 2;
	dotY	= (sY - height) / 2 - 50;
	
	
	with(obj.style)
	{
		top		= dotY;
		left	= dotX;
		display	= '';
		zIndex	= 100;
		position='absolute';
	}

	setTimeout("setCapslockInfoOff()", 4000);
}
function setCapslockInfoOff()
{
	
	obj = document.getElementById('capsDiv');
	if(obj)
	{
		obj.style.display = 'none';
	}
}

//------------------------------------------------------------------------
// ¼ýÀÚ¸¸ ÀÔ·Â°¡´É
// »ó´Ü¼ýÀÚÅ° ¹× ¿À¸¥ÂÊ ¼ýÀÚÅ° ¿Í ¹é½ºÆäÀÌ½º,delete Å°µµ Çã¿ëÇÑ´Ù
//------------------------------------------------------------------------
function isNumber(val)
{
	if(val)		ek = val.keyCode;
	else		ek	= event.keyCode;
	
	//if(ek != 8 || ((ek < 48 && ek != 46) || (ek > 57)) || (ek < 96 || (ek > 105))
	if(ek !=9 && (ek < 48 && (ek != 8 &&ek != 46)) || (ek > 57 && ek < 96) || ek > 105)
	{
		alert("¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù!!");
		
		event.returnValue = false;
		return false;
	}
}
function isFloat()
{
	var ek		= event.keyCode;
	// 190 (.)
	//if(ek != 8 || ((ek < 48 && ek != 46) || (ek > 57)) || (ek < 96 || (ek > 105))
	
	if((ek < 48 && (ek != 8 &&ek != 46)) || (ek > 57 && ek < 96) || ek > 105)
	{
		if(ek != 190 && ek != 110) {
		alert("¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù!!");
		event.returnValue = false;
		}
	}
}
function juminCheck(juminVal)
{
	var juminArr = new Array(12);				
	var flag = true;

	j = 2;										
	juminHab = 0;								

	for(i = 0 ; i < juminVal.length - 1; i++)	
	{
		juminArr[i]	= juminVal.charAt(i) * j;	
		juminHab	= juminHab + juminArr[i];	

		if(j == 9)	j = 2;						
		else		j++;						
	}

	juminMod = juminHab % 11;
	last_bit = 11 - juminMod;
	
	if(last_bit == juminVal.charAt(12))	flag = true;
	else								flag = false;

	return flag;
}

//---------------------------------------------
//	ÀÏÁ¤±æÀÌ°¡ µÇ¸é ´ÙÀ½ ÀÔ·ÂÄ­À¸·Î Æ÷Ä¿½º°¡ ÀÌµ¿ÇÑ´Ù
//	ÁÖ¹Îµî·Ï¹øÈ£ Ã¢µî¿¡¼­ ¸¹ÀÌ »ç¿ëµÊ
//---------------------------------------------
function moveNextField(field1,field2,limit)
{
	nowLen	= field1.value.length;

	if(nowLen == limit)	field2.focus();
}

//----------------------------------------------
//	»õÃ¢¶ç¿ì±â ½ºÅ©¸³Æ®
//	url				»õÃ¢¿¡ Ãâ·ÂÇÒ ÆÄÀÏ °æ·Î
//	obj				Ã¢ÀÇ ÀÌ¸§(ÁöÁ¤¾ÈÇØµµ µÊ)
//	width			Ã¢ ³ÐÀÌ
//	height			Ã¢ ³ôÀÌ
//	locateX			Ã¢ °¡·ÎÀ§Ä¡
//	locateY			Ã¢ ¼¼·ÎÀ§Ä¡
//----------------------------------------------
function openWindow(url,obj,elements,width,height)
{
	if(document.layers)
	{
		var	sX	= screen.availWidth;
		var	sY	= screen.availHeight;
	}

	if(document.all)
	{
		var	sX	= screen.width;
		var	sY	= screen.Height;
	}

	dotX	= (sX - width) / 2;
	dotY	= (sY - height) / 2;

	elements	+= ",width=" + width + ",height=" + height + ",left=" + dotX + ",top=" + dotY; 
	return window.open(url,obj,elements);
}

function openWindowHide(url,obj,width,height)
{
	elements	= ",width=" + width + ",height=" + height + ",top=10000,left=10000"; 
	window.open(url,obj,elements);
}
//------------------------------------------------------
//	ÀÔ·Â¹Ú½º¿¡ Æ÷Ä¿½º°¡ ¿À¸é ±âº»°ªÀ» »èÁ¦ÇÑ´Ù
//------------------------------------------------------
function clearField(field)
{
	if(field.value == field.defaultValue)		field.value = "";
}

//----------------------------------------------------------------
//	ÀÔ·Â¹Ú½º¿¡ ¾Æ¹«³»¿ëÀÌ ¾øÀÌ Æ÷Ä¿½º°¡ »ç¶óÁö¸é ±âº»°ªÀ» Ã¤¿î´Ù
//----------------------------------------------------------------
function checkField(field)
{
	if(field.value == "")						field.value = field.defaultValue;
}

//------------------------------------------------------
//	ÀÍ½ºÇÃ·Î·¯¿¡¼­ ³Ý½ºÄÉÀÌÇÁ¿¡¼­ ¾²´Â blink È¿°úÁÜ
//------------------------------------------------------
function doBlink()
{ 
	var blink = document.all.tags("BLINK") // ±ÛÀÚ°¡ ±ôºýÀÌ´Â ÅÂ±×¸¦ ÁöÁ¤ÇÏ´Â °÷ÀÌ´Ù. 
	
	for (var i=0; i < blink.length; i++) 
		blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
}

function startBlink()
{ 
	if (document.all) setInterval("doBlink()",600) // ¼ýÀÚ°¡ ÀÛÀ»¼ö·Ï »¡¶óÁü. 
} 

//--------------------------------
//	·¹ÀÌ¾î °´Ã¼ º¸ÀÌ°Ô ÇÏ±â
//--------------------------------
function viewLayer(id,stat)
{
	obj = document.getElementById(id);
	if(obj)
	{
		if(stat == null || stat == 'auto')
		{
			if(obj.style.display == '')	stat = 'none';
			else						stat = '';
		}

		obj.style.display = stat;
	}
}

function layerOpen(obj)
{
	// nn
	if(document.layers)
	{
		var obj	= document.layers[obj];
		obj.visibility = "visible";
	}

	// ie
	if(document.all)
	{
		var obj	= document.all[obj];
		var objX = document.body.clientWidth / 2 + document.body.scrollLeft - 180;
		var objY = document.body.clientHeight / 2 + document.body.scrollTop - 0;

		obj.style.posLeft		= objX;
		obj.style.posTop		= objY;
		obj.style.visibility	= "visible";
	}
}

//----------------------------------
//	·¹ÀÌ¾î °´Ã¼ ¼û±â±â
//----------------------------------
function layerClose(obj)
{
	// nn
	if(document.layers)
	{
		var obj	= document.layers[obj];
		obj.visibility = "hidden";
	}

	// ie
	if(document.all)
	{
		var obj	= document.all[obj];
		obj.style.visibility = "hidden";
	}
}

//-------------------------------------------
//	·Ñ¿À¹ö µî ¾×¼ÇÀÌ ÃëÇØÁö¸é ÀÌ¹ÌÁö¹Ù²Ù´Â ÇÔ¼ö
//-------------------------------------------
function swapImg(imgSrc,newImg)
{
	imgSrc.src	= newImg;
}

//---------------------------------------
//	ÄíÅ°¼³Á¤
//---------------------------------------
function getCookie(name)
{
	var nameOfCookie = name + "="; 
	var x = 0; 
	while(x <= document.cookie.length)
	{ 
		var y = (x+nameOfCookie.length); 
		if(document.cookie.substring(x,y) == nameOfCookie)
		{
			if((endOfCookie=document.cookie.indexOf(";",y)) == -1)
			{
				endOfCookie = document.cookie.length; 
			}
			return unescape(document.cookie.substring(y,endOfCookie)); 
		}
		x = document.cookie.indexOf(" ",x) + 1; 
		if(x == 0)	break;
	} 
	return ""; 
}

//-------------------------------------
//	¼³Á¤µÈ ÄíÅ° °¡Á®¿À±â
//-------------------------------------
function setCookie(name,value,expire)
{
	cookieStr = name+'='+escape(value)+";path=/;expires="+expire.toGMTString()+";";
	document.cookie	= cookieStr;
}

//---------------------------------------------------
//	¸¶¿ì½º ¿À¹ö »ö»ó
//----------------------------------------------------
function mouseOverColor(obj,bgColor,fontColor,cursor,bold)
{
	obj.style.backgroundColor	= bgColor;
	obj.style.color				= fontColor;
	obj.style.cursor			= cursor;
	if(bold) obj.style.fontWeight = bold;
}
function menuOverColor(obj,bgColor,fontColor,cursor)
{
	mouseOverColor(obj,bgColor,fontColor,cursor)
}
//---------------------------------------------------
//	¸¶¿ì½º ¾Æ¿ô »ö»ó
//----------------------------------------------------
function mouseOutColor(obj,bgColor,fontColor,bold)
{
	obj.style.backgroundColor	= bgColor;
	obj.style.color				= fontColor;
	if(bold) obj.style.fontWeight = bold;
}
function menuOutColor(obj,bgColor,fontColor,cursor)
{
	mouseOutColor(obj,bgColor,fontColor,cursor)
}

//------------------------------------------------
//	ÀÔ·ÂµÈ ¼ýÀÚ°ª¿¡ 1000´ÜÀ§¾¿ ,¸¦ ºÙÀÎ´Ù
//------------------------------------------------
function commaNum(num)
{ 
	num = num.replace(/,/gi,"");
	if(num < 0)
	{
		num *= -1;
		var minus = true;
	}
	else
	{
		var minus = false;
	}

	var dotPos		= (num+"") . split(".");
	var dotU		= dotPos[0];
	var dotD		= dotPos[1];
	var commaFlag	= dotU . length % 3;

	if(commaFlag)
	{
		var out = dotU.substring(0,commaFlag);
		if(dotU.length > 3) out += ",";
	}
	else
	{
		var out = "";
	}

	for(i = commaFlag ; i < dotU.length ; i += 3)
	{
		out += dotU.substring(i, i+3);
		if(i < dotU.length-3) out += ",";
	}

	if(minus)	out = "-" + out;

	if(dotD)	return out + "." + dotD;
	else		return out 
}

//ÀÌ¹ÌÁöº¸±â
function viewImage(f){
	imgObj		= new Image();
	imgObj.src	= f;

	screen_width	= screen.width - 30 ;
	screen_height	= screen.height - 30 ;
	img_width		= imgObj.width ;
	img_height		= imgObj.height ;
	
	var opt2 = "";
	if(screen_width < img_width || screen_height < img_height){
		wopt		= "scrollbars=yes,status=no,resizable=no";   
	}else{
		wopt		= "scrollbars=no,status=no,resizable=no";   
	}
	
	wopt	   += ",width=300, height=300";
	
	wbody		= "<head><title>IR Robot</title>";
	wbody      += "<script language='javascript'>";
	wbody	   += "window.focus();";
	wbody      += "function finalResize(){";
	wbody	   += "  window.moveTo(0,0);";
	wbody	   += "  var oBody=document.body;";
	wbody	   += "  var oImg=document.images[0];";
	wbody	   += "  var xdiff=oImg.width-oBody.clientWidth;";
	wbody	   += "  var ydiff=oImg.height-oBody.clientHeight;";
	wbody	   += "  if(oImg.width < screen.availWidth || oImg.height < screen.availHeight) ";
	wbody	   += "  window.resizeBy(xdiff,ydiff);";
	wbody	   += "  else window.resizeTo(screen.availWidth,screen.availHeight);";
	
	wbody	   += "}";
	wbody	   += "</"+"script>";
	wbody	   += "</head>";
	wbody	   += "<body onLoad='finalResize()' style='margin:0' scroll=auto>";
	wbody	   += "<a href='javascript:window.close()'><img src='" + imgObj.src + "' border=0 "+ opt2 + "></a>";
	wbody	   += "</body>";
	winResult	= window.open("","bigimg",wopt);
	winResult.document.open("text/html", "replace");
	winResult.document.write(wbody);
	winResult.document.close();
	return;
}
function viewImage4(f){
	imgObj		= new Image();
	imgObj.src	= f;

	screen_width	= screen.width - 30 ;
	screen_height	= screen.height - 30 ;
	img_width		= imgObj.width ;
	img_height		= imgObj.height ;
	
	var opt2 = "";
	if(screen_width < img_width || screen_height < img_height){
		wopt		= "scrollbars=yes,status=no,resizable=no";   
	}else{
		wopt		= "scrollbars=no,status=no,resizable=no";   
	}
	
	wopt	   += ",width=300, height=300";
	
	wbody		= "<head><title>IR Robot</title>";
	wbody      += "<script language='javascript'>";
	wbody	   += "window.focus();";
	wbody      += "function finalResize(){";
	wbody	   += "  window.moveTo(0,0);";
	wbody	   += "  var oBody=document.body;";
	wbody	   += "  var oImg=document.images[0];";
	wbody	   += "  var xdiff=oImg.width-oBody.clientWidth;";
	wbody	   += "  var ydiff=oImg.height-oBody.clientHeight;";
	wbody	   += "  if(oImg.width < screen.availWidth || oImg.height < screen.availHeight) ";
	wbody	   += "  window.resizeBy(xdiff,ydiff);";
	wbody	   += "  else window.resizeTo(screen.availWidth,screen.availHeight);";
	
	wbody	   += "}";
	wbody	   += "</"+"script>";
	wbody	   += "</head>";
	wbody	   += "<body onLoad='finalResize()' style='margin:0' scroll=auto>";
	wbody	   += "<a href='javascript:window.close()'><img src='" + imgObj.src + "' border=0 "+ opt2 + "></a>";
	wbody	   += "</body>";
	winResult	= window.open("","bigimg",wopt);
	winResult.document.open("text/html", "replace");
	winResult.document.write(wbody);
	winResult.document.close();
	return;
}

function viewImage2(url,width,height,ext)
{	
	screen_width	= screen.width - 30 ;
	screen_height	= screen.height - 30 ;
	img_width		= width ;
	img_height		= height ;
	
	home_path		= url.split("/spPackage/");
	home_path		= home_path[0] + "/spPackage/common_image";

	if(screen_width < img_width || screen_height < img_height)
	{
		wopt		= "left=0,top=0,scrollbars=yes,status=no,resizable=no,width="+screen_width+",height="+screen_height;
	}
	else
	{
		wopt		= "left=0,top=0,scrollbars=no,status=no,resizable=no,width="+img_width+",height="+img_height;
	}

	
	var opt2 = "width="+img_width+" height="+img_height;

	if(ext == "swf")
	{
		viewIMG   = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ";
		viewIMG	+= "codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' ";
		viewIMG	+= "width='"+img_width+"' height='"+img_height+"'> ";
		viewIMG	+= "<param name='movie' value='"+url+"'>";
		viewIMG	+= "<param name='play' value='true'>";
		viewIMG	+= "<param name='loop' value='true'>";
		viewIMG	+= "<param name='quality' value='High'>";
		viewIMG	+= "<param name='_cx' value='5080'>";
		viewIMG	+= "<param name='_cy' value='5080'>";
		viewIMG	+= "<param name='src' value='"+url+"'>";
		viewIMG	+= "<param name='WMode' value='Transparent'>";
		viewIMG	+= "<param name='Menu' value='true'>";
		viewIMG	+= "<param name='AllowScriptAccess' value='always'>";
		viewIMG	+= "<param name='Scale' value='ShowAll'>";
		viewIMG	+= "<param name='DeviceFont' value='false'>";
		viewIMG	+= "<param name='EmbedMovie' value='false'>";
		viewIMG	+= "<param name='SeamlessTabbing' value='true'>";
		viewIMG	+= "<embed width='"+img_width+"' height='"+img_height+"' src='"+url+"' ";
		viewIMG	+= "play='true' loop='true' quality='High' ";
		viewIMG	+= "pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' ";
		viewIMG	+= "WMode='Transparent' Menu='true' AllowScriptAccess='always' Scale='ShowAll' DeviceFont='false' EmbedMovie='false' SeamlessTabbing='true'></embed></object>";
	}
	else
	{
		viewIMG = "<img src='" + url + "' border=0 "+ opt2 + ">";
	}
	
	wbody		= "<head><title>IR Robot</title>\n";
	wbody      += "<script language='javascript'>\n";
	wbody	   += "window.focus();\n";
	wbody      += "function finalResize(){\n";
	wbody	   += "  window.moveTo(0,0);\n";	
	wbody	   += "  var oBody=document.body;\n";
	wbody	   += "  var oImg=document.images[0];\n";
	wbody	   += "  var xdiff=oImg.width-oBody.clientWidth;\n";
	wbody	   += "  var ydiff=oImg.height-oBody.clientHeight;\n";	
	wbody	   += "  if(oImg.width < screen.availWidth || oImg.height < screen.availHeight) \n";
	wbody	   += "  window.resizeBy(xdiff,ydiff);\n";
	wbody	   += "  else window.resizeTo(screen.availWidth,screen.availHeight);\n";	
	
	if(ext == "swf")
	{
		wbody	   += "  document.all.blankID.style.display = 'none' ;";		
	}
	
	wbody	   += "}\n";
	wbody	   += "</"+"script>\n";
	wbody	   += "</head>\n";
	wbody	   += "<body onLoad='finalResize()' style='margin:0' scroll=auto>\n";
	wbody	   += "<span style='position:absolute;width:'"+img_width+";height:"+img_height+">";
	wbody	   += "<span style='position:absolute;top:0;left:0;z-index:0;'>";
	wbody	   += viewIMG+"</span>";
	wbody	   += "<span id='blankID' style='position:absolute;z-index:100;top:0;left:0'>";
	wbody	   += "<a href='javascript:window.close()'><img src='"+home_path+"/blank.gif' width="+img_width+" height="+img_height+" name='blankImg' border=0></a>";
	wbody	   += "</span></span>";
	wbody	   += "</body>";
	winResult	= window.open("","bigimg",wopt);
	winResult.document.open("text/html", "replace");
	winResult.document.write(wbody);
	winResult.document.close();
	return;
	
	
		
	return;
}

function imgView(obj)
{
	imgUrl	= obj.src;
	viewImage(imgUrl);
}



// ÇÑ±ÛÀÔ·Â±ÝÁö
function not_kor(){
	if(event.keyCode>127){
		event.returnValue=false;
	}
}

//checkbox Control in Listpage
function CheckSel(form,fName) 
{
	check_i = form.elements.length;
	u = 0 ;
	for(i=0;i<check_i;i++) 
	{
		check_no = eval("form.elements[" + i + "]"); 

		var chkType = check_no.type ;
		if(chkType != "checkbox") continue ;

		if(fName != null)
		{
			if(check_no.name != fName) continue;
		}
		
		if(check_no.checked == false ) 
		{		
			check_no.checked = true ;
			
			u ++ ;
		}
	}
    
	if(u == 0 ) 
	{
		for(i=0;i<check_i;i++) {
			check_no = eval("form.elements[" + i + "]"); 
			
			var chkType = check_no.type ;
			if(chkType != "checkbox") continue ;
			if(fName != null)
			{
				if(check_no.name != fName) continue;
			}
			
			check_no.checked = false ;
		}
	}
}

function  SelDel(form,msg,fName) 
{
	var check_nums = form.elements.length;
   
	var checkLen = 0;
	for(var i = 0; i < check_nums; i++) 
	{
		var checkbox_obj = eval("form.elements[" + i + "]");
		
		var chkType = checkbox_obj.type ;

		if(chkType != "checkbox") continue ;
		if(fName != null)
		{
			if(checkbox_obj.name != fName) continue;
		}		

		if(checkbox_obj.checked == true) 
		{			
			//break;
			checkLen++;
		}
	}
	
	//if(i == check_nums) 
	if(checkLen == 0) 
	{       
		alert("¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø½À´Ï´Ù!");
		return;   
	}
	else
	{   
		if(!msg) msg = "¼±ÅÃµÈ Ç×¸ñÀÌ »èµÇµË´Ï´Ù.\n\nÁ¤¸»·Î »èÁ¦ÇÒ±î¿ä?";
		
		flag1 = confirm(msg);
	   
		if(flag1) 
		{			  
			return true ;
		}
	}
}


//ajax ¿¡ º¸³¾ elementº¯¼ö 
function elSetQuery(form)
{
	len			= form.elements.length ;

	strParams	= "";
	for(i=0;i<len;i++)
	{
		elName	= form.elements[i].name ;
		elVal	= encodeURIComponent(form.elements[i].value) ;
		elType	= form.elements[i].type ;

		if(elType == 'radio' || elType == 'checkbox')
		{
			if(form.elements[i].checked == false)
			{
				continue ;
			}
		}
		if(elType == 'button' || elType == 'submit') continue ;


		if(i > 0) strParams += "&";
		strParams += elName + "=" + elVal ;
	}

	return strParams ;

}

//********************************************************
// ÀÌµ¿°ü·Ã ÇÔ¼ö
//*********************************************************
function locHref(qty,url)
{
	if(url) this_page = url;
	else
	{
		var qryString = document.location.search;
		var this_page = sLocationPath.replace(qryString,"");
	}
	
	document.location.href	= this_page+"?" + qty ;
}

function locRepl(qty,url)
{
	if(url) this_page = url;
	else
	{
		var qryString = document.location.search;
		var this_page = sLocationPath.replace(qryString,"");
	}
	
	document.location.replace(this_page+"?" + qty);
}


//ÀÌ¹ÌÁö ¸®»çÀÌÁî...
function contentImgResize(objName,max)
{
	maxsize = max;
	var content = document.getElementById(objName);
	var img = content.getElementsByTagName("img");



	for(i=0; i<img.length; i++)
	{

		temp = new Image();
		temp.src = img[i].src ;
		if(temp.width > maxsize)
		{
			
			reSize = imageResize(temp.src,maxsize);
			
			img[i].width  = reSize[0];
			img[i].height = reSize[1];
		}

	}
}

function imageResize(image,r_w,r_h)
{
	
	imgObj = new Image();
	imgObj.src = image;

	filewidth = imgObj.width;
	fileheight = imgObj.height;

	if(!r_h)   r_h    = fileheight;

	if(filewidth > r_w)
	{
		width_         = r_w ;
		height_        = (fileheight * width_) / filewidth ;

		if(height_ > r_h)
		{
			width_     =  (r_w * r_h) / height_ ;
			height_    = r_h ;
		}

		height_    = Math.round(height_);
		width_     = Math.round(width_);
	}
	else
	{
		width_     = filewidth ;
		height_    = (fileheight * width_) / filewidth ;

		if(height_ > r_h)
		{
			width_     = (width_ * r_h) / height_ ;
			height_    = r_h ;
		}

		height_    = Math.round(height_);
		width_     = Math.round(width_);
	}

	rtn = new Array();
	rtn[0] = width_;
	rtn[1] = height_;
	

	return rtn ;
}

/*function mainMenuGo(qty)
{
	domain		= document.domain ;
	url			= document.URL ;
	Rurl		= url.split("?");
	exclusion	= "http://" + domain ;

	real		= url.substring(exclusion.length,Rurl[0].length);

	document.location.href	= real + "?" + qty ;
}
function mainPageGo(qty)
{
	document.location.href	= qty ;
}*/
function ShowBack(){
	var back = document.getElementById("div_background");
	var back2 = document.getElementById("frm_background");


	back.style.left = 0;
	back.style.top  = 0;
	if(document.body.scrollWidth > document.body.clientWidth)
		back.style.width = document.body.scrollWidth;
	else
		back.style.width = '100%';
	if(document.body.scrollHeight > document.body.clientHeight)
		back.style.height = document.body.scrollHeight;
	else
		back.style.height = '100%';

	back2.style.left = 0;
	back2.style.top = 0;
	if(document.body.scrollWidth > document.body.clientWidth)
		back2.style.width = document.body.scrollWidth;
	else
		back2.style.width = '100%';
	if(document.body.scrollHeight > document.body.clientHeight)
		back2.style.height = document.body.scrollHeight;
	else
		back2.style.height = '100%';

	back.style.filter = "alpha(opacity=50)";
	back.style.zIndex = 9;
	back2.style.zIndex = 10;
	back2.style.filter = "alpha(opacity=0)";
	back.innerHTML = "<table width='100%' height='100%' bgcolor='#666666'><tr><td></td></tr></table>";
	back.style.display = "";
	back2.style.display = "";
 }
 function HideBack(){
  document.getElementById("div_background").style.display = "none";
  document.getElementById("frm_background").style.display = "none";
 }
document.writeln("<div id='div_background' style='display:none;position:absolute'></div>");
document.writeln("<iframe id='frm_background' border=0 frameborder=0 style='display:none;position:absolute;'></iframe>");
