
function getCookie(sName) {
	var ca = document.cookie.split(/\s*;\s*/);
	var re = new RegExp("^(\\s*"+sName+"\\s*=)");
	
	for(var i=0; i < ca.length; i++) {
		if (re.test(ca[i])) return unescape(ca[i].substr(RegExp.$1.length));
	}
	
	return null;
}

 function setCookie(sName, sValue, nDays, sDomain, sPath) {
	var sExpire = "";
	
	if (typeof nDays == "number") {
		sExpire = ";expires="+(new Date((new Date()).getTime()+nDays*1000*60*60*24)).toGMTString();
	}
	if (typeof sDomain == "undefined") sDomain = "";
	if (typeof sPath == "undefined") sPath = "/";
	
	document.cookie = sName+"="+escape(sValue)+sExpire+"; path="+sPath+(sDomain?"; domain="+sDomain:"");
	
	return this;
}

function removeCookie(sName, sDomain, sPath) {
	if (this.getCookie(sName) != null) this.setCookie(sName, "", -1, sDomain, sPath);	
	return this;
}

var aDefaultList=["mw_040101","mw_0403","mw_030401"];//°øÁö»çÇ×,º¸µµÀÚ·á,¹ý·ÉÀÚ·á
var aCookieList=[];
var aCacheList=[];

