/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};



/**
 * jQueryRollover v1.0.1
 * http://rewish.org/javascript/jquery_rollover_plugin
 *
 * Copyright (c) 2009 Rewish (http://rewish.org/)
 *
 * Licensed under the MIT:
 * [en] http://www.opensource.org/licenses/mit-license.php
 * [ja] http://sourceforge.jp/projects/opensource/wiki/licenses%2FMIT_license
 *
 * Inspired by:
 * Telepath Labs (http://dev.telepath.co.jp/labs/article.php?id=15)
 *
 * Usage:
 * jQuery(document).ready(function($) {
 *   // <img>
 *   $('div#nav a img').rollover();
 *
 *   // <input type="image">
 *   $('form input:image').rollover();
 *
 *   // set postfix
 *   $('div#nav a img').rollover('_over');
 * });
 *
 **/
(function($) {
    $.fn.rollover = function(postfix) {
        postfix = postfix || '_on';
        return this.not('[src*="'+ postfix +'."]').each(function() {
            var img = $(this);
            var src = img.attr('src');
            var src_on = [
                src.substr(0, src.lastIndexOf('.')),
                src.substring(src.lastIndexOf('.'))
            ].join(postfix);
            $('<img>').attr('src', src_on);
            img.hover(
                function() {
                    img.attr('src', src_on);
                },
                function() {
                    img.attr('src', src);
                }
            );
        });
    };
})(jQuery);



/*  ================================================================================
 *
 *  JavaScript -Default version 3.0.6
 *  (c) 2004-2009 coliss.com
 *
 *  この作品は、クリエイティブ・コモンズの表示 2.1 日本ライセンスの下で
 *  ライセンスされています。
 *  この使用許諾条件を見るには、http://creativecommons.org/licenses/by/2.1/jp/を
 *  チェックするか、クリエイティブ･コモンズに郵便にてお問い合わせください。
 *  住所は：559 Nathan Abbott Way, Stanford, California 94305, USA です。
 *
================================================================================  */


/*  ================================================================================
TOC
============================================================
Set Adjustment
Page Scroller
============================================================
this script requires jQuery 1.3(http://jquery.com/)
================================================================================  */


/*  ================================================================================
Set Adjustment
================================================================================  */
var virtualTopId = "top",
    virtualTop,
    adjTraverser,
    adjPosition,
    callExternal = "pSc",
    delayExternal= 200;

/* example
======================================================================  */
//    virtualTop = 0;    // virtual top's left position = 0
//    virtualTop = 1;    // virtual top's left position = vertical movement
//    adjTraverser = 0;  // left position = 0
//    adjTraverser = 1;  // horizontal movement.
//    adjPosition = -26;

