// id: flash id
// url: source url
// w: source width
// h: source height
// t: wmode (window/transparent/opaque)
function flashWrite(url,w,h,id,bg,win,pNum,mNum){
 
 var flashStr=
 "<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='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
 "<param name='allowScriptAccess' value='always' />"+
 "<param name='movie' value='"+url+"' />"+
 "<param name='flashvars' value='pNum="+pNum+"&mNum="+mNum+"' />"+
 "<param name='wmode' value='transparent' />"+
 "<param name='menu' value='false' />"+
 "<param name='quality' value='high' />"+
 "<param name='bgcolor' value='"+bg+"' />"+
 "<embed src='"+url+"' flashvars='pNum="+pNum+"&mNum="+mNum+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
 "</object>";
 
 document.write(flashStr);

}



// demian add 20080627
function ChgInput(obj) {
    obj.className = "";
}

// ÀÌ¹ÌÁö ·Ñ¿À¹ö //
function imageOver(imgEl) {
	imgEl.src = imgEl.src.replace(".gif", "_on.gif");
}
function imageOut(imgEl) {
	imgEl.src = imgEl.src.replace("_on.gif", ".gif");
}

// tab : 1  //
function New_Tab(name,line){
	for (var i = 1; i <= line; i++) {
		var New_TabDiv="newTab_"+i;
		console = document.getElementById(New_TabDiv);
		console.style.display='none'
	}
	New_TabDiv="newTab_"+name;
	console = document.getElementById(New_TabDiv);
	console.style.display='block';
}



// tab : 2  //
function Tab_View(name,line){
	for (var i = 1; i <= line; i++) {
		var Tab_ViewDiv="Tab_ViewDiv_"+i;
		console = document.getElementById(Tab_ViewDiv);
		console.style.display='none'
	}
	Tab_ViewDiv="Tab_ViewDiv_"+name;
	console = document.getElementById(Tab_ViewDiv);
	console.style.display='block';
}


/* LAYER  */
function layerShow(layerId) {
	document.getElementById(layerId).style.display = "block";
}
function layerHide(layerId) {
	document.getElementById(layerId).style.display = "none";
}
/* FAQ  */
function initToggle(tabContainer) {
	triggers = tabContainer.getElementsByTagName("a");

	for(i = 0; i < triggers.length; i++) {
		if (triggers.item(i).href.split("#")[1])
			triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);

		if (!triggers.item(i).targetEl)
			continue;

		triggers.item(i).targetEl.style.display = "none";
		triggers.item(i).onclick = function () {
			if (tabContainer.current == this) {
				this.targetEl.style.display = "none";
				tabContainer.current = null;
			} else {
				if (tabContainer.current) {
					tabContainer.current.targetEl.style.display = "none";
				}
				this.targetEl.style.display = "block";
				tabContainer.current = this;
			}
			return false;
		}
	}
}

/* Tab Content
----------------------------------------------------------------------------------------------------------------------------*/
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace("_on", "");
				}
			}

			this.targetEl.style.display = "block";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

/* Ãß°¡ 2008-06-28 ½ºÅ¸ÀÏ·¯½º */
function showHideElem1(_objId, _param_split){
	var showObj = document.getElementById(_objId);
	if(!showObj) return false;
	//³ªÅ¸³¾ °´Ã¼°¡ ÀÖ°í ¼û±æ °´Ã¼°¡ ´Ù¼öÀÎ°æ¿ì
	if(_param_split){
		//¼û±æ °´Ã¼µé ¹®ÀÚ¿­(¾ð´õ¹Ù¸¦ ±¸ºÐÀÚ·Î ÆÄ¶ó¸ÞÅÍ¸¦ ¹Þ´Â´Ù)
		var hideObjId_arr = _param_split.split("_");
		//¼û±æ °´Ã¼ ¹è¿­
		var hideObj_arr = Array();
		for(i=0; i<hideObjId_arr.length; i++){
			hideObj_arr[i] = document.getElementById(hideObjId_arr[i]);
		}
		//¼û±æ °´Ã¼ ¼û±â±â
		for(i=0; i<hideObj_arr.length; i++){
			if(hideObj_arr[i].style){
				hideObj_arr[i].style.display = "none";
			}else{
				return false;
			}
		}
		//³ªÅ¸³¾ °´Ã¼ ³ªÅ¸³»±â
		showObj.style.display = "block";
	}
	//³ªÅ¸³»°Å³ª ¼û±æ °´Ã¼°¡ ÇÑ°³ÀÎ °æ¿ì 
	else{
		if(showObj.style.display == "block"){
			showObj.style.display = "none";
		}else{
			showObj.style.display = "block";
		}
	}
}
// quick menu
function initMoving(target, position, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit - obj.offsetHeight;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;

	if (typeof(window.pageYOffset) == "number") {
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return document.documentElement.scrollTop;
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) {
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		obj.getHeight = function() {
			return 500;
		}
	} 

	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		} else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit;
		if (pos < obj.topLimit)
			pos = obj.topLimit;

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 30)
}
function initMovingRev(target, position, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = document.documentElement.clientHeight - position;
	obj.topLimit = document.documentElement.clientHeight - topLimit; 
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit - obj.offsetHeight;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;

	if (typeof(window.pageYOffset) == "number") {
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return document.documentElement.scrollTop;
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) {
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		obj.getHeight = function() {
			return 500;
		}
	} 

	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		} else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit;
		if (pos < obj.topLimit)
			pos = obj.topLimit;

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 30)
}
/*************************************************************************
* Login
*************************************************************************/
function ClearImage(aa) {
	if (aa == "id"){
		document.all.id.style.backgroundImage="";
		document.all.id.style.backgroundColor="E2E2E2";
	}else if (aa == "pw"){
		document.all.pw.style.backgroundImage="";
		document.all.pw.style.backgroundColor="E2E2E2";
	}
}


