/* S : 2011-12-10 화현 */
var user = {
    IE			:!!(window.attachEvent && !window.opera),
    IE6			:((navigator.userAgent.toLowerCase().indexOf("msie 6")!=-1)&&(navigator.userAgent.toLowerCase().indexOf("msie 7")<0)),
    IE7			:(navigator.userAgent.toLowerCase().indexOf("msie 7")!=-1),
    IE9			:(navigator.userAgent.toLowerCase().indexOf("msie 9")!=-1),
    FF			:(navigator.userAgent.toLowerCase().indexOf("firefox")!=-1),
    Opera:  !!window.opera,
    WebKit: navigator.userAgent.indexOf("AppleWebKit/") > -1,
    Gecko:  navigator.userAgent.indexOf("Gecko") > -1 && navigator.userAgent.indexOf("KHTML") == -1,
    MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
}

var util = {
	$ : function(element) {
		if (arguments.length > 1) {
			for (var i = 0, elements = [], length = arguments.length; i < length; i++) elements.push(util.$(arguments[i]));
			return elements;
		}
		if (typeof(element) == "string") element = document.getElementById(element);
		return element;
	},
	AddEvent : function(obj, type, fn) { //Event Register
		if(obj.addEventListener) {
			obj.addEventListener(type, fn, false);
		} else 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["on"+type] = obj["e"+type+fn];
		}
	},
	create : function(opts){ // create element
		var rv=(user.IE&&!user.IE9)? '' : document.createElement(opts.tagname);
		for(var i in opts){
			if(i!='tagname'){
				if(user.IE&&!user.IE9) rv+=' '+((i=='classname')? 'class' : i)+'="'+opts[i]+'"';
				else rv.setAttribute((i=='classname')? 'class' : i,opts[i]);
			}
		}
		return (user.IE&&!user.IE9)? document.createElement('<'+opts.tagname+rv+'>') : rv;
	},
	show : function(obj){ util.$(obj).style.display = "block"; },
	hidden : function(obj){ util.$(obj).style.display = "none"; },
	toggle : function(obj){ util.$(obj).style.display = (util.$(obj).style.display=="block") ? "none" : "block" ; },
	getDoffset : function(obj){ //Offset Position
		var pos=[0,0];
		if(obj.offsetParent){
			do{
				pos[0] += obj.offsetLeft;
				pos[1] += obj.offsetTop;
			}while(obj = obj.offsetParent);
		}
		return pos;
	},
	pop : function(url,w,h,s){
		w=(s)? w+17 : w;
		s=(s)? 'yes' : 'no';
		var sw=screen.availWidth;
		var sh=screen.availHeight;
		var left=(sw/2)-(w/2);
		var top=(sh/2)-(h/2);
		var winname=url.substr(url.lastIndexOf('/')+1).split(/\.html|\.php/)[0];
		window.open(url,winname,'left='+left+',top='+top+',width='+w+',height='+h+',scrollbars='+s+',resizeable=no,menubar=no,status=yes,location=no,toolbar=no');
	},
	reflash : function(obj, swfid, src, w, h, flashvars, base, wmode, bg, appleHtml){ // flash reWrite.
		var wmode = wmode || "transparent", bg = bg || "#ffffff", base = base || "", flashvars = flashvars || "", html="", appleHtml = appleHtml || false;
		if(user.MobileSafari&&appleHtml){
			html = appleHtml;
		}else{
			if(user.IE)	html += "<object id='"+swfid+"' width='"+w+"' height='"+h+"' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'>";
			else				html += "<object type='application/x-shockwave-flash' data='"+src+"' width='"+w+"' height='"+h+"'>"
									html += "<param name='movie' value='"+src+"' />"
												+ "<param name='quality' value='high' />"
												+ "<param name='base' value='"+base+"' />"
												+ "<param name='bgcolor' value='#ffffff' />"
												+ "<param name='play' value='true' />"
												+ "<param name='loop' value='true' />"
												+ "<param name='wmode' value='"+wmode+"' />"
												+ "<param name='scale' value='showall' />"
												+ "<param name='menu' value='true' />"
												+ "<param name='devicefont' value='false' />"
												+ "<param name='salign' value='' />"
												+ "<param name='allowScriptAccess' value='always' />"
												+ "<param name='FlashVars' value='"+flashvars+"' />"
												+ "<a href='http://www.adobe.com/go/getflash'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>"
												+ "</object>";
		}
		obj.innerHTML = html;
	},
	move : function(obj,dir,ms,me,pORm,percent,time,fun){ //( 오브젝트 , 이동property:style.left OR scrollLeft등 , 시작위치 , 이동할위치 , +(1)인지-(0)인지구별 )
		clearTimeout(obj.moveact);
		ms = parseFloat(ms);
		me = parseFloat(me);
		if(dir.indexOf("opacity")>-1){
			if(!obj.style.opacity) obj.style.opacity = ms;
			var _me = obj.style.opacity;
			var _mm = (pORm) ? percent : -percent ;
			var pos = parseFloat(_me)+parseFloat(_mm);
			if((pORm==1&&_me>=me)||(pORm==0&&_me<=me)){
				obj.style.opacity = me;
				if(user.IE) obj.style.filter = "alpha(opacity="+(me*100)+")";
				if(fun) eval(fun);
			}else{
				obj.style.opacity = pos;
				if(user.IE) obj.style.filter = "alpha(opacity="+(pos*100)+")";
				if((pORm==1&&_me<me)||(pORm==0&&_me>me)) obj.moveact=setTimeout(function(){util.move(obj,dir,eval("obj."+dir),me,pORm,percent,time,fun)},time);
			}
		}else{
			var pos = Math.ceil((me-ms)*percent);
			var unit = (dir.indexOf("style.")>-1) ? "px" : "";
			if(unit=="px"&&!eval("obj."+dir)) eval("obj."+dir+" = ms+unit");
			if(!eval("obj."+dir)) eval("obj."+dir+" = "+ms+unit);
			if(pos==0) pos = (pORm) ? 1 : -1 ;
			var _me = eval("parseInt(obj."+dir+")");
			if((pORm==1&&_me>=me)||(pORm==0&&_me<=me)){
				eval("obj."+dir+" = me+unit");
				if(fun) eval(fun);
			}else{
				eval("obj."+dir+" = (parseInt(obj."+dir+")+pos)+unit");
				if((pORm==1&&_me<me)||(pORm==0&&_me>me)) obj.moveact=setTimeout(function(){util.move(obj,dir,eval("obj."+dir),me,pORm,percent,time,fun)},time);
			}
		}
	}
}
/* E : 2011-12-10 화현 */

