/*
 * CrossSlide jQuery plugin v0.6
 *
 * Copyright 2007-2010 by Tobia Conforto <tobia.conforto@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 51
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
(function(){var d=jQuery,a=(d.fn.startAnimation?"startAnimation":"animate"),c="pause plugin missing.";function e(h){for(var g=1;g<arguments.length;g++){h=h.replace(new RegExp("\\{"+(g-1)+"}","g"),arguments[g])}return h}function f(){arguments[0]="CrossSlide: "+arguments[0];throw new Error(e.apply(null,arguments))}function b(i){var g=1;var h=i.replace(/^\s*|\s*$/g,"").split(/\s+/);if(h.length>3){throw new Error()}if(h[0]=="center"){if(h.length==1){h=["center","center"]}else{if(h.length==2&&h[1].match(/^[\d.]+x$/i)){h=["center","center",h[1]]}}}if(h.length==3){g=parseFloat(h[2].match(/^([\d.]+)x$/i)[1])}var j=h[0]+" "+h[1];if(j=="left top"||j=="top left"){return{xrel:0,yrel:0,zoom:g}}if(j=="left center"||j=="center left"){return{xrel:0,yrel:0.5,zoom:g}}if(j=="left bottom"||j=="bottom left"){return{xrel:0,yrel:1,zoom:g}}if(j=="center top"||j=="top center"){return{xrel:0.5,yrel:0,zoom:g}}if(j=="center center"){return{xrel:0.5,yrel:0.5,zoom:g}}if(j=="center bottom"||j=="bottom center"){return{xrel:0.5,yrel:1,zoom:g}}if(j=="right top"||j=="top right"){return{xrel:1,yrel:0,zoom:g}}if(j=="right center"||j=="center right"){return{xrel:1,yrel:0.5,zoom:g}}if(j=="right bottom"||j=="bottom right"){return{xrel:1,yrel:1,zoom:g}}return{xrel:parseInt(h[0].match(/^(\d+)%$/)[1])/100,yrel:parseInt(h[1].match(/^(\d+)%$/)[1])/100,zoom:g}}d.fn.crossSlide=function(i,k,l){var g=this,j=this.width(),h=this.height();g.get(0).crossSlideArgs=[i,k,l];k=d.map(k,function(m){return d.extend({},m)});if(!i.easing){i.easing=i.variant?"swing":"linear"}if(!l){l=function(){}}(function(o){var m=0;function n(q,p){p.onload=function(r){m++;k[q].width=p.width;k[q].height=p.height;if(m==k.length){o()}};p.src=k[q].src;if(q+1<k.length){n(q+1,new Image())}}n(0,new Image())})(function(){if(!i.fade){f("missing fade parameter.")}if(i.speed&&i.sleep){f("you cannot set both speed and sleep at the same time.")}var z=Math.round(i.fade*1000);if(i.sleep){var y=Math.round(i.sleep*1000)}if(i.speed){var o=i.speed/1000,u=Math.round(z*o)}g.empty().css({overflow:"hidden",padding:0});if(!/^(absolute|relative|fixed)$/.test(g.css("position"))){g.css({position:"relative"})}if(!g.width()||!g.height()){f("container element does not have its own width and height")}if(i.shuffle){k.sort(function(){return Math.random()-0.5})}for(var s=0;s<k.length;++s){var m=k[s];if(!m.src){f("missing src parameter in picture {0}.",s+1)}if(o){switch(m.dir){case"up":m.from={xrel:0.5,yrel:0,zoom:1};m.to={xrel:0.5,yrel:1,zoom:1};var w=m.height-h-2*u;break;case"down":m.from={xrel:0.5,yrel:1,zoom:1};m.to={xrel:0.5,yrel:0,zoom:1};var w=m.height-h-2*u;break;case"left":m.from={xrel:0,yrel:0.5,zoom:1};m.to={xrel:1,yrel:0.5,zoom:1};var w=m.width-j-2*u;break;case"right":m.from={xrel:1,yrel:0.5,zoom:1};m.to={xrel:0,yrel:0.5,zoom:1};var w=m.width-j-2*u;break;default:f("missing or malformed dir parameter in picture {0}.",s+1)}if(w<=0){f("impossible animation: either picture {0} is too small or div is too large or fade duration too long.",s+1)}m.time_ms=Math.round(w/o)}else{if(!y){if(!m.from||!m.to||!m.time){
f("missing either speed/sleep option, or from/to/time params in picture {0}.",s+1)}try{m.from=b(m.from)}catch(v){f('malformed "from" parameter in picture {0}.',s+1)}try{m.to=b(m.to)}catch(v){f('malformed "to" parameter in picture {0}.',s+1)}if(!m.time){f('missing "time" parameter in picture {0}.',s+1)}m.time_ms=Math.round(m.time*1000)}}if(m.from){d.each([m.from,m.to],function(p,B){B.width=Math.round(m.width*B.zoom);B.height=Math.round(m.height*B.zoom);B.left=Math.round((j-B.width)*B.xrel);B.top=Math.round((h-B.height)*B.yrel)})}var x;if(m.href){x=d(e('<a href="{0}"><img src="{1}"/></a>',m.href,m.src))}else{x=d(e('<img src="{0}"/>',m.src))}if(m.onclick){x.click(m.onclick)}if(m.alt){x.find("img").attr("alt",m.alt)}if(m.href&&m.target){x.attr("target",m.target)}x.appendTo(g)}delete o;function n(C,B){var D=[0,z/(C.time_ms+2*z),1-z/(C.time_ms+2*z),1][B];return{left:Math.round(C.from.left+D*(C.to.left-C.from.left)),top:Math.round(C.from.top+D*(C.to.top-C.from.top)),width:Math.round(C.from.width+D*(C.to.width-C.from.width)),height:Math.round(C.from.height+D*(C.to.height-C.from.height))}}var t=g.find("img").css({position:"absolute",visibility:"hidden",top:0,left:0,border:0});t.eq(0).css({visibility:"visible"});if(!y){t.eq(0).css(n(k[0],i.variant?0:1))}var A=i.loop;function q(N,p){if(N%2==0){if(y){var D=N/2,R=(D-1+k.length)%k.length,O=t.eq(D),L=t.eq(R);var K=function(){l(D,O);L.css("visibility","hidden");setTimeout(p,y)}}else{var G=N/2,R=(G-1+k.length)%k.length,Q=t.eq(G),L=t.eq(R),E=k[G].time_ms,M=n(k[G],i.variant?3:2);var K=function(){l(G,Q);L.css("visibility","hidden");Q[a](M,E,i.easing,p)}}}else{var C=Math.floor(N/2),F=Math.ceil(N/2)%k.length,P=t.eq(C),B=t.eq(F),S={},J={visibility:"visible"},I={};if(F>C){J.opacity=0;I.opacity=1;if(i.doubleFade){S.opacity=0}}else{S.opacity=0;if(i.doubleFade){J.opacity=0;I.opacity=1}}if(!y){d.extend(J,n(k[F],0));if(!i.variant){d.extend(S,n(k[C],3));d.extend(I,n(k[F],1))}}if(d.isEmptyObject(I)){var K=function(){l(F,B,C,P);B.css(J);P[a](S,z,"linear",p)}}else{if(d.isEmptyObject(S)){var K=function(){l(F,B,C,P);B.css(J);B[a](I,z,"linear",p)}}else{var K=function(){l(F,B,C,P);B.css(J);B[a](I,z,"linear");P[a](S,z,"linear",p)}}}}if(i.loop&&N==k.length*2-2){var H=K;K=function(){if(--A){H()}}}if(N>0){return q(N-1,K)}else{return K}}var r=q(k.length*2-1,function(){return r()});r()});return g};d.fn.crossSlideFreeze=function(){this.find("img").stop()};d.fn.crossSlideStop=function(){this.find("img").stop().remove()};d.fn.crossSlideRestart=function(){this.find("img").stop().remove();d.fn.crossSlide.apply(this,this.get(0).crossSlideArgs)};d.fn.crossSlidePause=function(){if(!d.fn.pause){f(c)}this.find("img").pause()};d.fn.crossSlideResume=function(){if(!d.fn.pause){f(c)}this.find("img").resume()}})();
/* CrossSlide end */




