// 090525 ³×ºñ ¹× ÀÌ¹ÌÁö·Ñ¿À¹ö
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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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 menuMouseOver(idx){
	try{
		for(i=1 ; i<=6 ; i++){
			
			objImage = document.getElementById("menu"+i);
			objLayer = document.getElementById("subblock"+i);
			if(i == idx){
				objImage.src = objImage.src.replace(i+"off.gif", i+"on.gif");
				objLayer.style.display = "block";
			}else{
				objImage.src = objImage.src.replace(i+"on.gif", i+"off.gif");
				objLayer.style.display = "none";
			}
		}
	}catch(err){
	
	}
}

// ¸ÞÀÎ ¹è³Ê
function mainbanner(num) {
for (i = 1; i < 6; i++) {
		if (num == i) {
			document.getElementById('mainbannerimage_0'+i+'').src = "/images/common/layout_main_ban0"+i+"on.gif"
		} else {
			document.getElementById('mainbannerimage_0'+i+'').src = "/images/common/layout_main_ban0"+i+"off.gif"
		}
	}
}

//ÇÃ·¡½Ã ·Îµå
function flashLoader(width,height,dir,mainPos,subPos){
	if (dir.indexOf("swf") > 0) {
		document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+width+"' height='"+height+"'>");
		document.write("<param name='movie' value='"+dir+"?mmenu="+mainPos+"&smenu="+subPos+"'>");
		document.write("<param name='quality' value='high'>");
		document.write("<param name='wmode' value='transparent'>");
		document.write("<param name='base' value='.'>");
		document.write("<param name=FlashVars value='mmenu="+mainPos+"&smenu="+subPos+"' />");
		document.write("<embed base='.' FlashVars='mmenu="+mainPos+"&smenu="+subPos+"' src='"+dir+"?mmenu="+mainPos+"&smenu="+subPos+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"' wmode='transparent'></embed>");
		document.write("</object>");
	}
	else {
		document.write("<img src='"+dir+"' width='"+width+"' height='"+height+"'  border='0'>");
	}
}
// ¸ÞÀÎ ¹è³Ê ¸µÅ©
function banner_b(flag){
	if (flag == 10) {document.location.href = '/appeal/appeal01_1.jsp';}
	if (flag == 20) {document.location.href = '/appeal/appeal02_1.jsp';}
	if (flag == 30) {document.location.href = '/appeal/appeal03_1.jsp';}	
	if (flag == 40) {document.location.href = '/appeal/appeal04_1.jsp';}	
	if (flag == 50) {document.location.href = '/appeal/appeal05_1.jsp';}	
}

//°øÅëOnLoad//
function BodyOnload(){
   
//	Startquick();	/*¿À¸¥ÂÊ¿òÁ÷ÀÌ´ÂÅ¾¹öÆ°*/
}
var Class = function(properties){
	var klass = function(){
		for (p in this) this[p]._proto_ = this;
		if (arguments[0] != 'noinit' && this.initialize) return this.initialize.apply(this, arguments);
	};
	klass.extend = this.extend;
	klass.implement = this.implement;
	klass.prototype = properties;
	return klass;
};

Object.extend = function(){
	var args = arguments;
	if (args[1]) args = [args[0], args[1]];
	else args = [this, args[0]];
	for (property in args[1]) args[0][property] = args[1][property];
	return args[0];
};

function $type(obj, types){
	if (!obj) return false;
	var type = false;
	if (obj instanceof Function) type = 'function';
	else if (obj.nodeName){
		if (obj.nodeType == 3 && !/\S/.test(obj.nodeValue)) type = 'textnode';
		else if (obj.nodeType == 1) type = 'element';
	}
	else if (obj instanceof Array) type = 'array';
	else if (typeof obj == 'object') type = 'object';
	else if (typeof obj == 'string') type = 'string';
	else if (typeof obj == 'number' && isFinite(obj)) type = 'number';
	return type;
};

var Element = new Class({

	getTop: function(){
		return this.getOffset('top');
	},

	getLeft: function(){
		return this.getOffset('left');
	}

});


//2007-05-08 ¿ÀÃ¢ÈÆ Ãß°¡
var mooObjContainer = new Object();

function $(el){	
	if ($type(el) == 'string'){
		if(!mooObjContainer[el]){
			el = document.getElementById(el) || window[el] || document[el];			
		}else{
			return mooObjContainer[el];
		}		
	}
	if ($type(el) == 'element'){		
		if (!el.extend){
			Unload.elements.push(el);
			el.extend = Object.extend;
			el.extend(Element.prototype);
		}
		mooObjContainer[el.id] = el;
		return el;
	} else return false;
};

