
/*--------------------------------------------------------------------------*/
/*
 *  OCBox
/*
/*--------------------------------------------------------------------------*/

function OCBox(idno){
	bc=('box_close'+(idno));
	bo=('box_open'+(idno));
	if(document.getElementById(bc).style.display == "none" ){
		document.getElementById(bc).style.display = "block";
		document.getElementById(bo).style.display = "none";
	}
	else{
		document.getElementById(bc).style.display = "none";
		document.getElementById(bo).style.display = "block";
	}
}

/*--------------------------------------------------------------------------*/
/*
 *  Tool Tips
/*
/*--------------------------------------------------------------------------*/
//
// qTip - CSS Tool Tips - by Craig Erskine
// http://qrayg.com
//
// Multi-tag support by James Crooke
// http://www.cj-design.com
//
// Inspired by code from Travis Beckham
// http://www.squidfingers.com | http://www.podlob.com
//
// A copy of the license is included in the section entitled "GNU
// Free Documentation License".
//
/*--------------------------------------------------------------------------*/

var qTipTag = "a,label,input";
var qTipX = 0;
var qTipY = 15;
tooltip = {name : "qTip", offsetX : qTipX, offsetY : qTipY,tip : null}
tooltip.init=function(){
	var tipNameSpaceURI = "http://www.w3.org/1999/xhtml";
	if(!tipContainerID){
		var tipContainerID = "qTip";
	}
	var tipContainer = document.getElementById(tipContainerID);
	if(!tipContainer){
		tipContainer = document.createElementNS ? document.createElementNS(tipNameSpaceURI, "div") : document.createElement("div");
		tipContainer.setAttribute("id", tipContainerID);
		document.getElementsByTagName("body").item(0).appendChild(tipContainer);
	}
	if (!document.getElementById) return;
	this.tip = document.getElementById (this.name);
	if (this.tip) document.onmousemove = function (evt){
		tooltip.move(evt)
	};
	var a, sTitle, elements;
	var elementList = qTipTag.split(",");
	for(var j = 0; j < elementList.length; j++){
		elements = document.getElementsByTagName(elementList[j]);
		if(elements){
			for (var i = 0; i < elements.length; i ++){
				a = elements[i];
				sTitle = a.getAttribute("title");				
				if(sTitle){
					a.setAttribute("tiptitle", sTitle);
					a.removeAttribute("title");
					a.removeAttribute("alt");
					a.onmouseover = function(){
						tooltip.show(this.getAttribute('tiptitle'))
					};
					a.onmouseout = function(){
						tooltip.hide()
					};
				}
			}
		}
	}
}

/*--------------------------------------------------------------------------*/
/*
 *  Tool Tips[image]
/*
/*--------------------------------------------------------------------------*/

tooltip.move = function (evt) {
	var x=0, y=0;
	if (document.all){
		x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		x += window.event.clientX;
		y += window.event.clientY;
		
	}
	else{
		x = evt.pageX;
		y = evt.pageY;
	}
	this.tip.style.left = (x + this.offsetX) + "px";
	this.tip.style.top = (y + this.offsetY) + "px";
}
tooltip.show = function (text){
	if (!this.tip) return;
	this.tip.innerHTML = text;
	this.tip.style.display = "block";
}
tooltip.hide = function (){
	if (!this.tip) return;
	this.tip.innerHTML = "";
	this.tip.style.display = "none";
}
window.onload = function (){
	tooltip.init ();
}
this.imagePreview = function(){	
	xOffset = 10;
	yOffset = 30;
	$("a.preview").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='preview'><img src='"+ this.href +"' alt='' />"+ c +"</p>");								 
		$("#preview").css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px").fadeIn("fast");
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });
	$("a.preview").mousemove(function(e){
		$("#preview").css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px");
	});	
};
$(document).ready(function(){
	imagePreview();
});
this.screenshotPreview = function(){	
	xOffset = 1;
	yOffset = 1;
	$("a.screenshot").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshot'><img src='"+ this.rel +"' alt='' style='width: 240px;' />"+ c +"</p>");								 
		$("#screenshot").css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px").fadeIn("fast");
    },
	function(){
		this.title = this.t;	
		$("#screenshot").remove();
    });
	$("a.screenshot").mousemove(function(e){
		$("#screenshot").css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px");
	});
};
$(document).ready(function(){
	screenshotPreview();
});

/*--------------------------------------------------------------------------*/
/*
 *  Rollovers
/*
/*--------------------------------------------------------------------------*/

function initRollovers() {
	if (!document.getElementById) return
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');
	for (var i = 0; i < aImages.length; i++) {
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+ftype);
			aImages[i].setAttribute('hsrc', hsrc);
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}
try{
	window.addEventListener("load",initRollovers,false);
}
catch(e){
	window.attachEvent("onload",initRollovers);
}

/*--------------------------------------------------------------------------*/
/*
 *  j_hover
/*
/*--------------------------------------------------------------------------*/

$(document).ready(function(){
	$("img.j_hover").fadeTo(0,1.0);
	$("img.j_hover").hover(function(){
		$(this).fadeTo(200,0.6);
	},
	function(){
		$(this).fadeTo(150,1.0);
	});
});

/*--------------------------------------------------------------------------*/
/*
 *  QuickFlip
/*
/*--------------------------------------------------------------------------*/
//
// Copyright (c) 2009 Jon Raasch (http://jonraasch.com/)
// Licensed under the FreeBSD License (See terms below)
//
// @version 2.0.0
//
// Open source under the FreeBSD License.
//
/*--------------------------------------------------------------------------*/

