/*** ¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ° Å¬¸¯ ±ÝÁö ***/
/*
var message=""; // °æ°í ¸Þ¼¼Áö¸¦ ³ÖÀ¸·Á¸é ¿©±â¿¡ ÀÔ·ÂÇÕ´Ï´Ù
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")

/*** ¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ° Å¬¸¯ ±ÝÁö ***/



var thisUrl = document.location + "";





// outer-script
function objectlaunch(objcode) {
	document.write(objcode);
}

//ÆË¾÷ ¸®»çÀÌÂ¡
function popResize(p_width, plus) {
	var curBody = document.body;
	var p_height = curBody.scrollHeight + (curBody.offsetHeight - curBody.clientHeight)+5;
	if (navigator.appVersion.indexOf("Windows NT 5.1") > -1 && navigator.appMinorVersion.indexOf("SP2") > -1)
		p_height = p_height + 20;	//xpÀÎ °æ¿ì 20 plus
	if (navigator.appVersion.indexOf("Windows NT 5.1") > -1)
		p_height = p_height + 5;
	//alert(navigator.appMinorVersion);
	self.resizeTo(p_width, p_height+plus);
}

//ÆË¾÷Ã¢ ½ºÅ©¸³Æ® - ½ºÅ©·Ñ¹Ù ¾ø´Â °Í
function popwindow(pop,width,height)
{
	var url = pop;  
	var wd = width;
	var he = height;
	
	window.open(url,"","toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd +",height=" + he + ";")
}

//ÆË¾÷Ã¢ ½ºÅ©¸³Æ® - ½ºÅ©·Ñ¹Ù ÀÖ´Â °Í
function popwindow2(pop,width,height)
{
	var url = pop;  
	var wd = width;
	var he = height;
	
	window.open(url,"","toolbar=0,menubar=0,scrollbars=yes,resizable=no,width=" + wd +",height=" + he + ";")
}

//·¹ÀÌ¾î shoe / hide ½ºÅ©¸³Æ®
function LayerSH(LayerName,Status) {
ns4 = (document.layers)?true:false
ie4 = (document.all)?true:false

if (ns4) {
	LayerN = document.layers[LayerName]
	if (Status == 'show') LayerN.visibility = 'show';
	if (Status == 'hide') LayerN.visibility = 'hidden';
	}	
if (ie4) {
	LayerN = document.all[LayerName].style
	if (Status == 'show') LayerN.visibility = 'visible';
	if (Status == 'hide') LayerN.visibility = 'hidden';
	}
}

//·¹ÀÌ¾î over
function over(num){
	for (i=1; i<=4; i++){
	document.all["Layers"+i].style.visibility="hidden";
		if (i==num){
		document.all["Layers"+i].style.visibility="visible";
		}
	}
}

function out(){
	for (i=1; i<=4; i++){
	document.all["Layers"+i].style.visibility="hidden";
	}
	document.all.Layers1.style.visibility="visible";
}

function GoUrl(url)
{
	location.href = url;
}

// faq
function show_answer(q, a) {
  var tagName = "";
  var id = "";

  for(var obj in document.all) {
    tagName = document.all[obj].tagName;
    id = document.all[obj].id;
    if (tagName == "DIV") {
      if (!id.indexOf("A")) document.all[obj].style.display = "none";
      if (!id.indexOf("Q")) document.all[obj].style.display = "block";
    }
  }
  q.style.display = "none";
  a.style.display = "block";
}



function winOpen(urlname,name,width,height,scroll_type)
{
	var newWindow = window.open(urlname,name,"height="+height+",width="+width+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll_type+",resizable=no,top=10,left=10");
	newWindow.focus();
}

function winOpen2(urlname,name,width,height,scroll_type,status_type)
{
	var newWindow = window.open(urlname,name,"height="+height+",width="+width+",toolbar=no,location=no,directories=no,status="+status_type+",menubar=no,scrollbars="+scroll_type+",resizable=no,top=10,left=10");
	newWindow.focus();
}

function winOpen3(urlname,name,width,height,scroll_type,left,top)//À§Ä¡±îÁö ÁöÁ¤
{
	var newWindow = window.open(urlname,name,"height="+height+",width="+width+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll_type+",resizable=no,top="+ top +",left="+left);
	newWindow.focus();
}

function winNewOpen(urlname)
{
	var newWindow = window.open(urlname,"INFO","top=10,left=10,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");//fullscreen
	newWindow.focus();
	self.close();
}

//»õÃ¢À¸·Î À©µµ¿ì ¶ç¿ì±â
function winNewOpen2(urlname)
{
	var newWindow = window.open(urlname,"","top=10,left=10,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");//fullscreen
	newWindow.focus();
}


TextSlider = function(className) {
    document.write("<div id='TextSliderPLayer_"+ className +"'><div id='TextSliderLayer_"+ className +"'></div></div>");

    this.item = [];
    this.width = this.height = this.speed = this.pixel = this.interval =
        this.size = this.moveCount = this.X = this.Y = 0;
    this.direction = "";
    this.pLayer = document.getElementById("TextSliderPLayer_"+ className);
    this.layer = document.getElementById("TextSliderLayer_"+ className);
    this.align = "left";
    this.intervalId = null;
    this.className = className;
    this.isPause = false;
}
TextSlider.prototype.init = function() {
    with (this.pLayer.style) {
        width = this.width+"px";
        height = this.height+"px";
        overflow = "hidden";
    }
    with (this.layer.style) {
        width = this.direction=='up' || this.direction=='down' ? this.width+"px" : this.size*(this.item.length+1)+"px";
        height = this.direction=='up' || this.direction=='down' ? this.size*(this.item.length+1)+"px" : this.height+"px";
        top = 0;
        left = 0;
        position = "relative";
    }
    for (var i=0; i<parseInt(this.height / this.size, 10)+1; i++)
        this.item[this.item.length] = this.item[i];
    switch (this.direction) {
        case "up": this.X = this.Y = 0; break;
        case "down": this.X = 0; this.layer.style.top = this.Y = -this.size*(this.item.length-1); break;
        case "left": this.X = this.Y = 0; break;
        case "right": this.Y = 0; this.layer.style.left = this.X = -this.size*(this.item.length-1); break;
    }
    var __html = "<div onmouseover='"+this.className+".pause()' onmouseout='"+this.className+".unpause()'>";
    if (this.direction=='up' || this.direction=='down') {
        __html += "<table width='"+ this.layer.style.width +"' cellspacing='0' cellpadding='0' border='0'>";
        for (var i in this.item)
            __html += "<tr><td height='"+this.size+"' style='overflow:hidden' align='"+this.align+"' valign='top'>"+this.item[i]+"</td></tr>";
        __html += "</table>";
    } else {
        __html += "<table cellspacing='0' cellpadding='0' border='0'><tr>";
        for (var i in this.item)
            __html += "<td width='"+this.size+"' height='"+ this.layer.style.height +"' align='"+this.align+"' \
                valign='top' style='overflow:hidden;'>"+this.item[i]+"</td>";
        __html += "</tr></table>";
    }
    __html += "</div>";
    this.layer.innerHTML = __html;
    this.start();
}
TextSlider.prototype.start = function() {
    this.intervalId = setInterval(this.className+".move()", this.speed);
}
TextSlider.prototype.move = function() {
    if (this.isPause) return;
    switch (this.direction) {
        case "up": this.Y -= this.pixel; break;
        case "down": this.Y += this.pixel; break;
        case "left": this.X -= this.pixel; break;
        case "right": this.X += this.pixel; break;
    }
    if (this.direction=='up' || this.direction=='down') {
        if (Math.abs(this.Y)%this.size==0) this.stop();
        this.layer.style.top = this.Y;
    } else {
        if (Math.abs(this.X)%this.size==0) this.stop();
        this.layer.style.left = this.X;
    }
}
TextSlider.prototype.stop = function() {
    clearInterval(this.intervalId);
    switch (this.direction) {
    case "up":
        if (Math.abs(this.Y) >= parseInt(this.layer.style.height,10)-this.size) this.Y = this.layer.style.top = 0;
        break;

    case "down":
        if (Math.abs(this.Y) <= 0) this.Y = this.layer.style.top = -this.size*(this.item.length-1);
        break;

    case "left":
        if (Math.abs(this.X) >= parseInt(this.layer.style.width,10)-this.size) this.X = this.layer.style.left = 0;
        break;

    case "right":
        if (Math.abs(this.X) <= 0) this.X = this.layer.style.left = -this.size*(this.item.length-1);
        break;
    }
    setTimeout(this.className+".start()", this.interval);
}
TextSlider.prototype.pause = function() {this.isPause = true;}
TextSlider.prototype.unpause = function() {this.isPause = false;}
//######################################################################################################################
//##########################			ÀÌº¥Æ®°øÁö»çÇ× Å¸ÀÌÆ² ·Ñ¸µ	³¡		############################################
//######################################################################################################################


/****  ÄíÅ°  ****/
// value = 1 : Äí±â ÀÖÀ½ 
function setCookie( name, expiredays ){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=1; path=/; expires=" + todayDate.toGMTString() + ";"
	//document.cookie = name + "=1; path=/; expires=" + todayDate.toGMTString() + ";domain=megapass.net;"		//µµ¸ÞÀÎÄíÅ° »ç¿ë½Ã
}

function getCookie(uName) {

	var flag = document.cookie.indexOf(uName+'=');
	if (flag != -1) { 
		flag += uName.length + 1
		end = document.cookie.indexOf(';', flag) 

		if (end == -1) end = document.cookie.length
		return unescape(document.cookie.substring(flag, end))
	}
}

//ÇÃ·¡½ÃÁ¦³×·¹ÀÌÅÍ...id,³ÐÀÌ,³ôÀÌ,Åõ¸í¿©ºÎ,Å©·Î½ºµµ¸ÞÀÎÇã¿ë
function FlashGen(id,w,h,url,transPparent,arrowDomain){

//var _globlURL="./Flash/";
//var _globlURL="/Flash/";

var url=url;
if(arrowDomain){
var arrowDomainT="always";
}else{
var arrowDomainT="always";
}
document.write("<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+"'>")
document.write("<param name='movie' value='"+url+"'/>");
document.write("<param name='quality' value='high' />");
if(!transPparent){
document.write("<param name='wmode' value='transparent' />");
}
document.write("<param name='allowScriptAccess' value='"+arrowDomainT+"' />");
document.write("<embed src='"+url+"' quality='high' wmode='transparent' width="+w+" height="+h+" name='"+id+"' align='middle' allowScriptAccess='"+arrowDomainT+"' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
document.write("</object>");
}

//¶ÁÈ¡¿ò
var t_id=setInterval(animate,20);
var pos=0;
var dir=2;
var len=0;
function animate()
{
var elem=document.getElementById('progress');
if(elem!=null){
if(pos==0)len+=dir;
if(len>32||pos>79)pos+=dir;
if(pos>79)len-=dir;
if(pos>79&&len==0)pos=0;
elem.style.left=pos;
elem.style.width=len;
}
}
function remove_loading(){
this.clearInterval(t_id);
var targelem=document.getElementById('loader_container');
targelem.style.display='none';
targelem.style.visibility='hidden';
}