function menudisplay(type){ /*  네비게이션  */
	var obj = document.getElementById("dp2");
	if(obj.timer) clearTimeout(obj.timer);
	if(!obj.style.height) obj.style.height = 0;
	if(type=="show"){
		obj.outType = false;
		util.move(obj,"style.height",obj.style.height,obj.scrollHeight,1,0.2,10);
	}else if(type=="hide"){
		obj.outType = true;
		obj.timer = setTimeout(function(){ menudisplay("close") },500);
	}else{
		if(obj.outType) util.move(obj,"style.height",obj.style.height,0,0,0.2,10);
	}
}
function autoBlurFucntion() {if(event.srcElement.tagName=="A") document.body.focus();}
document.onfocusin=autoBlurFucntion;

function openBrWindow(theURL, w, h) { //v2.0
   window.open(theURL,'잉글리쉬에그',"width="+w+", height="+h+"location=no, directories=no, resizable=no, statusbar=no, toolbar=no, menubar=no, scrollbars=no");
 }

function openBrWindow1(theURL, w, h) { //v2.0
   window.open(theURL,'잉글리쉬에그',"width="+w+", height="+h+"location=no, directories=no, resizable=no, statusbar=no, toolbar=no, menubar=no, scrollbars=yes");
 }


function popup(txtTitle, imgSrc){
			imgWin=window.open("","","width=0, height=0, resizeable=yes, location=no, menubar=no, toolbar=no");
			imgWin.document.write("<html><head><title>"+txtTitle+"</title></head><script>");
			imgWin.document.write("function resizeWindown(){");
			imgWin.document.write("var obj=document.getElementById('img');");
			imgWin.document.write("var w=obj.width;");
			imgWin.document.write("var h=obj.height;");
			imgWin.document.write("window.resizeTo(w+15, h+65);}");
			imgWin.document.write("</script><body onLoad='resizeWindown();' style='margin:0; padding:0'>");
			imgWin.document.write("<img src='../images/popup/"+imgSrc+"' onClick='self.close()' alt='' style='cursor:pointer;' id='img'>");
			imgWin.document.write("</html>");
			imgWin.document.close();
}