$(function() {
	
	var bCookie = getCookie("MWSERV");
	var fmenu = document.getElementById("fmenu");
	if(bCookie==null||bCookie.length<1)
	{
		fmenu.innerHTML = ""; 		
		jQuery.each(aDefaultList,function(i){				
			var val = $("#"+aDefaultList[i]).val().split("|");
			var g = document.createElement("li");				
			g.innerHTML = "<a href='"+val[0]+"' title='"+val[2]+"'>"+val[2]+"</a>";				
			fmenu.appendChild(g);
		});	
		removeCookie("MWSERV");		
		setCookie("MWSERV",aDefaultList.join("@"),365);
		aCacheList = aDefaultList.concat();
	}
	else
	{
		fmenu.innerHTML = ""; 	
		aCookieList=bCookie.split("@");
		jQuery.each(aCookieList,function(i){
			if(i<3){
				var val = $("#"+aCookieList[i]).val().split("|");
				var g = document.createElement("li");				
				g.innerHTML = "<a href='"+val[0]+"' title='"+val[2]+"'>"+val[2]+"</a>";				
				fmenu.appendChild(g);
			}
		});	
		
		aCacheList = aCookieList.concat();
	}

	$("input[name='setmenu']:checkbox").click(function() {		
		if($("input[name='setmenu']:checkbox:checked").size() > 3){
			alert("ÀÚÁÖ°¡´Â ¸Þ´º´Â ÃÖ´ë 3°³±îÁö¸¸ ¼±ÅÃ °¡´ÉÇÕ´Ï´Ù.");
			$(this).removeAttr("checked");
		}else{		
			var fmenu = document.getElementById("fmenu");
				fmenu.innerHTML = "";
			var chcked_id= ($(this).attr("id"));
			if(!$(this).attr("checked")){				
				jQuery.each(aCacheList,function(i){						
					if(chcked_id == aCacheList[i]){						
						aCacheList.splice(i,1);
					}						
				});				
			}else{			
				aCacheList.push($(this).attr("id"));
			}			
			jQuery.each(aCacheList,function(i){	
				var val = $("#"+aCacheList[i]).val().split("|");
				var g = document.createElement("li");				
				g.innerHTML = "<a href='"+val[0]+"' title='"+val[2]+"'>"+val[2]+"</a>";				
				fmenu.appendChild(g);
			});
		}		
	});	
	$("#svcmore_h").click(function() {		
		if($("#setmymenu_area").css("display") == "none"){
			$("input[name='setmenu']:checkbox").each(function(chk){				
				$(this).removeAttr("checked");
			});
			var bCookie = getCookie("MWSERV");
			aCookieList=bCookie.split("@");			
			jQuery.each(aCookieList,function(i){				
				$("input[name='setmenu']:checkbox").each(function(chk){				
					if($(this).attr("id") == aCookieList[i]){					
						$(this).attr("checked","checked");
					}
				});
			});
		}
		$("#setmymenu_area").toggle();
		return false;
	});	
	$("#setmymenu_top_close").click(function() {
		$("#setmymenu_area").hide();
		return false;
	});
	$("#mymenu_default").click(function() {
		$("input[name='setmenu']:checkbox").each(function(chk){				
			$(this).removeAttr("checked");
		});
		fmenu.innerHTML = ""; 		
		jQuery.each(aDefaultList,function(i){				
			var val = $("#"+aDefaultList[i]).val().split("|");
			var g = document.createElement("li");				
			g.innerHTML = "<a href='"+val[0]+"' title='"+val[2]+"'>"+val[2]+"</a>";				
			fmenu.appendChild(g);
			$("#"+aDefaultList[i]).attr("checked","checked");	
		});		
		aCacheList =[];
		aCacheList = aDefaultList.concat();				
		return false;		
	});	
	$("#mymenu_cancel").click(function() {		
		fmenu.innerHTML = ""; 		
		jQuery.each(aCookieList,function(i){				
			var val = $("#"+aCookieList[i]).val().split("|");
			var g = document.createElement("li");				
			g.innerHTML = "<a href='"+val[0]+"' title='"+val[2]+"'>"+val[2]+"</a>";				
			fmenu.appendChild(g);
		});	
		removeCookie("MWSERV");		
		setCookie("MWSERV",aCookieList.join("@"),365);
		aCacheList = aCookieList.concat();
		$("#setmymenu_area").hide();
		return false;
	});	
	$("#mymenu_set").click(function() {
		removeCookie("MWSERV");		
		if(aCacheList.length < 1){
			alert("¼±ÅÃµÈ ¸Þ´º°¡ ¾ø½À´Ï´Ù.ÃÊ±â¸Þ´º¼³Á¤À¸·Î µ¹¾Æ°©´Ï´Ù.");
			fmenu.innerHTML = ""; 		
			jQuery.each(aDefaultList,function(i){				
				var val = $("#"+aDefaultList[i]).val().split("|");
				var g = document.createElement("li");				
				g.innerHTML = "<a href='"+val[0]+"' title='"+val[2]+"'>"+val[2]+"</a>";				
				fmenu.appendChild(g);
			});				
			setCookie("MWSERV",aDefaultList.join("@"),365);
			aCookieList = aDefaultList.concat();
			aCacheList = aDefaultList.concat();			
		}else{
			setCookie("MWSERV",aCacheList.join("@"),365);
		}		
		$("#setmymenu_area").hide();
		return false;
	});	

	$("#notice_close").click(function() {
		$("#notice_div").css("display","none");
		removeCookie("NOTICETOGGLE");
		setCookie("NOTICETOGGLE","none",365);
		return false;
	});
	$("#notice_open").click(function() {
		$("#notice_div").css("display","block");
		removeCookie("NOTICETOGGLE");
		setCookie("NOTICETOGGLE","block",365);
		return false;
	});
	$("#weeklyhot_close").click(function() {
		$("#weeklyhot_div").css("display","none");
		removeCookie("WEEKLYHOTTOGGLE");
		setCookie("WEEKLYHOTTOGGLE","none",365);
		return false;
	});
	$("#weeklyhot_open").click(function() {
		$("#weeklyhot_div").css("display","block");
		removeCookie("WEEKLYHOTTOGGLE");
		setCookie("WEEKLYHOTTOGGLE","block",365);
		return false;
	});
	$("#sosok_close").click(function() {
		$("#sosok_div").css("display","none");
		removeCookie("SOSOKTOGGLE");
		setCookie("SOSOKTOGGLE","none",365);
		return false;
	});
	$("#sosok_open").click(function() {
		$("#sosok_div").css("display","block");
		removeCookie("SOSOKTOGGLE");
		setCookie("SOSOKTOGGLE","block",365);
		return false;
	});
	$("#mvdata_close").click(function() {
		$("#mvdata_div").css("display","none");
		removeCookie("MVDATATOGGLE");
		setCookie("MVDATATOGGLE","none",365);
		return false;
	});
	$("#mvdata_open").click(function() {
		$("#mvdata_div").css("display","block");
		removeCookie("MVDATATOGGLE");
		setCookie("MVDATATOGGLE","block",365);
		return false;
	});
	$("#service_data_close").click(function() {
		$("#service_data").css("display","none");
		removeCookie("SERVICE_DATATOGGLE");
		setCookie("SERVICE_DATATOGGLE","none",365);
		return false;
	});
	$("#service_data_open").click(function() {
		$("#service_data").css("display","block");
		removeCookie("SERVICE_DATATOGGLE");
		setCookie("SERVICE_DATATOGGLE","block",365);
		return false;
	});
	_setToggleByCookies();
	
});