(function($){
	$.quickFlip = {
		wrappers : [],
		options  : [],
		objs     : [],
		init : function( options, box ) {
			var options = options || {};
			options.closeSpeed = options.closeSpeed || 180;
			options.openSpeed  = options.openSpeed  || 120;
			options.ctaSelector = options.ctaSelector || '.quickFlipCta';
			options.refresh = options.refresh || false;
			options.easing = options.easing || 'swing';
			var $box = typeof( box ) != 'undefined' ? $(box) : $('.quickFlip');
			var $kids = $box.children();
			if ( $box.css('position') == 'static' ) $box.css('position', 'relative');
			var i = $.quickFlip.wrappers.length;
			$kids.each(function(j) {
				var $this = $(this);
				if ( options.ctaSelector ) $.quickFlip.attachHandlers($(options.ctaSelector, $this), i, j);
				if ( j ) $this.hide();
			});
			$.quickFlip.options.push( options );
			$.quickFlip.objs.push({$box : $($box), $kids : $($kids)});
			$.quickFlip.buildQuickFlip(i);
			$(window).resize( function() {
				for ( var i = 0; i < $.quickFlip.wrappers.length; i++ ) {
					$.quickFlip.removeFlipDivs(i);
					$.quickFlip.buildQuickFlip(i);
				}
			});
		},
        buildQuickFlip : function(i, currPanel) {
			$.quickFlip.options[i].panelWidth = $.quickFlip.options[i].panelWidth || $.quickFlip.objs[i].$box.width();
			$.quickFlip.options[i].panelHeight = $.quickFlip.options[i].panelHeight || $.quickFlip.objs[i].$box.height();
			var options = $.quickFlip.options[i];
			var thisFlip = {
				wrapper    : $.quickFlip.objs[i].$box,
				index      : i,
				halfwidth  : parseInt( options.panelWidth / 2),
				classNames : [],
				panels     : [],
				flipDivs   : [],
				flipDivCols : [],
				currPanel   : currPanel || 0,
				options     : options
			};
			$.quickFlip.objs[i].$kids.each(function(j) {
				var $thisPanel = addPanelCss( $(this) );
				thisFlip.panels.push( $thisPanel );
				thisFlip.classNames.push( $thisPanel[0].className );
				var $flipDivs = buildFlip( thisFlip, j ).hide().appendTo(thisFlip.wrapper);
				thisFlip.flipDivs.push( $flipDivs );
				thisFlip.flipDivCols.push( $flipDivs.children() );
			});
			$.quickFlip.wrappers[i] = thisFlip;
			function buildFlip( x, y ) {
				var $out = $('<div></div>');
				var inner = x.panels[y].html();
				var $leftCol = $(buildFlipCol(x, x.classNames[y], inner)).appendTo( $out );
				var $rightCol = $(buildFlipCol(x, x.classNames[y], inner)).appendTo( $out );
				$leftCol.css('right', x.halfwidth);
				$rightCol.css('left', x.halfwidth);
				$rightCol.children().css({
					right : 0,
					left : 'auto'
				});
				return $out;
			}
			function buildFlipCol(x, classNames, inner ) {
				var $col = $('<div></div>');
				$col.css({
					width : x.halfwidth,
					height : options.panelHeight,
					position : 'absolute',
					top : 0,
					overflow : 'hidden',
					margin : 0,
					padding : 0
				});
				var $inner = addPanelCss('<div></div>');
				$inner.addClass(classNames);
				$inner.html(inner);
				$col.html($inner);
				return $col;
			}
			function addPanelCss( $panel ) {
				if ( typeof( $panel.css ) == 'undefined' ) $panel = $( $panel );
				$panel.css({
					position : 'absolute',
					top : 0,
					left : 0,
					margin : 0,
					padding : 0,
					width : options.panelWidth,
					height : options.panelHeight
				});
				return $panel;
			}
		},
		flip : function( i, nextPanel, repeater, options) {
			if ( typeof(i) != 'number' || typeof($.quickFlip.wrappers[i]) == 'undefined' ) return false;
			var x = $.quickFlip.wrappers[i];
			var j = x.currPanel;
			var k = ( typeof(nextPanel) != 'undefined' && nextPanel != null ) ? nextPanel : ( x.panels.length > j + 1 ) ? j + 1 : 0;
			x.currPanel = k;
			var repeater = typeof(repeater) != 'undefined' ? repeater : 1;
			var options = $.quickFlip.combineOptions( options, $.quickFlip.options[i] );
			x.panels[j].hide()
			if ( options.refresh ) {
				$.quickFlip.removeFlipDivs(i);
				$.quickFlip.buildQuickFlip(i, k);
				x = $.quickFlip.wrappers[i];
			}
			x.flipDivs[j].show();
			var panelFlipCount1 = 0;
			var panelFlipCount2 = 0;
			x.flipDivCols[j].animate( { width : 0 }, options.closeSpeed, options.easing, function() {
				if (!panelFlipCount1) {
					panelFlipCount1++;
				}
				else {
					x.flipDivs[k].show();
					x.flipDivCols[k].css( 'width', 0 );
					x.flipDivCols[k].animate( { width : x.halfwidth }, options.openSpeed, options.easing, function() {
						if ( !panelFlipCount2 ) {
							panelFlipCount2++;
						}
						else {
							x.flipDivs[k].hide();
							x.panels[k].show();
							switch(repeater) {
								case 0:
								case -1:
								$.quickFlip.flip( i, null, -1);
								break;
								case 1: 
								break;
								default:
								break;
							}
						}
					});
				}
			});
		},
		attachHandlers : function($the_cta, i, panel) {
			$the_cta.click(function(ev) {
				ev.preventDefault();
				$.quickFlip.flip(i);
			});
		},
		removeFlipDivs : function(i) {	for ( var j = 0; j < $.quickFlip.wrappers[i].flipDivs.length; j++ ) $.quickFlip.wrappers[i].flipDivs[j].remove();},
		compareObjs : function(obj1, obj2) {
			if (!obj1 || !obj2 || !obj1.length || !obj2.length || obj1.length != obj2.length) return false;
			for ( var i=0; i < obj1.length; i++ ) {if (obj1[i]!==obj2[i]) return false;}
			return true;
		},
		combineOptions : function( opts1, opts2 ) {
			opts1 = opts1 || {};
			opts2 = opts2 || {};
			for ( x in opts1 ) {opts2[x] = opts1[x];}
			return opts2;
		}
	};
	$.fn.quickFlip = function( options ) {
		this.each( function() {new $.quickFlip.init( options, this );});
		return this;
	};
	$.fn.whichQuickFlip = function() {
		var out = null;
		for ( var i=0; i < $.quickFlip.wrappers.length; i++ ) {if ( $.quickFlip.compareObjs(this, $( $.quickFlip.wrappers[i].wrapper)) ) out = i;}
		return out;
	};
	$.fn.quickFlipper = function( options, nextPanel, repeater ) {
		this.each( function() {
			var $this = $(this);
			var thisIndex = $this.whichQuickFlip();
			if ( thisIndex == null ) {$this.quickFlip( options );thisIndex = $this.whichQuickFlip();}
			$.quickFlip.flip( thisIndex, nextPanel, repeater, options );
		});
	};
})( jQuery );


/*--------------------------------------------------------------------------*/
/*
 *  ID
/*
/*--------------------------------------------------------------------------*/

$('document').ready(function(){
	$('#ranking_outer').quickFlip();
	$('#tab li a').each(function(){
		$(this).click(function(){
			$('#tab li').each(function(){
				$(this).removeClass('selected');
			});
			$(this).parent().addClass('selected');
			var flipid=$(this).attr('id').substr(4);
			$('#ranking_outer').quickFlipper({ }, flipid, 1);
			return false;
		});
	});
});

/*--------------------------------------------------------------------------*/
/*
 *  boxgrid
/*
/*--------------------------------------------------------------------------*/


$('document').ready(function(){
	$('.boxgrid.caption').hover(function(){
		$(".cover", this).stop().animate({bottom:"0"},{queue:false,duration:160});
	},
	function() {
		$(".cover", this).stop().animate({bottom:"-90px"},{queue:false,duration:160});
	});
	$('.minigrid.caption').hover(function(){
		$(".cover", this).stop().animate({bottom:"0"},{queue:false,duration:160});
	},
	function() {
		$(".cover", this).stop().animate({bottom:"-110px"},{queue:false,duration:160});
	});
	$('.photogrid.caption').hover(function(){
		$(".cover", this).stop().animate({bottom:"0"},{queue:false,duration:160});
	},
	function() {
		$(".cover", this).stop().animate({bottom:"-110px"},{queue:false,duration:160});
	});
});

/*--------------------------------------------------------------------------*/
/*
/* inputlength - 文字数のカウント
/*
/*--------------------------------------------------------------------------*/

function ShowLength(str, num) {
	document.getElementById("inputlength" + num).innerHTML = str.length;
}

/*--------------------------------------------------------------------------*/
/*
/* navi_over - クラマネのナビのマウスオーバー
/*
/*--------------------------------------------------------------------------*/

$(document).ready(function() {
	$("#topnav li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	$("#topnav li").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the a tag
		$(this).find("span").show().html(linkText); //Add the text in the span tag
	}); 
	$("#topnav li").hover(function() {	//On hover...
		$(this).find("span").stop().animate({ 
			marginTop: "-40" //Find the span tag and move it up 40 pixels
		}, 100);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0" //Move the span back to its original state (0px)
		}, 100);
	});
});
$(document).ready(function() {
	$("#topnav2 li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	$("#topnav2 li").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the a tag
		$(this).find("span").show().html(linkText); //Add the text in the span tag
	}); 
	$("#topnav2 li").hover(function() {	//On hover...
		$(this).find("span").stop().animate({ 
			marginTop: "-40" //Find the span tag and move it up 40 pixels
		}, 100);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0" //Move the span back to its original state (0px)
		}, 100);
	});
});


/*--------------------------------------------------------------------------*/
/*
/* jQuery UI 1.5.2
/*
/* Copyright (c) 2008 Paul Bakaus (ui.jquery.com)
/* Dual licensed under the MIT (MIT-LICENSE.txt)
/* and GPL (GPL-LICENSE.txt) licenses.
/*
/* http://docs.jquery.com/UI
/*
/*--------------------------------------------------------------------------*/