function fncShowLayerPop(e,src)
{
    if(window.event) e = window.event;
    var pdv = document.getElementById('popup_div');
    var pos = getMousePosition(e);


    pdv.style.left = (pos.x+15)+'px';
    pdv.style.top  = (pos.y+100)+'px';


    pdv.innerHTML = '<img src="'+src+'" onmouseout="fncHideLayerPop()" />';
    pdv.style.display   = 'block';
}


function fncHideLayerPop()
{
    var pdv = document.getElementById('popup_div');
    pdv.style.display   = 'none';
}


function getMousePosition(event)
{
    var x = (getIEVer()<=0) ? event.pageX: window.event.clientX + document.documentElement.scrollLeft;
    var y = (getIEVer()<=0) ? event.pageY: window.event.clientY + document.documentElement.scrollTop;
    return {'x':50,'y':50};
}


function fncClick()
{
    var abc = new Array();
    abc = getMousePosition( window.event );
    alert(abc.x+'-'+abc.y);
}


function getIEVer()
{
    var retval = 0;
    var agent = navigator.userAgent.toLowerCase();
    var ver = agent.split(';');
    if(agent.indexOf('msie') != -1)
    {
        retval = parseFloat(ver[1].slice(6, ver[1].length));
    }
    return retval;
}

function displayImage(picName, windowName, windowWidth, windowHeight){
var winHandle = window.open("" ,windowName,"toolbar=no,scrollbars=yes,resizable=no,width=" + windowWidth + ",height=" + windowHeight)
if(winHandle != null){
var htmlString = "<html><head><title>Picture</title></head>" 
htmlString += "<body style='margin:0; padding:0;' onload='resizeTo(" + windowWidth + "," + windowHeight + ");'>"
htmlString += "<a href=javascript:window.close()><img src=" + picName + " border=0 alt=닫기></a>"
htmlString += "</body></html>"
winHandle.document.open()
winHandle.document.write(htmlString)
winHandle.document.close()
} 
if(winHandle != null) winHandle.focus()
return winHandle
}