function _setToggleByCookies()
{
	var noticeCookie = getCookie("NOTICETOGGLE");	
	$("#notice_div").css("display",noticeCookie!=null?noticeCookie:"block");
	var weeklyhotCookie = getCookie("WEEKLYHOTTOGGLE");	
	$("#weeklyhot_div").css("display",weeklyhotCookie!=null?weeklyhotCookie:"block");
	var sosokCookie = getCookie("SOSOKTOGGLE");
	$("#sosok_div").css("display",sosokCookie!=null?sosokCookie:"block");
	var mvdataCookie = getCookie("MVDATATOGGLE");
	$("#mvdata_div").css("display",mvdataCookie!=null?mvdataCookie:"block");
	var service_dataCookie = getCookie("SERVICE_DATATOGGLE");
	$("#service_data").css("display",service_dataCookie!=null?service_dataCookie:"block");	
}

// GNB
function gnbNaviNew() {
	var gnbNavi = document.getElementById("gn_wrap");
	subMenu = gnbNavi.getElementsByTagName("ul");	
	for (i=0; i<subMenu.length; i++) {
		if(subMenu[i].id != "gnb1" && subMenu[i].id != "gnb2"){
			subMenu[i].style.display = "none";						// ÀüÃ¼ ¼­ºê·¹ÀÌ¾î ¼û±è.
		}
	}

	var gnbMenu = gnbNavi.getElementsByTagName("li");	
	for (j=0; j<gnbMenu.length; j++) {
		if (gnbMenu[j].className == "gnb_menu") {
			thismenu = gnbMenu[j].getElementsByTagName("a")[0];			
			thismenu.onmouseover = function() {				
				subMenu = gnbNavi.getElementsByTagName("ul");
				for (k=0; k<subMenu.length; k++) {
					if(subMenu[k].id != "gnb1" && subMenu[k].id != "gnb2"){						
						subMenu[k].style.display = "none";						
						subMenu[k].parentNode.style.zIndex = "0";
					}
				}
				
				gnbImg = gnbNavi.getElementsByTagName("img");
				for (l=0; l<gnbImg.length; l++) {					
					if (gnbImg[l].src.indexOf("_over.gif") != -1 ){
						gnbImg[l].src = gnbImg[l].src.replace("_over.gif",".gif");
					}
				}	
				this.getElementsByTagName("img")[0].src = this.getElementsByTagName("img")[0].src.replace(".gif","_over.gif");
				if (!this.parentNode.getElementsByTagName("ul")[0]) return false;				
				this.parentNode.getElementsByTagName("ul")[0].style.display = "";
				this.parentNode.getElementsByTagName("ul")[0].parentNode.style.zIndex = "1";
				
			}
			thismenu.onfocus = function() {
				subMenu = gnbNavi.getElementsByTagName("ul");
				for (k=0; k<subMenu.length; k++) {
					if(subMenu[k].id != "gnb1" && subMenu[k].id != "gnb2"){
						subMenu[k].style.display = "none";
						subMenu[k].parentNode.style.zIndex = "0";
					}
				}

				gnbImg = gnbNavi.getElementsByTagName("img");
				for (l=0; l<gnbImg.length; l++) {
					if (gnbImg[l].src.indexOf("_over.gif") != -1 ){
						gnbImg[l].src = gnbImg[l].src.replace("_over.gif",".gif");
					}
				}

				this.getElementsByTagName("img")[0].src = this.getElementsByTagName("img")[0].src.replace(".gif","_over.gif");
				if (!this.parentNode.getElementsByTagName("ul")[0]) return false;
				this.parentNode.getElementsByTagName("ul")[0].style.display = "";
				this.parentNode.getElementsByTagName("ul")[0].parentNode.style.zIndex = "1";
			}
		}
	}	
}