(function($) {
	$.ui = {
		plugin: {
			add: function(module, option, set) {
				var proto = $.ui[module].prototype;
				for(var i in set) {
					proto.plugins[i] = proto.plugins[i] || [];
					proto.plugins[i].push([option, set[i]]);
				}
			},
			call: function(instance, name, args) {
				var set = instance.plugins[name];
				if(!set) { return; }
				for (var i = 0; i < set.length; i++) {
					if (instance.options[set[i][0]]) {
						set[i][1].apply(instance.element, args);
					}
				}
			}
		},
		cssCache: {},
		css: function(name) {
			if ($.ui.cssCache[name]) {
				return $.ui.cssCache[name];
			}
			var tmp = $('<div class="ui-gen">').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body');
			$.ui.cssCache[name] = !!((!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) ||!(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))));
			try {
				$('body').get(0).removeChild(tmp.get(0));
			}
			catch(e){}
			return $.ui.cssCache[name];
		},
		disableSelection: function(el) {
			$(el).attr('unselectable', 'on').css('MozUserSelect', 'none');
		},
		enableSelection: function(el) {
			$(el).attr('unselectable', 'off').css('MozUserSelect', '');
		},
		hasScroll: function(e, a) {
			var scroll = /top/.test(a||"top") ? 'scrollTop' : 'scrollLeft', has = false;
			if (e[scroll] > 0) return true; e[scroll] = 1;
			has = e[scroll] > 0 ? true : false; e[scroll] = 0;
			return has;
		}
	};
	var _remove = $.fn.remove;
	$.fn.remove = function() {
		$("*", this).add(this).triggerHandler("remove");
		return _remove.apply(this, arguments );
	};
	function getter(namespace, plugin, method) {
		var methods = $[namespace][plugin].getter || [];
		methods = (typeof methods == "string" ? methods.split(/,?\s+/) : methods);
		return ($.inArray(method, methods) != -1);
	}
	$.widget = function(name, prototype) {
		var namespace = name.split(".")[0];
		name = name.split(".")[1];
		$.fn[name] = function(options) {
			var isMethodCall = (typeof options == 'string'), args = Array.prototype.slice.call(arguments, 1);
			if (isMethodCall && getter(namespace, name, options)) {
				var instance = $.data(this[0], name);
				return (instance ? instance[options].apply(instance, args) : undefined);
			}
			return this.each(function() {
			var instance = $.data(this, name);
				if (isMethodCall && instance && $.isFunction(instance[options])) {
					instance[options].apply(instance, args);
				}
				else if (!isMethodCall) {
					$.data(this, name, new $[namespace][name](this, options));
				}
			});
		};
		$[namespace][name] = function(element, options) {
			var self = this;
			this.widgetName = name;
			this.widgetBaseClass = namespace + '-' + name;
			this.options = $.extend({}, $.widget.defaults, $[namespace][name].defaults, options);
			this.element = $(element).bind('setData.' + name, function(e, key, value) {
				return self.setData(key, value);
			})
			.bind('getData.' + name, function(e, key) {
				return self.getData(key);
			})
			.bind('remove', function() {
				return self.destroy();
			});
			this.init();
		};
		$[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
	};
	$.widget.prototype = {
		init: function() {},
		destroy: function() {
			this.element.removeData(this.widgetName);
		},
		getData: function(key) {
			return this.options[key];
		},
		setData: function(key, value) {
			this.options[key] = value;
			if (key == 'disabled') {
				this.element[value ? 'addClass' : 'removeClass'](
					this.widgetBaseClass + '-disabled');
			}
		},
		enable: function() {
			this.setData('disabled', false);
		},
		disable: function() {
			this.setData('disabled', true);
		}
	};
	$.widget.defaults = {disabled: false};
	$.ui.mouse = {
		mouseInit: function() {
			var self = this;
			this.element.bind('mousedown.'+this.widgetName, function(e) {
				return self.mouseDown(e);
			});
			if ($.browser.msie) {
				this._mouseUnselectable = this.element.attr('unselectable');
				this.element.attr('unselectable', 'on');
			}
			this.started = false;
		},
		mouseDestroy: function() {
			this.element.unbind('.'+this.widgetName);
			($.browser.msie
				&& this.element.attr('unselectable', this._mouseUnselectable));
		},
		mouseDown: function(e) {
			(this._mouseStarted && this.mouseUp(e));
			this._mouseDownEvent = e;
			var self = this,
				btnIsLeft = (e.which == 1),
				elIsCancel = (typeof this.options.cancel == "string" ? $(e.target).parents().add(e.target).filter(this.options.cancel).length : false);
			if (!btnIsLeft || elIsCancel || !this.mouseCapture(e)) {
				return true;
			}
			this._mouseDelayMet = !this.options.delay;
			if (!this._mouseDelayMet) {
				this._mouseDelayTimer = setTimeout(function() {
					self._mouseDelayMet = true;
				}, this.options.delay);
			}
			if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
				this._mouseStarted = (this.mouseStart(e) !== false);
				if (!this._mouseStarted) {
					e.preventDefault();
					return true;
				}
			}
			this._mouseMoveDelegate = function(e) {
				return self.mouseMove(e);
			};
			this._mouseUpDelegate = function(e) {
				return self.mouseUp(e);
			};
			$(document)
				.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
				.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
			
			return false;
		},
		mouseMove: function(e) {
			if ($.browser.msie && !e.button) {
				return this.mouseUp(e);
			}
			if (this._mouseStarted) {
				this.mouseDrag(e);
				return false;
			}
			if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
				this._mouseStarted =
					(this.mouseStart(this._mouseDownEvent, e) !== false);
				(this._mouseStarted ? this.mouseDrag(e) : this.mouseUp(e));
			}
			return !this._mouseStarted;
		},
		mouseUp: function(e) {
			$(document)
				.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
				.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
			if (this._mouseStarted) {
				this._mouseStarted = false;
				this.mouseStop(e);
			}
			return false;
		},
		mouseDistanceMet: function(e) {
			return (Math.max(
					Math.abs(this._mouseDownEvent.pageX - e.pageX),
					Math.abs(this._mouseDownEvent.pageY - e.pageY)
				) >= this.options.distance
			);
		},
		mouseDelayMet: function(e) {
			return this._mouseDelayMet;
		},
		mouseStart: function(e) {},
		mouseDrag: function(e) {},
		mouseStop: function(e) {},
		mouseCapture: function(e) { return true; }
	};
	$.ui.mouse.defaults = {
		cancel: null,
		distance: 1,
		delay: 0
	};

})(jQuery);


/*--------------------------------------------------------------------------*/
/*
 * jquery.scrollFollow.js
 * Copyright (c) 2008 Net Perspective (http://kitchen.net-perspective.com/)
 * Licensed under the MIT License (http://www.opensource.org/licenses/mit-license.php)
 * 
 * @author R.A. Ray
 *
 * @projectDescription	jQuery plugin for allowing an element to animate down as the user scrolls the page.
 * 
 * @version 0.4.0
 * 
 * @requires jquery.js (tested with 1.2.6)
 * @requires ui.core.js (tested with 1.5.2)
 * 
 * @optional jquery.cookie.js (http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/)
 * @optional jquery.easing.js (http://gsgd.co.uk/sandbox/jquery/easing/ - tested with 1.3)
/*
/*--------------------------------------------------------------------------*/

(function($) {
	$.scrollFollow = function ( box, options ){
		box = $( box );
		var position = box.css( 'position' );
		function ani(){		
			box.queue( [ ] );
			var viewportHeight = parseInt( $( window ).height() );	
			var pageScroll =  parseInt( $( document ).scrollTop() );
			var parentTop =  parseInt( box.cont.offset().top );
			var parentHeight = parseInt( box.cont.attr( 'offsetHeight' ) );
			var boxHeight = parseInt( box.attr( 'offsetHeight' ) + ( parseInt( box.css( 'marginTop' ) ) || 0 ) + ( parseInt( box.css( 'marginBottom' ) ) || 0 ) );
			var aniTop;
			if ( isActive ){
				if ( options.relativeTo == 'top' ){
					if ( box.initialOffsetTop >= ( pageScroll + options.offset ) ){
						aniTop = box.initialTop;
					}
					else{
						aniTop = Math.min( ( Math.max( ( -parentTop ), ( pageScroll - box.initialOffsetTop + box.initialTop ) ) + options.offset ), ( parentHeight - boxHeight - box.paddingAdjustment ) );
					}
				}
				else if ( options.relativeTo == 'bottom' ){
					if ( ( box.initialOffsetTop + boxHeight ) >= ( pageScroll + options.offset + viewportHeight ) ){
						aniTop = box.initialTop;
					}
					else{
						aniTop = Math.min( ( pageScroll + viewportHeight - boxHeight - options.offset ), ( parentHeight - boxHeight ) );
					}
				}
				if ( ( new Date().getTime() - box.lastScroll ) >= ( options.delay - 20 ) ){
					box.animate({top: aniTop},options.speed,options.easing);
				}
			}
		};
		var isActive = true;
		if ( $.cookie != undefined ){
			if( $.cookie( 'scrollFollowSetting' + box.attr( 'id' ) ) == 'false' ){
				var isActive = false;
				$( '#' + options.killSwitch ).text( options.offText ).toggle(function (){
					isActive = true;
					$( this ).text( options.onText );
					$.cookie( 'scrollFollowSetting' + box.attr( 'id' ), true, { expires: 365, path: '/'} );
					ani();
				},
				function (){
					isActive = false;
					$( this ).text( options.offText );
					box.animate({top: box.initialTop},options.speed, options.easing);	
					$.cookie( 'scrollFollowSetting' + box.attr( 'id' ), false, { expires: 365, path: '/'} );
				});
			}
			else{
				$( '#' + options.killSwitch ).text( options.onText )
				.toggle(function (){
					isActive = false;
					$( this ).text( options.offText );
					box.animate({top: box.initialTop}, 0);	
					$.cookie( 'scrollFollowSetting' + box.attr( 'id' ), false, {
						expires: 365, path: '/'
					});
				},
				function (){
					isActive = true;
					$( this ).text( options.onText );
					$.cookie( 'scrollFollowSetting' + box.attr( 'id' ), true, { expires: 365, path: '/'} );
					ani();
				});
			}
		}
		if ( options.container == ''){
			box.cont = box.parent();
		}
		else{
			box.cont = $( '#' + options.container );
		}
		box.initialOffsetTop =  parseInt( box.offset().top );
		box.initialTop = parseInt( box.css( 'top' ) ) || 0;
		if ( box.css( 'position' ) == 'relative' ){
			box.paddingAdjustment = parseInt( box.cont.css( 'paddingTop' ) ) + parseInt( box.cont.css( 'paddingBottom' ) );
		}
		else{
			box.paddingAdjustment = 0;
		}
		$( window ).scroll( function (){
			$.fn.scrollFollow.interval = setTimeout( function(){ ani();} , options.delay );
			box.lastScroll = new Date().getTime();
		});
		$( window ).resize( function (){
			$.fn.scrollFollow.interval = setTimeout( function(){ ani();} , options.delay );
			box.lastScroll = new Date().getTime();
		});
		box.lastScroll = 0;
		ani();
	};
	$.fn.scrollFollow = function ( options ){
		options = options || {};
		options.relativeTo = options.relativeTo || 'top';
		options.speed = options.speed || 500;
		options.offset = options.offset || 0;
		options.easing = options.easing || 'swing';
		options.container = options.container || this.parent().attr( 'id' );
		options.killSwitch = options.killSwitch || 'killSwitch';
		options.onText = options.onText || 'Turn Slide Off';
		options.offText = options.offText || 'Turn Slide On';
		options.delay = options.delay || 0;
		this.each( function(){
			new $.scrollFollow( this, options );
		});
		return this;
	};
})(jQuery);