function show(num) {
		for(var i = 1; i < 13; i++) {
			obj = document.getElementById('show'+i);
			if ( num == i ) {
				obj.style.display = "block";
			} else {
				obj.style.display = "none";
			}
		}
	}

	function showHideElem1(showele, hideele)
	{
		document.getElementById(showele).style.display = "";
		hideele = hideele.split("_");
		for(i=0; i<hideele.length; i++)
		{
			document.getElementById(hideele[i]).style.display = "none";
		}
	}


/*************************************************************************
* ¸Þ´º Ç®´Ù¿î
*************************************************************************/
function displaydiv(acode){
	var alayer =		document.getElementById("Layer"+acode).style;
	alayer.display = "block";
}
function displayout(acode){
	var alayer =		document.getElementById("Layer"+acode).style;
	alayer.display = "none";
}

// Tab Content
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" on", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

// get¹æ½ÄÀ» post¹æ½ÄÀ¸·Î ¹Ù²ã¼­ º¸³¿
function hideActionPost(hr)
{
    hr2 = hr.split("?");
    var htmltag = "<html><head><title></title> "
    htmltag = htmltag + "<meta http-equiv='Content-Type' content='text/html; charset=euc-kr'></head><body>"
    
    htmltag = htmltag + "<form name='locationform' method='post' action='"+hr2[0]+"'>";

    if (hr2.length > 1)
    {
        hr3 = hr2[1].split("&");

        for (i = 0 ; i < hr3.length ; i++)
        {
            hr4 = hr3[i].split("=");
            htmltag += "<input type=hidden name='"+hr4[0]+"' value='"+hr4[1]+"'>";
        }
    }
    htmltag += "</form></body></html>";
    document.write(htmltag);
    locationform.submit();
}


		
//±ÛÀÚÅ©±â Á¶Á¤
var TitleCurrentFontSize = 12;
var ContentCurrentFontSize = 12;
var TitleCurrentLineHeight = 12;
var ContentCurrentLineHeight = 12;

function SetFontSize(SizeFlag) {
	
	obj = document.all;

	if (SizeFlag == '0') {
		ContentCurrentFontSize = ContentCurrentFontSize + 1;
		ContentCurrentLineHeight = parseInt(ContentCurrentFontSize*1.6);
		obj.content.style.fontSize = ContentCurrentFontSize + "px";
		obj.content.style.lineHeight = ContentCurrentLineHeight + "px";
		
		if(obj.contents2)
		{
			obj.content2.style.fontSize = ContentCurrentFontSize + "px";
			obj.content2.style.lineHeight = ContentCurrentLineHeight + "px";	
		}
		
	} else {
		if (ContentCurrentFontSize>0) {
			ContentCurrentFontSize = ContentCurrentFontSize - 1;
			ContentCurrentLineHeight = parseInt(ContentCurrentFontSize*1.6);
		}
		obj.content.style.fontSize = ContentCurrentFontSize + "px";
		obj.content.style.lineHeight = ContentCurrentLineHeight + "px";
		
		if(obj.contents2)
		{
			obj.content2.style.fontSize = ContentCurrentFontSize + "px";
			obj.content2.style.lineHeight = ContentCurrentLineHeight + "px";	
		}
	}
}

function globalGoSearch(fm) {
	//var form = document.searchForm;
	alert("global search");
	if(fm.search_text.value=="") {
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		return;
	}  else {
		fm.submit();
	}
}

/**
	·Î±×ÀÎ°ü·Ã »ç¿ëÀÚ ¾ÆÀÌµð ±â¾ïÇÏ´Â ÇÔ¼ö
*/
function setCookie (name, value, expires) {   
	document.cookie = name + "=" + escape (value) +
	  "; path=/; expires=" + expires.toGMTString() + 
	  "; domain=positive.co.kr";
}
/**========================================================================
	****************************************************
		·Î±×ÀÎ°ü·Ã »ç¿ëÀÚ ¾ÆÀÌµð ±â¾ïÇÏ´Â ÇÔ¼ö
	****************************************************
===========================================================================*/
function getCookie(Name) {
	var search = Name + "="
	if (document.cookie.length > 0)	{ // ÄíÅ°°¡ ¼³Á¤µÇ¾î ÀÖ´Ù¸é
		offset = document.cookie.indexOf(search)
		if (offset != -1) { // ÄíÅ°°¡ Á¸ÀçÇÏ¸é
			offset += search.length
			// set index of beginning of value
			end = document.cookie.indexOf(";", offset)
			// ÄíÅ° °ªÀÇ ¸¶Áö¸· À§Ä¡ ÀÎµ¦½º ¹øÈ£ ¼³Á¤
			if (end == -1)
			  end = document.cookie.length
			return unescape(document.cookie.substring(offset, end))
		}
	}
	return "";
}