// LNB
function imgMenuOver(containderID) {
	var objwrap = document.getElementById(containderID);
	var imgMenu = objwrap.getElementsByTagName("a");

	for (i=0; i<imgMenu.length; i++) {
		if(imgMenu[i].getElementsByTagName("img").length == 0) continue;

		if (imgMenu[i].getElementsByTagName("img")[0].src.indexOf("_over.gif") != -1 ) {
			continue;
		}
		imgMenu[i].onmouseover = function() {
			subImage = this.getElementsByTagName("img")[0];
			if (subImage.src.indexOf("_over.gif") != -1) return false;
			subImage.src = subImage.src.replace(".gif","_over.gif");
		}
		imgMenu[i].onfocus = function() {
			subImage = this.getElementsByTagName("img")[0];
			if (subImage.src.indexOf("_over.gif") != -1) return false;
			subImage.src = subImage.src.replace(".gif","_over.gif");
		}
		imgMenu[i].onmouseout = function() {
			subImage = this.getElementsByTagName("img")[0];
			subImage.src = subImage.src.replace("_over.gif", ".gif");
		}
		imgMenu[i].onblur = function() {
			subImage = this.getElementsByTagName("img")[0];
			subImage.src = subImage.src.replace("_over.gif", ".gif");
		}
	}
}


// Tab Content
function initTabMenuNew(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 == "tabbtn")
			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();
}

// Tab Content
function initTabMenuMwMovie(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 == "tabbtn")
			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.photoTargetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]+"_photo");
		thismenu.photoTargetEl.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";
				currentmenu.photoTargetEl.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";
			this.photoTargetEl.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();
}

function pupopZone(){
		var btnPre = document.getElementById("bnnrctrl_prev"); // ÀÌÀü
		var btnStop = document.getElementById("bnnrctrl_stop"); // Á¤Áö
		//var btnAuto = document.getElementById("bnnrctrl_auto"); // ÀÚµ¿
		var btnNext = document.getElementById("bnnrctrl_next"); // ´ÙÀ½
		
		var List = document.getElementById('popup_list');
		var ListUl = List.getElementsByTagName("LI");
		if(ListUl.length < 2) return;
		
		// 1¹ø ¹è³Ê »©°í ¸ðµÎ °¡¸®±â
		for(var i=1; i<ListUl.length; i++) ListUl[i].style.display = "none";

		// ¹è³Êµ¹¸®±â
		var currnetBnnr = 0; // ÇöÁ¦ º¸¿©Áö°í ÀÖ´Â ¹è³Ê³Ñ¹ö
		var oldBnnr; // Àü¿¡ º¸¿©ÁÖ¾ú´ø ¹è³Ê³Ñ¹ö
		
		this.zoneLoop = function(){ // ¹è³Ê¹Ù²Ù±â
			oldBnnr = currnetBnnr;
			(currnetBnnr == ListUl.length-1) ? currnetBnnr=0 : currnetBnnr++;
			
			if(oldBnnr != undefined) ListUl[oldBnnr].style.display = "none";
			ListUl[currnetBnnr].style.display = "";
		}
		
		var zoneLoop = setInterval(this.zoneLoop, 10000);
		
		btnStop.onclick = function(){ // Á¤Áöµ¿ÀÛ
			clearInterval(zoneLoop);
			//btnAuto.style.display = "";
			//btnAuto.focus();
			//this.style.display = "none";
		}
		/**
		btnAuto["func_"] = this.zoneLoop;
		btnAuto.onclick = function(){ // ÀÚµ¿µ¿ÀÛ
			btnStop.style.display = "";
			btnStop.focus();
			this.style.display = "none";
			zoneLoop = setInterval(this["func_"] , 4000);
		}*/
		btnPre.onclick = function(){ // ÀÌÀü
			clearInterval(zoneLoop);
			oldBnnr = currnetBnnr;
			(currnetBnnr == 0) ? currnetBnnr=ListUl.length-1 : currnetBnnr--;
			
			ListUl[oldBnnr].style.display = "none";
			ListUl[currnetBnnr].style.display = "";
			btnStop.style.display = "";
			//btnAuto.style.display = "";
		}
		btnNext.onclick = function(){ // ´ÙÀ½
			clearInterval(zoneLoop);
			oldBnnr = currnetBnnr;
			(currnetBnnr == ListUl.length-1) ? currnetBnnr=0 : currnetBnnr++;
			
			ListUl[oldBnnr].style.display = "none";
			ListUl[currnetBnnr].style.display = "";
			btnStop.style.display = "";
			//btnAuto.style.display = "";
		}		
	}


//open window

function jsOpenWindow(url,scrollbars,resizable,top,left,width,height){
	window.open(url,'popup_zone','left='+left+',top='+top+',width='+width+',height='+height+',scrollbars='+scrollbars+',resizable='+resizable);
}