/*--------------------------------------------------------------------------*/
/*
/* scrollFollow.slide
/*
/*--------------------------------------------------------------------------*/

var uniquepageid=window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, "");
function animatedcollapse(divId, animatetime, persistexpand, initstate){
	this.divId=divId;
	this.divObj=document.getElementById(divId);
	this.divObj.style.overflow="hidden";
	this.timelength=animatetime;
	var thisobj=this;
	if (isNaN(this.contentheight)){
		animatedcollapse.dotask(window, function(){thisobj._getheight(persistexpand)}, "load");
		if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes" && this.isExpanded!="")this.divObj.style.visibility="hidden";
	}
	else if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes" && this.isExpanded!="")this.divObj.style.height=0;
	if (persistexpand)animatedcollapse.dotask(window, function(){animatedcollapse.setCookie(uniquepageid+"-"+thisobj.divId, thisobj.isExpanded)}, "unload");
}
animatedcollapse.prototype._getheight=function(persistexpand){
	this.contentheight=this.divObj.offsetHeight;
	if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes"){
		this.divObj.style.height=0;
		this.divObj.style.visibility="visible";
	}
	else 	
		this.divObj.style.height=this.contentheight+"px";
}
animatedcollapse.prototype._slideengine=function(direction){
	var elapsed=new Date().getTime()-this.startTime;
	var thisobj=this;
	if (elapsed<this.timelength){
		var distancepercent=(direction=="down")? animatedcollapse.curveincrement(elapsed/this.timelength) : 1-animatedcollapse.curveincrement(elapsed/this.timelength);
		this.divObj.style.height=distancepercent * this.contentheight +"px";
		this.runtimer=setTimeout(function(){thisobj._slideengine(direction)}, 1);
	}
	else{
		this.divObj.style.height=(direction=="down")? this.contentheight+"px" : 0;
		this.isExpanded=(direction=="down")? "yes" : "no";
		this.runtimer=null;
	}
}
animatedcollapse.prototype.slidedown=function(){
	if (typeof this.runtimer=="undefined" || this.runtimer==null){
		if (isNaN(this.contentheight))alert("Please wait until document has fully loaded then click again");
		else if (parseInt(this.divObj.style.height)==0){
			this.startTime=new Date().getTime();
			this._slideengine("down");
		}
	}
}
animatedcollapse.prototype.slideup=function(){
	if (typeof this.runtimer=="undefined" || this.runtimer==null){
		if (isNaN(this.contentheight))alert("Please wait until document has fully loaded then click again");
		else if (parseInt(this.divObj.style.height)==this.contentheight){
			this.startTime=new Date().getTime();
			this._slideengine("up");
		}
	}
}
animatedcollapse.prototype.slideit=function(){
	if (isNaN(this.contentheight))alert("Please wait until document has fully loaded then click again");
	else if (parseInt(this.divObj.style.height)==0)this.slidedown();
	else if (parseInt(this.divObj.style.height)==this.contentheight)this.slideup();
}
animatedcollapse.curveincrement=function(percent){
	return (1-Math.cos(percent*Math.PI)) / 2;
}
animatedcollapse.dotask=function(target, functionref, tasktype){ 
	var tasktype=(window.addEventListener)? tasktype : "on"+tasktype;
	if (target.addEventListener)target.addEventListener(tasktype, functionref, false);
	else if (target.attachEvent)target.attachEvent(tasktype, functionref);
}
animatedcollapse.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i");
	if (document.cookie.match(re))return document.cookie.match(re)[0].split("=")[1];
	return "";
}
animatedcollapse.setCookie=function(name, value){
  document.cookie = name+"="+value;
}


/*--------------------------------------------------------------------------*/
/*
/* Rotation_banner
/*
/*--------------------------------------------------------------------------*/

ban = new Array(18);
ban[0] = "<a href='/s9010000705/'><img src='/images/common/banner/1201.jpg' alt='aL-ter LieN' class='j_hover' /></a>";
ban[1] = "<a href='/s7010000011/'><img src='/images/common/banner/1310.jpg' alt='スタイルインデックス池袋' class='j_hover' /></a>";
ban[2] = "<a href='/fword%E3%83%A6%E3%83%BC%E3%83%95%E3%82%A9%E3%83%AA%E3%82%A2/'><img src='/images/common/banner/1304.jpg' alt='ユーフォリア' class='j_hover' /></a>";
ban[3] = "<a href='/fword%E3%82%AB%E3%83%9F%E3%83%AF%E3%82%B6/'><img src='/images/common/banner/1302.jpg' alt='髪技' class='j_hover' /></a>";
ban[4] = "<a href='http://shimokita.biguinejp.com/' target='_blank'><img src='/images/common/banner/1306.jpg' alt='JEAN-CLAUDE BIGUINE 下北沢店' class='j_hover' /></a>";
ban[5] = "<a href='http://www.le-clic.com/' target='_blank'><img src='/images/common/banner/1307.jpg' alt='ルクリックアベダ' class='j_hover' /></a>";
ban[6] = "<a href='http://www.visageginza.jp/' target='_blank'><img src='/images/common/banner/1308.jpg' alt='VISAGE 銀座店' class='j_hover' /></a>";
ban[7] = "<a href='http://www.jethair.com/index.html' target='_blank'><img src='/images/common/banner/1311.jpg' alt='JET' class='j_hover' /></a>";
ban[8] = "<a href='http://www.fix-cl.com/' target='_blank'><img src='/images/common/banner/1312.jpg' alt='FiX HAIR CLINIC' class='j_hover' /></a>";
ban[9] = "<a href='http://www.arche-hair.com/index.html' target='_blank'><img src='/images/common/banner/1313.jpg' alt='アルシュヘアー' class='j_hover' /></a>";
ban[10] = "<a href='/s9010001250/'><img src='/images/common/banner/1401.jpg' alt='FORME' class='j_hover' /></a>";
ban[11] = "<a href='http://hair-room.info/' target='_blank'><img src='/images/common/banner/1403.jpg' alt='hair room' class='j_hover' /></a>";
ban[12] = "<a href='http://yellowcorn.net/' target='_blank'><img src='/images/common/banner/1404.jpg' alt='YELLOW CORN 横浜店' class='j_hover' /></a>";
ban[13] = "<a href='http://www.be-impress.com/' target='_blank'><img src='/images/common/banner/1405.jpg' alt='be impress' class='j_hover' /></a>";
ban[14] = "<a href='http://www.modshair.co.jp/index.php?id=737' target='_blank'><img src='/images/common/banner/1406.jpg' alt='mods hair' class='j_hover' /></a>";
ban[15] = "<a href='http://serendipity-hair.com/index.html' target='_blank'><img src='/images/common/banner/1407.jpg' alt='SERENDIPITY hair design' class='j_hover' /></a>";
ban[16] = "<a href='/fwordBirthday/' target='_blank'><img src='/images/common/banner/1321.jpg' alt='Birthday' class='j_hover' /></a>";
ban[17] = "<a href='fwordImage%2BAVEDA' target='_blank'><img src='/images/common/banner/1322.jpg' alt='Image AVEDA hair design' class='j_hover' /></a>";
banNo = Math.floor(Math.random() * 18);



