/*
	eveny handler
*/
function addEvent(obj,type,fn){
	if(obj.attachEvent) {
		obj['e'+type+fn] = fn;
		obj[type+fn] = function(){obj['e'+type+fn](window.event);}
		obj.attachEvent('on'+type,obj[type+fn]);
	}
	else obj.addEventListener(type,fn,false);
}

function removeEvent(obj,type,fn){
	if(obj.detachEvent){
		obj.detachEvent('on'+type,obj[type+fn]);
		obj[type+fn] = null;
	}
	else obj.removeEventListener(type,fn,false);
}

function addClass(el,clsName) {
	if(el.className) {
		el.className += " "+clsName;
	}	else {
		el.className = clsName;
	}
}

function removeClass(el,clsName) {
	if(el.className == clsName) {
		el.className = "";
	} else {
		el.className = el.className.replace(' '+clsName,'');
	}
}

var EvtClone = function(e){
	var Clone = document.createEventObject ? document.createEventObject(e) : e;
	return Clone;
}

// window resizer
function winSize(Url,w,h){
	window.resizeTo(w,h);
	this.src=Url;
}

function rollOver(){
	this.init = function(obj, dis, overName){
		//alert(obj+'\n'+ dis+'\n'+ overName);
		if (!obj) return false;
		var outName = ".gif";
		var overName = (overName ? overName : "_on.gif");
		var objEl = obj.getElementsByTagName("a");
		for (i=0; i<objEl.length; i++) {
			img = objEl[i].getElementsByTagName("img")[0];
			addEvent(objEl[i], 'mouseover', function(){
				if(this.childNodes[0].className!="on") this.childNodes[0].src = this.childNodes[0].src.replace(outName, overName);
			});
			addEvent(objEl[i], 'mouseout', function(){
				if(this.childNodes[0].className!="on") this.childNodes[0].src = this.childNodes[0].src.replace(overName,outName);
			});
		}
	}
	this.set = function(){
		
	}
}

addEvent(window, 'load', function(){
	topRoll = new rollOver();
	topRoll.init(document.getElementById("top_navi"), true);

	subRoll = new rollOver();
	subRoll.init(document.getElementById("sub_navi"));
});


var depth1 = new Array(); //name, obj
var depth2 = new Array();
var depth2Top = new Array();
var depth3 = new Array();

var locationGetter = {
	init : function(topObj, subObj, contentsName){
		if(!document.getElementById(subObj) || !document.getElementById(contentsName)) return false;

		subObj = document.getElementById(subObj);
		subAnchor = subObj.getElementsByTagName("a");

		for(var no=0; no < subAnchor.length; no++){	
			if (document.getElementById(contentsName).getAttribute('alt') == subAnchor[no].childNodes[0].getAttribute('alt')){
				depth3Obj = subAnchor[no].getElementsByTagName('img')[0];
				depth3Alt = document.getElementById(contentsName).getAttribute('alt');
			}
		}
		if (depth3Obj.parentNode.parentNode.parentNode.parentNode.tagName == 'LI') {
			depth2Obj = depth3Obj.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('img')[0];
			depth2Alt = depth2Obj.getAttribute('alt');
		}
		else{
			depth2Obj = depth3Obj;
			depth2Alt = depth3Alt;
			depth3Obj = null;
			depth3Alt = null;
		}
		
		depth2 = [depth2Alt, depth2Obj];
		depth3 = [depth3Alt, depth3Obj];

		topObj = document.getElementById(topObj);
		topAnchor = topObj.getElementsByTagName("a");
		
		var depth2TopObj;
		var depth2TopAlt;
		var match = new Array();
		var matchCnt = 0;
		for(var no=0; no < topAnchor.length; no++){	
			if (depth2Alt == topAnchor[no].childNodes[0].getAttribute('alt')){
				depth2TopObj = topAnchor[no].getElementsByTagName('img')[0];
				depth2TopAlt = depth2Alt;

				match[matchCnt] = no;
				matchCnt++;
			}
		}
		if(match.length>1){
			if(location.href.indexOf('mid')>0){
				mid = getMid(location.href);
				for(var k=0; k < match.length; k++){
					link = getMid(topAnchor[match[k]].href);
					if(mid == link){
						depth2TopObj = topAnchor[match[k]].getElementsByTagName('img')[0];
						depth2TopAlt = depth2TopObj.getAttribute('alt');
						
					}				
				}
			}
			else {
				fileName = getFileName(location.href);
				for(var k=0; k < match.length; k++){
					link = getFileName(topAnchor[match[k]].href);
					if(fileName == link){
						depth2TopObj = topAnchor[match[k]].getElementsByTagName('img')[0];
						depth2TopAlt = depth2TopObj.getAttribute('alt');
						
					}				
				}
			}
		}
		if (!depth2TopObj){
				mid = getMid(location.href);
				cateId = mid.substr(0, 3);
				if (cateId == '124'){
					depth1Obj = document.getElementById('topSub04').getElementsByTagName('img')[0];
				}
				if (cateId == '125'){
					depth1Obj = document.getElementById('topSub05').getElementsByTagName('img')[0];
				}
				if (cateId != '124' && cateId != '125') return false;
				depth1Alt = depth1Obj.getAttribute('alt');
		}
		else if(depth2TopObj.parentNode.parentNode.parentNode.parentNode.parentNode.tagName == 'LI') {
			depth1Obj = depth2TopObj.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('img')[0]
			depth1Alt = depth1Obj.getAttribute('alt');
		}
		else{
			depth1Obj = depth2TopObj;
			depth1Alt = depth2TopAlt;
			depth2TopObj = null;
			depth2TopAlt = null;
		}

		depth1 = [depth1Alt, depth1Obj];
		depth2Top = [depth2TopAlt, depth2TopObj];		
	}
}

