﻿/* Site FashionDirectory JavaScript File */
/* Copyright(C) 2004-2010 FashionDirectory All Rights Reserved. Powerd by web-bz.com. 
 *
/*--------------------------------------------------------------------------*/

//ホーム

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

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

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

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

//ポップアップ
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('ファッション用語-FashionDirectory-','http://fo.web-bz.com/fashion/',""); 
    } else if( document.all ) { 
        window.external.AddFavorite('http://fo.web-bz.com/fashion/','ファッション用語-FashionDirectory-'); 
    } else if( window.opera ) { 
    	location.href="#";
    } else if( window.print ) { 
        return true; 
    } 
} 



//AddClips

function addClips() {
<!--
AddClipsUrl    = 'http://fo.web-bz.com/fashion/';
AddClipsTitle  = 'ファッション用語-FashionDirectory-';
AddClipsId = '26BB80E4B539C';
AddClipsBcolor='#696969';
AddClipsNcolor='#f8f8ff';
AddClipsTcolor='#333333';
AddClipsType='0';
AddClipsVerticalAlign='middle'; 
//-->
}


//AmazonAffiliate
function advOne() { 
} 



//GoogleAdsense
function adsText() { 
} 
function adsUnit() { 
<!--
google_ad_client = "pub-6318791174965911";
//FashionDirectory 468x15
google_ad_slot = "6331666131";
google_ad_width = 468;
google_ad_height = 15;
//-->
} 

function adsRectangl() { 
<!--
google_ad_client = "pub-6318791174965911";
//FashionDirectory 336x280
google_ad_slot = "8772623620";
google_ad_width = 336;
google_ad_height = 280;
//-->
} 

function adsWidth() { 
<!--
google_ad_client = "pub-6318791174965911";
//FashionDirectory 160x600
google_ad_slot = "6265486487";
google_ad_width = 160;
google_ad_height = 600;
//-->
} 




/* End JavaScript File */