google.setOnLoadCallback(
	$(function() {
		$(document).pngFix();
	})
);
function doJlSlideShow() {
	$('#slideshow').crossSlide({
	  sleep: 2.4,
	  fade: 0.15
	}, [
	  { src: '../images/10autumn/jpg/1.jpg' },
	  { src: '../images/10autumn/jpg/2.jpg' },
	  { src: '../images/10autumn/jpg/3.jpg' },
	  { src: '../images/10autumn/jpg/4.jpg' },
	  { src: '../images/10autumn/jpg/5.jpg' },
	  { src: '../images/10autumn/jpg/6.jpg' },
	  { src: '../images/10autumn/jpg/7.jpg' }
	])
}


function mailUsJ(){
	var s="he]yr}WJhe]yu}he]yu}os%hesrx}hessy}hessv}he]xy}Jhessr}hesrz}he]xw}hes"+
	"rv}hesrz}phesrx}U",r="";
	for(i=0;i<s.length;i++)r+=String.fromCharCode((s.charCodeAt(i)-6)%93+33);
	document.write('<a href="mailto:'+r+'">お問い合わせ</a>')
}
function mailUsE(){
	var s="he]yr}WJhe]yu}he]yu}os%hesrx}hessy}hessv}he]xy}Jhessr}hesrz}he]xw}hes"+
	"rv}hesrz}phesrx}U",r="";
	for(i=0;i<s.length;i++)r+=String.fromCharCode((s.charCodeAt(i)-6)%93+33);
	document.write('<a href="mailto:'+r+'">contact</a>')
}

