﻿/* Site 造園.com JavaScript File */
/*
/*--------------------------------------------------------------------------*/

//home

function onHome() {
    location.href="http://gr.web-bz.com/zouen/";
}

function onUp() {
    location.hash="up";
}

function onDown() {
    location.hash="down";
}

function onReturn() {
    history.back();
	return false;
}

//Popup
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');
});


// FontChanger
// Copyright (c) 2007 Hirotaka Ogawa
// REQUIRES: prototype.js, cookiemanager.js
// http://

//フォントサイズ変更
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([
'<ul id="' + id + '" class="FontChanger">',
'<li title="FontChange">FontChange</li>',
'<li id="' + id + '-small" class="Small" title="Small">小 Small</li>',
'<li id="' + id + '-medium" class="Medium" title="Medium">中 Medium</li>',
'<li id="' + id + '-large" class="Large" title="Large">大 Large</li>',
'</ul>'
    ].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();
};


//カラー変更
ColorChanger = Class.create();
ColorChanger.prototype = {
  id: null,
  cookieManager: null,
  cookieName: 'body.style.color',
  initialize: function(id) {
    this.id = id || 'colorChanger';
    this.cookieManager = new CookieManager();
    var color = this.cookieManager.getCookie(this.cookieName);
    if (color) document.body.style.color = color;
  },
  setCookieShelfLife: function(days) {
    this.cookieManager.cookieShelfLife = days;
  },
  change: function(color) {
    document.body.style.color = color;
    this.cookieManager.setCookie(this.cookieName, color);
  },
  reset: function() {
    document.body.style.color = '';
    this.cookieManager.clearCookie(this.cookieName);
  },
  show: function() {
    var id = this.id;
    document.writeln([
'<ul id="' + id + '" class="ColorChanger">',
'<li title="ColorChange">ColorChange</li>',
'<li id="' + id + '-black" class="Black" title="Black">Black</li>',
'<li id="' + id + '-dimgray" class="Dimgray" title="Dimgray">Dimgray</li>',
'<li id="' + id + '-darkslategray" class="Darkslategray" title="Darkslategray">Darkslategray</li>',
'</ul>'
    ].join("\n"));
    Event.observe($(id + '-black' ), 'click', this.onClickBlack.bind(this));
    Event.observe($(id + '-dimgray'), 'click', this.onClickDimgray.bind(this));
    Event.observe($(id + '-darkslategray' ), 'click', this.onClickDarkslategray.bind(this));
  },
  onClickBlack:  function(e) { this.change('black' ); },
  onClickDimgray: function(e) { this.change('dimgray'); },
  onClickDarkslategray:  function(e) { this.change('darkslategray'); }
};
// Bootstrap
ColorChanger.start = function(id) {
  var colorChanger = new ColorChanger(id);
  colorChanger.setCookieShelfLife(90);
  colorChanger.show();
};


//BookMark
function addBookmark() { 
    if (window.sidebar) { 
        window.sidebar.addPanel('庭木の手入れ･剪定-造園.com','http://gr.web-bz.com/zouen/',""); 
    } else if( document.all ) { 
        window.external.AddFavorite('http://gr.web-bz.com/zouen/','庭木の手入れ･剪定-造園.com'); 
    } else if( window.opera ) { 
    	location.href="#";
    } else if( window.print ) { 
        return true; 
    } 
} 


//AddClips

function addClips() {
<!--
AddClipsUrl    = 'http://gr.web-bz.com/zouen/';
AddClipsTitle  = '庭木の手入れ･剪定-造園.com';
AddClipsId = '2FB04CDBE6D90';
AddClipsBcolor='#cc9966';
AddClipsNcolor='#fffff0';
AddClipsTcolor='#666666';
AddClipsType='0';
AddClipsVerticalAlign='middle'; 
//-->
}


//AmazonAffiliate
function advOne() { 
} 



//GoogleAdsense
function adsText() { 
} 
function adsUnit() { 
<!--
google_ad_client = "pub-6318791174965911";
/* 造園.com 468x15 */
google_ad_slot = "9182426072";
google_ad_width = 468;
google_ad_height = 15;
//-->
} 

function adsRectangl() { 
<!--
google_ad_client = "pub-6318791174965911";
/* 造園.com 336x280 */
google_ad_slot = "7475566267";
google_ad_width = 336;
google_ad_height = 280;
//-->
} 

function adsWidth() { 
<!--
google_ad_client = "pub-6318791174965911";
/* 造園.com 160x600 */
google_ad_slot = "6954050495";
google_ad_width = 160;
google_ad_height = 600;
//-->
} 



/* End JavaScript File */
