// Common JavaScript Document
<!--
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_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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_showHideLayers() { //v6.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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function PH_printWindow(features){
	window.open('/printout.php?site=' + window.location.href,'print',features);
}

function PH_disableSubmit(form){
	var elements = form.elements;
	for (var i = 0; i < elements.length; i++) {
		if (elements[i].type == 'submit') {
			elements[i].blur();
			elements[i].disabled = 'true';
		}
	}
}

function ctrlWind(url) {
 opener.location.href = url; window.close();
}

function MM_jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

function PH_page_load(){
	return ture;
}


/****
 * detect banners
 */
function setBanner(){
	//初期設定
	var jmpUrl = "http://www.suntory-kenko.com/link/?365cldrpad";
	//var jmpUrl = new Array();
	var banImg = new Array();
	//リンク先、バナー指定
	//jmpUrl[0] = "/";
	banImg[0] = "/lib_image/banner/468_60_01.gif";
	banImg[1] = "/lib_image/banner/468_60_02.gif";
	//alert(banImg.length);
	var setNum = Math.floor(Math.random()*(banImg.length));
	//イメージオブジェクト生成
	document.write('<a href="'+jmpUrl+'" target="_blank"><img src="'+banImg[setNum]+'" width="468" height="60" border="0" alt=""></a>');
//	document.write('<a href="http://tsurukame-book.net/?dog365/0707" target="_blank"><img src="/lib_image/banner/ban_dog365_0707.gif" alt="" width="165" height="60" border="0"></a>');
//	document.write('<a href="http://dododay.jp/?dog365/0706" target="_blank"><img src="/lib_image/banner/dododay_149bana.gif" alt="dododayドゥドゥデイ" width="149" height="60" border="0"></a><a href="http://new.gakken.co.jp/?dog365/0706" target="_blank"><img src="/lib_image/banner/gakken_149_60.gif" alt="Gakken Online" width="149" height="60" border="0"></a>');
//	document.write('<a href="http://kurasse.jp/?dog" target="_blank"><img src="/lib_image/banner/kurasse_banner_156.gif" alt="クラッセ" width="156" height="60" border="0"></a><a href="http://dododay.jp/?dog365/0706" target="_blank"><img src="/lib_image/banner/dododay_149bana.gif" alt="dododayドゥドゥデイ" width="149" height="60" border="0"></a><a href="http://new.gakken.co.jp/?dog365/0706" target="_blank"><img src="/lib_image/banner/gakken_149_60.gif" alt="Gakken Online" width="149" height="60" border="0"></a>');
}
// for Pre Login
function setBanner2(){
	var jmpUrl = new Array();
	var banImg = new Array();
	jmpUrl[0] = "/user_login";
	banImg[0] = "/lib_image/common/dummy_head_banner.gif";
	//jmpUrl[0] = "/regist2.cgi\" onClick=\"MM_openBrWindow('/regist2.cgi','','scrollbars=yes,resizable=yes,width=650,height=500'); return false;";
	//banImg[0] = "/lib_image/banners/banner1.jpg";	
	document.write('<a href="'+jmpUrl[0]+'"><img src="'+banImg[0]+'" width="468" height="60" border="0"></a>');
}