addEvent(window, 'load', function(){
//	locationGetter.init('top_navi', 'sub_navi', 'contentsName');
});

addEvent(window, 'load', function(){
	locationGetter.init('top_navi', 'sub_navi', 'contentsName');
	if (depth1.length>0){
		depth1[1].src = depth1[1].src.replace(".gif", "_on.gif");
		depth1[1].className = 'on';
	}
	if (depth2Top[1] != null && depth2Top.length>0){
		depth2Top[1].src = depth2Top[1].src.replace(".gif", "_on.gif");
		depth2Top[1].className = 'on';
	}
	if (depth2.length>0){
		depth2[1].src = depth2[1].src.replace(".gif", "_on.gif");
		depth2[1].className = 'on';
	}
	if (depth3[1] != null && depth3.length>0){
		depth3[1].src = depth3[1].src.replace(".gif", "_on.gif");
		depth3[1].className = 'on';
	}
});

function getMid(uri){
	if(uri.indexOf("mid=")<0) return false;
	var thisUriArray = uri.split('mid=');
	var getMid = thisUriArray[1];
	if(getMid.indexOf("#")>0)getMid = getMid.substr(0,getMid.indexOf("#"));
	if(getMid.indexOf("&")>0)getMid = getMid.substr(0,getMid.indexOf("&"));
	if(getMid.indexOf("?")>0)getMid = getMid.substr(0,getMid.indexOf("?"));	
	return getMid;
}