/*  ================================================================================
Page Scroller
================================================================================  */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('(c($){7 D=$.E.D,C=$.E.C,G=$.E.G,A=$.E.A;$.E.1Q({C:c(){3(!6[0])1g();3(6[0]==i)b 1b.1P||$.1q&&5.B.1e||5.f.1e;3(6[0]==5)b((5.B&&5.1p=="1l")?5.B.1i:5.f.1i);b C.1n(6,1o)},D:c(){3(!6[0])1g();3(6[0]==i)b 1b.1T||$.1q&&5.B.1v||5.f.1v;3(6[0]==5)b((5.B&&5.1p=="1l")?5.B.1m:5.f.1m);b D.1n(6,1o)},G:c(){3(!6[0])b 11;7 k=5.M?5.M(6[0].z):5.1t(6[0].z);7 j=1u 1r();j.x=k.1j;1s((k=k.1a)!=12){j.x+=k.1j}3((j.x*0)==0)b(j.x);g b(6[0].z)},A:c(){3(!6[0])b 11;7 k=5.M?5.M(6[0].z):5.1t(6[0].z);7 j=1u 1r();j.y=k.19;1s((k=k.1a)!=12){j.y+=k.19}3((j.y*0)==0)b(j.y);g b(6[0].z)}})})(1Y);$(c(){$(\'a[F^="#"]\').1d(c(){7 h=R.21+R.20;7 H=((6.F).1Z(0,(((6.F).18)-((6.X).18)))).Q((6.F).1f("//")+2);3(h.I("?")!=-1)Y=h.Q(0,(h.I("?")));g Y=h;3(H.I("?")!=-1)Z=H.Q(0,(H.I("?")));g Z=H;3(Z==Y){d.V((6.X).1V(1));b 1O}});$("f").1d(c(){d.O()})});6.q=12;7 d={14:c(w){3(w=="x")b(($(5).C())-($(i).C()));g 3(w=="y")b(($(5).D())-($(i).D()))},13:c(w){3(w=="x")b(i.17||5.f.t||5.f.J.t);g 3(w=="y")b(i.1R||5.f.1J||5.f.J.1J)},S:c(l,m,v,p,o){7 q;3(q)P(q);7 1F=16;7 L=d.13(\'x\');7 N=d.13(\'y\');3(!l||l<0)l=0;3(!m||m<0)m=0;3(!v)v=$.1I.1N?10:$.1I.1W?8:9;3(!p)p=0+L;3(!o)o=0+N;p+=(l-L)/v;3(p<0)p=0;o+=(m-N)/v;3(o<0)o=0;7 U=u.1z(p);7 T=u.1z(o);i.1X(U,T);3((u.1A(u.1w(L-l))<1)&&(u.1A(u.1w(N-m))<1)){P(6.q);i.1x(l,m)}g 3((U!=l)||(T!=m))6.q=1B("d.S("+l+","+m+","+v+","+p+","+o+")",1F);g P(6.q)},O:c(){P(6.q)},1K:c(e){d.O()},V:c(n){d.O();7 r,s;3(!!n){3(n==1L){r=(K==0)?0:(K==1)?i.17||5.f.t||5.f.J.t:$(\'#\'+n).G();s=((K==0)||(K==1))?0:$(\'#\'+n).A()}g{r=(1C==0)?0:(1C==1)?($(\'#\'+n).G()):i.17||5.f.t||5.f.J.t;s=1E?($(\'#\'+n).A())+1E:($(\'#\'+n).A())}7 15=d.14(\'x\');7 W=d.14(\'y\');3(((r*0)==0)||((s*0)==0)){7 1G=(r<1)?0:(r>15)?15:r;7 1y=(s<1)?0:(s>W)?W:s;d.S(1G,1y)}g R.X=n}g d.S(0,0)},1c:c(){7 h=R.F;7 1H=h.1f("#",0);7 1h=h.1M(1k);3(!!1h){1D=h.Q(h.I("?"+1k)+4,h.18);1S=1B("d.V(1D)",1U)}3(!1H)i.1x(0,0);g b 11}};$(d.1c);',62,126,'|||if||document|this|var||||return|function|coliss||body|else|usrUrl|window|tagCoords|obj|toX|toY|idName|frY|frX|pageScrollTimer|anchorX|anchorY|scrollLeft|Math|frms|type|||id|top|documentElement|width|height|fn|href|left|anchorPath|lastIndexOf|parentNode|virtualTop|actX|getElementById|actY|stopScroll|clearTimeout|slice|location|pageScroll|posY|posX|toAnchor|dMaxY|hash|usrUrlOmitQ|anchorPathOmitQ||true|null|getWindowOffset|getScrollRange|dMaxX||pageXOffset|length|offsetTop|offsetParent|self|initPageScroller|click|clientWidth|indexOf|error|checkPageScroller|scrollWidth|offsetLeft|callExternal|CSS1Compat|scrollHeight|apply|arguments|compatMode|boxModel|Object|while|all|new|clientHeight|abs|scroll|setY|ceil|floor|setTimeout|adjTraverser|anchorId|adjPosition|spd|setX|checkAnchor|browser|scrollTop|cancelScroll|virtualTopId|match|mozilla|false|innerWidth|extend|pageYOffset|timerID|innerHeight|delayExternal|substr|opera|scrollTo|jQuery|substring|pathname|hostname'.split('|'),0,{}))



/*--------------------------------------------------------------------------*
 *  
 *  alphafilter JavaScript Library beta13
 *  
 *  MIT-style license. 
 *  http://blog.webcreativepark.net/2007/02/01-233315.html
 * 
 *  2007-2009 Kazuma Nishihata 
 *  http://www.to-r.net
 *  
 *--------------------------------------------------------------------------*/