/*--------------------------------------------------------------------------*/
/*
/* jQuery.ScrollTo
/*
/*--------------------------------------------------------------------------*/
/**
 * jQuery.ScrollShow - Scrolling Slideshow.
 * Copyright (c) 2007 Ariel Flesler - aflesler(at)gmail(dot)com
 * Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php).
 * Date: 10/30/2007
 * @author Ariel Flesler
 * @version 0.7
 *
 * @id jQuery.fn.scrollShow
 * @param {Object} settings Hash of settings (detailed below).
 * @return {jQuery} Returns the same jQuery object, for chaining.
 **/
(function($){
	var defaults = {
		elements:'img',//elements selector (relative to view)
		itemSize:{
			height:144,
			width:170
		},
		view:null,//container of the elements, the one to fix the width.
		navigators:null,//selector to the elements to navigate the slideshow.
		navigationMode:'s',//sequential, random, localscroll
		speed:600,//speed of transition, 1 for no-animation
		wrappers:'simple',//simple,resize,crop,link
		circular:false,//should the slideshow rewind/advance on the extremes ?.
		easing:'linear',//easing equation
		axis:'x',//axis to displace the slideshow
		margin:true,//take margin in account?
		start:null, //force the scroll to start at some position element.
		setWidth:false//whether to calculate and set, the overall width of the slideshow.
	};
	function wrap( $els, type, size ){//wrap the photos with several different wrappers.
		switch( type ){
			case 'crop': $els = $els.wrap('<div class="jq-ss-crop">').parent().css('overflow','hidden');					
			case 'resize': return $els.css( size );
			case 'simple': return $els.wrap('<div class="jq-ss-simple">').parent();
			default: return $els;					
		}
	};
	$.fn.scrollShow = function( settings ){
		settings = $.extend( {}, defaults, settings );
		return this.each(function(){
			var 
				widget	  = this,
				$view	  = settings.view ? $(settings.view, this) : this,
				$elements = $(settings.elements, $view),
				limit	  = $elements.length,
				active	  = 0;
			$.each( settings.wrappers.split(/\s*,\s*/), function( i, wrapper ){
				$elements = wrap( $elements, wrapper, settings.itemSize );													 
			});			
			$elements.css( settings.itemSize );//ensure the outer elements have fixed size.
			if( !settings.navigators ){//this shouldn't get to happen
				settings.navigators = '';
				settings.navigationMode = 'r';
			}
			if( settings.navigators.constructor != Array )
				settings.navigators = [settings.navigators];
			$.each( settings.navigationMode.split(''), function( i, type ){
				switch( type.charAt(0) ){
					case 's'://sequential navigation
						$(settings.navigators[i],widget)
							.eq(0).bind('click', { dir: -1 }, sequential ).end()
							.eq(1).bind('click', { dir: +1 }, sequential );
					break;
					case 'r'://random navigation
						var $nav = $(settings.navigators[i] || $elements, widget),
							ratio = $elements.length / $nav.length;
						if( ratio === Infinity ) return;//no navigator found
						$nav.each(function( pos ){
							$(this).bind( 'click', { pos: Math.floor(ratio*pos) }, random );												  
						});
					break;
				}
			});				
			(function( $e, w ){					  
				var imgw = ($e.width() + attrs('margin') + attrs('padding') + attr('border'));
				do w -= imgw;
				while( w > 0 && limit-- );//find the last element we can scroll To.
				if( !settings.setWidth ) return;
				do{
					$e = $e.parent();
					if( $e[0] == $view[0] )
						return;
				}while( $e.length > 1 );
				$e.width( imgw * $elements.length  );//if there's a container for the elements, calculate it's width.
			})( $elements, $view.width() );
			if( settings.start != null )
				random( settings.start );
			function attrs( name ){
				return attr(name+'Left') + attr(name+'Right');
			};
			function attr( name ){
				return parseInt($elements.css(name)) || 0;	
			};
			function sequential( event ){
				event.data.pos = active + event.data.dir;
				return random( event );
			};
			function random( event ){
				var pos = typeof event == 'number' ? event : event.data.pos;
				if( pos < 0 )
					pos = active == 0 && settings.circular ? limit : 0;
				else if( pos > limit )
					pos = active == limit && settings.circular ? 0 : limit;
				$view.stop().scrollTo( $elements[pos], settings );
				active = pos;
				return false;
			};				
		});
	};	  
})( jQuery );


/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007 Ariel Flesler - aflesler(at)gmail(dot)com
 * Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php).
 * Date: 10/29/2007
 * @author Ariel Flesler
 * @version 1.2.2
 * Compatible with jQuery 1.2.1, tested on Firefox 2.0.0.7, and IE 6, both on Windows.
 **/
(function($){
	$.scrollTo=function(a,b){
		return $('html,body').scrollTo(a,b)
	};
	$.fn.scrollTo=function(e,f){
		f=$.extend({axis:'y',speed:1},f||{});
		if(f.axis.length!=2)f.queue=false;
		if(f.queue)f.speed=Math.ceil(f.speed/2);
		return this.each(function(){
			var d=$(this),t=e,k,l,u={};
			switch(typeof t){
				case'string':
				if(/^([+-]=)?\d+(px)?$/.test(t))break;t=$(t,this);
				case'object':k=$(t).offset()
			}
			$.each(f.axis.split(''),parse);
			animate(f.onAfter);
			function parse(i,a){
				var b=a=='x'?'Left':'Top',p=b.toLowerCase();
				var c='scroll'+b;
				u[c]=k?k[p]+(d.is('html,body')?0:d[0][c]-d.offset()[p]):t;
				if(f.margin&&typeof t=='object')u[c]-=parseInt($(t).css('margin'+b))||0;
				if(!i&&f.queue){
					if(d[0][c]!=u[c])animate(f.onAfterFirst);
					delete u[c]
				}
			};
			function animate(a){
				d.animate(u,f.speed,f.easing,a)
			}
		}
	)}
})(jQuery);



/*--------------------------------------------------------------------------*/
/*
/* SUPERNOTE
/*
/*--------------------------------------------------------------------------*/

