try{document.domain = 'daum.net';}catch(e){} 
try {document.execCommand("BackgroundImageCache",false,true);}catch(e){}
function checkLogin() {
	if(confirm("먼저 로그인 하셔야 합니다.\n로그인 페이지로 이동 하시겠습니까?")){
	}else{
		UI.$("comment").value = ""; UI.$("comment").blur();
	}
}

//-- 미즈쿡 검색
function _jsSearchForm() {
	var SearchKeyword = document.getElementById("q");
	if(UI.trim(SearchKeyword.value) == "") {
		alert("검색어를 입력해 주세요.");
		return false;
	} else {
		if(document.location.toString().indexOf('/search/')<0 && UI.$('searchquery_text_mimic') && SearchKeyword.value==UI.$('searchquery_text_mimic').value){
			location.href = UI.$('searchquery_link_mimic').value;
			return false;
		} else {
			document.getElementById("searchForm").submit();
			return gLink(null, "SBCZ", "1", "2");
		}
	}
}

//--------------------- JES : 2008-12-10
var UI={};
Object.extend=function(a, b){
  for (var property in b) a[property] = b[property];
  return a;
};

UI.$=function(s) { return document.getElementById(s) };
UI.trim=function(s) {return s.replace(/(^\s*)|(\s*$)/g, "") };
UI.toogle=function(id) { UI.$(id).style.display=(UI.getStyle(UI.$(id),'display')=='none') ? 'block':'none' };
UI.getEl=function(e){var E=UI.getE(e);return E.target || E.srcElement}
UI.getE=function(e){return e || window.event}
UI.random=function(min, max){ return Math.floor(Math.random() * (max - min + 1) + min) };
UI.addEvent=function(object, type, listener) {	
	if(object.addEventListener) {if(type=='mousewheel')type='DOMMouseScroll'; object.addEventListener(type, listener, false)}
	else { object.attachEvent("on"+type, listener); }
};
UI.delEvent=function(object, type, listener){
	if (object.removeEventListener) {if(type=='mousewheel')type='DOMMouseScroll'; object.removeEventListener(type, listener, false)}
	else object.detachEvent('on'+type, listener);
};
UI.stopEvent=function(event) {
	var e=event || window.event;
	if(e.preventDefault) {e.preventDefault(); e.stopPropagation(); }
	else {e.returnValue = false; e.cancelBubble = true;}
};
UI.getEventWheel=function(e){
	var delta=0;
	if(e.wheelDelta) delta=e.wheelDelta/120;
	else if(e.detail) delta=-e.detail/3;
	return delta;
};
UI.getBrowser=function(){
	var ua=navigator.userAgent.toLowerCase();
	var opera=/opera/.test(ua)
	UI._browser={
		ie:!opera && /msie/.test(ua),
		ie_ver: parseFloat(((ua.split('; '))[1].split(' '))[1]),
		opera:opera,
		ff:/firefox/.test(ua),
		gecko:/gecko/.test(ua)		
	};
	return UI._browser;
};
UI.resizeIframe=function(iframe_id) {
	var h = (self.innerHeight) ? document.documentElement.offsetHeight : document.body.scrollHeight;
	try{parent.UI.$(iframe_id).style.height = h+"px";}catch(e){}
};
UI.rollOver=function(s) {
	var img=(typeof(s)=="string") ? img=UI.$(s):s;
	img.onmouseover=function() { UI.rollOver.over(img) }
	img.onmouseout=function() { UI.rollOver.out(img) }
}
UI.rollOver.over=function(img){ var src=img.src; img.src=src.replace("_off.","_on."); }
UI.rollOver.out=function(img){ var src=img.src; img.src=src.replace("_on.","_off."); };

