// JavaScript Document


 
function pop_find_post(){
	win = window.open ('/investment/pop_find_post.asp','pop_find_post','width=310 , height=300 , scrollbars=no');
	win.focus();
}


function layer_view (layer_name, layer_display){
	if (layer_display == "view"){
		document.getElementById(layer_name).style.display = "block" ;
	} else {
		document.getElementById(layer_name).style.display = "none" ;
	}
}



// Flash

var EmbedStr = "";
function GetFlash(url,x,y) { 
	EmbedStr = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + x + "' height='" + y + "'>";
	EmbedStr += "<param name='allowScriptAccess' value='always' />";
	EmbedStr += "<param name='movie' value='" + url + "' />";
	EmbedStr += "<param name='quality' value='high' />";
	EmbedStr += "<param name='bgcolor' value='#ffffff' />";
	EmbedStr += "<param name='menu' value='false' />";
	EmbedStr += "<param name='wmode' value='transparent' />";
	EmbedStr += "<embed src='" + url + "' id='flashObject' name='flashObject' quality='high' menu='false' wmode='transparent' bgcolor='#ffffff' width='" + x + "' height='" + y + "' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	EmbedStr += "</object>";
	
	document.write(EmbedStr);
	return;
}
	
// IE6 PNG Åõ¸í
function fixPNG(myImage) 
{
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
	var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
   var imgTitle = (myImage.title) ? 
             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
   var imgStyle = "display:inline-block;" + myImage.style.cssText
   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
   myImage.outerHTML = strNewHTML   
    }
}




// RollOver
function imageOver(imgs) {
	imgs.src = imgs.src.replace("off.gif", "on.gif");
}
function imageOut(imgs) {
	imgs.src = imgs.src.replace("on.gif", "off.gif");
//  onmouseover="imageOver(this);" onmouseout="imageOut(this);"
} 








/******************************************************************************
	ÆÄÀÏ¸í : common.js - °øÅë Javascript
	ÀÛ¼ºÀÚ : PortfolioAD
	ÀÛ¼ºÀÏ : 2006-07-13
******************************************************************************/

var sendit;
var win;
 


//=================================================================================================================================
// IE ¼³°è º¯°æ¿¡ µû¸¥ À¥ ¾îÇÃ¸®ÄÉÀÌ¼Ç ·Îµå º¯°æ
//=================================================================================================================================
/*
var EmbedStr = "";
function GetFlash(url,x,y) { 
	EmbedStr = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + x + "' height='" + y + "'>";
	EmbedStr += "<param name='allowScriptAccess' value='always' />";
	EmbedStr += "<param name='movie' value='" + url + "' />";
	EmbedStr += "<param name='quality' value='high' />";
	EmbedStr += "<param name='bgcolor' value='#ffffff' />";
	EmbedStr += "<param name='menu' value='false' />";
	EmbedStr += "<param name='wmode' value='transparent' />";
	EmbedStr += "<embed src='" + url + "' id='flashObject' name='flashObject' quality='high' menu='false' wmode='transparent' bgcolor='#ffffff' width='" + x + "' height='" + y + "' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	EmbedStr += "</object>";
	
	document.write(EmbedStr);
	return;
}
*/	

//=================================================================================================================================
// ÇÊµå°ªÀ¸·Î ¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â
//=================================================================================================================================
function NumberKeyOnly(obj) {
	// obj : ÇÊµå¸í (ex. document.form.title)
	var checkOK = "0123456789";
	var checkStr = obj.value;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
		allNum += ch;
	}
	if (!allValid){
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÒ¼ö ÀÖ½À´Ï´Ù.");
		obj.value = obj.defaultValue;
		obj.focus();
		return;
	}
}

//=================================================================================================================================
// Æ÷ÅÍ½º ÀÚµ¿ ÀÌµ¿
//=================================================================================================================================

function moveFocus(obj,len,nxtObj)
{
	if(obj.value.length >= len)
		eval(nxtObj).focus();
}

