/**
 * Copyright (c) 2004 by Samsung SDS Systems Inc
 * All rights reserved.
 * 
 * ÀÎºô¼îÇÎ ¸µÅ© ÀÚ¹Ù½ºÅ©¸³Æ® °øÅëÇÔ¼ö
 *
 *
 * @version 1.1, 2004/05/28
 * @version 1.2, 2006/01/16
 * @author reoha, reoha@empal.com
 */
 

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
} 

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_showHideLayers() { //v3.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_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}
 
//#À¯Æ¿¸Þ´º 
//1. Á¤º¸È­¸¶À»È¨
function go_org_home(){document.location.href = 'http://www.invil.org';}
//2. ÀÎºô¼îÇÎÈ¨
function go_com_home(){document.location.href = 'http://www.invil.com';}
//3. Ã¼Çè°ü±¤È¨
function go_tour_home(){document.location.href = 'http://tour.invil.com';}
//4. ¸¶ÀÌÆäÀÌÁöÈ¨
function go_mypage_home(){document.location.href = 'http://www.invil.org/mypage_new/index.jsp';}
//5. ¸ÞÀÏÈ¨
function go_mail_home(){document.location.href = 'http://mail.invil.org/';}
//6. °Ë»öÈ¨
//function go_search_home(){document.location.href = 'http://www.invil.org/search/html/total_search/search.jsp';}
function go_search_home(){document.location.href = 'http://search.invil.org';}
//7. »çÀÌÆ®¸Ê
function go_sitemap_home(){document.location.href = 'http://www.invil.org/sitemap/';}
//8. ÀÎºô´º½ºÈ¨
function go_news_home(){document.location.href = 'http://news.invil.org/';}
//9. Ä¿¹Â´ÏÆ¼È¨
function go_community_home(){document.location.href = 'http://community.invil.org/';}
//10. ÂÊÁöÈ¨
function go_memo_home(){document.location.href = 'http://memo.invil.org/';}
//11. Á¤º¸Ã¤³Î È¨
function go_info_home(){document.location.href = 'http://info.invil.org/';}

//#ÀÌ´ÞÀÇ ÀÌº¥Æ® °¡±â
function go_event(){document.location.href = '/event/PpAnyEvent11.jsp';}


//#ÀÎºô¼îÇÎ ±âÈ¹Àü
//1. Á¦Ã¶»óÇ°Àü 
//function go_1plan(){document.location.href = 'http://www.invil.com/servlet/common/InvilServlet?module=seasonProd&action=SeasonProdList';}
function go_1plan(){document.location.href = 'http://www.invil.com/themeshop/PpThemeshopSeasonProdList.jsp';}
//2. Å×¸¶¼îÇÎÀü
function go_2plan(){document.location.href = 'http://www.invil.com/servlet/common/InvilServlet?module=themeshop&action=main_view';}
//3. ÀÎ±â»óÇ°Àü
function go_3plan(){document.location.href = 'http://www.invil.com/bestshop/PpBestshopMain.jsp';}
//4. °í°´¸¸Á·»óÇ°Àü
function go_4plan(){document.location.href = 'http://www.invil.com/servlet/common/InvilServlet?module=commentProdMarket&action=list';}
//5. °øµ¿/´ë·®±¸¸Å
function go_5plan(){document.location.href = 'http://www.invil.com/servlet/common/InvilServlet?module=cooperHeavy&action=listCooperHeavyMain';}
//6. °æ¸Å/¿ª°æ¸Å
function go_6plan(){document.location.href = 'http://www.invil.com/servlet/common/InvilServlet?module=auctionReauction&action=listAuctionReauctionMain';}


//#Äü¸Þ´º
//Àå¹Ù±¸´Ï°¡±â 
function go_cart(){document.location.href = 'http://www.invil.com/basket/PpCatalogueBasketView.jsp';}
//ÁÖ¹®¹è¼ÛÁ¶È¸
function go_order(){document.location.href = 'http://www.invil.com/servlet/common/InvilServlet?module=mypage&action=orderList&menu=1';}
//´Ü°ñ»ý»êÀÚ°¡±â
function go_who(){window.open('http://www.invil.com/2004/mypage/regular_pop.jsp','regular_pop','width=400,height=220');}
//ÀÌ¿ë¾È³»°¡±â
function go_why(){window.open('http://www.invil.org/customer/guide/mall/Guide01.jsp','','');}
//°í°´¼¾ÅÍ°¡±â
function go_center(){window.open('http://www.invil.org/customer/','','');}
//°øÀÎÀÎÁõ ÆË¾÷
function go_public() {window.open('http://www.invil.com/ord/2004/gongin_popup.jsp','','width=600,height=680,toolbar=no,fullscreen=no,directories=no,status=no,scrollbars=auto,menubar=no,location=no,resize=no');}
//¸ÅÀåÀÌµ¿ÇÏ±â
function go_Submain(bar){opener.location.href="http://www.invil.com/servlet/common/InvilServlet?module=bigCateProd&action=list&big_code=0"+bar+"0000";}
 

//#Áö¿ªÀåÅÍ¹Ù·Î°¡±â 
function go_Map(bar){
	//alert(bar);
    window.open("http://www.invil.com/mapguide/ct_invilmap"+bar+".html","mapgudie",'width=660,height=465,toolbar=no,fullscreen=no,directories=no,status=yes,scrollbars=auto,menubar=no,location=no,resize=no');
}
	 
//#Á¤º¸È­¸¶À»¹Ù·Î°¡±â
//Áöµµ·ÎÃ£±â 
function go_Mapguide(){
	//window.open("http://www.invil.org/invil_world/PhSearchByMap.jsp","mapgudie",'width=660,height=465,toolbar=no,fullscreen=no,directories=no,status=yes,scrollbars=auto,menubar=no,location=no,resize=no');
	window.open("http://www.invil.org/invil_world/region_map/ct_invilmap.html","mapgudie",'width=660,height=465,toolbar=no,fullscreen=no,directories=no,status=yes,scrollbars=auto,menubar=no,location=no,resize=no');	
}	
//Æ¯»ê¹°·ÎÃ£±â
function go_special(){
	window.open("http://www.invil.org/invil_world/PhSearchBySpecial.jsp","mapgudie",'width=660,height=465,toolbar=no,fullscreen=no,directories=no,status=yes,scrollbars=auto,menubar=no,location=no,resize=no');		
}		
//Å×¸¶·ÎÃ£±â
function go_theme(){
	window.open("http://www.invil.org/invil_world/PhSearchByTheme.jsp","mapgudie",'width=660,height=465,toolbar=no,fullscreen=no,directories=no,status=yes,scrollbars=auto,menubar=no,location=no,resize=no');		
}	



//#¸Ê ½ºÅ©¸³Æ®
function go_1map(){	go_searchBymap(1);};	
function go_2map(){	go_searchBymap(2);};	
function go_3map(){	go_searchBymap(3);};	
function go_4map(){	go_searchBymap(4);};	
function go_5map(){	go_searchBymap(5);};	
function go_6map(){	go_searchBymap(6);};	
function go_7map(){	go_searchBymap(7);};	
function go_8map(){	go_searchBymap(8);};	
function go_9map(){	go_searchBymap(9);};
function shop_map1(){ go_searchBymap(1);};
function shop_map2(){ go_searchBySpecial();};
//1. Áöµµ·ÎÃ£±â
/*function go_searchBymap(no){
	//alert(no);
	//url = 'http://www.invil.com/mapguide/shop_map/ct_invilmap'+no+'.html';
	url = 'http://www.invil.com/mapguide/shop_map/ct_invilmap.jsp?no='+no;
	window.open(url,"mapgudie",'width=660,height=465,toolbar=no,fullscreen=no,directories=no,status=yes,scrollbars=auto,menubar=no,location=no,resize=no');		
};*/
//Áöµµ·ÎÃ£±â 
function go_searchBymap(no){ 
	var no =no;
	if(no=="1"){no="_gyeonggi";
	}else if(no=="2"){no="_gangwon";
	}else if(no=="3"){no="_chungbuk";
	}else if(no=="4"){no="_chungnam";
	}else if(no=="5"){no="_jeonbuk";
	}else if(no=="6"){no="_jeonnam";
	}else if(no=="7"){no="_gyeonbuk";
	}else if(no=="8"){no="_gyeongnam";
	}else if(no=="9"){no="_jeju"; 
	}
	url = 'http://www.invil.org/invil_world/region_map/ct_invilmap.jsp?no='+no;
//	url = 'http://www.invil.com/mapguide/shop_map/ct_invilmap.jsp?no='+no;
	window.open(url,"mapgudie",'width=660,height=465,toolbar=no,fullscreen=no,directories=no,status=yes,scrollbars=auto,menubar=no,location=no,resize=no');		
};
//2. Æ¯»ê¹°·ÎÃ£±â  
function go_searchBySpecial() {
	//alert('Æ¯»ê¹°·ÎÃ£±â');
	url = 'http://www.invil.org/invil_world/PhSearchBySpecial.jsp'; //'http://www.invil.com/mapguide/shop_special/ct_invilspecial.html';
	window.open(url,"mapgudie",'width=660,height=465,toolbar=no,fullscreen=no,directories=no,status=yes,scrollbars=auto,menubar=no,location=no,resize=no');		
}



//#¼îÇÎ¸ÞÀÎ ÇÃ·¡½¬¸µÅ©
//1.¿ì¼ö³ó°¡
function go_themesub1(){
	window.location.href="/servlet/common/InvilServlet?module=interview&action=list&userType=G";
}
//2.ÀÎºô¸íÇ°°ü
function go_themesub2(){
	window.location.href="/themeshop/PpThemeshopProdList.jsp?shop_code=1015";
}
//3.Å×¸¶º°»óÂ÷¸²
function go_themesub3(){
	window.location.href="/servlet/common/InvilServlet?module=themeTable&action=ThemeTableMarket";
}
//4.°æ¸Å¿ª°æ¸Å
function go_themesub4(){
	window.location.href="/servlet/common/InvilServlet?module=auctionReauction&action=listAuctionReauctionMain";
}

//#¸ÞÀÎÇÃ·¡½¬
//1. Å×¸¶»óÂ÷¸² 
function go_menu1(){location.href="/servlet/common/InvilServlet?module=themeTable&action=ThemeTableMarket";}
//2. ¼±¹°ÄÚ³Ê 
function go_menu2(){location.href="/themeshop/PpThemeshopProdList.jsp?shop_code=1505";}
//3. °øµ¿´ë·®±¸¸Å 
function go_menu3(){location.href='/servlet/common/InvilServlet?module=cooperHeavy&action=listCooperHeavyMain';}
//4. Á¦Ã¶»óÇ°Àü 
//function go_menu4(){location.href='/servlet/common/InvilServlet?module=seasonProd&action=SeasonProdList';}
function go_menu4(){location.href='http://www.invil.com/themeshop/PpThemeshopSeasonProdList.jsp';}
//5. ÀÎºôºê·£µå¸ô 
function go_menu5(){location.href="/html/young/shop/brandShop.jsp";}
//6. ÇÑÁ¤»óÇ°Àü 
function go_menu6(){location.href="/servlet/common/InvilServlet?module=ProductQuantity&action=front&shop_code=1020";}
//7. ¼¼Æ®»óÇ°ÄÚ³Ê 
function go_menu7(){location.href="/servlet/common/InvilServlet?module=ProductQuantity&action=front&shop_code=1025";}

//#°øÅë Top¸Þ´º
//1.ÀÌº¥Æ®/±âÈ¹Àü
function go_menu01(){
	window.location.href="/servlet/common/InvilServlet?module=event_current&action=current_list";
//	window.location.href="/servlet/common/InvilServlet?module=eventMain&action=list";
	//window.location.href="/event/tg200601/event_01.jsp";
}
//2.Á¦Ã¶»óÇ°Àü
function go_menu02(){	
	//window.location.href="/servlet/common/InvilServlet?module=seasonProd&action=SeasonProdList";
		window.location.href="http://www.invil.com/themeshop/PpThemeshopSeasonProdList.jsp";
}
//3.ÁÖ°£º£½ºÆ®
function go_menu03(){
	window.location.href="/bestshop/PpBestshopMain.jsp";
}
//4.°í°´ÃßÃµ»óÇ°
function go_menu04(){
	window.location.href="/servlet/common/InvilServlet?module=commentProdMarket&action=list";
}
//5.Ä£È¯°æ³ó»ê¹°
function go_menu05(){
//	window.location.href="/servlet/common/InvilServlet?module=premiumcatprod&action=main_view";
	window.location.href="/servlet/common/InvilServlet?module=themeshop&action=main_view";
}
//6.°øµ¿´ë·®±¸¸Å
function go_menu06(){
	window.location.href="/servlet/common/InvilServlet?module=cooperHeavy&action=listCooperHeavyMain";
}



//#·Î±×ÀÎ Ã³¸®
function afterLogin() {
    this.document.location.reload();
}

//#·Î±×ÀÎ ¿µ¿ª¿¡ ³ª¿À´Â ·£´ý ÄÜÅÙÃ÷
function random_content(){
		var mycontent=new Array()
		// HTML »ç¿ë°¡´É 
		mycontent[1]='¾È³çÇÏ¼¼¿ä!'
		mycontent[2]='¾î¼­¿À¼¼¿ä!'
		mycontent[3]='È¯¿µÇÕ´Ï´Ù.'
	
		var ry=Math.floor(Math.random()*mycontent.length)
		if (ry==0)ry=1
		document.write(mycontent[ry])
}
 
//#È¸¿ø °ü·Ã Á¤º¸
//1. È¸¿øÁ¤º¸º¯°æ
function go_member_info_update(){document.location.href = "http://secure.invil.org/member_new/PhUpdateMember.jsp" ;}
//2. È¸¿ø°¡ÀÔ
function go_member_join(){document.location.href = "https://secure.invil.org/member_new/PhCheckMember.jsp";}
//3. ·Î±×ÀÎ
//function go_member_login(return_url){document.location.href = "https://secure.invil.org/member_new/phPopLogin.jsp?return_url="+return_url}
function go_member_login(request_url){
	var paramInfoAdd = "";
	var paramSplit = new Array(2);
	paramSplit = request_url.split("?");
	paramInfoAdd = paramSplit[1] ;
	request_url = makeReturnURLWhenLogin();

	if( !( paramInfoAdd == null || paramInfoAdd == "" || paramInfoAdd == undefined) ){		
		request_url = request_url+"^^"+paramInfoAdd;
	}
	//document.location.href = "https://secure.invil.org/login_new/index.jsp?return_url="+request_url
	//window.open("https://secure.invil.org/member_new/PhPopLogin.jsp?return_url="+request_url);

	win1= window.open("https://secure.invil.org/member_new/PhPopLogin.jsp?return_url="+escape("http://www.invil.com/callOpener.jsp?func=afterLogin") , "Login", "width=660,height=520,scrollbars=no,menubars=no" );
	
}
function afterLogin() {
//ºñÈ¸¿ø °áÁ¦½Ã ·Î±×ÀÎ ºÐ±â¸¦ À§ÇÑ Ã³¸® 
      
	  this.document.location.href="http://www.invil.com/chkOrdPage.jsp?loca="+escape(this.document.location);
	  //this.document.location.reload();
      
    

	
}
function makeReturnURLWhenLogin(){
		var finalReturnURL = location.protocol +"//"+location.hostname;
		var pathnameStr = location.pathname;
		var searchStr = location.search;


		if( !(pathnameStr == null || pathnameStr == undefined || pathnameStr =="")  ){
				finalReturnURL = finalReturnURL + pathnameStr;			//alert("95 >> "+pathnameStr);
		}
		if( !(searchStr == null || searchStr == undefined || searchStr == "") ){			//alert("99 >> "+searchStr);
				finalReturnURL = finalReturnURL + searchStr;
		}
		while ( finalReturnURL.search("&")  > 0 ) {
			finalReturnURL = finalReturnURL.replace("&", "^^")
		}//end while	
		return finalReturnURL;
}


//4. ·Î±×¾Æ¿ô
function go_member_logout(return_url){document.location.href = "https://secure.invil.com/login/PhLogOutDomain.jsp?return_url="+return_url}
//5. Àû¸³±Ý
function go_member_mileage(){document.location.href= "http://www.invil.com/servlet/common/InvilServlet?module=mileage&action=list&menu=9";}
//6. ºñÈ¸¿ø±¸¸Å
//function go_guest_order(){document.location.href = "http://www.invil.com/ord/2004//PpOrdOrder.jsp?isMember=N&flag=first";}
function go_guest_order(){
	if(this.bohocheck.checked){
		document.location.href = "http://www.invil.com/ord/2004/fourth/PpOrdOrder_L.jsp?isMember=N&flag=first";
	}else{
		alert("ºñÈ¸¿ø ±¸¸Å½Ã °³ÀÎÁ¤º¸º¸È£Á¤Ã¥¿¡ µ¿ÀÇÇÏ¼Å¾ß ÁÖ¹®ÀÌ °¡´ÉÇÕ´Ï´Ù.");
		this.bohocheck.focus();
		return;
	}		
}
//7. ºñ¹Ð¹øÈ£Ã£±â
function go_password_search(){document.location.href= "https://secure.invil.org/member_new/PhSearchIDPasswd.jsp";}


//ÆË¾÷
function popUp(url) {
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
	self.name = "mainWin"; 
}

function event_popup() {
	//var popwin;
	//popwin = window.open("/event/pop_up/20040623/popup_corn.html","mallEventPopup","top=100,left=130,width=755, height=140,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no");
}

//#Á¦ÈÞ¸ÅÀå¹Ù·Î°¡±â
function goJoinSiteMall(joinSiteCls){
	//location.href="/servlet/common/InvilServlet?module=joinprod&action=fjoinlist&joinSiteCls="+joinSiteCls;
	//2004.08.03 ÀÌ»óÇù ¼öÁ¤
	window.open('/servlet/common/InvilServlet?module=joinprod&action=fjoinlist&joinSiteCls='+joinSiteCls, '_parent', '');
}


//##ÀÎºô¼îÇÎÀ¸·Î ½ÃÀÛÇÏ±â
function startInvilShop(){
	this.style.behavior='url(#default#homepage)';
	this.setHomePage('http://www.invil.com');
}


    function membergradeinfo(){
        window.open("http://www.invil.org/mypage_new/MemberGradeInfo.html", "MemberGradeInfo", "width=700, height=710, status=no, scrollbars=no" );
    }