//
// world visionalist 計測タグ
// 2011/04/06
// UTF-8
//
// ------------------------------------------------------------------------------ //
// Change Log
// ------------------------------------------------------------------------------ //
// 20120210 Add /dressers_coorde in "wjp-w-snap"
// 20111031 Change the definition of categoryID2
// 20110929 Update for SP SiteS
// 20110527 Update category logic
// 20110421 Update category logic
// 20110419 Remove for Dev. Server
// 20110412 Add for Dev. Server
// 20110406 Realese first
//

// SP Site ではない場合に以下実行されるようにする
if ( !location.href.match( "www.world.co.jp/sp/" ) && !location.href.match( "pc.manage.world.co.jp/sp/" ) ) {

	var pageID = "";
	var directory2ndPath = "";
	var categoryID1 = "";
	var categoryID2 = "wjp";
	var categoryID3 = "";

	switch ( location.pathname.split("/")[1] ) {
	  case "index.html":
	    categoryID1 = "wjp-top";
	    break;
	  case "shop":
	    // /shop だった場合は、SHOP-ID を取得する
	    categoryID1 = "wjp-s-" + location.pathname.split("/")[2];
	    break;
	  case "wt":
	    if ( location.pathname.split("/")[2] == "special_edition" ) {
	      categoryID1 = "wjp-w-special-edition";
	    } else if ( location.pathname.split("/")[2] == "how_to" ) {
	      categoryID1 = "wjp-w-howto";
	    } else if ( location.pathname.split("/")[2] == "topics" ) {
	      categoryID1 = "wjp-w-topics";
	    } else if ( location.pathname.split("/")[2] == "column" ) {
	      if ( location.pathname.split("/")[3] == "world_ism" ) {
	        categoryID1 = "wjp-w-ism";
	      } else {
	        categoryID1 = "wjp-w-column";
	      }
	    } else if ( location.pathname.split("/")[2] == "rank-up" ) {
	      categoryID1 = "wjp-w-rankup";
	    } else if ( location.pathname.split("/")[2] == "street_snap" ) {
	      categoryID1 = "wjp-w-snap";
	    } else if ( location.pathname.split("/")[2] == "dressers_coorde" ) {
	      categoryID1 = "wjp-w-snap";		  
	    } else if ( location.pathname.split("/")[2] == "news" ) {
	      categoryID1 = "wjp-w-news";
	    } else if ( location.pathname.split("/")[2] == "blog" ) {
	      categoryID1 = "wjp-w-blog";
	    } else {
	      categoryID1 = "wjp-w-other";
	    }
	    break;
	  case "search":
	    if ( location.pathname.split("/")[2] == "shop" ) {
	      categoryID1 = "wjp-w-search-shop";
	    } else if ( location.pathname.split("/")[2] == "brand" ) {
	      categoryID1 = "wjp-w-search-brand";
	    } else if ( location.pathname.split("/")[2] == "sites" ) {
	      categoryID1 = "wjp-w-search-sites";
	    } else {
	      categoryID1 = "wjp-w-search-other";
	    }
	    break;
	  case "news":
	    if ( location.pathname.split("/")[2] == "onlinestore" ) {
	      categoryID1 = "wjp-o-online";
	    } else if ( location.pathname.split("/")[2] == "media" ) {
	      categoryID1 = "wjp-m-media";
	    } else {
	      categoryID1 = "wjp-m-other";
	    }
	    break;
	  default:
	    // http://www.world.co.jp/ の場合
	    if ( location.pathname.split("/")[1] == "" ) {
	      categoryID1 = "wjp-top";
	    } else {
	      // 上記以外のものすべてはブランド扱い
	      categoryID1 = "wjp-b-" + location.pathname.split("/")[1];
	      categoryID2 = "wjp-brands";
	    }
	}


	// 本番サーバーの場合
	if ( location.host.match( "www.world.co.jp" ) ) {
	  // パラメーター生成
	  document.write( "<script type='text/javascript'>VLTrace_custom_getparam=\'p=&u1=" + categoryID1 + "&u2=" + categoryID2 + "\';<\/script>" );
	  if ( document.location.protocol == "http:" ) {
	    document.write("<script type='text/javascript' src='http://la.world.co.jp/js/visionalist.js'><\/script>");
	  } else {
	    document.write("<script type='text/javascript' src='https://la.world.co.jp/js/visionalist.js'><\/script>");
	  }
	// ステージングサーバーの場合
	} else if ( location.host.match( "pc.manage.world.co.jp" ) ) {
	 // パラメーター生成
	  document.write( "<script type='text/javascript'>VLTrace_custom_getparam=\'p=&u1=" + categoryID1 + "&u2=" + categoryID2 + "\';<\/script>" );
	  document.write("<script type='text/javascript' src='/resources_shared/scripts/visionalist.js'><\/script>");

	// 開発サーバーの場合
	} else {
	 // パラメーター生成
	  document.write( "<script type='text/javascript'>VLTrace_custom_getparam=\'p=&u1=" + categoryID1 + "&u2=" + categoryID2 + "\';<\/script>" );
	  document.write("<script type='text/javascript' src='/resources_shared/scripts/visionalist.js'><\/script>");

	}

	$(document).ready(function(){
		$('body img').eq(0).css({ position:'absolute',bottom:'0',left:'0'});
	});


}