/* S : 2011-12-10 화현 */
function checkform(obj){
	obj.checked = obj.checked || false;
	obj.checked = !obj.checked;
	obj.className = (obj.checked) ? obj.className+" checked" : obj.className.replace(/ checked/ig,"");
}
function topItemView(id){
	var obj = document.getElementById(id);
	var tab = obj.getElementsByTagName("a");
	obj.btnN = util.create({tagname:'span',classname:'next',style:'visibility:hidden;position:absolute;left:0;top:0;width:0;height:0;overflow:hidden;'});
	obj.parentNode.appendChild(obj.btnN);
	obj.curentNum = 0;
	for(i=0;i<tab.length;i++){
		tab[i].obj = obj, tab[i].num = i;
		tab[i].viewCont = document.getElementById(tab[i].href.split("#")[1]);
		tab[i].onclick = function(){
			if(this.obj.curent){
				this.obj.curent.className = "";
				this.obj.curent.style.zIndex = 1;
				$(this.obj.curent.viewCont).animate({ opacity : 0 },400,function(){ $(this).css("visibility","hidden"); })
			}
			this.obj.curent = this;
			this.obj.curentNum = this.num;
			this.className = "curent";
			this.style.zIndex = 2;
			if(user.IE) this.viewCont.style.filter = "alpha(opacity=0)";
			else this.viewCont.style.opacity = "0";
			this.viewCont.style.visibility = "visible";
			$(this.obj.curent.viewCont).animate({ opacity : 1 },400)
			return false;
		}
	}
	obj.btnN.onclick = function(){ tab[(obj.curentNum+1>tab.length-1)?0:obj.curentNum+1].click(); }
	if(tab.length>0) tab[obj.curentNum].onclick();
	if(tab.length>1) repeatRoll(obj,obj.btnN,3000);
}
function nextCont(id,type){
	var obj = document.getElementById(id);
	var list = (type=="dl") ? obj.getElementsByTagName("dd") : obj.getElementsByTagName("li") ;
	if(list.length>0){
		list[0].style.zIndex = 100;
		list[0].style.opacity = 1;
		list[0].style.visibility = "visible";
	}
	if(list.length>1){
		btnArea = util.create({tagname:'span',classname:'btnPN'});
		btnArea.prev = util.create({tagname:'span',classname:'prev'});
		btnArea.next = util.create({tagname:'span',classname:'next'});
		obj.appendChild(btnArea);
		btnArea.appendChild(btnArea.prev);
		btnArea.appendChild(btnArea.next);
		btnArea.count = 0, btnArea.old = 0, btnArea.max = list.length-1, btnArea.item = list;
		btnArea.prev.onclick = function(){
			btnArea.old = btnArea.count;
			btnArea.count = (btnArea.count-1<0)?btnArea.max : btnArea.count-1;
			npView(btnArea.item[btnArea.count],btnArea.item[btnArea.old]);
		}
		btnArea.next.onclick = function(){
			btnArea.old = btnArea.count;
			btnArea.count = (btnArea.count+1>btnArea.max)?0:btnArea.count+1;
			npView(btnArea.item[btnArea.count],btnArea.item[btnArea.old]);
		}
		repeatRoll(obj,btnArea.next);
	}
}
function npView(cur,old){
	util.move(old,"style.opacity",cur.style.opacity,0,0,0.1,40,"obj.style.zIndex=1;obj.style.visibility='hidden';");
	cur.style.visibility = 'visible';
	cur.style.zIndex = 100;
	cur.style.opacity = (cur.style.opacity) ? cur.style.opacity : 0;
	util.move(cur,"style.opacity",cur.style.opacity,1,1,0.1,40);
}

