function over(obj){
	obj.src = obj.src.replace('.gif','_on.gif');
	obj.onmouseout = function(){
		this.src = this.src.replace('_on.gif','.gif');
	}
}

/*png 사용 자바스크립트*/
function setPng24(obj) { 
	obj.width=obj.height=1; 
	obj.className=obj.className.replace(/\bpng24\b/i,''); 
	obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
	obj.src='';  
	return ''; 
}

/* 팝업 */
function OpenPopup(url, w, h){
	var winl = (screen.width - w) / 2; 
	var wint = (screen.height - h) / 3; 
	var winform = window.open(url,'_blank', 'top='+wint+',left='+winl+'toolbar=0, status=0, scrollbars=0, location=0, menubar=0, resizable=no, width='+w+', height='+h); 
}

function closeWin(){
		self.close();
}

// flashWrite(파일경로, 가로, 세로, 아이디, 배경색, 변수, 윈도우모드)
function flashWrite(url,w,h,id,bg,vars,win){

	// 플래시 코드 정의
	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='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' 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);

}

//플래쉬 삽입 스크립트
function SWFLoader() {
	var obj = new String;
	var parameter = new String;
	var embed = new String;
	
	var classId = new String;
    var codeBase = new String;
	var pluginSpage = new String;
	var embedType = new String;	
	var allParameter = new String;	
	
	var src = new String;
	var width = new String;
	var height = new String;
	var id = new String;
	var title = new String;
	var layer = new String;
	var arg = new String;
	var altText = new String;
	var wmode = new String;

	this.init = function ( w, h, s, a ) {
		width = w; 
		height = h; 
		src = s; 
		arg = a; 
		wmode = 'transparent'; 

		classId = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
		codeBase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';
		pluginSpage = 'http://www.macromedia.com/go/getflashplayer';
		embedType = 'application/x-shockwave-flash';

		parameter += "<param name='allowScriptAccess' value='always'>\n";
		parameter += "<param name='allowFullScreen' value='false'\n>";
		parameter += "<param name='movie' value='"+ s + "'>\n";
		parameter += "<param name='quality' value='best'/>\n";
		parameter += "<param name='base' value='.'>\n";
		parameter += "<param name='scale' value='noscale'/>\n";
		parameter += "<param name='expressinstall' value='Scripts/expressInstall.swf' />\n";
	}
	
	this.parameter = function ( param, value ) {
		 parameter += "<param name='"+param +"' value='"+ value + "'>\n";
	}

	this.wmode = function ( value ) {
		wmode = value;
	}

	this.id = function ( value ) {
		id = value;
	}
	this.title = function ( value ) {
		title = value;
	}

	this.shocknone = function ( value ) {
		altText = value;
	}

	this.layer = function ( value ) {
		if(value == undefined) {
			layer = "";
		} else {
			layer = value;
		}
	}

	this.show = function () {
		obj = '<object id="'+id+'" width="'+width+'" height="'+height+'" title="'+title+'" classid="'+classId+'" codebase="'+codeBase+'">\n'+
			parameter +
			'<param name="wmode" value="'+wmode+'">\n'+
			'<!--[if !IE]>-->\n' +
			'<object type="application/x-shockwave-flash" data="' + src + '" width="' + width + '" height="' + height + '" id="' + id + '">\n' +
				parameter +
				'<param name="wmode" value="'+wmode+'">\n'+
			'<!--<![endif]-->\n' +
				'<div class="alt-content alt-' + id + '2">' + altText + '</div>\n' +
			'<!--[if !IE]>-->\n' +
			'</object>\n' +
			'<!--<![endif]-->\n' +
		'</object>';

		if(layer == "") {
			document.write(obj);

		}else{
			var div = document.getElementById( layer);
			div.style.display = "";
			div.innerHTML = obj;
		}
	}
}

//팝업처리하는 함수입니다.
//xml 링크URL값이 Null인경우 이 함수를 호출합니다.
function openPopup(){
	alert("공지팝업");
	
}

//GNB 서브영역이 열릴때
function openSub(){
	document.getElementById("gnb").style.height="212px";
	document.getElementById("gnbfl").style.height="212px";
	document.getElementById("gnbfl2").style.height="212px";
	
}
//GNB영역이 닫힐때
function closeSub(){
	document.getElementById("gnb").style.height="47px";
	document.getElementById("gnbfl").style.height="47px";
	document.getElementById("gnbfl2").style.height="47px";
}

var scroll_act = true; // 마우스 롤아웃시 변수값
var viewstart; // 위쪽 여백 (메뉴가 위에서 ''픽셀 떨어진 곳에 보여집니다)
var viewscroll = 100; // 스크롤시 브라우저 위쪽과 떨어지는 거리
var viewbottom; // 스크롤시 마지막 바닥값
var quickbase = 500; // 스크롤 시작위치
var activatespeed = 10;
var scrollspeed = 20;

var quicktimer;
var quick_obj;

function refresh_quick(){
	var quickstartpoint;
	var quickendpoint;
	bottomlimit = document.body.scrollHeight - viewbottom;
	quickstartpoint = parseInt(quick_obj.style.top, 10);
	quickendpoint = Math.max(document.documentElement.scrollTop, document.body.scrollTop) + viewscroll;
	/*
	quick_obj.onmouseover = function(){
		scroll_act = false;
		quick_obj.onmouseout = function(){
			scroll_act = true;
		}
	}
	*/
	if(scroll_act){
		if (quickendpoint < viewstart){
			quickendpoint = viewstart;
		}
		if (quickendpoint > bottomlimit){
			quickendpoint = bottomlimit;
		}
		if (quickstartpoint != quickendpoint){
			stmnScrollAmount = Math.ceil( Math.abs( quickendpoint - quickstartpoint ) / 15 );
			quick_obj.style.top = parseInt(quick_obj.style.top, 10) + ( ( quickendpoint < quickstartpoint ) ? -stmnScrollAmount : stmnScrollAmount ) + 'px';
		}
	}
	quicktimer = setTimeout("refresh_quick();", activatespeed);
}
function initializequick(obj,right,starttop,stopbottom){
	quick_obj = document.getElementById(obj);
	viewstart = starttop;
	viewbottom = stopbottom;
	quick_obj.style.position = 'absolute';
	quick_obj.style.right = right + 'px';
	quick_obj.style.top = document.body.scrollTop + quickbase + 'px';
	refresh_quick();
}
function ScrollTop(){
	self.window.scroll(0,0);
}

function getCookie(name)
{
	/*
	var results = document.cookie.match ( '(^|;) ?' + name + '=([^;]*)(;|$)' );

	if ( results ){
		return ( unescape ( results[2] ) );
	}
	else{
		return null;
	}
	*/
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function setCookie(name, value, expiredays)
{
	var expires = "";
	
	if(expiredays){
		var exdate = new Date();
		exdate.setTime(exdate.getTime()+(expiredays*24*60*60*1000));
		expires = ";expires=" + exdate.toGMTString();
	}

	document.cookie = name+ "=" +escape(value) + expires+"; path=/";
}

function deleteCookie(name)
{
  //var cookie_date = new Date ( );  // current date & time
  //cookie_date.setTime ( cookie_date.getTime() - 1 );
  //document.cookie = name += "=; expires=" + cookie_date.toGMTString();
	setCookie(name, "", -1);
}

function Usemenu_show(objBox){
	document.getElementById(objBox).style.display ='block';
}

function tmenu_close(){
	document.getElementById("menu_all_box").style.display ='none';
}

function Usemenu_show(objBox){
	document.getElementById(objBox).style.display ='block';
}