function jsOpenNewWindow(winURL,width,height,scrollbars){
 var winWidth = width;
 var winHeight = height; 
 var winName = "newPopup";
 var winPosLeft = (screen.width) ? (screen.width - winWidth) / 2 : 0;
 var winPosTop = (screen.height) ? (screen.height - winHeight) / 2 : 0;
 var winOpt = "width="+winWidth+",height="+winHeight+",top="+winPosTop+",left="+winPosLeft;
 window.open(winURL, winName, winOpt + ",menubar=no,status=no,scrollbars="+scrollbars+",resizable=no");
}


 
function showElement(ele){
	var ele = document.getElementById(ele);
	ele.style.display = "block";
	return false;
}
 function hideElement(ele){
	var ele = document.getElementById(ele);
	ele.style.display = "none";
	return false;
 } 

 //¸ÞÀÎ ¹Ì´Ï°ø°¨ ·Ñ¸µ
function mainrollingminifeed(){
	var obj=document.getElementById('sosok3');
	var moveobj=obj.getElementsByTagName('ul')[0];
	var banners=obj.getElementsByTagName('li');
	obj.style.width='240px'; /* obj.style.width ¹Ì´Ï°ø°¨ ³»¿ëÀÌ »Ñ·ÁÁö´Â ³ÐÀÌ  */
	obj.style.height='95px'; /* obj.style.height ¹Ì´Ï°ø°¨ ³»¿ëÀÌ »Ñ·ÁÁö´Â ³ôÀÌ,  */
	moveobj.style.marginTop='0px';
	moveobj.style.display='block';
	this.canimove=true;
	var temp,nowm,speed=50,onew=-7; /* onew ·Ñ¸µµÇ´Â ±æÀÌÁ¶Àý,  */

	var rolling=function(){
		nowm=parseInt(moveobj.style.marginTop);

		if(onew<nowm){
			setm(nowm+(Math.floor((onew-nowm)/speed)));
			moveobj.action=setTimeout(rolling,10);
		}else if(onew>nowm || onew==nowm){
			setm(0);
			items=moveobj.getElementsByTagName('li');
			temp=items[0].cloneNode(true);
			moveobj.removeChild(items[0]);
			moveobj.appendChild(temp);
			autorolling();
		}
	}
	
	var autorollingtime=2000;
	var autorollingtimer=0;
	var autorollingtimerid;
	var autorolling=function(){
		clearTimeout(autorollingtimerid);
		if(!mainrolling.canimove){
			autorollingtimer=0;
		}else{
			if(autorollingtime>autorollingtimer){
				autorollingtimer+=100;
				autorollingtimerid=setTimeout(autorolling,100);
			}else if(autorollingtime<=autorollingtimer){
				clearTimeout(autorollingtimerid);
				autorollingtimer=0;
				rolling();
			}
		}
	}
	this.restart=function(){
		autorolling();
	}

	var setm=function(newm){
		moveobj.style.marginTop=newm+'px';
	}

	obj.onmouseover=function(){
		mainrolling.canimove=false;
	}
	obj.onmouseout=function(){
		mainrolling.canimove=true;
		mainrolling.restart();
	}

	rolling();
}
 
 //¸ÞÀÎ ±Þ»ó½Â°Ë»ö¾î ·Ñ¸µ