UI.popUp=function(url,name,w,h,scroll,resize,status,center){
	if(!scroll) scroll=0;
	if(!resize) resize=0;
	if(!status) status=1;
	if(center)	
	{
		var x = (screen.width - w) / 2;
		var y = (screen.height - h) / 2;
		center = ",top="+y+",left="+x;
	}
	return window.open(url,name,"width="+w+",height="+h+",status="+status+",resizable="+resize+",scrollbars="+scroll+center);
};
UI.setCookie=function(name, value, expires, path, domain, secure){
	if(expires){
		var d=new Date(); d.setDate(d.getDate()+expires);
		expires = d.toGMTString();
	}
	document.cookie = name + "=" + escape(value) +
	  ((expires) ? "; expires=" + expires : "") +
	  ((path) ? "; path=" + path : "") +
	  ((domain) ? "; domain=" + domain : "") +
	  ((secure) ? "; secure" : "");
};
UI.getCookie=function(name){
	name += "=";
	cookie = document.cookie + ";";
	start = cookie.indexOf(name);
	if (start != -1)
	{
		end = cookie.indexOf(";",start);
		return unescape(cookie.substring(start + name.length, end));
	}
	return "";
};
UI.embedSWF=function(f,w,h,options){
	var param={	id:"UIswf_"+f,quality:'high',bgcolor:'#ffffff',allowScriptAccess:'always'}
	Object.extend(param, options);

	var id='id="'+param.id+'"';
	var name = 'name="'+param.id+'"';
	var p='',e='';	

	for(i in param) 
	{
		if(i=='id')continue;
		p+='<param name="'+i+'" value="'+param[i]+'">\n';
		e+=i+'="'+param[i]+'" ';
	}

	var s='<object '+id+' width="'+w+'" height="'+h+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0">';
	s+='<param name="movie" value="'+f+'">'+ p;	
	s+='<embed '+name+' src="'+f+'" width="'+w+'" height="'+h+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" '+e+'/>';
	s+='</object>';
	document.write(s);
	return s;
};
UI.embedWMP=function(f,w,h,options){
	var param={	id:"UIwmp_"+f,autostart:'1',showstatusbar:'-1',transparentatstart:'1',displaybackcolor:'0',uimode:'full'}
	Object.extend(param, options);

	var id='id="'+param.id+'" name="'+param.id+'"';
	var p='',e='';
	for(i in param) 
	{
		if(i=='id')continue;
		p+='<param name="'+i+'" value="'+param[i]+'">\n';
		e+=i+'="'+param[i]+'" ';
	}
	var s='<object '+id+' width="'+w+'" height="'+h+'" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" style="filter:gray();">';
	s+='<param name="filename" value="'+f+'">'+ p;
	s+='<embed '+id+' src="'+f+'" width="'+w+'" height="'+h+'" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/mediaplayer/" '+e+' />';
	s+='</object>';
	document.write(s);
};
UI.getStyle=function(el, style) {
	var value = el.style[style];
	if(!value)
	{
		if(document.defaultView && document.defaultView.getComputedStyle) 
		{
			var css = document.defaultView.getComputedStyle(el, null);
			value = css ? css[style] : null;
		} 
		else if (el.currentStyle) value = el.currentStyle[style];
	}
	return value == 'auto' ? null : value;
};
UI.getPosition=function(el)
{
	var left=0,top=0;
	while(el)
	{
		left+=el.offsetLeft || 0;
		top+=el.offsetTop || 0;
		el=el.offsetParent;
	}
	return {'x': left, 'y': top}
};
UI.getScroll=function () {
	if(document.all && typeof document.body.scrollTop != "undefined")
	{
		var cont=document.compatMode!="CSS1Compat"?document.body:document.documentElement;
		return {left:cont.scrollLeft, top:cont.scrollTop, width:cont.clientWidth, height:cont.clientHeight}
	}
	else 
		return {left:window.pageXOffset, top:window.pageYOffset, width:window.innerWidth, height:window.innerHeight}
};
UI.submit=function(f) { 
	var form=UI.$(f)||document.forms[f];	
	if(form.onsubmit && !form.onsubmit()) return;
	form.submit();
};
UI.focus=function(n) { 
	var s=null;
	s = UI.$(n)||document.getElementsByName(n)[0];
	s.focus();
};
UI.$F=function(n) {
	var s=null;
	s = UI.$(n)||document.getElementsByName(n)[0];
	if(s.type=="checkbox")
	{
		var c=[];
		var r=document.getElementsByName(n);
		for(var i=0;i<r.length; i++) if(r[i].checked) c.push(r[i].value);
		return (c.length>0)?c:"";
	}
	else if(s.type=="radio")
	{
		var r=document.getElementsByName(n);
		for(var i=0;i<r.length; i++) if(r[i].checked) return r[i].value;
		return "";
	}
	return s.value;
};
UI.length=function(str,len,tail){
	if(!tail) tail="";
	var l=0, c=0, l2=0, u="", s="";
	if(len>0) l2=len;	
	for(var i=0;u=str.charCodeAt(i);i++)
	{
		if (u>127) l+=2;
		else l++;
		if(l2) {
			s+=str.charAt(i); 
			if(l>=l2)
			{
				if(l>l2) s=s.slice(0,-1);
				return s+tail;
			}
		}		
	}
	return l2 ? s:l;
};
UI.html2str=function(s,m){
	var s1=["&amp;","&#39;","&quot;","&lt;","&gt;"];
	var s2=["&","'","\"","<",">"];
	var s3=[];
	if(m) {s3=s1;s1=s2;s2=s3;}
	for(var i in s1) s=s.replace(new RegExp(s1[i],"g"), s2[i]);
	return s;
};
UI.setOpacity=function(el,value){
	el.style.filter="alpha(opacity="+value+")";
	el.style.opacity=(value/100);
	el.style.MozOpacity=(value/100);
	el.style.KhtmlOpacity=(value/100);
};
UI.indexOf=function(arr,s){
	for(var i=0;i<arr.length; i++) if(arr[i]==s) return i;
	return -1;
};
UI.resizeImage=function(img,w,h){
	var t = new Image();
	t.src=img.src;	
	if(t.width==0 || t.height==0) return;
	if(t.width>w || t.height >h)
	{
		img.width=w;img.height=h;
		if((t.width/w) > (t.height/h) )	img.height=Math.round(t.height * (w / t.width));
		else img.width = Math.round(t.width *  (h / t.height));
	}
	else
	{
		img.width=t.width;
		img.height=t.height;
	}
	if(img.width==0 || img.height==0) setTimeout(function(){UI.resizeImage(img,w,h)},500);
};
UI.StringBuffer=function(){this.buffer=new Array()}
UI.StringBuffer.prototype={append:function(s){this.buffer.push(s)},toString:function(){return this.buffer.join("")}};
UI.parseQuery=function(s){
	var str=s||location.search.substr(1);
	var r={},t=[];
	var a=str.split('&');
	for(var i=0;i<a.length;i++){t=a[i].split("=");r[t[0]] = t[1];}
	return r;
};
UI.addComma=function(s){
	s+='';
	var re = new RegExp('(-?[0-9]+)([0-9]{3})'); 
	while(re.test(s)) s = s.replace(re, '$1,$2'); 
	return s;
}; 
UI.mouseOut=function(e, obj){
	var to = !!e.relatedTarget?e.relatedTarget:event.toElement; 
	while(to) {				
		if(to == obj) return false; 
		to = to.parentNode; 
	} return true;
	UI.stopEvent((e)?e:event);
};