new function(){
	try{
		if (navigator.userAgent.indexOf("MSIE")!= -1 && navigator.appVersion.indexOf("6.0")!= -1) {//for old ie
			var elements = getElementsByClassName("alphafilter");
			for (var i=0; i<elements.length; i++) {
				var element = elements[i];
				if(element.nodeName=="IMG"){
					var newimg           = document.createElement("b");
					for(var key in element.currentStyle){
						newimg.style[key]=element.currentStyle[key];
					}
					newimg.className     = element.className;
					newimg.style.display = "inline-block";
					newimg.style.zoom = "1";
					newimg.style.width   = element.width;
					newimg.style.height  = element.height;
					newimg.style.styleFloat   = element.align;
					newimg.style.filter  = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+element.src+",sizingMethod='scale')";
					newimg.originalSrc = element.src;
					if (element.parentNode.tagName == "A") {
						element.parentNode.style.cursor = "pointer";
						element.parentNode.style.position="relative";
						newimg.style.cursor = "pointer";
					}
					newimg.images = new Image();
					newimg.images.src = element.src;
					element.className.split(/\s+/);
					
					element.parentNode.insertBefore(newimg,element)
					element.style.display="none";
				}else{
					var anchors = element.getElementsByTagName("a");
					for (var j=0; j<anchors.length; j++) {
						var anchor = anchors[j];
						anchor.style.position="relative";
						anchor.style.cursor="pointer";
					}
					var iputs = element.getElementsByTagName("input");
					for (var j=0; j<iputs.length; j++) {
						var iput = iputs[j];
						iput.style.position="relative";
					}
					var iputs = element.getElementsByTagName("textarea");
					for (var j=0; j<iputs.length; j++) {
						var iput = iputs[j];
						iput.style.position="relative";
					}
					var iputs = element.getElementsByTagName("select");
					for (var j=0; j<iputs.length; j++) {
						var iput = iputs[j];
						iput.style.position="relative";
					}
					var  newimg = element.currentStyle.backgroundImage || element.style.backgroundImage;
					newimg.match(/^url[("']+(.*\.png)[)"']+$/i)
					var newimg = RegExp.$1;
					element.style.filter ="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+newimg+",sizingMethod='scale')";
					element.style.background = "none";
				}
			}
		}
	}catch(e){}
	function imageReplace(){
		var btnClassName = "btn";
		var objAll = document.getElementsByTagName ? document.getElementsByTagName("*") : document.all;
		for (var i = 0; i < objAll.length; i++) {
			var btn=false;
			var eltClass = objAll[i].className.split(/\s+/);
			for (var j = 0; j < eltClass.length; j++) {
				if (eltClass[j] == btnClassName)btn = true;
			}
			if(btn == true){
				if(objAll[i].originalSrc){
					objAll[i].rolloverSrc = objAll[i].originalSrc.replace(/(\.gif|\.jpg|\.png)$/,"_on$1");
						objAll[i].onmouseover = function(){
							this.style.filter ="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+this.rolloverSrc+",sizingMethod='scale')";
						}
						objAll[i].onmouseout = function(){
							this.style.filter ="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+this.originalSrc+",sizingMethod='scale')";
						}
				}else{
					if(objAll[i].nodeName=="IMG"){
						objAll[i].originalSrc = objAll[i].src
						objAll[i].rolloverSrc = objAll[i].src.replace(/(\.gif|\.jpg|\.png)$/,"_on$1")
						objAll[i].onmouseover = function(){
							this.src = this.rolloverSrc;
						}
						objAll[i].onmouseout = function(){
							this.src = this.originalSrc;
						}
					}
				}
			}
		}
	}
	function getElementsByClassName(className){
		var i, j, eltClass;
		var objAll = document.getElementsByTagName ? document.getElementsByTagName("*") : document.all;
		var objCN = new Array();
		for (i = 0; i < objAll.length; i++) {
			eltClass = objAll[i].className.split(/\s+/);
			for (j = 0; j < eltClass.length; j++) {
				if (eltClass[j] == className) {
					objCN.push(objAll[i]);
					break;
				}
			}
		}
		return objCN;
	}
	function addEvent(elm,listener,fn){
		try{
			elm.addEventListener(listener,fn,false);
		}catch(e){
			elm.attachEvent("on"+listener,fn);
		}
	}
	addEvent(window,"load",imageReplace)
}


//中段画像切替------------------------------------------------------------------------------------------

function con(image)
{
	document.conveyor.src=image;
}

function pla(image)
{
	document.plant.src=image;
}

function sol(image)
{
	document.solution.src=image;
}