function getFileName(uri){
	if(uri.indexOf("#")>0)uri = uri.substr(0,uri.indexOf("#"));
	if(uri.indexOf("&")>0)uri = uri.substr(0,uri.indexOf("&"));
	if(uri.indexOf("?")>0)uri = uri.substr(0,uri.indexOf("?"));
	var thisUriArray = uri.split(/\//);
	var thisFileName = thisUriArray[thisUriArray.length-1];
	return thisFileName;
}

function subNavi(){
	if(!document.getElementById("top_navi")) return false;
	var a = document.getElementById("top_navi");
	var b = a.getElementsByTagName("li");
	var c = a.getElementsByTagName("ul").length-1;
	if(depth1[1]){
		//var subId = document.getElementById("topSub0" + main).getElementsByTagName("div")[0];
		//alert(subId.innerHTML);
		var subId = depth1[1].parentNode.parentNode.getElementsByTagName('div')[0]
		//alert(xsID.innerHTML);
		subId.style.display = "block";
	}else{}
	for(j = 1;j <= c;j++){
		var d = document.getElementById("topSub0" + j);
		
		d.onmouseover = function(){
			if(!document.getElementById("top_navi")) return false;
			var z = document.getElementById("top_navi");
			var x = z.getElementsByTagName("div");
			for(i = 0;i < x.length;i++){
					x[i].style.display = "none";
			}
			if(!this.getElementsByTagName("div")[0]) return false;
			this.getElementsByTagName("div")[0].style.display = "block";
		}
		d.onmouseout = function(){
			if(!this.getElementsByTagName("div")[0]) return false;
			this.getElementsByTagName("div")[0].style.display = "none";
			if(depth1[1]){
				depth1[1].parentNode.parentNode.getElementsByTagName("div")[0].style.display = "block";
			}else{}
		}
		d.childNodes[0].onfocus = function(){
			if(!document.getElementById("top_navi")) return false;
			var z = document.getElementById("top_navi");
			var x = z.getElementsByTagName("div");
			for(i = 0;i < x.length;i++){
					x[i].style.display = "none";
			}
			if(!this.parentNode.getElementsByTagName("div")[0]) return false;
			this.parentNode.getElementsByTagName("div")[0].style.display = "block";
		}		
	}
}

addEvent(window, 'load', subNavi);

function getStyle(el, property) {
 if (el.style[property]) {  // style ÇÁ¶óÆÛÆ¼°¡ ÀÖÀ»¶§
  return el.style[property];
 } else if (el.currentStyle && el.currentStyle[property]) { // IE
  return el.currentStyle[property];
 } else if (document.defaultView && 
   document.defaultView.getComputedStyle) { // W3C
  var converted = "";
  for (var i=0, len=property.length; i<len; ++i) {
   if (property.charAt(i)==property.charAt(i).toUpperCase()) {
    converted = converted + "-"+property.charAt(i).toLowerCase();
   } else {
    converted = converted+property.charAt(i);
   }
  }
  if (document.defaultView.getComputedStyle(el, "").getPropertyValue(converted)) {
   return document.defaultView.getComputedStyle(el, "").getPropertyValue(converted);
  }
 }
} 

/*
	±ÛÀÚ Å©±âÁ¶Àý
*/
var fSize = '0.9em';
function fontSize(state){
	//fSize = getStyle(document.body, 'fontSize');
	fSize = fSize.split('em')[0];
	fSize = parseFloat(fSize);
	if (state =='up' && fSize <= parseFloat(1.4)){
		fSize = fSize + 0.07;
	} else if (state =='down' && fSize >= parseFloat(0.5)){
		fSize = fSize - 0.07;
	} else if (state == 'default'){
		fSize = 0.9;
	}else {
		alert('¹üÀ§ ÃÊ°úÀÔ´Ï´Ù.');
	}
	fSize = fSize + 'em';
	document.body.style.fontSize = fSize;
}


var txtScroll = {
	cnt: 0,
	height: 0,
	inter: null,
	obj: null,
	init: function(obj){
		this.obj = obj;
		if(!obj) return false;
		obj.getElementsByTagName('ul')[0].style.position = 'absolute';
		
		//this.inter = setInterval(this.play, '3000');
		//addEvent(obj, 'mouseover', txtScroll.stop);
		//addEvent(obj, 'mouseout', txtScroll.play);
	},
	stop: function(){
		//alert(txtScroll.inter);
		clearInterval(txtScroll.inter);
	},
	play: function(){
		obj = txtScroll.obj;
		//alert(obj.innerHTML);
		var childs = obj.getElementsByTagName('li');
		if(txtScroll.cnt==childs.length){
			txtScroll.cnt = 0;
			txtScroll.height = 0;
		}
		//alert(txtScroll.cnt);
		obj.getElementsByTagName('ul')[0].style.top = -(txtScroll.height) + 'px';
		txtScroll.height = childs[txtScroll.cnt].offsetHeight + txtScroll.height;
		txtScroll.cnt++
	}
}

 /* º£³Ê½ºÅ©·Ñ */
function scrolling_up(objId,sec1,sec2,speed,width){
	this.objId=objId;
	this.sec1=sec1;
	this.sec2=sec2;
	this.speed=speed;
	this.h=0;
	this.div=document.getElementById(this.objId);
	this.width= (!width ? width : this.div.childNodes[1].childNodes[0].offsetWidth);
	this.htmltxt=this.div.innerHTML;
	this.div.innerHTML=this.htmltxt+this.htmltxt;
	this.div.isover=false;
	this.div.controlPlay = true;
	this.div.onmouseover=function(){this.isover=true;}
	this.div.onmouseout=function(){this.isover=false;}
	var aTags = this.div.getElementsByTagName('a');
	for (var i=0; i<aTags.length; i++){
		aTags[i].onfocus=function(){this.isover=true;}
		aTags[i].onblur=function(){this.isover=false;}
	}
	var self=this;
	this.div.style.left=0;
	window.setTimeout(function(){self.play()},this.sec1);
} 
scrolling_up.prototype={
	play:function(){
		var self=this;
		this.width= this.div.childNodes[1].childNodes[0].offsetWidth;
		if(!this.div.isover && document.getElementById('rollPause').alt == 'Á¤Áö'){
			this.h+=this.speed;
			if(this.div.offsetLeft < (-this.div.scrollWidth/2)){
				this.div.style.left = 0 + 'px';
				this.h = 0;
			}else{
				if(this.h%this.width==0){
					window.setTimeout(function(){self.play()},this.sec1);
					return;
				}
				this.div.style.left = -this.h-1 + 'px';
			}
		}
		window.setTimeout(function(){self.play()},this.sec2);
	},
	prev:function(){
		if(this.div.offsetLeft < (-this.div.scrollWidth/2)) this.div.style.left = - this.div.scrollWidth/2 + 'px';
		if ( this.h != 0 && (this.h - this.width) > 0) {
			this.h = this.h - this.width;
			this.div.style.left = -this.h + 'px';
			
		} else {
			this.div.style.left = 0 + 'px';
			this.h = 0;
			
		}
	},
	next:function(){
		if(this.div.offsetLeft < (-this.div.scrollWidth/2)) this.div.style.left =0;
		if ( this.h < this.div.scrollWidth-this.width*2 ) {
			this.h = this.h + this.width;
			this.div.style.left = -this.h + 'px';
 
		} else {
			this.h = 0;
			this.div.style.left = 0 + 'px';
 
		}
	},
	pause:function(){
		var btn = document.getElementById('rollPause');
		if( this.div.controlPlay == true ){
			this.div.controlPlay = false;
			this.div.isover = true;
		//	btn.src = '/images/main/main/banner_play.gif';
			btn.alt = '½ÃÀÛ';
		}else{
			this.div.controlPlay = true;
			this.div.isover = false;
		//	btn.src = '/images/main/main/banner_stop.gif';
			btn.alt = 'Á¤Áö';
		}
	}
};

var banners;
function init_banner() {
	banners = new scrolling_up("rolling_bannerList",3000,4,1,134); // objId,sec1,sec2,speed,height
/*	document.getElementById("banner_con").onmouseover = function() {
		banners.div.isover=true;
	}
	document.getElementById("banner_con").onmouseout = function() {
		if( banners.div.controlPlay == true ) {
			banners.div.isover=false;
		}else{
			banners.div.isover=true;
		}
	}
	document.getElementById("banner_con").onfocus = function() {
		banners.div.isover=true;
	}
	document.getElementById("banner_con").onblur = function() {
		banners.div.isover=false;
	}*/
}

//ÀÌ¹ÌÁö·Ñ¿À¹ö
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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];}
}

