var $https_root = "https://" + location.host + "/";
var $http_root = "http://" + location.host + "/";
var pageNotF = "";
var $rsid = "sonybitdrivenejp";
if ("www.bit-drive.ne.jp" != location.host) {
	$rsid += "dev";
}

function anchorHTTPS($relativeUrl, $dispText, $target, $titleText) {
	if ($target == null) {
		$target = "_blank";
	}
	if ($titleText == null) {
		$titleText = $dispText + "へ";
	}
	document.write("<a href='" + $https_root + $relativeUrl + "' target='" + $target + "' title='" + $titleText + "'>" + $dispText + "</a>");
}

function anchorHTTPSImg($relativeUrl, $src, $width, $height, $alt, $target) {
	if ($target == null) {
		$target = "_blank";
	}
	document.write("<a href='" + $https_root + $relativeUrl + "' target='" + $target + "' title='" + $alt + "'><img src='" + $src + "' width='" + $width + "' height='" + $height + "' border='0' alt='" + $alt + "'></a>");
}

function anchorHTTPSImgOnOff($relativeUrl, $srcOff, $srcOn, $width, $height, $alt, $target) {
	if ($target == null) {
		$target = "_blank";
	}
	document.write("<a href='" + $https_root + $relativeUrl + "' target='" + $target + "' title='" + $alt + "'><img src='" + $srcOff + "' width='" + $width + "' height='" + $height + "' border='0' alt='" + $alt + "' onmouseover='this.src=\"" + $srcOn + "\";' onmouseout='this.src=\"" + $srcOff + "\";'></a>");
}

function anchorHTTPSImgHV($relativeUrl, $src, $width, $height, $hspace, $vspace, $alt, $target) {
	if ($target == null) {
		$target = "_blank";
	}
	document.write("<a href='" + $https_root + $relativeUrl + "' target='" + $target + "'><img src='" + $src + "' width='" + $width + "' height='" + $height + "' hspace='" + $hspace + "' vspace='" + $vspace + "' border='0' alt='" + $alt + "'></a>");
}

function redirectHTTPS($relativeUrl) {
	location.href=$https_root + $relativeUrl;
}

function areaHTTPS($relativeUrl, $shape, $coords, $alt) {
	document.write("<area shape='" + $shape + "' coords='" + $coords + "' href='" + $https_root + $relativeUrl + "' alt='" + $alt + "'/>");
}

function anchorHTTPTop($relativeUrl, $dispText) {
	document.write("<a href='" + $http_root + $relativeUrl + "' target='_top' name='top'>" + $dispText + "</a>");
}

function anchorHTTP($relativeUrl, $dispText, $target) {
	if ($target == null) {
		$target = "_blank";
	}
	document.write("<a href='" + $http_root + $relativeUrl + "' target='" + $target + "'>" + $dispText + "</a>");
}

function anchorHTTPImg($relativeUrl, $src, $width, $height, $alt, $align, $target) {
	if ($target == null) {
		$target = "_blank";
	}
	document.write("<a href='" + $http_root + $relativeUrl + "' target='" + $target + "' title='" + $alt + "'><img src='" + $src + "' width='" + $width + "' height='" + $height + "' border='0' alt='" + $alt + "' align='" + $align + "'></a>");
}

function optionHTTPS($relativeUrl, $dispText) {
	document.write("<OPTION VALUE='" + $https_root + $relativeUrl + "'>" + $dispText + "</OPTION>");
}

function openWin($url,$winName) {
window.open($url,$winName,"toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width=600,height=700");
}
function openWin1($url,$winName) {
window.open($url,$winName,"toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width=480,height=550");
}
function openWin2($url,$winName) {
window.open($url,$winName,"toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,width=490,height=550");
}

function yearMake() {
	dd = new Date();
	yy = dd.getYear();
	if (yy < 2000) { yy += 1900; }
}

//SiteCatalyst用タグ埋め込み
function SCTag() {
document.write("<script type='text/javascript' src='/s_code.js'></script>");
document.write("<script type='text/javascript' src='/sitecatalyst.js'></script>");
}

// 資料請求等の経路判別用cookieの設定
// -> mk_typeが複数ある場合、後のものを優先する
// -> mk_typeが1～99の数値の場合、cookieに情報設定する(当てはまらない場合は設定しない)
var param = location.search;
if (param.indexOf("mk_type") != -1) {
  mk_type = "";
  param_array = param.substr(1).split("&");
  array_length = param_array.length;
  for (i = 0; i < array_length; i++) {
    txt = param_array[i];
    if (txt.indexOf("mk_type=") == 0){
      str = txt.substr(8);
      if ((str >= 1) && (str <= 99)) {
        mk_type = str;
      }
    }
  }
  if (mk_type != ""){
    exp=new Date();
    exp.setTime(exp.getTime()+1000*60*60*24*90);
    document.cookie = "mk_type=" + mk_type + "; expires=" + exp.toGMTString() + "; path=/forms/";
  }
}