function photoGallery(id){
	var caption, btnP, btnN, obj = document.getElementById(id);
	obj.list = obj.getElementsByTagName("li");
	obj.img = obj.getElementsByTagName("img");
	obj.cur = 0, obj.old = 0;
	if(obj.list.length<=1) return;
	if(obj.list.length>0) obj.cur = Math.ceil(obj.list.length/2)-1;
	obj.prevPos = {w:132,h:100,l:0,t:59};
	obj.curentPos = {w:284,h:212,l:148,t:0};
	obj.nextPos = {w:132,h:100,l:448,t:59};
	obj.btnP = util.create({tagname:'span',classname:'prev'});
	obj.btnN = util.create({tagname:'span',classname:'next'});
	obj.caption = util.create({tagname:'span',classname:'caption',style:'opacity:1'});
	obj.appendChild(obj.btnP);
	obj.appendChild(obj.btnN);
	obj.appendChild(obj.caption);

	for(i=0;i<obj.list.length;i++){
		obj.list[i].num = i, obj.list[i].wrap = obj, obj.list[i].item = obj.list;
		obj.list[i].onclick = function(){ this.obj = this.parentNode.parentNode; this.obj.old = this.obj.cur; this.obj.cur = this.num; if(this.obj.cur!=this.obj.old) this.obj.photoMove(); }
		if(obj.cur!=i) obj.list[i].getElementsByTagName("a")[0].onclick = function(){ return false; }
	}
	
	obj.photoMove = function(){
		$("#"+id+" .caption").fadeOut();
		this.caption.innerHTML = "<strong>" + this.img[this.cur].alt + "</strong>" + this.img[this.cur].title + "</span>";
		this.type = (this.old>this.cur) ? 0 : 1;
		this.typeCss = this.type ? "prevPos" : "nextPos";
		if(this.type){
			if(this.cur+1<this.list.length) viewSet(this.list[this.cur+1],'nextPos');
		}else{
			if(this.cur-1>=0) viewSet(this.list[this.cur-1],'prevPos');
		}

		$(this).find("li").css("zIndex",1).eq(this.old).css("zIndex",2).animate({
			width : eval("this."+this.typeCss+".w")+"px", height : eval("this."+this.typeCss+".h")+"px", left : eval("this."+this.typeCss+".l")+"px", top : eval("this."+this.typeCss+".t")+"px"
		},400,function(){
			this.getElementsByTagName("a")[0].onclick = function(){ return false; }
		}).end().eq(this.cur).css("zIndex",100).animate({
			width : this.curentPos.w+"px", height : this.curentPos.h+"px", left : this.curentPos.l+"px", top : this.curentPos.t+"px"
		},400,function(){
			if(this.wrap.cur-2>=0) this.item[this.wrap.cur-2].style.visibility = "hidden";
			if(this.wrap.cur+2<this.item.length) this.item[this.wrap.cur+2].style.visibility = "hidden";
			$("#"+id+" .caption").fadeIn();
			this.getElementsByTagName("a")[0].onclick = null;
		})
	}

	function viewSet(robj,type){
		with(robj.style){
			width = eval("robj.parentNode.parentNode."+type+".w+'px'");
			height = eval("robj.parentNode.parentNode."+type+".h+'px'");
			left = eval("robj.parentNode.parentNode."+type+".l+'px'");
			top = eval("robj.parentNode.parentNode."+type+".t+'px'");
			zIndex = 1;
			visibility = "visible";
		}
	}
	viewSet(obj.list[obj.cur],'curentPos');
	if(obj.list[obj.cur+1]) viewSet(obj.list[obj.cur+1],'nextPos');
	if(obj.list[obj.cur-1]) viewSet(obj.list[obj.cur-1],'prevPos');
	obj.caption.innerHTML = "<strong>" + obj.img[obj.cur].alt + "</strong>" + obj.img[obj.cur].title + "</span>";
	obj.btnP.onclick = function(){ if(this.parentNode.cur-1>=0) this.parentNode.list[this.parentNode.cur-1].onclick(); }
	obj.btnN.onclick = function(){ if(this.parentNode.cur+1<this.parentNode.list.length) this.parentNode.list[this.parentNode.cur+1].onclick(); }
}

var scroll = { ml : 0, pos : [], npos : [], curent : 0, mcount:0 , contain : "", area : "", mObj : "" }
scroll.down = function (e){
	e = window.event || e;
	scroll.pos=[e.clientX,e.clientY];
	scroll.ml=parseInt(scroll.mObj.style.left);
}
scroll.move = function (e){
	e = window.event || e;
	scroll.npos=[e.clientX,e.clientY];
	scroll.tempPos = (scroll.ml-(scroll.pos[0]-scroll.npos[0])<0) ? 0 : (scroll.ml-(scroll.pos[0]-scroll.npos[0]))>scroll.mObj.maxMl ? scroll.mObj.maxMl : (scroll.ml-(scroll.pos[0]-scroll.npos[0]));
	scroll.tempPos = (scroll.tempPos>scroll.mObj.maxMl)?scroll.mObj.maxMl : (scroll.tempPos<0)?0:scroll.tempPos;
	scroll.mObj.style.left=scroll.tempPos+'px';

	if(scroll.pos[0]>scroll.npos[0]) scroll.repeat.scrollLeft = scroll.tempPos*((scroll.mObj.maxMl/scroll.repeat.maxMl));
	else scroll.repeat.scrollLeft = (scroll.tempPos*Math.round(100*(scroll.repeat.maxMl/scroll.mObj.maxMl))/100);
}
scroll.up = function (e){
	scroll.onmoveend();
	document.onmousedown=document.onmousemove=document.onmouseup=null;
}