// MODAL
/**
2007-09-18
*/
UI.Modal=function(url,options){
	this.options={
		type:'image',
		alt:'',
		loading:false,
		opacity:30,
		width:0,height:0
	};
	Object.extend(this.options, options);
	var options=this.options;

	if(!UI.$('UIModalB')) UI.Modal.print();
	UI.setOpacity(UI.$('UIModalB'), options.opacity);
	
	UI.Modal.setB();
	if(options.loading) UI.Modal.center(UI.$('UIModalL'));

	if(options.type=='image')
	{
		UI.$('UIModalF').innerHTML = '<img id="UIModalImage" src="'+url+'" alt="'+options.alt+'" />';
		if(options.loading) UI.$('UIModalImage').style.display='none';
		UI.addEvent(UI.$('UIModalImage'), 'load', UI.Modal.onload);
	}
	else if(options.type=='iframe')
	{		
		UI.$('UIModalF').innerHTML = '<iframe name="UIModalIframe" id="UIModalIframe" src="'+url+'" '+options.status+'></iframe>';
		if(options.loading) 
		{
			UI.$('UIModalIframe').style.display='none';
			UI.addEvent(UI.$('UIModalIframe'), 'load', UI.Modal.onload);
		}
		UI.Modal.center(UI.$('UIModalF'));
	}
	UI.Modal.self=this;
	UI.addEvent(UI.$('UIModalB'), 'click', UI.Modal.reset);
	UI.addEvent(window,'resize', UI.Modal.onresize);
	UI.addEvent(window,'scroll', UI.Modal.onscroll);
};
UI.Modal.self={};
UI.Modal.onload=function(){
	UI.$('UIModalL').style.display='none';
	var pos=UI.getScroll();
	UI.Modal.center(UI.$('UIModalF'));	
	if(UI.Modal.self.options.type=='image')
	{
		UI.$('UIModalImage').style.display='block';
		UI.resizeImage(UI.$('UIModalImage'),pos.width,pos.height);	
	}
	else 
	{
		UI.$('UIModalIframe').style.display='block';
	}
	UI.Modal.center(UI.$('UIModalF'));
};
UI.Modal.print=function(){
	var d=document.createElement('div');
	var s='';
	s+='<div id="UIModalB" style="z-index:99998;width:100%;height:100%;position:absolute;display:none;background-color:#000;"></div>';
	s+='<div id="UIModalF" style="z-index:99999;position:absolute;display:none;"></div>';
	s+='<div id="UIModalL" style="z-index:99999;display:none;position:absolute;border:2px solid gray;">loading...</div>';
	d.innerHTML=s;
	document.getElementsByTagName('body')[0].appendChild(d);		
};
UI.Modal.setB=function(){
	var w=UI.$('UIModalB');
	var pos=UI.getScroll();
	w.style.top=pos.top+'px';
	w.style.left=pos.left+'px';
	if(document.all)
	{
		w.style.width=pos.width+'px';
		w.style.height=pos.height+'px';
	}
	w.style.display='block'	
};
UI.Modal.center=function(el){
	el.style.display='block';
	var pos=UI.getScroll();
	el.style.left=pos.width/2-el.offsetWidth/2+pos.left+'px';
	el.style.top=pos.height/2-el.offsetHeight/2+pos.top+'px';
};
UI.Modal.reset=function(){
	UI.Modal.self=null;
	UI.$('UIModalF').innerHTML='';
	UI.$('UIModalB').style.display='none';
	UI.$('UIModalF').style.display='none';
	UI.$('UIModalL').style.display='none';
	UI.delEvent(window,'resize',UI.Modal.onresize);
	UI.delEvent(window,'scroll',UI.Modal.onscroll);
};
UI.Modal.onresize=function(){
	var pos=UI.getScroll();
	if(UI.Modal.self.options.type=='image') UI.resizeImage(UI.$('UIModalImage'),pos.width,pos.height);
	UI.Modal.center(UI.$('UIModalF'));
	UI.Modal.setB();
};
UI.Modal.onscroll=function(){
	UI.Modal.onresize();
};
UI.toolTip=function(event, options) {

	var e=event || window.event;
	var el= e.target || e.srcElement;

	el.options={
		className:'UItoolTip',
		mousemove:UI.toolTip.mousemove
	};
	Object.extend(el.options, options);

	if(!el.UItoolTip) 
	{
		el.stitle = el.alt || el.title || el.stitle;
		el.title = el.alt = "";
		if(!el.stitle) return;
		
		var d = document.createElement("DIV");		
		d.className = el.options.className;
		d.style.position="absolute";	
		UI.$('CookToolTip').appendChild(d);
		
		el.UItoolTip=d;
		el.UItoolTip.innerHTML=el.stitle;
	}
	var scroll = UI.getScroll();
	var x = (e.clientX+scroll.left+10) + "px";
	var y = (e.clientY+scroll.top+10) + "px";
	el.UItoolTip.style.left = x;
	el.UItoolTip.style.top =  y;
	el.UItoolTip.style.visibility="visible";

	UI.addEvent(el,'mouseout',UI.toolTip.mouseout);
	if(el.options.mousemove) UI.addEvent(document, "mousemove", el.options.mousemove);
}

