//==== Pop Up ====
function popUp(theURL,winName,features) {
	window.open(theURL,winName,features);
}


//staff
function staffPop(URL){
	window.open(URL,'StaffPop','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=650,height=800');
}

function staffBlogLink(URL){
  if(window.name == 'StaffPop'){
    opener.location.href = URL;
    return true;
  }
    location.href = URL;
}

function getCategoryText() {

	// URLからカテゴリー文字列を取得
	var catStr = "";
	
	// URLのマッチング
	var urlStr = window.location.href;
	var urlArray = urlStr.match(/\/([^\/]{2})\/([^\/]{4})\/([^\/]{6})\//);
	if (urlArray == null) {
		urlArray = urlStr.match(/\/([^\/]{2})\/([^\/]{4})\//);
		if (urlArray == null) {
			urlArray = urlStr.match(/\/([^\/]{2})\//);
			if (urlArray == null) {
				// マッチしなかった場合デフォルトの値(AV)を代入
				catStr = "AV";
			} else {
				// WEBカテゴリーIDまでURLに含まれてない場合
				catStr = urlArray[1].toUpperCase();
			}
		} else {
			// 大カテゴリーIDまでURLに含まれてない場合
			catStr = urlArray[1].toUpperCase();
		}
	} else {
		// 中カテゴリーIDまでURLに含まれてない場合
		catStr = urlArray[3].toUpperCase();
	}
	
	// 最上階層のURLを取得
	var rootPath = window.location.href.match(/(^[httpsfile]+:\/{2,3}[0-9a-z\.\-:]+)?:?[0-9]*?\//i)[1];

	// テキストの読み込み
	jQuery.ajax({
	// カテゴリーデータの読み込み
	url : rootPath+"/_inc/blog/"+catStr+".httxt",
	type : "get",
	dataType : "html",
	success : function(data){
	// イメージディレクトリの絶対パスでの指定置き換え
	$(".httxt").html(data.replace(/\/_img/g, rootPath+"/_img"));
	}
	});

}


function addBookmark(){
	var name = "ONLINE デジモノステーション";
	var url = "http://www.digimonostation.jp/";
		if (window.sidebar) {
			window.sidebar.addPanel(name, url,"");
		}else if( document.all ) {
			window.external.AddFavorite(url, name);
		}else if( window.opera && window.print ) {
			return true;
		}
}