function getCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return null;
}

function setCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

var article_fontSize = "";

function initFont()
{
	try
	{
		article_fontSize = fn_GetCookie("Pz_article_fontSizePx");
		
		if(isNaN(article_fontSize) == true || article_fontSize > 20 || article_fontSize < 6)
			article_fontSize = 13;
	}
	catch(e)
	{
		article_fontSize = 13;
	}
}

function setFont(article_fontSize)
{
	try
	{
		//document.getElementById("articleBody").className = "article0"+article_fontSize;

		if(document.getElementById("articleBody"))
			document.getElementById("articleBody").style.fontSize = article_fontSize+"px";
			
		setFontCookie(article_fontSize);
		
		
	if(document.getElementById("debuggerField"))
{
	//alert(getCookie("Pz_article_fontSizePx"));
}

	}
	catch(e)
	{
	}
}	

function setFontCookie(article_fontSize)
{
	fn_SetCookie("Pz_article_fontSizePx", article_fontSize, 0, "/", "joins.com");
}	

//¸ÞÀÏ
function sendemail() {

	var sWinName = "emailarticle";
	var cScroll = 0;
	var cResize = 0;
	var cTool = 0;
	var sWinopts = 'left='+0+', top='+0+', width='+570+',height='+255+', scrollbars='+cScroll+', resizable='+cResize;
	var	aid = document.frmArticle.AID.value;
	var theForm = document.frmArticle;			
	window.open("about:blank",sWinName,sWinopts); 
	//theForm.action = "/email/email_article.asp?strTotalID="+retP;
	theForm.action = this.News_Domain+"/article/pop_article_sendemail.asp?aid="+aid;
	theForm.target = sWinName;
	theForm.submit();

}

//ÀÎ¼â
function sendprint(aid,ctg) {

	var sWinName = "printarticle";
	var cScroll = 1;
	var cResize = 1;
	var cTool = 1;
	var sWinopts = 'left='+0+', top='+0+', width='+700+', scrollbars='+cScroll+', resizable='+cResize;
	window.open(this.News_Domain+'/article/print_article_pop.asp?ctg='+ctg+'&AID='+aid,sWinName,sWinopts);	
}



function fontPlus()
{		        
	if (article_fontSize < 20)
	{
		article_fontSize = parseInt(article_fontSize) + 1; 
		
		setFont(article_fontSize); 
	}
}

function fontMinus()
{
	if (article_fontSize > 6) {
		article_fontSize = parseInt(article_fontSize) - 1; 
		setFont(article_fontSize); 
	}
}   



// ±â»ç Á¤Á¤ ¿äÃ»
function sendreq() {

	var sWinName = "mobilearticle";
	var cScroll = 0;
	var cResize = 1;
	var cTool = 1;
	var sWinopts = 'left='+0+', top='+0+', width='+610+', height='+400+',  scrollbars='+cScroll+', resizable='+cResize;
	var	aid = document.frmArticle.AID.value;
	//window.open('http://article01.joins.com/cp/send_article.asp?ctg='+ctg+'&AID='+aid,sWinName,sWinopts);	
	window.open(this.News_Domain+'/article/pop_article_fixmail.asp?aid='+aid,sWinName,sWinopts);	
}

function PatzziRecipe(cHref, cWidth, cHeight, cScroll ){
	
	if (isNaN(parseInt(cWidth))) cWidth =  800;
	if (isNaN(parseInt(cHeight))) cHeight =  600;
	if (isNaN(parseInt(cScroll))) cScroll =  1;
	
	var cResize = 0;
	var cTool = 0;

	var cName = 'SearchArticle';
	var sWinopts = 'left='+(screen.width-cWidth)/2+', top='+(screen.height-cHeight)/2+', width='+cWidth+',height='+cHeight+', scrollbars='+cScroll+', resizable='+cResize+', toolbar='+cTool;

	window.open( cHref,"", sWinopts );

}

	// ÆË¾÷Ã¢ ¼Ò½º
	function WinOpen(Url, Name, Left, Top, Width, Height, Toolbar, Menubar, Statusbar, Scrollbar, Resizable) {
		Toolbar_str	= Toolbar ? 'yes' : 'no';
		Menubar_str	= Menubar ? 'yes' : 'no';
		Statusbar_str = Statusbar ? 'yes' : 'no';
		Scrollbar_str = Scrollbar ? 'yes' : 'no';
		Resizable_str = Resizable ? 'yes' : 'no';
	
		window.open(Url,Name,'left='+Left+',top='+Top+',width='+Width+',height='+Height+',toolbar='+Toolbar_str+',menubar='+Menubar_str+',status='+Statusbar_str+',scrollbars='+Scrollbar_str+',resizable='+Resizable_str);
	}

	function article_contextMenu() {
	   alert("ÆÌÂî´Â ºÒÆßÀ» ½È¾îÇÕ´Ï´Ù.\n\nÆÌÂî ±â»ç´Â ¼ÒÁßÇÏ´Ï±î¿ä~ (^.*)");
	   return false;
	}

 function goSearchRecipe_()
 {
 	  var searchWord = document.getElementById('keyword').value ;
 	  if(searchWord=="")
 	  {
 	  	 alert("°Ë»öÇÒ ´Ü¾î¸¦ ³ÖÀ¸¼¼¿ä"); 
 	  	 document.getElementById('keyword').focus();
 	  	 return false;
 	  }
		window.location.href="http://channel.patzzi.joins.com/channel/food/new_recipy/happy_search.asp?leftchk=lf&keyword="+escape(searchWord);		             
 }