﻿/* 就職論 http://dw.web-bz.com/shushoku/ JavaScript File */
/* Copyright(C) 2004-2010 All Rights Reserved. Powerd by web-bz.com. 
 *
/*--------------------------------------------------------------------------*/

//onClick

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

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();
};


//お気に入り登録
function addBookmark() { 
    if (window.sidebar) { 
        window.sidebar.addPanel('就職論','http://dw.web-bz.com/shushoku/',""); 
    } else if( document.all ) { 
        window.external.AddFavorite('http://dw.web-bz.com/shushoku/','就職論'); 
    } else if( window.opera ) { 
    	location.href="#";
    } else if( window.print ) { 
        return true; 
    } 
} 



//AddClips

function addClips() {
AddClipsUrl = 'http://dw.web-bz.com/shushoku/';
AddClipsTitle = '就職論';
AddClipsId = '1846E3D586B11';
AddClipsBcolor='#996666';
AddClipsNcolor='#fffaf0';
AddClipsTcolor='#666666';
AddClipsType = '0';
AddClipsVerticalAlign = 'middle'; 
AddClipsDefault = 'bookmark'; 
}


//GoogleAdsense
function adsUnit() { 
google_ad_client = "pub-6318791174965911";
/* 就職論 468x15 */
google_ad_slot = "6559626004";
google_ad_width = 468;
google_ad_height = 15;
} 
function adsRectangl() { 
google_ad_client = "pub-6318791174965911";
/* 就職論 336x280 */
google_ad_slot = "5557486095";
google_ad_width = 336;
google_ad_height = 280;
} 
function adsWidth() { 
google_ad_client = "pub-6318791174965911";
/* 就職論 160x600 */
google_ad_slot = "2820011618";
google_ad_width = 160;
google_ad_height = 600;
} 


//GoogleAnalysis

//日付など
function time() { 
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('現在：<B>' + year + '年' + month + '月' + day + '日（' + week + '）'); 
document.write(hour + '時' + min + '分' + sec + '秒</B>'); 
// 表示終了 
// 表示開始 
document.write('現在：' + year + '年' + month + '月' + day + '日'); 
// 表示終了 
// 表示開始 
document.write(year + '/' + month + '/' + day); 
// 表示終了 
// 表示開始 
document.write(hour + ':' + min); 
// 表示終了 

}

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

var lastup = new Date(document.lastModified); 

var year = lastup.getYear(); // 年 
var month = lastup.getMonth() + 1; // 月 
var day = lastup.getDate(); // 日 
var week = weeks[ lastup.getDay() ]; // 曜日 
var hour = lastup.getHours(); // 時 
var min = lastup.getMinutes(); // 分 
var sec = lastup.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('更新日時：<B>' + year + '年' + month + '月' + day + '日（' + week + '）'); 
document.write(hour + '時' + min + '分' + sec + '秒</B>'); 
// 表示終了 
// 表示開始 
document.write('更新日：' + year + '年' + month + '月' + day + '日'); 
// 表示終了 

// 表示開始 
document.write('LastUpdate: ' + year + '/' + month + '/' + day); 
// 表示終了 
}











/* End JavaScript File */
