//   Á¦  ¸ñ : °øÅë¸ðµâ JavaScript
// »ç¿ë¹ý  : <script language="JavaScript" src="/admin/common.js"> < /script>

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function pop_open_scrollbars(url,p_name,p_height,p_width,chk_scrollbars)
{
	if(!chk_scrollbars) chk_scrollbars = "yes"
	var mm = window.open(url,p_name, 'resizable=no,scrollbars=' + chk_scrollbars + ',height=' + p_height + ',width=' + p_width);
	mm.focus();

}
function open_search(query)
{
	if(!query) return;
	pop_open_scrollbars('http://link.kipris.or.kr/link/AJAX/BTOTAL.jsp?Query=' + query + '&GU=KT','',520,820,'yes');
}
function open_search2(query)
{
	if(!query) return;
	pop_open_scrollbars('http://link.kipris.or.kr/link/AJAX/BTOTAL.jsp?Query=' + query + '&GU=KP','',520,820,'yes');
}

function open_search3(query)
{
	if(!query) return;
	pop_open_scrollbars('http://link.kipris.or.kr/link/AJAX/BTOTAL.jsp?Query=' + query + '&GU=KD','',520,820,'yes');
}

function open_zipcode(query){
	
	if(!query) return;
	pop_open_scrollbars('/renew/popup/post.asp' + query,'',407,422,'yes');
}

function open_patent_help(query)
{
	if(!query) return;
	pop_open_scrollbars('/renew/popup/post.asp' + query,'',450,442,'yes');
}

function scrap_movie(idx)
{
	pop_open_scrollbars('/myhompy/scrap_pop_movie.asp?mem_id=<%=mem_id%>&ms_idx=' + idx,'',265,400,'no');
}
                                                           

function show_movie(url,movie,image)
{
	pop_open_scrollbars("pop_movie_view.asp?s_url=" + url + "&s_movie=" + movie + "&s_image=" + image ,"",600,600)
}

function search_shop(retobject)
{
	pop_open_scrollbars("/popup/search_franchisor_pop.asp?ret_object=" + retobject ,"",340,420)
}

function regist_movie_load(retobject)
{
	pop_open_scrollbars("http://www.suplusting.com/popup/auto_register_pop1.asp?ret_object=" + retobject ,"",602,500)
//	PopupModal("/popup/auto_register_pop1.asp?ret_object=" + retobject ,"",602,500)
}

function regist_battle_popup(ms_idx)
{
	pop_open_scrollbars("/popup/battle_entry_pop.asp?ms_idx=" + ms_idx ,"",260,400,"no")
}
function regist_vote_popup(bl_idx)
{
	if(check_login)
		pop_open_scrollbars("/popup/battle_vote_pop.asp?bl_idx=" + bl_idx ,"",291,400,"no")
	else
	{
		var f = document.formTopSearch;
		f.action = "/member/member_login.asp";
		f.submit();
	}
	
}
function register_notice_popup()
{
	pop_open_scrollbars("/popup/register_notice_pop.asp" ,"",686,480,"no")
}
function no_page_popup()
{
	pop_open_scrollbars("/popup/no_page_pop.asp" ,"",235,400,"no")
}
function check_regist_battle_popup()
{
	if(check_login)
		pop_open_scrollbars("/battle/battle_register_pop.asp" ,"",320,400,"no")
	else
	{
		var f = document.formTopSearch;
		f.action = "/member/member_login.asp";
		f.submit();
	}
}

function PopupModal(url,p_height,p_width){ 
	window.showModelessDialog(url,null,"help=no;dialogWidth=" + p_width + "px;dialogHeight:" + p_height + "px; center:yes; status:yes; resizable:no;");
 } 
 