if(typeof addEvent!='function'){
	var addEvent=function(o,t,f,l){
		var d='addEventListener',n='on'+t,rO=o,rT=t,rF=f,rL=l;
		if(o[d]&&!l)return o[d](t,f,false);
		if(!o._evts)o._evts={};
		if(!o._evts[t]){
			o._evts[t]=o[n]?{b:o[n]}:{};
			o[n]=new Function('e','var r=true,o=this,a=o._evts["'+t+'"],i;for(i in a){o._f=a[i];r=o._f(e||window.event)!=false&&r;o._f=null}return r');
			if(t!='unload')addEvent(window,'unload',function(){removeEvent(rO,rT,rF,rL)})
		}
		if(!f._i)f._i=addEvent._i++;o._evts[t][f._i]=f};
		addEvent._i=1;
		var removeEvent=function(o,t,f,l){
			var d='removeEventListener';
			if(o[d]&&!l)return o[d](t,f,false);
			if(o._evts&&o._evts[t]&&f._i)delete o._evts[t][f._i]
		}
	}
	function cancelEvent(e,c){
		e.returnValue=false;
		if(e.preventDefault)e.preventDefault();
		if(c){
			e.cancelBubble=true;
			if(e.stopPropagation)e.stopPropagation()
		}
	};
	function SuperNote(myName,config){
		var defaults={
			myName:myName,
			allowNesting:false,
			cssProp:'visibility',
			cssVis:'inherit',
			cssHid:'hidden',
			IESelectBoxFix:true,
			showDelay:0,
			hideDelay:500,
			animInSpeed:0.1,
			animOutSpeed:0.1,
			animations:[],
			mouseX:0,
			mouseY:0,
			notes:{},
			rootElm:null,
			onshow:null,
			onhide:null
		};
		for(var p in defaults)this[p]=(typeof config[p]=='undefined')?defaults[p]:config[p];
		var obj=this;addEvent(document,'mouseover',function(evt){
			obj.mouseHandler(evt,1)
		});
		addEvent(document,'click',function(evt){
			obj.mouseHandler(evt,2)
		});
		addEvent(document,'mousemove',function(evt){
			obj.mouseTrack(evt)
		});
		addEvent(document,'mouseout',function(evt){
			obj.mouseHandler(evt,0)
		});
		this.instance=SuperNote.instances.length;SuperNote.instances[this.instance]=this}SuperNote.instances=[];
		SuperNote.prototype.bTypes={};
		SuperNote.prototype.pTypes={};
		SuperNote.prototype.pTypes.mouseoffset=function(obj,noteID,nextVis,nextAnim){
			with(obj){
				var note=notes[noteID];
				if(nextVis&&!note.animating&&!note.visible){
					note.ref.style.left=checkWinX(mouseX,note)+'px';note.ref.style.top=checkWinY(mouseY,note)+'px'
				}
			}
		};
		SuperNote.prototype.pTypes.mousetrack=function(obj,noteID,nextVis,nextAnim){
			with(obj){
				var note=notes[noteID];
				if(nextVis&&!note.animating&&!note.visible){
					var posString='with('+myName+'){var note=notes["'+noteID+'"];note.ref.style.left=checkWinX(mouseX,note)+"px";note.ref.style.top=checkWinY(mouseY,note)+"px"}';
					eval(posString);
					obj.IEFrameFix(noteID,1);
					if(!note.trackTimer)note.trackTimer=setInterval(posString,50)
				}
				else if(!nextVis&&!nextAnim){
					clearInterval(note.trackTimer);
					note.trackTimer=null
				}
			}
		};
		SuperNote.prototype.pTypes.triggeroffset=function(obj,noteID,nextVis,nextAnim){
			with(obj){
				var note=notes[noteID];
				if(nextVis&&!note.animating&&!note.visible){
					var x=0,y=0,elm=note.trigRef;
					while(elm){
						x+=elm.offsetLeft;
						y+=elm.offsetTop;
						elm=elm.offsetParent
					}
					note.ref.style.left=checkWinX(x,note)+'px';
					note.ref.style.top=checkWinY(y,note)+'px'
				}
			}
		};
		SuperNote.prototype.bTypes.pinned=function(obj,noteID,nextVis){
			with(obj){
				return(!nextVis)?false:true
			}
		};
		SuperNote.prototype.docBody=function(){
			return document[(document.compatMode&&document.compatMode.indexOf('CSS')>-1)?'documentElement':'body']
		};
		SuperNote.prototype.getWinW=function(){return this.docBody().clientWidth||window.innerWidth||0};
		SuperNote.prototype.getWinH=function(){return this.docBody().clientHeight||window.innerHeight||0};
		SuperNote.prototype.getScrX=function(){return this.docBody().scrollLeft||window.scrollX||0};
		SuperNote.prototype.getScrY=function(){return this.docBody().scrollTop||window.scrollY||0};
		SuperNote.prototype.checkWinX=function(newX,note){with(this){return Math.max(getScrX(),Math.min(newX,getScrX()+getWinW()-note.ref.offsetWidth-8))}};
		SuperNote.prototype.checkWinY=function(newY,note){with(this){return Math.max(getScrY(),Math.min(newY,getScrY()+getWinH()-note.ref.offsetHeight-8))}};
		SuperNote.prototype.mouseTrack=function(evt){with(this){mouseX=evt.pageX||evt.clientX+getScrX()||0;mouseY=evt.pageY||evt.clientY+getScrY()||0}};
		SuperNote.prototype.mouseHandler=function(evt,show){
			with(this){
				if(!document.documentElement)return true;
				var srcElm=evt.target||evt.srcElement,trigRE=new RegExp(myName+'-(hover|click)-([a-z0-9]+)','i'),targRE=new RegExp(myName+'-(note)-([a-z0-9]+)','i'),trigFind=1,foundNotes={};
				if(srcElm.nodeType!=1)srcElm=srcElm.parentNode;
				var elm=srcElm;
				while(elm&&elm!=rootElm){
					if(targRE.test(elm.id)||(trigFind&&trigRE.test(elm.className))){
						if(!allowNesting)trigFind=0;
						var click=RegExp.$1=='click'?1:0,noteID=RegExp.$2,ref=document.getElementById(myName+'-note-'+noteID),trigRef=trigRE.test(elm.className)?elm:null;
						if(ref){
							if(!notes[noteID]){
								notes[noteID]={
									click:click,ref:ref,trigRef:null,visible:0,animating:0,timer:null
								};
								ref._sn_obj=this;
								ref._sn_id=noteID
							}
							var note=notes[noteID];
							if(!note.click||(trigRef!=srcElm))foundNotes[noteID]=true;
							if(!note.click||(show==2)){
								if(trigRef)notes[noteID].trigRef=notes[noteID].ref._sn_trig=elm;display(noteID,show);
									if(note.click&&(srcElm==trigRef))cancelEvent(evt)
								}
							}
						}
						if(elm._sn_trig){
							trigFind=1;elm=elm._sn_trig
						}
						else{
							elm=elm.parentNode
						}
					}
					if(show==2)for(var n in notes){
						if(notes[n].click&&notes[n].visible&&!foundNotes[n])display(n,0)
					}
				}
			};
			SuperNote.prototype.display=function(noteID,show){
				with(this){
					with(notes[noteID]){
						clearTimeout(timer);
						if(!animating||(show?!visible:visible)){
							var tmt=animating?1:(show?showDelay||1:hideDelay||1);
							timer=setTimeout('SuperNote.instances['+instance+'].setVis("'+noteID+'",'+show+',false)',tmt)
						}
					}
				}
			};
			SuperNote.prototype.checkType=function(noteID,nextVis,nextAnim){
				with(this){
					var note=notes[noteID],bType,pType;
					if((/snp-([a-z]+)/).test(note.ref.className))pType=RegExp.$1;
					if((/snb-([a-z]+)/).test(note.ref.className))bType=RegExp.$1;
					if(nextAnim&&bType&&bTypes[bType]&&(bTypes[bType](this,noteID,nextVis)==false))return false;
					if(pType&&pTypes[pType])pTypes[pType](this,noteID,nextVis,nextAnim);return true
				}
			};
			SuperNote.prototype.setVis=function(noteID,show,now){
				with(this){
					var note=notes[noteID];
					if(note&&checkType(noteID,show,1)||now){
						note.visible=show;
						note.animating=1;
						animate(noteID,show,now)
					}
				}
			};
			SuperNote.prototype.animate=function(noteID,show,now){
				with(this){
					var note=notes[noteID];
					if(!note.animTimer)note.animTimer=0;
					if(!note.animC)note.animC=0;
					with(note){clearTimeout(animTimer);
					var speed=(animations.length&&!now)?(show?animInSpeed:animOutSpeed):1;
					if(show&&!animC){
						if(onshow)this.onshow(noteID);IEFrameFix(noteID,1);
						ref.style[cssProp]=cssVis}animC=Math.max(0,Math.min(1,animC+speed*(show?1:-1)));
						if(document.getElementById&&speed<1)for(var a=0;a<animations.length;a++)animations[a](ref,animC);
						if(!show&&!animC){
							if(onhide)this.onhide(noteID);
							IEFrameFix(noteID,0);
							ref.style[cssProp]=cssHid
						}
						if(animC!=parseInt(animC)){
							animTimer=setTimeout(myName+'.animate("'+noteID+'",'+show+')',50)
						}
						else{
							checkType(noteID,animC?1:0,0);
							note.animating=0
						}
					}
				}
			};
			SuperNote.prototype.IEFrameFix=function(noteID,show){
				with(this){
					if(!window.createPopup||!IESelectBoxFix)return;
					var note=notes[noteID],ifr=note.iframe;
					if(!ifr){ifr=notes[noteID].iframe=document.createElement('iframe');
					ifr.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=0)';
					ifr.style.position='absolute';
					ifr.style.borderWidth='0';
					note.ref.parentNode.insertBefore(ifr,note.ref.parentNode.firstChild)
				}
				if(show){
					ifr.style.left=note.ref.offsetLeft+'px';
					ifr.style.top=note.ref.offsetTop+'px';
					ifr.style.width=note.ref.offsetWidth+'px';
					ifr.style.height=note.ref.offsetHeight+'px';
					ifr.style.visibility='inherit'
				}
				else{
					ifr.style.visibility='hidden'
				}
			}
		};