/**/
/* adjust用 グローバル変数定義 */
var amp_med = '284';
var amp_site = '157';
var amp_frame = '12014';
var amp_iframe = '0';
var amp_height = '60';
var amp_width = '468';
var amp_type = '0';
var amp_rurl = document.referrer;
var amp_send = location.protocol + '//ads.adjust-net.jp/adserver/ad/ads.js';
function setBannerEx(num){
	//広告タイプ判別	ad:adjust/ph:nomal
	var adType = "ph";
	//バナーID判別	1:topHeader/2:topFooter/3:innerHeader/4:innerFooter/5:calendarDetail/6:sideBanner
	if(num == 1){
	/*
		adType = "ad";
		amp_med = '284';
		amp_site = '157';
		amp_frame = '12014';
		amp_iframe = '0';
		amp_height = '60';
		amp_width = '468';
		amp_type = '0';
		amp_rurl = document.referrer;
		amp_send = location.protocol + '//ads.adjust-net.jp/adserver/ad/ads.js';
		*/
		adType = "top";
		document.write('<a href="http://www2.enekoshop.jp/shop/365calendar/" target="_blank"><img src="/lib_image/banner/ban_365shop.gif" width="468" height="60" border="0"></a>');
	}else if(num == 2){
		
		adType = "ad";
		amp_med = '284';
		amp_site = '157';
		amp_frame = '12431';
		amp_iframe = '0';
		amp_height = '90';
		amp_width = '728';
		amp_type = '0';
		amp_rurl = document.referrer;
		amp_send = location.protocol + '//ads.adjust-net.jp/adserver/ad/ads.js';
		
		//adType = "ph";

	}else if(num == 3){
	/*
		adType = "ad";
		amp_med = '284';
		amp_site = '157';
		amp_frame = '12014';
		amp_iframe = '0';
		amp_height = '60';
		amp_width = '468';
		amp_type = '0';
		amp_rurl = document.referrer;
		amp_send = location.protocol + '//ads.adjust-net.jp/adserver/ad/ads.js';
		*/
		adType = "top";
		document.write('<a href="http://www2.enekoshop.jp/shop/365calendar/" target="_blank"><img src="/lib_image/banner/ban_365shop.gif" width="468" height="60" border="0"></a>');
	}else if(num == 4){
		adType = "ad";
		amp_med = '284';
		amp_site = '157';
		amp_frame = '12432';
		amp_iframe = '0';
		amp_height = '90';
		amp_width = '728';
		amp_type = '0';
		amp_rurl = document.referrer;
		amp_send = location.protocol + '//ads.adjust-net.jp/adserver/ad/ads.js';

	}else if(num == 5){
		adType = "ad";
		amp_med = '284';
		amp_site = '157';
		amp_frame = '12433';
		amp_iframe = '0';
		amp_height = '60';
		amp_width = '468';
		amp_type = '0';
		amp_rurl = document.referrer;
		amp_send = location.protocol + '//ads.adjust-net.jp/adserver/ad/ads.js';
	/*
		adType = "swf";
		gImgStats = 1;
		PH_detect_swf("/lib_image/banner/animal_02.swf",468,69,"/lib_image/common/spacer.gif","");
	*/
		/*
		adType = "ad";
		amp_med = '284';
		amp_site = '157';
		amp_frame = '12433';
		amp_iframe = '0';
		amp_height = '60';
		amp_width = '468';
		amp_type = '0';
		amp_rurl = document.referrer;
		amp_send = location.protocol + '//ads.adjust-net.jp/adserver/ad/ads.js';
		*/
		
	}else if(num == 6){
		adType = "ad";
		amp_med = '284';
		amp_site = '157';
		amp_frame = '12434';
		amp_iframe = '0';
		amp_height = '200';
		amp_width = '200';
		amp_type = '0';
		amp_rurl = document.referrer;
		amp_send = location.protocol + '//ads.adjust-net.jp/adserver/ad/ads.js';

	}

	if(adType=="ad"){	//adjust banner
		/*
		var rand_1 = (new Date().getTime())%100000000;
		var rand_2 = Math.round(Math.random()*100000000.0);
		var rand_id = ""+rand_1+""+rand_2;
		var url  ="http://www.adjustnetwork.com/aan/serve?st=4&js=1&h=60&w=468&sl="+slNum+"&r="+rand_id;
		*/
//		document.write("<scr" + "ipt language='javascript' src='" + amp_send + "'></scr" + "ipt>");
	}else if(adType=="ph"){	//nomal banner
		//初期設定
		//var jmpUrl = new Array();
		//var jmpUrl = "http://dododay.jp/dowork/?/365/080417";
		var jmpUrl = "/product/index.php";
		var banImg = new Array();
		//リンク先、バナー指定
		//jmpUrl[0] = "/";
		banImg[0] = "/lib_image/banner/ban_product.gif";
		var setNum = Math.floor(Math.random()*(banImg.length));
		//イメージオブジェクト生成
//		document.write('<a href="'+jmpUrl+'" target="_blank"><img src="'+banImg[setNum]+'" width="468" height="60" border="0" alt=""></a>');
	}
}

/* ----------------------------------------
 * 親ウィンドウチェック。
----------------------------------------*/
function checkParent() {
	var ua = navigator.userAgent;
	if(!!window.opener)
		if( ua.indexOf('MSIE 4')!=-1 && ua.indexOf('Win')!=-1 ) 
		return !window.opener.closed
		else return typeof window.opener.document  == 'object'
	else return false
}
function openUrl(str){
	var toUrl = str;
	if(checkParent()) {
		window.opener.location.href = toUrl;
		//window.close();
	}	else{
		window.location.href = toUrl;
	}
}

/********************************************************************
   Detect Flash Movie  script by Seito Makino
   (C)pharcyde inc.
   
   ::: functions :::
   PH_detect_swf(MOVIE-PATH,WIDTH,HEIGHT,[ALT-PATH,INIT])
   	swfを出力する
   	MOVIE-PATH	:SWFへのパス
   	WIDTH		:幅
   	HEIGHT		:高さ
   	ALT-PATH	:プラグインがない場合の画像へのパス（ない場合はデフォルトメッセージを表示）
   	INIT		:ステータス設定に呼ばれるファンクション
   				（HTML出力の設定・プラグインのバージョン設定等が
   				　必要な場合はファンクション名を記述する）
   
   PH_detect_swf_init_def()
   設定の基本情報を返す
 *******************************************************************/