function show_emailrule(){ 
//	pop_open_scrollbars("/popup/email_rule.asp","",365,486,"no");

	msgWindow=window.open("/popup/email_rule.asp","","scrollbars=no,resizable=no,width=478,height=310");
	msgWindow.focus();

 } 
 
 function show_mydata(idx){ 
//	pop_open_scrollbars("/popup/email_rule.asp","",365,486,"no");

	msgWindow=window.open("/popup/mybrand_poppup.asp?t_idx=" + idx,"","scrollbars=no,resizable=no,width=520,height=500");
	msgWindow.focus();

 } 
  function show_mysrch(idx){ 
//	pop_open_scrollbars("/popup/email_rule.asp","",365,486,"no");

	msgWindow=window.open("/search/condition_pop.asp" ,"","scrollbars=no,resizable=no,width=520,height=500");
	msgWindow.focus();

 } 
  function show_reason(){ 
//	pop_open_scrollbars("/popup/email_rule.asp","",365,486,"no");

	msgWindow=window.open("/popup/reason_popup.asp" ,"","scrollbars=yes,resizable=no,width=520,height=500");
	msgWindow.focus();

 } 
function ShowFlash(obj,strMediaURL,obj_width,obj_height)
{
 var myObjectElement = document.createElement('<embed src="' + strMediaURL + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash" width="' + obj_width + '" height="' + obj_height + '"></embed>');
 obj.appendChild(myObjectElement);
 
} 
function popup_battle_compair(idx){ 
	msgWindow=window.open("/popup/battle_comparison_pop.asp?bl_idx=" + idx,"","scrollbars=no,resizable=no,width=710,height=643");
	msgWindow.focus();
} 

function popup_hompy_preview(getString){ 
	msgWindow=window.open("/myhompy/preview_pop.asp" + getString,"","scrollbars=yes,resizable=no,width=1020,height=760");
	msgWindow.focus();
}

function ShowScrapMovie(idx)
{
	pop_open_scrollbars('/popup/scrap.asp?ms_idx=' + idx,'',350,420,'yes');
}

function ShowScrapBoard(idx)
{
	pop_open_scrollbars('/popup/scrap_board.asp?hb_idx=' + idx,'',350,420,'yes');
}


//ÇÃ·¡½¬ ¸µÅ©

function link_m1() { document.location.href = "/music_box/"; } // ÀÎ»ç¸»
function link_m2() { document.location.href = "/hompy/"; } // ÀÎ»ç¸»
function link_m3() { document.location.href = "/knowhow/"; } // ÀÎ»ç¸»
function link_m4() { document.location.href = "/franchisor/"; } // ÀÎ»ç¸»

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//quickmenu ¼Ò½º

var nMenuTop = 0;				// ¸Þ´ºÀÇ »ó´Ü À§Ä¡°ª
var nMenuLeft = 0;			// ¸Þ´ºÀÇ ÁÂÃø À§Ä¡°ª
var nMenuMargin = 0;			// ¸Þ´ºÀÇ »ó´Ü ¿©¹é
var nScrollActivateSpeed = 2;	// ¿òÁ÷ÀÓ °¨Áö ¼Óµµ
var nScrollSpeed = 2;			// ¿òÁ÷ÀÓ ¼Óµµ
	
	function InitMenu()
	{
		Quick.style.top = document.body.scrollTop + nMenuTop;
		RefreshMenu();
		Quick.style.left = nMenuLeft;
	}
	
	function RefreshMenu()
	{
		var nMenuStartPoint, nMenuEndPoint, nMenuScrollAmount, nMenuRefreshTimer;

		nMenuStartPoint = parseInt(Quick.style.top, 10);
		nMenuEndPoint = document.body.scrollTop;
		if (nMenuEndPoint < nMenuMargin) nMenuEndPoint = nMenuMargin;

		if ( nMenuStartPoint != nMenuEndPoint )
		{
			nMenuScrollAmount = Math.ceil( Math.abs( nMenuEndPoint - nMenuStartPoint ) / 15 );
			Quick.style.top = parseInt(Quick.style.top, 10) + ( ( nMenuEndPoint < nMenuStartPoint ) ? -nMenuScrollAmount : nMenuScrollAmount );
			nMenuRefreshTimer = nScrollSpeed;
		}
		else
		{
			nMenuRefreshTimer = nScrollActivateSpeed;
		}

		setTimeout ("RefreshMenu();", nMenuRefreshTimer);
	}