//garbage collector


var Unload = {

	elements: [], functions: [], vars: [],
	
	unload: function(){
		Unload.functions.each(function(fn){
			fn();
		});
		
		window.removeEvent('unload', window.removeFunction);
		
		Unload.elements.each(function(el){
			for(p in Element.prototype){
				window[p] = null;
				document[p] = null;
				el[p] = null;
			}
			el.extend = null;
		});
	}
	
};

function shoppyPosition()
{
	var start, start1, end, scale, tmp, tmp1, seq, wstart, wend;
	tmp = $('quick_top');
	start = parseInt (tmp.style.top, 10);
	end = $('wrap').scrollTop + 175;

  if ( start != end )
  {
	 scale = Math.ceil( Math.abs( end - start )/10);
	  if ( end < start )	scale = -scale;
		tmp.style.top = start + scale + "px";
  }
  setTimeout ("shoppyPosition()", 30);
}

function shoppy()
{
	if (document.documentElement.scrollWidth < 1003)
	{
		$('quick_top').style.display = 'none';
	}
	else
	{
		$('quick_top').style.display = 'block';
		$('quick_top').style.right = $('wrap').scrollWidth/2 - 500 + 'px';
	}
}

function moveshoppy()
{
	if (document.documentElement.scrollWidth < 1003)
	{
		$('quick_top').style.display = 'none';
	}
	else
	{
		$('quick_top').style.display = 'block';
		$('quick_top').style.top = $('wrap').scrollTop + 175 + "px";
		shoppyPosition();
		return true;
	}
}


// ¸¶¿ì½º µû¶ó´Ù´Ï´Â ½ºÅ©·Ñ //

function A2YSlide(name,id,range,sec,tb,margin){ //°´Ã¼¸í,·¹ÀÌ¾îid,ÀÌµ¿°ª,ÀÌµ¿ÃÊ,»óÇÏÀ§Ä¡(false)?t:b,°è»êµÈ »óÇÏ À§Ä¡¿¡¼­ ¶³¾îÁú ¹üÀ§
	//¼Ó¼º
	this.name = name;
	this.obj = document.getElementById(id);
	this.range = range;
	this.sec = sec;
	this.tb = tb;
	this.margin = margin;
	
	this.Timer();
}

A2YSlide.prototype.Move = function A2YSlide_Move(fix_y){
	objY = parseInt(this.obj.style.top);	
	if(objY != fix_y){
		this.obj.style.top = (objY + this.GetMoveValue(objY,fix_y)) + 'px';
	}
	this.Timer();
}

A2YSlide.prototype.GetMoveValue = function A2YSlide_GetMoveValue(start, end){ //ÇöÀç À§Ä¡¿Í ÀÌµ¿ÇÒ À§Ä¡¿¡ µû¸¥ ÀÌµ¿°Å¸®¸¦ ¸®ÅÏÇÑ´Ù.
	return (end - start) * this.range;
}

A2YSlide.prototype.GetDocTnB = function A2YSlide_GetDocTnB(bTB){ //¹®¼­ÀÇ »ó´ÜorÇÏ´Ü ÇÈ¼¿°ªÀ» ¹ÝÈ¯ÇÑ´Ù. (!bTB) ? Top : Bottom
	return ((bTB)?document.documentElement.clientHeight:0) + document.documentElement.scrollTop;
}

A2YSlide.prototype.Timer = function A2YSlide_Timer(){
	setTimeout(this.name + '.Move('+(this.GetDocTnB(this.tb)+this.margin)+')',this.sec);
}


function A2Wzd_YSlide(id,range,sec,tb,margin){ //A2YSlideÀÇ »ý¼ºÀ» µµ¿ÍÁØ´Ù.
	eval('C'+id+" = new A2YSlide('C"+id+"','"+id+"',"+range+","+sec+","+tb+","+margin+');');
}

// ¸¶¿ì½º µû¶ó´Ù´Ï´Â ½ºÅ©·Ñ //



 function linkPage2(page,width,height){
	 
	 alert("linkPage("+page+","+width+","+height+")");
		window.open(page,"",width,height);
 }
 function linkPage(url){
	 
  var targeturl = url;
  newwin = window.open("","","scrollbars")
  if(document.all){
  newwin.moveTo(0,0)
  newwin.resizeTo(screen.width,screen.height)
  }
  newwin.location=targeturl
}

function siteStatic(code){
	call_tempa_img = new Image();
	call_tempa_img.src = "/common/jsp/staticAction.jsp?code="+code;
}