
// Äõ¸®½ºÆ®¸µ
//var args = getArgs(); 
//if(args.Mode == "") {}
            
function getArgs() 
{ 
	var args = new Object(); 
	var query = location.search.substring(1); 
	var pairs = query.split("&"); 
 
	for(var i = 0; i < pairs.length; i++) { 
		var pos = pairs[i].indexOf('='); 
		if (pos == -1) continue; 
		var argname = pairs[i].substring(0,pos); 
		var value = pairs[i].substring(pos+1); 
		args[argname] = unescape(value); 
	} 
	return args; 
} 


// ÄíÅ° »ý¼º
function setCookie(cName, cValue, cDay)
{
    var expire = new Date();
    expire.setDate(expire.getDate() + cDay);
    cookies = cName + '=' + escape(cValue) + '; path=/ '; // ÇÑ±Û ±úÁüÀ» ¸·±âÀ§ÇØ escape(cValue)¸¦ ÇÕ´Ï´Ù.
    if(typeof cDay != 'undefined') cookies += ';expires=' + expire.toGMTString() + ';';
    document.cookie = cookies;
}

// ÄíÅ° °¡Á®¿À±â
function getCookie(cName) 
{
    cName = cName + '=';
    var cookieData = document.cookie;
    var start = cookieData.indexOf(cName);
    var cValue = '';
    if(start != -1){
       start += cName.length;
       var end = cookieData.indexOf(';', start);
       if(end == -1)end = cookieData.length;
       cValue = cookieData.substring(start, end);
    }
    return unescape(cValue);
}



function image_window2(src)
{
    srcImg = new Image(); 
	clientWidth = screen.width; 
	clientHeight = screen.height; 
	srcImg.src = src.src; 
	var srcFileName = srcImg.src.substr(srcImg.src.lastIndexOf("/")+1, srcImg.src.length); 
	win = window.open("","","width=15,height=15,scrollbars=no,resizable=no,left="+(clientWidth/2-15)+",top="+(clientHeight/2-15)+""); 
	win.document.writeln("<html>"); 
	win.document.writeln("<head>"); 
	win.document.writeln("<title>"+document.title+"</title>"); 
	win.document.writeln("</head>"); 
	win.document.writeln("<body style='margin:0px;' bgcolor='#333333'>"); 
	win.document.writeln("<table border='0' cellpadding='0' cellspacing='0' style='cursor:pointer' onclick='self.close()'>"); 
	win.document.writeln("<tr>"); 
	win.document.writeln("<td align='center'><img src="+src.src+" name='winImg' style='cursor:pointer' onclick='self.close()' alt='Å¬¸¯ÇÏ¸é »ç¶óÁý´Ï´Ù'></td>"); 
	win.document.writeln("</tr>"); 
	win.document.writeln("</table>"); 
	win.document.writeln("</body>"); 
	win.document.writeln("</html>"); 
	srcImg = win.document.winImg; 
	while(true) 
	if(srcImg.readyState == "complete") 
		break; 
	var winWidth = srcImg.width+10; 
	var winHeight = srcImg.height+29; 
	var left = (clientWidth/2)-(srcImg.width/2); 
	var top = (clientHeight/2)-(srcImg.height/2); 
	if(clientWidth <= srcImg.width){ 
		winWidth = clientWidth; 
		left = 0; 
		win.document.body.scroll = "auto"; 
	} 
	if(clientHeight <= srcImg.height){ 
		winHeight = clientHeight-30; 
		top = 0; 
		win.document.body.scroll = "auto"; 
	} 
	win.moveTo(left, 0); 
	win.resizeTo(winWidth, winHeight); 

}

function resize_image()
{
    var target = document.getElementsByName('target_resize_image[]');
    for(i=0; i<target.length; i++) { 
        // ¿ø·¡ »çÀÌÁî¸¦ ÀúÀåÇØ ³õ´Â´Ù
        target[i].tmp_width  = target[i].width;
        target[i].tmp_height = target[i].height;
        // ÀÌ¹ÌÁö ÆøÀÌ Å×ÀÌºí Æøº¸´Ù Å©´Ù¸é Å×ÀÌºíÆø¿¡ ¸ÂÃá´Ù
        if(target[i].width > 728)
        {
            target[i].width = 728;
            target[i].height = target[i].tmp_height * (728 / target[i].tmp_width);
            
            //tnHeight = bitmap.Height * (widthLimit / bitmap.Width);
        }
    }
}





// Å¬¸¯ÇÑ°÷¿¡ ·¹ÀÌ¾î ¶ç¿ì±â
function abspos(e)
{
    this.x = e.clientX + (document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);
    this.y = e.clientY + (document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);
    return this;
}
function itemClick(e)
{
    var ex_obj = document.getElementById('lay');
    if(!e) e = window.Event;
    pos = abspos(e);
    ex_obj.style.left = pos.x+"px";
    ex_obj.style.top = (pos.y+10)+"px";
    ex_obj.style.display = ex_obj.style.display=='none'?'block':'none';
}

//  ÄÁÆ®·ÑÅ° return false
function keydown() 
{ 
    if((event.ctrlKey) || (event.shiftKey)) { 
        return false;
    } 
}

// À©µµ¿ìÀÌº¥Æ® FALSE
function content_cp()
{
 if (window.event)
    window.event.returnValue = false;
}

// ÅÂ±×Á¦°Å
function stripHTMLtag(string) { 
   var objStrip = new RegExp(); 
   objStrip = /[<][^>]*[>]/gi; 
   return string.replace(objStrip, ""); 
} 


// ÆÄÀÏ´Ù¿î·Îµå ¼³Ä¡¿©ºÎ ÆÇ´Ü
function SmartUserCheck()
{
    document.write(AjaxMethod.SmartUserCheck().value);
}    
function SmartJ()
{
    document.write(AjaxMethod.SmartJ().value);
}