// top menu action
var currentMenu;	// current shown menu (mouse over)
var focusMenu;	// current page menu
var menu = new Array();	// each menu array


//±Û·Î¹ú ³×ºñ°ÔÀÌ¼Ç(2Depth ¸Þ´º±×·ì)¿¡ ´ëÇÑ ¸¶¿ì½º ¶Ç´Â Å°º¸µå ¹ÝÀÀ(º¸ÀÓ/¼û±è)¼³Á¤

function menuD2block(id) {
	for(num=1; num<=5; num++) document.getElementById('D2MG'+num).style.display='none'; //D2MG1~D2MG6 ±îÁö ¼û±ä ´ÙÀ½
	document.getElementById(id).style.display='block'; //ÇØ´ç ID¸¸ º¸ÀÓ	 
}

function menuD3MGblock(id) {
	var D3Arr = new Array();
	D3Arr = document.getElementsBySelector("#sub_navi ul.depth3");
	for(i=0; i<D3Arr.length; i++) document.getElementsBySelector("#sub_navi ul.depth3")[i].style.display = "none";
	if(document.getElementById(id).getElementsByTagName("ul").item(0)) document.getElementById(id).getElementsByTagName("ul").item(0).style.display = "block";
}

function getAllChildren(e) {
	// Returns all children of element. Workaround required for IE5/Windows. Ugh.
	return e.all ? e.all : e.getElementsByTagName('*');
}