//=================================================================================================================================
// ÇÊ¼ö Ç×¸ñ NULL Ã¼Å©
//=================================================================================================================================
function f_nul_chk(obj,lbl)
{
	if( obj.value == '' )
	{
		alert('ÇÊ¼öÇ×¸ñ ' + lbl + ' ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		obj.focus(); 
		return true;   
	}
	else if (obj.value == 'null')
	{
		alert('ÇÊ¼öÇ×¸ñ ' + lbl + ' ¼±ÅÃÇÏ½Ê½Ã¿À.');
		return true;   
	}
	return false; 
}
 
//=================================================================================================================================
// ¼ýÀÚ¸¸ ÀÔ·Â °¡´É
//=================================================================================================================================
function f_is_num(obj,lbl)
{
	var nLen = obj.value.length; 
	for( i = 0 ; i < nLen ; i++)
	{
		temp = obj.value.substring(i,i+1);
		if( temp < '0' || temp > '9' )
		{
			alert(lbl + ' ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.');
			obj.select();
			return true;
		}     
	}
	return false;
}



//=================================================================================================================================
// ID Ã¼Å© (¼ýÀÚ ¹× ¿µ¹®ÀÚ¸¸ ÀÔ·Â °¡´É)
//=================================================================================================================================

function f_is_id(obj)
{
   var sTemp;

	for(var i = 0; i < obj.value.length; i++)
	{
	   sTemp = obj.value.substring(i, i+1);   
		if((sTemp <= '9') && (sTemp >= '0'))
		   continue;
		if((sTemp <= 'z') && (sTemp >= 'a'))
		   continue;
		if((sTemp <= 'Z') && (sTemp >= 'A'))
		   continue;
	   return true;
	}
   return false;
}


//=================================================================================================================================
// ¹®ÀÚ ±æÀÌ Ã¼Å© (X¹®ÀÚ ÀÌ»ó ÀÔ·Â °¡´É)
//=================================================================================================================================
function f_len_date_chk(obj,lbl, num)
{
	if( obj.value.length != num)
	{
		alert(lbl + ' ³¯Â¥ Çü½ÄÀ» ¸ÂÃç ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		obj.focus(); 
		return true;   
	}
	return false; 
}

//=================================================================================================================================
// ¹®ÀÚ ±æÀÌ Ã¼Å© (X¹®ÀÚ ÀÌ»ó ÀÔ·Â °¡´É)
//=================================================================================================================================
function f_len_s_chk(obj,lbl, num)
{
	if( obj.value.length < num)
	{
		alert(lbl + ' '  + num + '¹®ÀÚ ÀÌ»ó ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		obj.focus(); 
		return true;   
	}
	return false; 
}

//=================================================================================================================================
// ¹®ÀÚ ±æÀÌ Ã¼Å© (X¹®ÀÚ ÀÌÇÏ ÀÔ·Â °¡´É)
//=================================================================================================================================
function f_len_l_chk(obj,lbl, num)
{
	if( obj.value.length > num)
	{
		alert(lbl + ' '  + num + '¹®ÀÚ ÀÌÇÏ ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		obj.focus(); 
		return true;   
	}
	return false; 
}


//=================================================================================================================================
// Ã¼Å©µÈ radioÀÇ °ªÀ» °¡Á®¿Â´Ù.
// return an empty string if none are checked, or there are no radio buttons
// =================================================================================================================================
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
//=================================================================================================================================
// set the radio button with the given value as being checked
// do nothing if there are no radio buttons
// if the given value does not exist, all the radio buttons
// are reset to unchecked
//=================================================================================================================================
function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}

//=================================================================================================================================
// ÀÌ¹ÌÁö Resize
//=================================================================================================================================
function imgResize(img_id,maxWidth)
{
	var w=document.getElementById(img_id).width;
	var h=document.getElementById(img_id).height;
	if (w<=0) 
		window.setTimeout("imgResize('"+img_id+"'," + maxWidth + ")",10);
	else 
	{
		if (w > maxWidth)
			document.getElementById(img_id).width = maxWidth;
	}
}

//=================================================================================================================================
// Lay Display Ã³¸® Ã¼Å©
//=================================================================================================================================

function infoView(obj){
	obj.style.display = "";
}

function infoHidden(obj){
	obj.style.display = "none";
}
 
//=================================================================================================================================
// ¸ðµç ¸µÅ©¿¡ ¸µÅ© Å×µÎ¸® ¾ø¾Ö±â
//=================================================================================================================================
function allblur() {
	for (i = 0; i < document.links.length; i++)
		document.links[i].onfocus = document.links[i].blur;
}


//=================================================================================================================================
// ÄíÅ° »ý¼º
//=================================================================================================================================

function SetCookie( name, value, expiredays ){
	var todayDate = new Date();
	todayDate.setTime(todayDate.getTime() + 3600000*24*expiredays);
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}


//=================================================================================================================================
// ÄíÅ° °¡Á®¿À±â
//=================================================================================================================================
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 byte_check(obj,length_limit){
	var length = calculate_msglen(obj.value);
	if (length > length_limit) {
		alert("ÃÖ´ë " + length_limit + "byteÀÌ¹Ç·Î ÃÊ°úµÈ ±ÛÀÚ¼ö´Â ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù.");
		obj.value = obj.value.replace(/\r\n$/, "");
		obj.value = assert_msglen(obj.value, length_limit);
		document.all.viewcount.innerHTML = calculate_msglen(obj.value);
		obj.focus();
	}
}

function calculate_msglen(message){
	var nbytes = 0;
	for (i=0; i<message.length; i++) {
		var ch = message.charAt(i);
		if(escape(ch).length > 4) {
			nbytes += 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				nbytes += 1;
			}
		} else if (ch == '<' || ch == '>') {
			nbytes += 4;
		} else {
			nbytes += 1;
		}
	}
	document.all.viewcount.innerHTML = nbytes;
	return nbytes;
}

function assert_msglen(message, maximum){
	var inc = 0;
	var nbytes = 0;
	var msg = "";
	var msglen = message.length;

	for (i=0; i<msglen; i++) {
		var ch = message.charAt(i);
		if (escape(ch).length > 4) {
			inc = 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				inc = 1;
			}
		} else if (ch == '<' || ch == '>') {
			inc = 4;
		} else {
			inc = 1;
		}
		if ((nbytes + inc) > maximum) {
			break;
		}
		nbytes += inc;
		msg += ch;
	}
	return msg;
}

//=================================================================================================================================
// ÆË¾÷Ã¢ ´Ý°í ¸µÅ©ÆäÀÌÁö ÀÌµ¿
//=================================================================================================================================
function PopCloseLink(linkPage){
	var linkPage
	opener.location.href = linkPage;
   	self.close();
}

      
///////////// ¿µ¿ªÀÎ¼â
var initBody;

function beforePrint(){ 
	initBody = document.body.innerHTML; 
	document.body.innerHTML = content.innerHTML; 
	} 
function afterPrint(){ 
	document.body.innerHTML = initBody; 
	} 
function printArea() { 
	window.onbeforeprint = beforePrint;  
	window.onafterprint = afterPrint; 
	window.print(); } 


// RollOver
function imageOver(imgs) {
	imgs.src = imgs.src.replace("off.gif", "on.gif");
}
function imageOut(imgs) {
	imgs.src = imgs.src.replace("on.gif", "off.gif");
}
//  onmouseover="imageOver(this);" onmouseout="imageOver(this);"
 
 
 
 
//================================================================================

function to_top() { //Top
	x = document.body.scrollLeft;
	y = document.body.scrollTop;
	step = 2;
	
	while ((x != 0) || (y != 0)) {
	        scroll (x, y);
	        step += (step * step / 300);
	        x -= step;
	        y -= step;
	        if (x < 0) x = 0;
	        if (y < 0) y = 0;
	} 
	scroll (0, 0);
}


var AjaxObj = false;

function createAjax()
{
	try 
	{
		AjaxObj = new ActiveXObject("Msxml2.XMLHTTP");
	} 
	catch (e) 
	{
		try 
		{
			AjaxObj = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch (e2) 
		{
			AjaxObj = false;
		}
	}

	if (!AjaxObj && typeof AjaxObj != 'undefined') 
	{
		AjaxObj = new XMLHttpRequest();
	}
}

/////////////////////////////// ·¹ÀÌ¾î


function popdiv(divname1,divname2,a){
	ch = document.body.scrollHeight;
	switch(a){
	case 1: 
		document.getElementById(divname1).style.height = ch ;
		document.getElementById(divname1).style.display = 'block';
		document.getElementById(divname2).style.display = 'block'; 
		if(divname2 == "post_divpop")
		{
			document.getElementById("post_postdiv4").innerHTML = "";
			document.zipForm.keyword.value = "";
			document.zipForm.keyword.focus();
		}
		break;
	case 2: 
		document.getElementById(divname1).style.display = 'none';
		document.getElementById(divname2).style.display = 'none';
		break;
	}
	 
}



function goURL(url)
{
	location.href=url;
}



function paletteToggle() {
	window.cancelBubble = true;
	var oBtn = window.event.srcElement;
	if (oBtn.LinkType == "MINICALENDAR") {
		document.all.minicalendar.style.posLeft = event.clientX - 75;
		document.all.minicalendar.style.posTop = event.clientY + document.body.scrollTop + 10;
		document.all.minicalendar.style.visibility = "visible";
	} else {
		document.all.minicalendar.style.visibility = "hidden";
	}
	oLastBtn = oBtn;
}

function setDate(year,month,day) {
	eval("document.all."+oLastBtn.Item+".value = '"+year+"-"+month+"-"+day+"';");
	document.all.minicalendar.style.visibility = "hidden";
	return;
}

function minical()
{
	var html = "<object data=\"/Include/minicalendar.htm\" id=minicalendar name='minicalendar' height=177 style=\"background-color: #ffffff;filter: revealtrans(duration=0); left: 0px; top: 0px; visibility: hidden; z-index: 30; position: absolute;\" type=text/x-scriptlet width=154 viewastext></object>";
	document.write (html);
	//<input type='text' name='boxname' LinkType='MINICALENDAR' Item='boxname'>
}

function enableID(obj) {
	// obj : ÇÊµå¸í (ex. document.form.title)
	var checkOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_";
	var checkStr = obj;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
		allNum += ch;
	}
	if (!allValid){
		return false;
	} else {
		return true;
	}
}


//=================================================================================================================================
// ¸¶¿ì½º·Ñ¿À¹ö
//=================================================================================================================================
  

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_showHLayers() { //v3.0
	var i,p,v,obj,args=MM_showHLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
		obj.visibility=v; }
}

function numberCheck(obj) {
	// obj : ÇÊµå¸í (ex. document.form.title)
	var checkOK = "0123456789";
	var checkStr = obj;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
		allNum += ch;
	}
	if (!allValid){
		return false;
	} else {
		return true;
	}
}



function search_check(frm)
{
	if(!frm.keyword.value)
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¿© ÁÖ¼¼¿ä");
		frm.keyword.focus();
		return false;
	}
	return true;
}



// -->








 