document.write('<div id="CookToolTip"></div>');
UI.toolTip.seq = 1;
UI.toolTip.mousemove=function(event){
	var e=event || window.event; var el= e.target || e.srcElement;
	var scroll = UI.getScroll();
	el.UItoolTip.style.left=(e.clientX+scroll.left)+"px";
	el.UItoolTip.style.top=(e.clientY+scroll.top+20)+"px";
};
UI.toolTip.mouseout=function(event){
	var e=event || window.event; var el= e.target || e.srcElement;
	if(!el.UItoolTip) return;
	el.UItoolTip.style.visibility="hidden";
	if(el.options.mousemove) UI.delEvent(document, "mousemove",  el.options.mousemove);	
};

function Paging(prefix, lpp, total) {
	var currentPage = 1;
	var rest = 0;
	document.getElementById(prefix+'Prev').onclick = function(addPage){paginate(-1);}
	document.getElementById(prefix+'Next').onclick = function(addPage){paginate(1);}
	
	var paginate = function(addPage) {
		var page = currentPage + addPage;
		rest = total - lpp * page;
		if (page < 1) {paginate(Math.round(rest/lpp-1));return;}
		if (rest <= lpp * -1) {paginate((currentPage-1)*-1);return;}
		for(i=0;i<total;i++) {
			try { 
				document.getElementById(prefix + '_slide_' + (i + 1)).style.display = (lpp * (page - 1) <= i && lpp * page > i ) ? 'block' : 'none';
			} catch(e){}
		}
		currentPage = page;
		setButton();
	}
	var setButton = function() {
		document.getElementById(prefix+'Prev').className = "prevOn";
		document.getElementById(prefix+'Next').className = "nextOn";

		if (currentPage == 1) {// 첫 page일 경우 prev를 disabled로
			document.getElementById(prefix+'Prev').className = "prevOff";
		}
		
		if (rest > lpp * -1 && rest <= 0) { // 마지막 page일 경우
			document.getElementById(prefix+'Next').className = "nextOff";
		}
	}
	paginate(0);
}