var supernote = new SuperNote('supernote', {});
function animFade(ref, counter){
	var f = ref.filters, done = (counter == 1);
	if (f){
		if (!done && ref.style.filter.indexOf("alpha") == -1)ref.style.filter += ' alpha(opacity=' + (counter * 100) + ')';
		else if (f.length && f.alpha) with (f.alpha){
			if (done) enabled = false;
			else {
				opacity = (counter * 100); enabled=true
			}
		}
	}
	else ref.style.opacity = ref.style.MozOpacity = counter*0.999;
};
supernote.animations[supernote.animations.length] = animFade;
addEvent(document, 'click', function(evt){
	var elm = evt.target || evt.srcElement, closeBtn, note;
	while (elm){
		if ((/close/).test(elm.className)) closeBtn = elm;
		if ((/snb-pinned/).test(elm.className)) {
			note = elm; break
		}
		elm = elm.parentNode;
	}
	if (closeBtn && note){
		var noteData = note.id.match(/([a-z_\-0-9]+)-note-([a-z_\-0-9]+)/i);
		for (var i = 0; i < 20; i++)if (SuperNote.instances[i].myName == noteData[1]){
			setTimeout('SuperNote.instances[' + i + '].setVis("' + noteData[2] +
			'", false, true)', 100);
			cancelEvent(evt);
		}
	}
});
addEvent(supernote, 'show', function(noteID){});
addEvent(supernote, 'hide', function(noteID){});



/*--------------------------------------------------------------------------*/
/*
/*
/*
/*--------------------------------------------------------------------------*/

/*
bxGallery v1.1
Plugin developed by: Steven Wanderski
http://bxgalleryplugin.com
http://stevenwanderski.com

Released under the GPL license:
http://www.gnu.org/licenses/gpl.html
*/

(function($){
	$.fn.extend({
		bxGallery:function(options){
			var defaults={
				maxwidth:'',
				maxheight:'',
				thumbwidth:100,
				thumbcrop:false,
				croppercent:.35,
				thumbplacement:'bottom',
				thumbcontainer:'',
				opacity:.7,
				load_text:'',
				load_image:'/images/common/ajax-loader.gif',
				wrapperclass:'outer'
			}
			var options=$.extend(defaults,options);
			var o=options;
			var cont='';
			var caption='';
			var $outer='';
			var $orig=this;
			var tall=0;
			var wide=0;
			var showing=0;
			var i=0;
			var k=$orig.find('img').size();
			var current;preload_img();
			function preload_img(){
				$orig.hide();
				if(o.load_text!=''){
					$orig.before('<div id="loading">'+o.load_text+'</div>');
				}
				else{
					$orig.before('<div id="loading"><img src="'+o.load_image+'" /></div>');
				}
				$orig.parent().find('#loading').css({
					'textAlign':'center',
					'width':o.maxwidth
				});
				$orig.find('img').each(function(){
					var the_source=$(this).attr('src');
					var the_img=new Image();
					the_img.onload=function(){
						preload_check();
					};
					the_img.src=the_source;
				});
			}
			function preload_check(){
				i++;
				if(i==k){
					init();
				}
			}
			function init(){
				set_layout();
				set_main_img();
				place_thumbcontainer();
				set_thumbs();
			}
			function set_layout(){
				$orig.parent().find('#loading').hide();
				$orig.show();
				$orig.wrap('<div class="'+o.wrapperclass+'"></div>');
				$outer=$orig.parent();
				$orig.find('li').css({
					'position':'absolute'
				});
			}
			function set_main_img(){
				$orig.find('img').each(function(){
					var $this=$(this);
					var $imgheight=$this.height();
					var $imgwidth=$this.width();
					if($this.attr('title')!=''){
						caption=$this.attr('title');
						$this.parent().append('<div class="caption">'+caption+'</div>');
					}
					if(o.maxwidth!=''){
						if($this.width()>o.maxwidth){
							$this.width(o.maxwidth);
							$this.height(($imgheight/$imgwidth)*o.maxwidth);
						}
					}
					if(o.maxheight!=''){
						if($this.height()>o.maxheight){
							$this.height(o.maxheight);
							$this.width(($imgwidth/$imgheight)*o.maxheight);
						}
					}
					if($this.height()+$this.parent().find('.caption').height()>tall){
						tall=$this.height()+$this.parent().find('.caption').height();
					}
					if($this.width()>wide){
						wide=$this.width();
					}
					cont+='<li><img src="'+$this.attr('src')+'" /></li>';
				});
				$orig.find('li:not(:first)').hide();
				$orig.height(tall);
				$orig.width(wide);
				$outer.find('.caption').width(wide);
			}
			function place_thumbcontainer(){
				if(o.thumbplacement=='top'){
					$outer.prepend('<ul class="thumbs">'+cont+'</ul>');
					$outer.find('.thumbs').css({
						'overflow':'auto'
					});
				}
				else if(o.thumbplacement=='left'){
					$outer.prepend('<ul class="thumbs">'+cont+'</ul>');
					$orig.css({
						'float':'left'
					});
					$outer.find('.thumbs').css({
						'float':'left'
					});
				}
				else if(o.thumbplacement=='bottom'){
					$outer.append('<ul class="thumbs">'+cont+'</ul>');
				}
				else if(o.thumbplacement=='right'){
					$outer.append('<ul class="thumbs">'+cont+'</ul>');
					$orig.css({
						'float':'left'
					});
					$outer.find('.thumbs').css({
						'float':'right'
					});
				}
				$outer.append('<div style="clear:both"></div>');
				if(o.thumbcontainer!=''){
					$outer.find('.thumbs').width(o.thumbcontainer);
				}
			}
			function set_thumbs(){
				$outer.find('.thumbs li').each(function(){
					var $this=$(this);
					var $img=$this.find('img');
					var $imgwidth=$img.width();
					var $imgheight=$img.height();
					if(o.thumbcrop){
						$img.width($imgwidth*o.croppercent);
						$img.height(($imgheight/$imgwidth)*$img.width());
						$this.css({
							'float':'left',
							'width':o.thumbwidth,
							'height':o.thumbwidth,
							'overflow':'hidden',
							'cursor':'pointer'
						});
					}
					else{
						$img.width(o.thumbwidth);
						$img.height(($imgheight/$imgwidth)*o.thumbwidth);
						$this.css({
							'float':'left',
							'margin-left':'10px',
							'margin-bottom':'10px',
							'cursor':'pointer'
						});
						$this.height($img.height());
					}
					$this.click(function(){
						var x=$outer.find('.thumbs li').index($this);
						if(showing!=x){
							$orig.find('li').fadeOut();
							$orig.find('li').eq(x).fadeIn();
							showing=x;
						}
					});
				});
				var $thumb=$outer.find('.thumbs li');
				$thumb.eq(0).addClass('on');
				$thumb.not('.on').fadeTo(0,o.opacity);
				$thumb.click(function(){
					var t=$(this);
					var i=$thumb.index(this);
					if(current!=i){
						$thumb.removeClass('on');
						t.addClass('on');
						$thumb.not('.on').fadeTo(200,o.opacity);
						current=i;
					}
				})
				.hover(function(){
					$(this).stop().fadeTo(200,1);
				},
				function(){
					$(this).not('.on').stop().fadeTo(200,o.opacity);
				});
			}
		}
	});
})
(jQuery);










/*
 * jQuery FlexSlider v1.0 (Release)
 * http://flex.madebymufffin.com
 *
 * Copyright 2011, Tyler Smith
 * Free to use under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 */