function PH_detect_swf_init_def(imgSWF,sWidth,sHeight,altImg){
	//基本出力（1：Flash　2：JPEG,GIF　3：HTML）
	gImgStats = 1;
	//フラッシュムービーのパス
	gImgSWF = imgSWF;
	//フラッシュムービーサイズ
	gsWidth = sWidth;
	gsHeight = sHeight;
	//代替画像ファイルへのパス
	gAltImg = altImg;
	//ＨＴＭＬソース
	gHtmlsrc = 'このコンテンツの閲覧には、<br>最新のFlashPlayerが必要です。';
	//プラグイン判定Falseの場合の処理（１：代替え画像出力、２：HTML出力）
	gPlginF = 2;
	
	if(gAltImg == "") gPluginF = 2;
};

var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
		for (var i = 0; i < words.length; ++i)
		{
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
		}
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

function PH_detect_swf(imgSWF,sWidth,sHeight,altImg,initFunc){
	//configure
	if(initFunc == ""){
		PH_detect_swf_init_def(imgSWF,sWidth,sHeight,altImg);
	}else{
		eval(initFunc);
	}
	
	if (gImgStats == 3){
		document.write(gHtmlsrc);
	}else if(gImgStats == 2){
		document.write('<img src="' + gAltImg + '" width="' + gsWidth + '" height="' + gsHeight + '" border="0">');
	}else{
		if ( MM_FlashCanPlay ) {
				document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
			document.write('  codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
			document.write(' ID="movie" WIDTH="' + gsWidth + '" HEIGHT="' + gsHeight + '" ALIGN="">');
			document.write(' <param name="allowScriptAccess" value="sameDomain" />  '); 
			document.write(' <PARAM NAME=movie VALUE="' + gImgSWF + '"> <PARAM NAME=quality VALUE=best> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '); 
			document.write(' <EMBED src="' + gImgSWF + '" quality="best" bgcolor=#FFFFFF  ');
			document.write(' swLiveConnect=true WIDTH="' + gsWidth + '" HEIGHT="' + gsHeight + '" NAME="movie" ALIGN=""');
			document.write(' allowScriptAccess="sameDomain"');
			document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="https://www.macromedia.com/go/getflashplayer">');
			document.write(' </EMBED>');
			document.write(' </OBJECT>');
		} else{
			if(gPlginF == 2){
				document.write(gHtmlsrc);
			}else{
				document.write('<IMG SRC="' + gAltImg + '" WIDTH="' + gsWidth + '" HEIGHT="' + gsHeight + '" BORDER="0">');
			}
		}
	}
};

/* Photo Album Image Delete Confirm */
function delCheck(val) {
	if(window.confirm('この画像を削除してもよろしいですか?\nカレンダーに登録済みの画を削除するとカレンダー上からも画像が消えてしまいますので、くれぐれもご注意ください。')){
		location.href = val; 
	}
}
/* Photo Album Image Zoom */
function zoomPhoto(val) {
	subWin = window.open("test_subwin.html","ImageView",'scrollbars=yes,resizable=yes,width=620,height=450'); 
	subWin.document.open();
	subWin.document.writeln('<html><head><title>zoom sample<\/title><\/head>'); 
	subWin.document.writeln('<body onload="self.focus()" style="padding:0;margin:0;text-align:center;"><div>'); 
	subWin.document.writeln('<img src="'+val+'" alt="zoom" width="640" height="480"><br>'); 
	subWin.document.writeln('<a href="javascript:window.close();"><img src="/lib_image/subwin/bt_close.gif" alt="このウィンドウを閉じる" width="96" height="25" border="0"></a>'); 
	subWin.document.writeln('<\/div><\/body><\/html>'); 
	subWin.document.close(); 
}

/* Upload Step Image Zoom */
function zoomImage(val) {
	subWin = window.open("","ZoomImage",'scrollbars=yes,resizable=yes,width=640,height=570'); 
	subWin.document.open();
	subWin.document.writeln('<html><head><title>zoom<\/title><\/head>'); 
	subWin.document.writeln('<body onload="self.focus()" style="padding:0;margin:0;text-align:center;"><div>'); 
	subWin.document.writeln('<a href="javascript:window.close();"><img src="'+val+'" alt="zoom"></a><br>'); 
	subWin.document.writeln('<a href="javascript:window.close();"><img src="/lib_image/subwin/bt_close.gif" alt="閉じる" width="96" height="25"></a>'); 
	subWin.document.writeln('<\/div><\/body><\/html>'); 
	subWin.document.close(); 
}

/* ------------------------------------------------------------
 * setHtml
 * CALL : ALL
 * ARG  : msg - Message Strings | place - Set Target ID
 * ------------------------------------------------------------ */
function setHtml(msg,place){
	if(document.all || document.getElementById){ // IE4/5、NN6用の分岐 
		if(document.all)document.all(place).innerHTML = msg; 
		else document.getElementById(place).innerHTML = msg; 
	} else if(document.layers){ // NN4.7用の分岐 
		with(document.layers[place]){ 
		document.open(); 
		document.write(msg); 
		document.close(); 
		} 
	} 
}
//-->