document.getElementsBySelector = function(selector) {
	// Attempt to fail gracefully in lesser browsers
	if (!document.getElementsByTagName) {
		return new Array();
	}

	// Split selector in to tokens
	var tokens = selector.split(' ');
	var currentContext = new Array(document);

	for (var i = 0; i < tokens.length; i++) {
		token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');;
		if (token.indexOf('#') > -1) {
			// Token is an ID selector
			var bits = token.split('#');
			var tagName = bits[0];
			var id = bits[1];
			var element = document.getElementById(id);
			if (tagName && element.nodeName.toLowerCase() != tagName) {
				// tag with that ID not found, return false
				return new Array();
			}
			// Set currentContext to contain just this element
			currentContext = new Array(element);
			continue; // Skip to next token
		}

		if (token.indexOf('.') > -1) {
			// Token contains a class selector
			var bits = token.split('.');
			var tagName = bits[0];
			var className = bits[1];
			if (!tagName) {
				tagName = '*';
			}
			// Get elements matching tag, filter them for class selector
			var found = new Array;
			var foundCount = 0;
			for (var h = 0; h < currentContext.length; h++) {
				var elements;
				if (tagName == '*') {
						elements = getAllChildren(currentContext[h]);
				} else {
						elements = currentContext[h].getElementsByTagName(tagName);
				}
				for (var j = 0; j < elements.length; j++) {
					found[foundCount++] = elements[j];
				}
			}
			currentContext = new Array;
			var currentContextIndex = 0;
			for (var k = 0; k < found.length; k++) {
				if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) {
					currentContext[currentContextIndex++] = found[k];
				}
			}
			continue; // Skip to next token
		}
		// Code to deal with attribute selectors
		if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) {
			var tagName = RegExp.$1;
			var attrName = RegExp.$2;
			var attrOperator = RegExp.$3;
			var attrValue = RegExp.$4;
			if (!tagName) {
				tagName = '*';
			}
			// Grab all of the tagName elements within current context
			var found = new Array;
			var foundCount = 0;
			for (var h = 0; h < currentContext.length; h++) {
				var elements;
				if (tagName == '*') {
						elements = getAllChildren(currentContext[h]);
				} else {
						elements = currentContext[h].getElementsByTagName(tagName);
				}
				for (var j = 0; j < elements.length; j++) {
					found[foundCount++] = elements[j];
				}
			}
			currentContext = new Array;
			var currentContextIndex = 0;
			var checkFunction; // This function will be used to filter the elements
			switch (attrOperator) {
				case '=': // Equality
					checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); };
					break;
				case '~': // Match one of space seperated words
					checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); };
					break;
				case '|': // Match start with value followed by optional hyphen
					checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); };
					break;
				case '^': // Match starts with value
					checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); };
					break;
				case '$': // Match ends with value - fails with "Warning" in Opera 7
					checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); };
					break;
				case '*': // Match ends with value
					checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); };
					break;
				default :
					// Just test for existence of attribute
					checkFunction = function(e) { return e.getAttribute(attrName); };
			}
			currentContext = new Array;
			var currentContextIndex = 0;
			for (var k = 0; k < found.length; k++) {
				if (checkFunction(found[k])) {
					currentContext[currentContextIndex++] = found[k];
				}
			}
			// alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue);
			continue; // Skip to next token
		}
		// If we get here, token is JUST an element (not a class or ID selector)
		tagName = token;
		var found = new Array;
		var foundCount = 0;
		for (var h = 0; h < currentContext.length; h++) {
			var elements = currentContext[h].getElementsByTagName(tagName);
			for (var j = 0; j < elements.length; j++) {
				found[foundCount++] = elements[j];
			}
		}
		currentContext = found;
	}
	return currentContext;
}

function combin_search(){
	document.getElementById("searchBtn01").innerHTML = "<input type='image' src='/images/nowon/main/btn_search_02.gif'>";
	document.getElementById("searchBtn02").innerHTML = "<a href='#search' onClick='searchEngineDetail()'><img src='/images/nowon/main/btn_search_01.gif'></a>";
}

