function AddFavorite(title,url){
  if(window.opera && window.print){ // opera
  var elem = document.createElement('a');
  elem.setAttribute('href',url);
  elem.setAttribute('title',title);
  elem.setAttribute('rel','sidebar');
  elem.click();
  }
  else if(document.all) { // ie
    window.external.AddFavorite(url, title);
  }
  else if (window.sidebar) { // firefox
    window.sidebar.addPanel(title, url, "");
  }
}

function GetCookie(name) { 
  var nameOfCookie = name + "=";
  var x = 0;
  while ( x <= document.cookie.length ){
      var y = (x+nameOfCookie.length);
      if ( document.cookie.substring( x, y ) == nameOfCookie ) {
          if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
          endOfCookie = document.cookie.length;
          return unescape( document.cookie.substring( y, endOfCookie ) );
      }
      x = document.cookie.indexOf( " ", x ) + 1;
      if ( x == 0 ) break;
  }
  return "";
} 

function XgolfMove(theURL) { 

  var uid = this.GetCookie('UID');
  if (uid!='') {
    window.open(theURL+uid,"Xgolf","width=500,height=300"); 
  }
  else {
    window.open("/skin1/popup_fantomlogmgs.tpl","Xgolf","width=500,height=300");
    location.href="?action=CsLogin";
  }
}

function MembershipMove(theURL) { 
  window.open(theURL); 
}

function menulink(link_go) {  

		switch ( link_go ) {

			case '1' : <!--about fantom-->
			location.href=   "?action=FantomHistory";
			break;

			case '1-1' : <!--history-->
			location.href=   "?action=FantomHistory";
			break;

			case '1-2' : <!--concept-->
			location.href=   "?action=FantomConcept";
			break;
			
			case '1-3' : <!--location-->
			location.href=   "?action=FantomLocation";
			break;



			case '2' : <!--style-->
			location.href=   "?action=StyleCatalogue";
			break;			

			case '2-1' : <!--ecatalogue-->
			location.href=   "?action=StyleCatalogue";
			break;
			
			case '2-2' : <!--product-->
			location.href=   "?action=StyleProduct";
			break;

			case '2-2-1' : <!--man-->
			location.href=   "?action=StyleProductView&type=man";
			break;

			case '2-2-2' : <!--woman-->
			location.href=   "?action=StyleProductView&type=woman";
			break;			

			case '2-3' : <!--weekly styling-->
			location.href=   "?action=StyleStyling";
			break;
			

			case '3' : <!--lounge-->
			location.href=   "?action=LoungeSponsor";
			break;			

			case '3-1' : <!--sponsorship-->
			location.href=   "?action=LoungeSponsor";
			break;

			case '3-1-1' : <!--sponsorship-->
			location.href=   "?action=LoungeSponsor";
			break;

			case '3-1-2' : <!--sponsorship-->
			location.href=   "?action=LoungeSubSponsor";
			break;

			case '3-2' : <!--player gallery-->
			location.href=   "?action=LoungePlayer";
			break;			

			case '3-3' : <!--media-->
			location.href=   "?action=LoungeMedia";
			break;						

			case '3-4' : <!--golf tips-->
			location.href=   "?action=FantomStar";
			break;			


			case '4' : <!--news-->
			location.href=   "?action=NewsRelease";
			break;			

			case '4-1' : <!--news release-->
			location.href=   "?action=NewsRelease";
			break;
			
		

			case '5' : <!--event-->
			location.href=   "?action=EventOngoing";
			break;			

			case '5-1' : <!--ongoing event-->
			location.href=   "?action=EventOngoing";
			break;
			
			case '5-2' : <!--past event-->
			location.href=   "?action=EventPast";
			break;
		

			case '6' : <!--store-->
			location.href=   "?action=StoreInfo";
			break;
			
			case '6-1' : <!--store info-->
			location.href=   "?action=StoreInfo";
			break;
			
			case '6-2' : <!--online shopping-->
			MembershipMove("http://www.creasmall.co.kr");
			break;
			
			case '6-3' : <!--agent-->
			location.href=   "?action=StoreAgent";
			break;

			case '7-1' : <!--logo-->
			location.href=   "?action=main";
			break;


			case '8-1' : <!--login-->
			location.href=   "?action=CsLogin";
			break;
			
			case '8-2' : <!--membership-->
			MembershipMove("http://www.creasmall.co.kr/?action=Membercheck&from=fantom");
			break;

			case '8-3' : <!--sitemap-->
			location.href=   "?action=CsSitemap";
			break;

			case '8-4' : <!--privacy policy-->
			location.href=   "?action=CsPrivacy";
			break;

			case '8-5' : <!--terms of use-->
			location.href=   "?action=CsTermsofuse";
			break;

			case '8-6' : <!--add bookmark-->
			AddFavorite("Valuable Masstige Golfwear FANTOM","http://www.fantom.co.kr/");
			break;

			case '8-7' : <!--xgolf-->
			XgolfMove("http://fantom.xgolf.co.kr/certi/xgolf_coupon_certi.asp?user_id=");
			break;

			case '8-8' : <!--logout-->
			location.href=   "?action=Logout";
			break;

			case '8-9' : <!--mypage-->
			alert('준비중입니다.');
			break;
		}
		
}