scroll.onmoveend = function (e){
	scroll.mObj.ms = parseInt(scroll.mObj.style.left);
	if(scroll.pos[0]-scroll.npos[0]>0) scroll.curent = Math.floor(scroll.mObj.ms/(scroll.mObj.maxMl/(scroll.li.length-scroll.mcount)));
	else scroll.curent = Math.ceil(scroll.mObj.ms/(scroll.mObj.maxMl/(scroll.li.length-scroll.mcount)));
	if(scroll.li.length-scroll.mcount<scroll.curent) scroll.curent = scroll.li.length-scroll.mcount;
	scroll.action(scroll.curent);
}
scroll.action = function(step){
	if ((scroll.li.length-scroll.mcount)<step) step = scroll.li.length-scroll.mcount;
	scroll.curent = step;
	pOrm = (parseInt(scroll.mObj.style.left) > (scroll.mObj.maxMl/(scroll.li.length-scroll.mcount))*scroll.curent) ? 0 : 1;
	util.move(scroll.mObj,"style.left",scroll.mObj.style.left,(scroll.mObj.maxMl/(scroll.li.length-scroll.mcount))*scroll.curent,pOrm,0.2,30);
	util.move(scroll.repeat,"scrollLeft",scroll.repeat.scrollLeft,scroll.li[0].offsetWidth*(scroll.curent),pOrm,0.2,30);
}
scroll.init = function(id){
	scroll.contain = document.getElementById(id);
	scroll.repeat = scroll.contain.getElementsByTagName("div")[0];
	scroll.ul = scroll.contain.getElementsByTagName("ul")[0];
	scroll.li = scroll.ul.getElementsByTagName("li");
	if(scroll.li.length==0) return;
	scroll.mcount = Math.ceil(scroll.repeat.offsetWidth/scroll.li[0].offsetWidth);
	if(scroll.li.length<=scroll.mcount) return;
	else scroll.ul.style.width = (scroll.li[0].offsetWidth*scroll.li.length)+"px";
	scroll.bp = util.create({tagname:'span',classname:'prev'});
	scroll.bn = util.create({tagname:'span',classname:'next'});
	scroll.area = util.create({tagname:'span',classname:'scroll'});
	scroll.mObj = util.create({tagname:'span',classname:'btn png',style:"left:0"});
	scroll.bp.onclick = function(){ if(scroll.curent-1>=0) scroll.action(scroll.curent-1); }
	scroll.bn.onclick = function(){ if(scroll.curent+1<=scroll.li.length-scroll.mcount) scroll.action(scroll.curent+1); }
	scroll.contain.appendChild(scroll.bp);
	scroll.contain.appendChild(scroll.bn);
	scroll.contain.appendChild(scroll.area);
	scroll.area.appendChild(scroll.mObj);
	scroll.mObj.style.left = 0;
	scroll.mObj.maxMl = scroll.area.offsetWidth-scroll.mObj.offsetWidth;
	scroll.repeat.maxMl = scroll.repeat.scrollWidth-scroll.repeat.offsetWidth;
	scroll.repeat.scrollLeft = 0;
	scroll.mObj.onmousedown=function(e){
		document.onmousedown=function(e){ scroll.down(e) };
		document.onmousemove=function(e){ scroll.move(e) };
		document.onmouseup=scroll.up;
	}
}

function tabView(obj){
	$(obj).parent().find("a").each(function(){
		if(obj==this){
			$(this).parents("div")[0].className = "tab "+ ($(this).attr("href").replace("#",""))
			$($(this).attr("href")).show();
		}else{
			$($(this).attr("href")).hide();
		}
	})
}