function pop_play(paraUrl){
	var win_open = window.open(paraUrl, 'vod', 'width=730,height=540,toolbar=no,status=no');
	win_open.focus();
}



//----------------------- ÅëÇÕ °Ë»ö ----------------------------
function check_GlabalSearch(f){
	if(f.search_str.value == ""){
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		f.search_str.focus();
		return false;
	}
	if(f.gubun.value == "1"){
		f.action="http://search.nowon.kr/RSA/front/Search.jsp";
		f.qt.value = f.search_str.value ;
	}else {
		f.action="/nowon/nowon.jsp?mid=113211";
	}

	return true;
	
}





//----------------------- ¸¸Á·µµ Æò°¡ ----------------------------
function check_form_satisfy(f) {


	if (f.is_login.value=="N" ) {
		if (confirm("·Î±×ÀÎÈÄ ÀÌ¿ë°¡´ÉÇÕ´Ï´Ù. ·Î±×ÀÎÆäÀÌÁö·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?")) {
			f.action = "/help/help.jsp?mid=102301" ;
			return true;
		} else {
			return false;
		}
	}



	if (f.satisfy(0).checked == false && f.satisfy(1).checked == false && f.satisfy(2).checked == false && f.satisfy(3).checked == false && f.satisfy(4).checked == false) {
		alert ("¸¸Á·Á¡¼ö¸¦ ¼±ÅÃÇØ ÁÖ½Ê½Ã¿ä");
		f.satisfy(0).focus();
		return false;
	}

	return true;

}

function popupRoll (){
	this.popup = document.getElementById('popupZone');
	this.sec1 = 1000;
	this.isOver = false;
	this.num = 0;
	this.popup.onmouseover=function(){this.isover=true;}
	this.popup.onmouseout=function(){this.isover=false;}
	var aTags = this.popup.getElementsByTagName('a');
	for (var i=0; i<aTags.length; i++){
		aTags[i].onfocus=function(i){
			this.isover=true;
			popupRoll.action(i);
		}
		aTags[i].onblur=function(i){
			this.isover=false;
			popupRoll.action(i);
		}
	}
	var self=this;
	window.setTimeout(function(){self.play()},this.sec1);
}


popupRoll.prototype={
	play:function(){
		var self=this;
		if(!this.div.isover){
			if(this.num > dt.length) this.num == 0;
			this.action(this.num);
			this.num++;
			window.setTimeout(function(){self.play()},this.sec1);
		}
		
	},
	action:function(num){
		dt = this.popup.getElementsByTagName('dt');
		dd = this.popup.getElementsByTagName('dd');
		if(num > dt.length) num == 0;
		for(i=1; i <= dt.length; i++){
			if(i == num){
				dd[num].style.display = 'block';
				dt[num].getElementsByTagName('img')[0].src = '/images/main/main/popup_btn"+num+"_on.gif';
			}
			else{
				dd[num].style.display = 'none';
				dt[num].getElementsByTagName('img')[0].src = '/images/main/main/popup_btn"+num+".gif';
			}
		}
	}
}


function replaceAll(str1,str2){

var strTemp = this;
strTemp = strTemp.replace(new RegExp(str1,"g"),str2);
return strTemp;

}

var currentFontSize = 3;
function zoomUtil(state, e){
		//alert('d')
	var idx;
	var arrFontSize = new Array();

	arrFontSize[0] = "65%";
	arrFontSize[1] = "75%";
	arrFontSize[2] = "85%";
	arrFontSize[3] = "100%";
	arrFontSize[4] = "110%";
	arrFontSize[5] = "120%";
	arrFontSize[6] = "130%";

	var e = e || window.event;
	if (e) {
		if (state == "in") {
			if (currentFontSize < 6 ) {
				idx = currentFontSize + 1;
				currentFontSize = idx;
			}else{
				idx = 6;
				currentFontSize = idx;
			}
		} else if (state == "default") {
			idx = 3;
			currentFontSize = idx;
		} else if (state == "out") {
			if ( currentFontSize >= 1) {
				idx = currentFontSize - 1;
				currentFontSize = idx;
			}else{
				idx = 0;
				currentFontSize = idx;
			}
		}
	}
	document.getElementById('wrap').style.zoom = arrFontSize[idx];
	document.body.style.zoom = arrFontSize[idx];
	return false;
}