function mainsearchrollingminifeed(){
	var obj=document.getElementById('popular_new');
	var moveobj=obj.getElementsByTagName('ul')[0];
	var banners=obj.getElementsByTagName('li');
	obj.style.width='100px'; /* obj.style.width ¹Ì´Ï°ø°¨ ³»¿ëÀÌ »Ñ·ÁÁö´Â ³ÐÀÌ  */
	obj.style.height='30px'; /* obj.style.height ¹Ì´Ï°ø°¨ ³»¿ëÀÌ »Ñ·ÁÁö´Â ³ôÀÌ,  */
	moveobj.style.marginTop='0px';
	moveobj.style.display='block';
	this.canimove=true;
	var temp,nowm,speed=50,onew=-7; /* onew ·Ñ¸µµÇ´Â ±æÀÌÁ¶Àý,  */

	var rolling=function(){
		nowm=parseInt(moveobj.style.marginTop);

		if(onew<nowm){
			setm(nowm+(Math.floor((onew-nowm)/speed)));
			moveobj.action=setTimeout(rolling,10);
		}else if(onew>nowm || onew==nowm){
			setm(0);
			items=moveobj.getElementsByTagName('li');
			temp=items[0].cloneNode(true);
			moveobj.removeChild(items[0]);
			moveobj.appendChild(temp);
			autorolling();
		}
	}
	
	var autorollingtime=3000;
	var autorollingtimer=0;
	var autorollingtimerid;
	var autorolling=function(){
		clearTimeout(autorollingtimerid);
		if(!mainsearchrolling.canimove){
			autorollingtimer=0;
		}else{
			if(autorollingtime>autorollingtimer){
				autorollingtimer+=100;
				autorollingtimerid=setTimeout(autorolling,100);
			}else if(autorollingtime<=autorollingtimer){
				clearTimeout(autorollingtimerid);
				autorollingtimer=0;
				rolling();
			}
		}
	}
	this.restart=function(){
		autorolling();
	}

	var setm=function(newm){
		moveobj.style.marginTop=newm+'px';
	}

	obj.onmouseover=function(){
		mainsearchrolling.canimove=false;
	}
	obj.onmouseout=function(){
		mainsearchrolling.canimove=true;
		mainsearchrolling.restart();
	}

	rolling();
}
 
 
function go_site(val){
		var frm = document.link_frm_go;
		if ( val != "" &  val != "http//") {
			frm.target="_blank";
			frm.action=val;
			frm.submit();
		}
	}

	function totalSearchsubmit(){
		var coll_val = "" ;
		/*if ( document.search.query.value == "" ) {
			alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
			return;
		}*/
		for ( i = 0 ; i < document.search.coll.length ; i ++ ) {
			if ( document.search.coll[i].checked == true )
				coll_val = document.search.coll[i].value ;
		}
		if ( coll_val == "EMP" ) {
			document.search.EMPL_NM.value = document.search.query.value ;
			document.search.target = "_self";
			document.search.action = "/front/sg/ssg0201ls.jsp?PAR_MENU_ID=05&MENU_ID=050202";
			document.search.submit();
		} else {
			document.search.target = "_self";
			document.search.action = "/front/sch/search.jsp";
			document.search.submit();
		}
	}

	/*	±ÛÀÚÈ®´ëÃà¼Ò */	
	var currentFontSize = 1;
	function zoomUtil(state, e){
		var idx;
		var arrFontSize = new Array();
	
		arrFontSize[0] = "65%";
		arrFontSize[1] = "75%";
		arrFontSize[2] = "85%";
		arrFontSize[3] = "100%";
		arrFontSize[4] = "110%";
		
		var e = e || window.event;
		if (e) {
			if (state == "plus") {		
				if (currentFontSize < 6 ) {
					idx = currentFontSize + 1;
					currentFontSize = idx;
				}else{
					idx = 6;
					currentFontSize = idx;
				}			
			} else if (state == "default") {
				idx = 1;
				currentFontSize = idx;
			} else if (state == "minus") {			
				if ( currentFontSize >= 1) {
					idx = currentFontSize - 1;
					currentFontSize = idx;
				}else{
					idx = 0;
					currentFontSize = idx;
				}
			}		
		}	
		$("body").css("font-size", arrFontSize[idx]);
		return false;
	}

	function viewSearchType(){
		var collLIst = document.getElementById('stype_list');
		if (collLIst.style.display == 'block') {
			collLIst.style.display = 'none';
		}
		else {
			collLIst.style.display = 'block';
		}
	}

	function selectSchType(obj) {
		var tobj = obj.parentNode;
		var typeTxt = tobj.getElementsByTagName('label')[0].innerHTML;
		var dash = typeTxt.indexOf('-');
		if (dash != -1) {
			typeTxt = typeTxt.substr(dash+1,typeTxt.length);
		}
		document.getElementById('stype_title').innerHTML = typeTxt;
		viewSearchType();
		try {
			q.focus();
		}catch (e) {}
	}


function jsOpenSite(formEl) {	
	var errorMessage = null;
	var objFocus = null;
	if (formEl.sitelink.value.length == 0) {
		errorMessage = "ÀÌµ¿ÇÏ½Ç »çÀÌÆ®¸¦ ¼±ÅÃÇÏ¼¼¿ä.";
		objFocus = formEl.sitelink;
	} 
	if(errorMessage != null) {
		alert(errorMessage);
		objFocus.focus();
		return false;
	}
	return true;
}