UI.Ajax = function(options) {
	this.options={
		method:'GET',
		param:'',
		onComplete:null,
		onError:null,
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		encoding:'UTF-8'
	}
	Object.extend(this.options, options);
	if(this.options.url) this.send();
};
UI.Ajax.prototype={
	getReq:function(){
		var req=null;
		try { req = new XMLHttpRequest(); }
		catch(e)
		{
			try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
			catch(e)
			{
				try { req = new ActiveXObject("Microsoft.XMLHTTP"); }
				catch(e) { }
			}
		}
		return req;
	},
	send:function(){
		this.req = this.getReq();	
		var op=this.options;
		var url=op.url;
		var param=op.param;
		var method=op.method.toUpperCase();
		if(method=='GET' && param) url=url+"?"+param;
		this.req.open(method, url, op.asynchronous);
		this.req.setRequestHeader('Content-Type', op.contentType+';charset='+op.encoding);
		
		var self = this;
		this.req.onreadystatechange = function() { self.onStateChange.call(self) }
		this.req.send(method=='POST'?param:null);
	},
	onStateChange: function() {
		if(this.req.readyState==4)
		{
			if(this.req.status=="200") this.options.onComplete(this.req);
			else
			{
				if(this.options.onError) this.options.onError(this.req);
//				else alert("서버에러입니다! 잠시후에 다시 시도하세요! "+this.req.status);
			}				
		}
	}
};



/*---------------------------------*/
//	mc : mizcook
/*---------------------------------*/
var mc = {};

