
var theTarget = "_blank";

function goThere(){
    if(!document.theForm.theMenu.selectedIndex==""){
    window.open(document.theForm.theMenu.options[document.theForm.theMenu.selectedIndex].value,theTarget,"");}
	}

//½É¹úÀÌ¾ß±â ·¹ÀÌ¾î

function bluring(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 

//Tab Menu
function DisplayMenu(index) {
    for (i=1; i<=6; i++) {
        if (index == i) {
            thisMenu = eval("menu" + index + ".style");
            thisMenu.display = "";
        } 
        else {
            otherMenu = eval("menu" + i + ".style"); 
            otherMenu.display = "none"; 
        }
	}

//	document.all["menuAllButton"].style.display = "";
	menuAllButton.style.display = "";
}

//¸ðµç ·¹ÀÌ¾î º¸¿©ÁÖ½Ã
function DisplayAllMenu() {
	for (i=1;i<=6; i++) {
            thisMenu = eval("menu" + i + ".style");
            thisMenu.display = "";
	}

//	document.all["menuAllButton"].style.display = "none";
	menuAllButton.style.display = "none";
}


//½É¹úÀÌ¾ß±â
function DisplayMenu_01(index,cut) {
    for (i=1; i<=cut; i++)
        if (index == i) {
            thisMenu = eval("Cmenu" + index + ".style");
            thisMenu.display = "";
        } 
        else {
            otherMenu = eval("Cmenu" + i + ".style"); 
            otherMenu.display = "none"; 
        }
}

// faq ·¹ÀÌ¾î
function mm_findobj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexof("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=mm_findobj(n,d.layers[i].document);
  if(!x && d.getelementbyid) x=d.getelementbyid(n); return x;
}

function mm_showhidelayers() { //v6.0
  var i,p,v,obj,args=mm_showhidelayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=mm_findobj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }


}
function mm_nbgroup(event, grpname) { //v6.0
  var i,img,nbarr,args=mm_nbgroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = mm_findobj(args[2])) != null && !img.mm_init) {
      img.mm_init = true; img.mm_up = args[3]; img.mm_dn = img.src;
      if ((nbarr = document[grpname]) == null) nbarr = document[grpname] = new array();
      nbarr[nbarr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = mm_findobj(args[i])) != null) {
        if (!img.mm_up) img.mm_up = img.src;
        img.src = img.mm_dn = args[i+1];
        nbarr[nbarr.length] = img;
    } }
  } else if (event == "over") {
    document.mm_nbover = nbarr = new array();
    for (i=1; i < args.length-1; i+=3) if ((img = mm_findobj(args[i])) != null) {
      if (!img.mm_up) img.mm_up = img.src;
      img.src = (img.mm_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.mm_up);
      nbarr[nbarr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.mm_nbover.length; i++) {
      img = document.mm_nbover[i]; img.src = (img.mm_dn) ? img.mm_dn : img.mm_up; }
  } else if (event == "down") {
    nbarr = document[grpname];
    if (nbarr)
      for (i=0; i < nbarr.length; i++) { img=nbarr[i]; img.src = img.mm_up; img.mm_dn = 0; }
    document[grpname] = nbarr = new array();
    for (i=2; i < args.length-1; i+=2) if ((img = mm_findobj(args[i])) != null) {
      if (!img.mm_up) img.mm_up = img.src;
      img.src = img.mm_dn = (args[i+1])? args[i+1] : img.mm_up;
      nbarr[nbarr.length] = img;
  } }
}


// ·¹ÀÌ¾îÃ³¸® ½ºÅ©¸³Æ®
var previd = null;

function displaysub(subid) {

	if (previd != null) {
		if (previd != subid) {
			previd.style.display = "none";
		}
	}

	if (subid.style.display == "none") {
		subid.style.display = "block";
	} else {
		subid.style.display = "none";
	}
	previd = subid;
}

function goLogin(url){
	if(url == null){
		document.location = URL_ROOT + "customer_n/login.asp?loginReturnUrl=" + escape(CURRENT_PAGE);
	}else{
		document.location = URL_ROOT + "customer_n/login.asp?loginReturnUrl=" + escape(url);
	}
}

function goDirectLogin(p_current_page, p_sso_logininfo){
	document.location = URL_ROOT + "/common/xt_login.asp?loginReturnUrl=" + escape(p_current_page) + "&loginParam=" + escape(p_sso_logininfo);
}

function syncSSO__(){
	if(ISLOGINED != SSO_LOGINED){
		if(ISLOGINED==true){
			document.location = URL_ROOT + "/member/xt_logout.asp?loginReturnUrl=" + escape(CURRENT_PAGE);
		}else{			
			document.location = URL_ROOT + "/common/xt_login.asp?loginReturnUrl=" + escape(CURRENT_PAGE) + "&loginParam=" + escape(SSO_LOGININFO);
			//goDirectLogin(CURRENT_PAGE, SSO_LOGININFO);
		}
	}
}

function syncSSO(k){
    //alert(SSO_LOGINED);
	if(ISLOGINED != SSO_LOGINED){
		if(ISLOGINED==true){
			document.location = "/member/xt_logout.asp?loginReturnUrl=" + escape(CURRENT_PAGE);
		}else{
			document.location = URL_ROOT + "/common/xt_login.asp?loginReturnUrl=" + escape(CURRENT_PAGE) + "&loginParam=" + escape(SSO_LOGININFO) + "&gb=" + k;
		}
	}
}

function goLogout(){
	document.location = "/member/xt_logout.asp?loginReturnUrl=" + escape(CURRENT_PAGE);
}

function goJoin(){
	document.location = URL_ROOT + "customer_n/join/join_01.asp";
}
function goModify(){
	document.location = URL_ROOT + "customer_n/my_page.asp";
}

function init_start(){
	// code here ...  init()ÇÔ¼ö°¡ ÇØ´çÆäÀÌÁö³»¿¡¼­ overridingµÇ¾îÁö±â ¶§¹®¿¡ ±× ÀÌÀü¿¡ ½ÇÇàÇÏ°íÀÚ ÇÏ´Â ±â´ÉÀ» ¿©±â¿¡ ³ÖÀ¸½Ã¿À	
		
	init();

	//setTimeout("popupEvent();", 2000);	
}

function init(){

}

function jinro_event(value){
	if (value=="1")	window.open('http://www.chamisulfresh.com/evt/ing_evt_list.asp');
	if (value=="2") window.open('http://www.chamisulfresh.com/best/best_food.asp');
}

function policy(){

	aPopup_pageUrl = "policy.asp";

	var aPopup = window.open(aPopup_pageUrl, "win_policy", "top=0,left=0,width=500, height=332,scrollbars=no,resizable=no");


    if (aPopup == null)
    {
		alert("°³ÀÎÁ¤º¸º¸È£Á¤Ã¥À» º¸³»½Ç·Á¸é Â÷´ÜµÈ ÆË¾÷Ã¢À» Çã¿ëÇØ ÁÖ½Ê½Ã¿À.");
	}

	aPopup.focus();
	
}

function event_link(value){
	if (value=="1")	 window.location.href='/sweet/reply_list.asp';
}