function photoGallery2(obj){
	var prevBtn = "prevRepeat", nextBtn = "nextRepeat", view = "viewArea", vimg = "thum", vtxt = "caption";
	obj.ul = obj.find(".list");
	obj.list = obj.find(".list li");
	if(obj.list.length <= 0) return;
	obj.curent = 0;
	obj.mg = obj.list[0].offsetWidth-obj.list[0].getElementsByTagName("img")[0].offsetWidth;
	obj.max = (obj.list[0].offsetWidth*obj.list.length-obj.mg);
	obj.ul.css("width",(obj.max+obj.mg)+"px");
	obj.next = (obj.ul.parent().width()+obj.mg)/obj.list[0].offsetWidth;
	obj.prepend("<img class='"+prevBtn+"' src='../images/contents/gallery_prev.gif' alt='' /><img class='"+nextBtn+"' src='../images/contents/gallery_next.gif' alt='' />");
	obj.prepend("<div class='"+view+"'><div class='item'></div></div>");
	obj.view = obj.find("."+view);
	obj.pBtn = obj.find("."+prevBtn);
	obj.nBtn = obj.find("."+nextBtn);
	obj.list.each(function(index){
		$(this).click(function(){
			obj.list.eq(obj.curent).find("img").removeClass("curent");
			obj.curent = index;
			if(obj.curent%obj.next==0){
				obj.ul.animate({
					marginLeft : -((obj.curent/obj.next)*obj.ul.parent().width())-(obj.mg*((obj.curent/obj.next)+1))+"px"
				},300);
			}
			$(this).find("img").addClass("curent");
			obj.view.append("<div class='item' style='z-index:1;'>"+this.innerHTML+"</div>").fadeIn("slow");
			if(obj.find(".item").length>1) obj.find(".item:first-child").css("z-index",2).fadeOut("slow",function(){ $(this).remove(); });
		})
		if(index==0) $(this).click();
	})
	obj.pBtn.click(function(){
		obj.list[obj.curent==0?obj.list.length-1:obj.curent-1].click();
	})
	obj.nBtn.click(function(){
		obj.list[obj.curent==obj.list.length-1?0:obj.curent+1].click();
	})
	repeatRoll(obj[0],obj.nBtn[0]);
}

function repeatRoll(obj,btn,time){
	time = time || 2000;
	obj.repeat = setInterval(function(){btn.click();},time);
	obj.btn = btn;
	obj.onmouseover = function(){ clearInterval(this.repeat); };
	obj.onmouseout = function(){ this.repeat = setInterval(function(){btn.click();},time); };
}
function selectLayer(obj){
	$(obj).find("ul").toggle();
	$(obj).find("a").not(".default").each(function(index){
		$(this).click(function(){
			var txt = this.innerHTML;
			$(obj).find(".default").html(txt);
			$(obj).find("ul").hide();
			return false;
		})
	});
}
function interviewPop(obj){
	var popUrl = obj.href+"&img="+obj.getElementsByTagName("img")[0].src;
	obj.imgB = util.create({tagname:'img',src:obj.getElementsByTagName("img")[0].src,style:'visibility:hidden;position:absolute;bottom:0;left:-9999px;'});
	obj.parentNode.parentNode.parentNode.appendChild(obj.imgB);
	obj.imgB.onload = function(){
		window.open(popUrl,'잉글리쉬에그',"width="+(obj.imgB.offsetWidth+80<480?480:obj.imgB.offsetWidth+80)+", height="+(obj.imgB.offsetHeight+143>700?700:obj.imgB.offsetHeight+143)+"location=no, directories=no, resizable=no, statusbar=no, toolbar=no, menubar=no, scrollbars=yes");
		$(obj.imgB).remove();
	}
}
/* E : 2011-12-10 화현 */


var trace = {
	show : function(msg,type){
		if(!trace.area){
			trace.area = util.create({tagname:'div',id:'trace',style:'position:fixed; left:10px; top:10px; padding:5px; background:#fff; border:1px solid red;'});
			document.getElementsByTagName("body")[0].appendChild(trace.area);
		}
		trace.area.innerHTML = (type) ? trace.area.innerHTML+"<br />"+msg : msg;
	}
}
//trace.show(1);