(function ($) {
  $.fn.extend({
    flexslider: function(options) {
      //Plugin options and their default values
      var defaults = {
        animation: "fade",              //Select your animation type (fade/slide)
        slideshow: true,                //Should the slider animate automatically by default? (true/false)
				slideshowSpeed: 7000,           //Set the speed of the slideshow cycling, in milliseconds
				animationDuration: 500,         //Set the speed of animations, in milliseconds
				directionNav: true,             //Create navigation for previous/next navigation? (true/false)
				controlNav: true,               //Create navigation for paging control of each clide? (true/false)
				keyboardNav: true,              //Allow for keyboard navigation using left/right keys (true/false)
				prevText: "",           //Set the text for the "previous" directionNav item
				nextText: "次の写真を見る",               //Set the text for the "next" directionNav item
				slideToStart: 0,                //The slide that the slider should start on. Array notation (0 = first slide)
				pauseOnAction: true,            //Pause the slideshow when interacting with control elements, highly recommended. (true/false)
				pauseOnHover: false,            //Pause the slideshow when hovering over slider, then resume when no longer hovering (true/false)
				controlsContainer: ""           //Advanced property: Can declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken.
			}
			
			//Get slider, slides, and other useful variables
			var options =  $.extend(defaults, options),
			    slider = $(this),
			    container = $('.slides', slider),
			    slides = $('.slides li', slider),
			    ANIMATING = false,
          currentSlide = options.slideToStart;
      
      //Slider animation initialize
      if (options.animation.toLowerCase() == "slide") {
        slides.show(); //show slides after using CSS to hide them for loading
        slider.css({"overflow": "hidden"});
        slides.width(slider.width()).css({"float": "left"});
        container.width((slides.length * slider.width()) + 200); //extra width to account for quirks
      } else { //Default to fade
        slides.hide().eq(currentSlide).fadeIn(400);
      }
      	
    	///////////////////////////////////////////////////////////////////
    	// FLEXSLIDER: ANIMATION TYPE
    	function flexAnimate(target) {
        if (!ANIMATING) {
          ANIMATING = true;
          if (options.animation.toLowerCase() == "slide") {
      	    container.animate({"margin-left": (-1 * target)* slider.width() + "px"}, options.animationDuration, function(){
      	      ANIMATING = false;
      	      currentSlide = target;
      	    });
        	} else { //Default to Fade
        	  slider.css({"minHeight": slides.eq(currentSlide).height()});
      	    slides.eq(currentSlide).fadeOut(options.animationDuration, function() {
              slides.eq(target).fadeIn(options.animationDuration, function() {
                ANIMATING = false;
                currentSlide = target;
              });
              slider.css({"minHeight": "inherit"});
            });
        	}
      	}
  	  }
    	///////////////////////////////////////////////////////////////////
    	
    	///////////////////////////////////////////////////////////////////
    	// FLEXSLIDER: CONTROL NAV
      if (options.controlNav) {
        controlNav = $('.flex-control-nav li a');
        controlNav.eq(currentSlide).addClass('active');

        controlNav.click(function(event) {
          event.preventDefault();
          if ($(this).hasClass('active') || ANIMATING) {
            return;
          } else {

            controlNav.removeClass('active');
            $(this).addClass('active');
            
            var selected = controlNav.index($(this));
            flexAnimate(selected);
            if (options.pauseOnAction) {
              clearInterval(animatedSlides);
            }
          }
        });
      }
      ///////////////////////////////////////////////////////////////////
      
      //////////////////////////////////////////////////////////////////
      //FLEXSLIDER: DIRECTION NAV
      if (options.directionNav) {
        //Create and append the nav
        if ($(options.controlsContainer).length > 0) {
            $(options.controlsContainer).append($('<ul class="flex-direction-nav clearfix"><li><a class="prev" href="#">' + options.prevText + '</a></li><li><a class="next" href="#">' + options.nextText + '</a></li></ul>'));
          } else {
            slider.append($('<ul class="flex-direction-nav clearfix"><li><a class="prev" href="#">' + options.prevText + '</a></li><li><a class="next" href="#">' + options.nextText + '<img src="/images/common/base/blank.gif" width="23" height="16" alt="" class="bg_arrow" /></a></li></ul>'));
          }
      
      	$('.flex-direction-nav li a').click(function(event) {
      	  event.preventDefault();
      	  if (ANIMATING) {
      	    return;
      	  } else {
        	  
        	  if ($(this).hasClass('next')) {
        	    var target = (currentSlide == slides.length - 1) ? 0 : currentSlide + 1;
        	  } else {
        	    var target = (currentSlide == 0) ? slides.length - 1 : currentSlide - 1;
        	  }
            
            if (options.controlNav) {
          	  controlNav.removeClass('active');
          	  controlNav.eq(target).addClass('active');
      	    }
      	    
        	  flexAnimate(target);
        	  if (options.pauseOnAction) {
              clearInterval(animatedSlides);
            }
          }
      	});
      }
    	//////////////////////////////////////////////////////////////////

      //////////////////////////////////////////////////////////////////
      //FLEXSLIDER: KEYBOARD NAV
      if (options.keyboardNav) {
        $(document).keyup(function(event) {
          if (ANIMATING) {
            return;
          } else if (event.keyCode != 39 && event.keyCode != 37){
            return;
          } else {
            
            if (event.keyCode == 39) {
        	    var target = (currentSlide == slides.length - 1) ? 0 : currentSlide + 1;
        	  } else if (event.keyCode == 37){
        	    var target = (currentSlide == 0) ? slides.length - 1 : currentSlide - 1;
        	  }
      	  
        	  if (options.controlNav) {
          	  controlNav.removeClass('active');
          	  controlNav.eq(target).addClass('active');
      	    }
      	  
        	  flexAnimate(target);
        	  if (options.pauseOnAction) {
              clearInterval(animatedSlides);
            }
          }
        });
      }
    	//////////////////////////////////////////////////////////////////

			//////////////////////////////////////////////////////////////////
      //FLEXSLIDER: ANIMATION SLIDESHOW
      if (options.slideshow) {
        var animatedSlides;
        
        function animateSlides() {
          if (ANIMATING) {
            return;
          } else {
        	  var target = (currentSlide == slides.length - 1) ? 0 : currentSlide + 1;
      	  
        	  if (options.controlNav) {
          	  controlNav.removeClass('active');
          	  controlNav.eq(target).addClass('active');
      	    }
      	  
        	  flexAnimate(target);
          }
        }
        
        //pauseOnHover
        if (options.pauseOnHover) {
          slider.hover(function() {
            clearInterval(animatedSlides);
          }, function() {
            animatedSlides = setInterval(animateSlides, options.slideshowSpeed);
          });
        }
        
        //Initialize animation
        if (slides.length > 1) {
          animatedSlides = setInterval(animateSlides, options.slideshowSpeed);
        }
      }
    	//////////////////////////////////////////////////////////////////
    	
    	//////////////////////////////////////////////////////////////////
      //FLEXSLIDER: RESIZE FUNCTIONS (If necessary)
      if (options.animation.toLowerCase() == "slide") {
        var sliderTimer;
        $(window).resize(function(){
          slides.width(slider.width());
          container.width((slides.length * slider.width()) + 300); //extra width to account for quirks
          
          //slider resize reset
          clearTimeout(sliderTimer);
          sliderTimer = setTimeout(function(){
            flexAnimate(currentSlide);
          }, 300);
        });
      }
      //////////////////////////////////////////////////////////////////
	  }
  });
  
})(jQuery);






var accordion=function(){
	var tm=10; var sp=10;
	function slider(n){
		this.nm=n; this.arr=[]; this.sel=''
	}
	slider.prototype.init=function(t,c,k){
		var a,h,s,l,i; a=document.getElementById(t);
		h=a.getElementsByTagName('dt'); s=a.getElementsByTagName('dd');
		l=h.length;
		for(i=0;i<l;i++){
			var d=h[i]; this.arr[i]=d; d.onclick=new Function(this.nm+".process(this)");
			if(k!=null&&c==i){this.sel=d.className=k}
		}
		l=s.length;
		for(i=0;i<l;i++){
			var d=s[i]; d.maxh=d.offsetHeight;
			if(c!=i){d.style.height='0'; d.style.display='none'}
		}
	}
	slider.prototype.process=function(d){
		var i,l; l=this.arr.length;
		for(i=0;i<l;i++){
			var h=this.arr[i]; var s=h.nextSibling;
			if(s.nodeType!=1){s=s.nextSibling}
			clearInterval(s.timer);
			if(h==d&&s.style.display=='none'){
				s.style.display=''; setup(s,1); h.className=this.sel}
			else if(s.style.display==''){setup(s,-1); h.className=''}
		}
	}
	function setup(c,f){c.timer=setInterval(function(){slide(c,f)},tm)}
	function slide(c,f){
		var h,m,d; h=c.offsetHeight; m=c.maxh; d=(f==1)?Math.ceil((m-h)/sp):Math.ceil(h/sp);
		c.style.height=h+(d*f)+'px'; c.style.opacity=h/m; c.style.filter='alpha(opacity='+h*100/m+')';
		if(f==1&&h>=m){clearInterval(c.timer)}
		else if(f!=1&&h==1){c.style.display='none'; clearInterval(c.timer)}
	}
	return{slider:slider}
}();


/*--------------------------------------------------------------------------*/
/*
 *  BP Calculator
/*
/*--------------------------------------------------------------------------*/
function Calculate(){
	var Div
	var a = document.calc_IN.data_A.value;
	var b = document.calc_IN.data_B.value;
	if(b == 99){
		alert("99で割ることになります");
	}else{
		Div = a/b;
		document.calc_OUT.data_D.value=Div;
	}
}


/*--------------------------------------------------------------------------*/
/*
 *  BP top
/*
/*--------------------------------------------------------------------------*/
num = 0;
function change(n){
	num = n;
	document.gallery.src = "/images/bp/"+n+".jpg";
}