// 레시피 인쇄하기
mc.print_recipe = function(articleId,viewType){
	// opt : total / shopping
	var w = (viewType == 'total') ? 760 : 579;
	window.open('http://board.miznet.daum.net/gaia/do/cook/recipe/mizr/print/read?articleId=' + articleId + '&bbsId=Mc001&viewType=' + viewType, 'recipe_print', 'width='+ w + ',height=600,scrollbars=1');
}
// 미즈쿡 일반 공통 인쇄하기 화면
mc.print_page = function(bbsId, articleId){
	window.open('http://board.miznet.daum.net/gaia/do/cook/print/read?articleId=' + articleId + '&bbsId=' + bbsId, 'article_print', 'width=760,height=600,scrollbars=1');	
}
mc.toggle_prints = function(e,opt,obj){
	var evt = e || window.event;
	if(obj==undefined){
		var tgt = 'prints';
		if(e.type == 'click'){
			if(UI.getBrowser().ie){
				var e_pos = UI.getPosition(e.srcElement);
				var mom_pos = UI.getPosition(e.srcElement.parentNode.parentNode);
			} else {
				var e_pos = UI.getPosition(e.target);
				var mom_pos = UI.getPosition(e.target.parentNode.parentNode);
			}
			UI.$(tgt).style.left = e_pos.x - mom_pos.x + 'px';			
		}
	} else {
		var tgt = obj;
		UI.$(obj).style.left = UI.$('bt_read_print').offsetLeft - 16 + 'px';
	}
	UI.$(tgt).style.display = (opt=='show') ? 'block' : 'none';
	
	if (evt.stopPropagation) { evt.stopPropagation();} else {evt.cancelBubble = true;} 		
}
mc.switch_feature = function(no){
 	for(i=1;i<=3;i++){
 	 	UI.$('feature'+i).style.display = (no==i) ? 'block' : 'none';
 	 	UI.$('feature_button'+i).className = (no==i) ? 'on' : '';
 	}
 	if(no==2){UI.$('feature_button1').className += 'no_line';}
 	if(no==3){UI.$('feature_button2').className += 'no_line';}
 		
	UI.$('feature_button1').className = UI.$('feature_button1').className + ' first';
	if(no!=3){UI.$('feature_button3').className = 'last';}
}

// 캘린더 인쇄하기 cl : m or d(monthly daily)
mc.print_calendar = function(cl, ymd){
	var f = (cl=='m') ? 'Monthly' : 'Daily';
	window.open('http://cook.miznet.daum.net/calendar'+f+'Recipe.do?ymd='+ymd+'&print=y', 'calendar_print', 'width=854,height=600,scrollbars=1');
}
// 레시피올리기에서 취소하는 경우
mc.goback = function(){if(document.referrer){location.href=document.referrer;} else {window.history.go(-1);}}

mc.toggle_detail_layer = function(link, tgt){
	if(tgt.style.display=='block'){mc.hide_detail_layer(link,tgt);}else{mc.show_detail_layer(link,tgt);}
	return false;
}
mc.hide_detail_layer = function(link, tgt){tgt.style.display = 'none';link.className = 'arrow_down';}
mc.show_detail_layer = function(link, tgt){tgt.style.display = 'block';link.className = 'arrow_up';}

mc.hide_all_detail_layer = function(obj){mc.hide_detail_layer(UI.$('selector_class'),obj);mc.hide_detail_layer(UI.$('selector_time'),obj);mc.hide_detail_layer(UI.$('selector_difficulty'),obj);}