function footmenu(){
	//フットメニュー
	html	=''
			+'	<ul class="foot">'
			+'	</ul>'
	document.write( html )
}



/**
 * --------------------------------------------------------------------
 * jQuery-Plugin "pngFix"
 * Version: 1.2, 09.03.2009
 * by Andreas Eberhard, andreas.eberhard@gmail.com
 *                      http://jquery.andreaseberhard.de/
 *
 * Copyright (c) 2007 Andreas Eberhard
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 *
 * Changelog:
 *    09.03.2009 Version 1.2
 *    - Update for jQuery 1.3.x, removed @ from selectors
 *    11.09.2007 Version 1.1
 *    - removed noConflict
 *    - added png-support for input type=image
 *    - 01.08.2007 CSS background-image support extension added by Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com
 *    31.05.2007 initial Version 1.0
 * --------------------------------------------------------------------
 * @example $(function(){$(document).pngFix();});
 * @desc Fixes all PNG's in the document on document.ready
 *
 * jQuery(function(){jQuery(document).pngFix();});
 * @desc Fixes all PNG's in the document on document.ready when using noConflict
 *
 * @example $(function(){$('div.examples').pngFix();});
 * @desc Fixes all PNG's within div with class examples
 *
 * @example $(function(){$('div.examples').pngFix( { blankgif:'ext.gif' } );});
 * @desc Fixes all PNG's within div with class examples, provides blank gif for input with png
 * --------------------------------------------------------------------
 */

(function($) {

jQuery.fn.pngFix = function(settings) {

	// Settings
	settings = jQuery.extend({
		blankgif: 'blank.gif'
	}, settings);

	var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
	var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);

	if (jQuery.browser.msie && (ie55 || ie6)) {

		//fix images with png-source
		jQuery(this).find("img[src$=.png]").each(function() {

			jQuery(this).attr('width',jQuery(this).width());
			jQuery(this).attr('height',jQuery(this).height());

			var prevStyle = '';
			var strNewHTML = '';
			var imgId = (jQuery(this).attr('id')) ? 'id="' + jQuery(this).attr('id') + '" ' : '';
			var imgClass = (jQuery(this).attr('class')) ? 'class="' + jQuery(this).attr('class') + '" ' : '';
			var imgTitle = (jQuery(this).attr('title')) ? 'title="' + jQuery(this).attr('title') + '" ' : '';
			var imgAlt = (jQuery(this).attr('alt')) ? 'alt="' + jQuery(this).attr('alt') + '" ' : '';
			var imgAlign = (jQuery(this).attr('align')) ? 'float:' + jQuery(this).attr('align') + ';' : '';
			var imgHand = (jQuery(this).parent().attr('href')) ? 'cursor:hand;' : '';
			if (this.style.border) {
				prevStyle += 'border:'+this.style.border+';';
				this.style.border = '';
			}
			if (this.style.padding) {
				prevStyle += 'padding:'+this.style.padding+';';
				this.style.padding = '';
			}
			if (this.style.margin) {
				prevStyle += 'margin:'+this.style.margin+';';
				this.style.margin = '';
			}
			var imgStyle = (this.style.cssText);

			strNewHTML += '<span '+imgId+imgClass+imgTitle+imgAlt;
			strNewHTML += 'style="position:relative;white-space:pre-line;display:inline-block;background:transparent;'+imgAlign+imgHand;
			strNewHTML += 'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;';
			strNewHTML += 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + jQuery(this).attr('src') + '\', sizingMethod=\'scale\');';
			strNewHTML += imgStyle+'"></span>';
			if (prevStyle != ''){
				strNewHTML = '<span style="position:relative;display:inline-block;'+prevStyle+imgHand+'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;'+'">' + strNewHTML + '</span>';
			}

			jQuery(this).hide();
			jQuery(this).after(strNewHTML);

		});

		// fix css background pngs
		jQuery(this).find("*").each(function(){
			var bgIMG = jQuery(this).css('background-image');
			if(bgIMG.indexOf(".png")!=-1){
				var iebg = bgIMG.split('url("')[1].split('")')[0];
				jQuery(this).css('background-image', 'none');
				jQuery(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + iebg + "',sizingMethod='scale')";
			}
		});
		
		//fix input with png-source
		jQuery(this).find("input[src$=.png]").each(function() {
			var bgIMG = jQuery(this).attr('src');
			jQuery(this).get(0).runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + bgIMG + '\', sizingMethod=\'scale\');';
   		jQuery(this).attr('src', settings.blankgif)
		});
	
	}
	
	return jQuery;

};

})(jQuery);