/**========================================================================
	**********************************************************
	»ç¿ëÀÚ ¾ÆÀÌµð¿¡ ºÙ¾î¼­ ÂÊÁö/ÇÊÅë°¡±â/Ä£±¸Ãß°¡ÇÏ´Â ÆË¾÷
	**********************************************************
===========================================================================*/
	function fnShowUserInfo(_objId) {
		var showObj = document.getElementById(_objId);

		var left = event.x + 25 ;
		var top  = event.y -50 ;

		if (top < 0) {
			top = 0;
		}
		if(showObj.style.display == "none") {
			showObj.style.position = "absolute";
			showObj.style.top = top;
			showObj.style.left = left;
			showObj.style.display = "";
		} else {
			showObj.style.display = "none";
		}
	}


/**========================================================================
	**********************************************************
	»ç¿ëÀÚ ¾ÆÀÌµð¿¡ ºÙ¾î¼­ ÂÊÁö/ÇÊÅë°¡±â/Ä£±¸Ãß°¡ÇÏ´Â ÆË¾÷
	**********************************************************
===========================================================================*/


// ÇÔ¼ö¸¦ È£ÃâÇÑ ÀÌ¹ÌÁö °´Ã¼ÀÇ »çÀÌÁî¿¡ ¸Â°Ô ÇØ´ç ÀÌ¹ÌÁöÀÇ »çÀÌÁî¸¦ º¯°æÇÕ´Ï´Ù.
// 2008-08-27
// ÀÛ¾÷ÀÚ : ÁÁÀº »ý°¢ ÃÖ¿ëÈ£
function ResizeImage(sender, limitWidth, limitHeight)
{
	sender.onload = null;
	sender.isLoaded = "false";
	var img = new Image();
	img.sender = sender;
	img.limitWidth = limitWidth;
	img.limitHeight = limitHeight;

	img.onload = function()
	{
		this.onload = null;
		var realWidth = this.width;
		var realHeight = this.height;
		var scale = 0.0;
		
		if ( this.limitWidth > 0 && this.limitHeight > 0 )
		{
			if (realWidth <= this.limitWidth && realHeight <= this.limitHeight)
			{
				scale = 1.0;
			}
			else
			{
				scalePrint = this.limitHeight / parseFloat(this.limitWidth);
				scaleImage = realHeight / parseFloat(realWidth);
				if (scalePrint < scaleImage)
				{
					scale = this.limitHeight / realHeight;
				}
				else
				{
					scale = this.limitWidth / realWidth;
				}
			}
		}
		else if (this.limitWidth > 0)
		{
			if (realWidth <= this.limitWidth)
			{
				scale = 1.0;
			}
			else
			{
				scale = this.limitWidth / realWidth;
			}
		}
		else if (this.limitHeight > 0)
		{
			if (realHeight <= this.limitHeight)
			{
				scale = 1.0;
			}
			else
			{
				scale = this.limitHeight / realHeight;
			}
		}
		else
		{
			scale = 1.0;
		}

		try
		{
			this.sender.isLoaded = "false";
			this.sender.width = Math.floor(scale * realWidth);
			this.sender.height = Math.floor(scale * realHeight);
			this.sender.style.width = String(Math.floor(scale * realWidth)) + "px";
			this.sender.style.height = String(Math.floor(scale * realHeight)) + "px";
			this.sender.onload = function()
			{
				this.onload = null;
				this.isLoaded = "true";
			};

			this.sender.src = this.src;
		}
		catch(e){}

	};
	
	img.src = sender.src;
}

//Å¬¶óÀÌ¾ðÆ® ½ºÅ©¸³Æ® ¿À·ù°¡ ¹ß»ýÇÒ°æ¿ì ptwn_clientscripterrorlogÅ×ÀÌºí¿¡
//·Î±×¸¦ ³²±â´Â ±â´ÉÀ» Ãß°¡
//2008-09-18
//ÃÖ¿ëÈ£
include_script('/inc/js/ErrorReport.js');
function include_script(src) { 
    var script = document.createElement("script"); 
    script.type = 'text/javascript';
    script.src = src; 

	if (document.getElementsByTagName('head') != null && document.getElementsByTagName('head')[0] != null)
	{
	    document.getElementsByTagName('head')[0].appendChild(script); 
	}
	else
	{
		if (document.body != null)
		{
			document.body.appendChild(script); 
		}		
	}
} 