mc.attach_detail_layers = function(){
	// 요리종류
	
	var link_div = document.createElement('div');link_div.className = 'detail_layer';link_div.setAttribute('class','detail_layer');
	document.getElementsByTagName('body')[0].appendChild(link_div);
	
	UI.addEvent(UI.$('selector_class'), 'click', function(){
			var link = UI.$('selector_class');
			link_div.setAttribute('id','layer_class');
			if(link.className=='arrow_up'){mc.hide_all_detail_layer(link_div);return false;} else {mc.hide_all_detail_layer(link_div);}
			var html = '';
			for(i=0;i<classList.length;i++){html += '<li><a href="http://board.miznet.daum.net/gaia/do/cook/recipe/mizr/list?bbsId=MC001&objCate1=' + classList[i].id + '&sortKey=depth&forceTalkro=T">' + classList[i].name + '</a></li>';}
			link_div.innerHTML = '<ul>' + html + '</ul>';
			var pos = UI.getPosition(link);
			link_div.style.top = pos.y + 15 + 'px';link_div.style.left = pos.x + 'px';
			UI.addEvent(link_div, 'mouseout', function(){if(UI.mouseOut(arguments[0],link_div)){mc.hide_detail_layer(link,link_div);}});			
			mc.toggle_detail_layer(link,link_div);return false;
		}
	);
	
	UI.addEvent(UI.$('selector_time'), 'click', function(){
			var link = UI.$('selector_time');
			link_div.setAttribute('id','layer_time');
			if(link.className=='arrow_up'){mc.hide_all_detail_layer(link_div);return false;} else {mc.hide_all_detail_layer(link_div);}
			var html = '';
			for(i=0;i<timeList.length;i++){html += '<li><a href="http://cook.miznet.daum.net/search/detailSearch.do?cookingtime_cate=' + timeList[i].id + '">' + timeList[i].name + '</a></li>';}
			link_div.innerHTML = '<ul>' + html + '</ul>';
			var pos = UI.getPosition(link);
			link_div.style.top = pos.y + 15 + 'px';link_div.style.left = pos.x + 'px';
			UI.addEvent(link_div, 'mouseout', function(){if(UI.mouseOut(arguments[0],link_div)){mc.hide_detail_layer(link,link_div);}});
			mc.toggle_detail_layer(link,link_div);return false;
		}
	);


	UI.addEvent(UI.$('selector_difficulty'), 'click', function(){
			var link = UI.$('selector_difficulty');
			link_div.setAttribute('id','layer_difficulty');
			if(link.className=='arrow_up'){mc.hide_all_detail_layer(link_div);return false;} else {mc.hide_all_detail_layer(link_div);}
			var html = '';
			for(i=0;i<difficultyList.length;i++){html += '<li><a href="http://cook.miznet.daum.net/search/detailSearch.do?difficulty=' + difficultyList[i].id + '">' + difficultyList[i].name + '</a></li>';}
			link_div.innerHTML = '<ul>' + html + '</ul>';
			var pos = UI.getPosition(link);
			link_div.style.top = pos.y + 15 + 'px';link_div.style.left = pos.x + 'px';
			UI.addEvent(link_div, 'mouseout', function(){if(UI.mouseOut(arguments[0],link_div)){mc.hide_detail_layer(link,link_div);}});
			mc.toggle_detail_layer(link,link_div);return false;
		}
	);
}

mc.zzim = function(){
	var f = UI.$('form_add_scrap');
	var popup = window.open('about:blank', 'popup_zzim', 'width=375,height=250,scrollbars=0');
	f.target = 'popup_zzim';
	f.submit();

}

// clipboard로 복사
//source : zeroclipboard ( http://code.google.com/p/zeroclipboard/ )
UI.Clipboard = {
		movieId: "clipboardSwf",
		moviePath: "http://img-contents.daum-img.net/miznet9/2008_home/mizcook/common/CopyClipboard.swf",
		init: function( width, height, text ){
	        this.setText( text );
			var html = this.getHTML( width, height );
			document.write( html );
		},
		setText: function( text ){
	        this.clipText = text;
		},
		dispatch: function( id, type, args ) {
	        if( type == "load" ){
	            if( !this.movie ){ 
	                this.movie = document.getElementById( this.movieId );
	            }
	            this.movie.setText( this.clipText  );
	        
			} else if( type == "complete" ){
	            
				alert("주소가 복사되었습니다.");
			}
		},
		getHTML: function(width, height) {
			// return HTML for movie
			var html = '';
			var flashvars = 'id=' + this.movieId + 
				'&width=' + width + 
				'&height=' + height;
				
			if (navigator.userAgent.match(/MSIE/)) {
				// IE gets an OBJECT tag
				var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
				html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+this.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
			}
			else {
				// all other browsers get an EMBED tag
				html += '<embed id="'+this.movieId+'" src="'+this.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" ></embed>';
			}
			return html;
		}
	};
