﻿/* http://www.zin-blue025z.com/ JabaScript File */
/* Copyright(C) 2005-2008 観葉植物の扉 All Rights Reserved. 
/*---------------------------------------------------------------------------------------------------------o--*/


/*---------------------------------------------------------------------------------------------------------お気に入り登録--*/


function addBookmark() { 
    if (window.sidebar) { 
        window.sidebar.addPanel('観葉植物の育て方 - 観葉植物の扉','http://www.zin-blue025z.com/',""); 
    } else if( document.all ) { 
        window.external.AddFavorite('http://www.zin-blue025z.com/','観葉植物の育て方 - 観葉植物の扉'); 
    } else if( window.opera ) { 
    	location.href="#";
    } else if( window.print ) { 
        return true; 
    } 
} 

/*---------------------------------------------------------------------------------------------------------最終更新日--*/


function lastModified() {
var weeks = new Array('日','月','火','水','木','金','土'); 

var now = new Date(); 

var year = now.getYear(); // 年 
var month = now.getMonth() + 1; // 月 
var day = now.getDate(); // 日 
var week = weeks[ now.getDay() ]; // 曜日 
var hour = now.getHours(); // 時 
var min = now.getMinutes(); // 分 
var sec = now.getSeconds(); // 秒 

if(year < 2000) { year += 1900; } 

// 数値が1桁の場合、頭に0を付けて2桁で表示する指定 
if(month < 10) { month = "0" + month; } 
if(day < 10) { day = "0" + day; } 
if(hour < 10) { hour = "0" + hour; } 
if(min < 10) { min = "0" + min; } 
if(sec < 10) { sec = "0" + sec; } 

document.write(year + '/' + month + '/' + day);
}

/*---------------------------------------------------------------------------------------------------------ポップアップ--*/


var PopupWindow = Class.create();
PopupWindow.prototype = {
    initialize: function(className, parentElement) {
        var elements = document.getElementsByClassName(className, parentElement);
        for (var i = 0, len = elements.length; i < len; i++) {
            Event.observe(elements[i], 'click', this.addPopupEvent.bindAsEventListener(this));
            Event.observe(elements[i], 'keypress', this.addPopupEvent.bindAsEventListener(this));
        }
    },
    addPopupEvent: function() {
        var element = Event.element(event);
        var link = element.getAttribute('href');
        window.open(link);
        Event.stop(event);
	}
};

Event.observe(window, 'load', function () {
    new PopupWindow('popup');
});


/*---------------------------------------------------------------------------------------------------------ロールオーバー--*/



function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}


/*---------------------------------------------------------------------------------------------------------フォントサイズ変更--*/


FontChanger = Class.create();
FontChanger.prototype = {
  id: null,
  cookieManager: null,
  cookieName: 'body.style.fontSize',
  initialize: function(id) {
    this.id = id || 'fontChanger';
    this.cookieManager = new CookieManager();
    var fontSize = this.cookieManager.getCookie(this.cookieName);
    if (fontSize) document.body.style.fontSize = fontSize;
  },
  setCookieShelfLife: function(days) {
    this.cookieManager.cookieShelfLife = days;
  },
  change: function(fontSize) {
    document.body.style.fontSize = fontSize;
    this.cookieManager.setCookie(this.cookieName, fontSize);
  },
  reset: function() {
    document.body.style.fontSize = '';
    this.cookieManager.clearCookie(this.cookieName);
  },
  show: function() {
    var id = this.id;
    document.writeln([
'<p id="' + id + '" class="FontChanger">',
'<span title="FontChange">文字の大きさを変える</span>',
'<span id="' + id + '-small" class="Small" title="Small">小</span>',
'<span id="' + id + '-medium" class="Medium" title="Medium">中</span>',
'<span id="' + id + '-large" class="Large" title="Large">大</span>',
'</p>'
    ].join("\n"));
    Event.observe($(id + '-small' ), 'click', this.onClickSmall.bind(this));
    Event.observe($(id + '-medium'), 'click', this.onClickMedium.bind(this));
    Event.observe($(id + '-large' ), 'click', this.onClickLarge.bind(this));
  },
  onClickSmall:  function(e) { this.change('12px' ); },
  onClickMedium: function(e) { this.change('14px'); },
  onClickLarge:  function(e) { this.change('16px'); }
};
// Bootstrap
FontChanger.start = function(id) {
  var fontChanger = new FontChanger(id);
  fontChanger.setCookieShelfLife(90);
  fontChanger.show();
};

/*---------------------------------------------------------------------------------------------------------AddClips--*/


function addClips() {
AddClipsUrl    = 'http://www.zin-blue025z.com/';
AddClipsTitle  = '観葉植物の育て方 - 観葉植物の扉';
AddClipsId = '1B0A6B1CC9228';
AddClipsBcolor='#a1875a';
AddClipsNcolor='#a1875a';
AddClipsTcolor='#cccccc';
AddClipsType='0';
AddClipsVerticalAlign='middle'; 
}

/*---------------------------------------------------------------------------------------------------------AmazonAffiliate--*/


function advAmazon() {
}

/*---------------------------------------------------------------------------------------------------------GoogleAdsense--*/


function adsText() {
}
/*--------------------------------------------------------------------------------------Partition--*/
function adsUnitTop() {
google_ad_client = "pub-6318791174965911";
/* 観葉植物の扉 468x15 08/06/10 */
google_ad_slot = "9273210817";
google_ad_width = 468;
google_ad_height = 15;
}
/*--------------------------------------------------------------------------------------Partition--*/
function adsUnitBottom() {
google_ad_client = "pub-6318791174965911";
/* 観葉植物の扉 728x15 08/06/10 */
google_ad_slot = "2593838228";
google_ad_width = 728;
google_ad_height = 15;
}
/*--------------------------------------------------------------------------------------Partition--*/
function adsBanner() {
google_ad_client = "pub-6318791174965911";
/* 観葉植物の扉 468x60 08/06/10 */
google_ad_slot = "0139648550";
google_ad_width = 468;
google_ad_height = 60;
}
/*--------------------------------------------------------------------------------------Partition--*/
function adsRectangl() {
google_ad_client = "pub-6318791174965911";
/* 観葉植物の扉 336x280 08/06/10 */
google_ad_slot = "9390402561";
google_ad_width = 336;
google_ad_height = 280;
}
/*--------------------------------------------------------------------------------------Partition--*/
function adsWidth() {
google_ad_client = "pub-6318791174965911";
/* 観葉植物の扉 160x600 08/06/10 */
google_ad_slot = "8950217437";
google_ad_width = 160;
google_ad_height = 600;
}


/*End*/