function getCookies(name)
{
	var pcookie = document.cookie.split("; ");
	for (var i=0; i < pcookie.length; i++)
	{
		var values = pcookie[i].split("=");
		if (name == values[0])
			return unescape(values[1]);
	}
	return null;
}

function checkLogin()
{
	if(!getCookies('SMSESSION') || getCookies('SMSESSION') == "LOGGEDOFF" || !getCookies('SM_USER') || !getCookies('dz_info'))
	{
		return false;
	}
	else 
	{
		return true;
	}
}

function dizzoSearch () {
//		srchForm = document.forms.srch2;
	srchForm = document.srch2;

	if (checkLogin() == false) {
		alert('ÁÖ°¡Á¶È¸ ±â´ÉÀº ·Î±×ÀÎ ÈÄ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.');
		var loginurl = "http://membership.chosun.com/login/protect_sso/sso_user_info.jsp";
//		window.top.location.href = loginurl + "?returl=" + escape("http://m-stock1.chosun.com/concert/dizzo/connect.jsp?itemmenu=/concert/dizzo/i/chart&select=chart&code=" +  srchForm.keyword.value);
		window.top.location.href = loginurl + "?returl=" + escape("http://stock.chosun.com/concert/dizzo/connect.jsp?itemmenu=/concert/dizzo/i/chart&select=chart&code=" +  srchForm.keyword.value);
		//window.top.location.href = loginurl + "?returl=" + escape(location.href);

		return false;
	}

	//°Ë»ö¾î È®ÀÎ
	if (srchForm.keyword.value == "") {
		alert ("Á¾¸ñ or ÄÚµå¸¦ ÀÔ·ÂÇÏ¼¼¿ä!");

		srchForm.keyword.focus();
		return false;
	}
	srchForm.code.value = srchForm.keyword.value;
	srchForm.action  = "http://m-stock1.chosun.com/concert/dizzo/connect.jsp";
	srchForm.submit();
}
document.write ("<table width='240' border='0' cellspacing='0' cellpadding='0'>");
document.write ("<form name=srch2 method=get action=''  onsubmit='return dizzoSearch()'>");
document.write ("  <input type=hidden name='itemmenu' value='/concert/dizzo/i/chart'>");
document.write ("  <input type=hidden name='select' value='chart'>");
document.write ("  <input type=hidden name='code'>");
document.write ("                    <tr>"); 
document.write ("                      <td width='54'><img src='http://businesstv.chosun.com/images/200801/money_main_3.jpg' width='54' height='34'></td>");
document.write ("                      <td background='http://businesstv.chosun.com/images/200801/money_main_4.jpg'>"); 
document.write ("                        <table border='0' cellspacing='0' cellpadding='0'>");
document.write ("                          <tr>"); 
document.write ("                            <td style='padding:0 0 0 3;'>"); 
document.write ("                              <input type='text' name='keyword' size='17'>");
document.write ("                            </td>");
document.write ("                            <td style='padding:0 0 0 5;'><input type='image' src='http://businesstv.chosun.com/images/200801/bt_search3.gif' width='36' height='18' border='0' style='cursor:pointer'></a></td>");
document.write ("                          </tr>");
document.write ("                        </table>");
document.write ("                      </td>");
document.write ("                    </tr>");
document.write ("                  </form></table>");