/* Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.0.3
 * Requires jQuery 1.1.3+
 * Docs: http://docs.jquery.com/Plugins/livequery
 */
(function(a){a.extend(a.fn,{livequery:function(f,e,d){var c=this,g;if(a.isFunction(f)){d=e,e=f,f=undefined}a.each(a.livequery.queries,function(h,j){if(c.selector==j.selector&&c.context==j.context&&f==j.type&&(!e||e.$lqguid==j.fn.$lqguid)&&(!d||d.$lqguid==j.fn2.$lqguid)){return(g=j)&&false}});g=g||new a.livequery(this.selector,this.context,f,e,d);g.stopped=false;g.run();return this},expire:function(f,e,d){var c=this;if(a.isFunction(f)){d=e,e=f,f=undefined}a.each(a.livequery.queries,function(g,h){if(c.selector==h.selector&&c.context==h.context&&(!f||f==h.type)&&(!e||e.$lqguid==h.fn.$lqguid)&&(!d||d.$lqguid==h.fn2.$lqguid)&&!this.stopped){a.livequery.stop(h.id)}});return this}});a.livequery=function(c,e,g,f,d){this.selector=c;this.context=e||document;this.type=g;this.fn=f;this.fn2=d;this.elements=[];this.stopped=false;this.id=a.livequery.queries.push(this)-1;f.$lqguid=f.$lqguid||a.livequery.guid++;if(d){d.$lqguid=d.$lqguid||a.livequery.guid++}return this};a.livequery.prototype={stop:function(){var c=this;if(this.type){this.elements.unbind(this.type,this.fn)}else{if(this.fn2){this.elements.each(function(d,e){c.fn2.apply(e)})}}this.elements=[];this.stopped=true},run:function(){if(this.stopped){return}var e=this;var f=this.elements,d=a(this.selector,this.context),c=d.not(f);this.elements=d;if(this.type){c.bind(this.type,this.fn);if(f.length>0){a.each(f,function(g,h){if(a.inArray(h,d)<0){a.event.remove(h,e.type,e.fn)}})}}else{c.each(function(){e.fn.apply(this)});if(this.fn2&&f.length>0){a.each(f,function(g,h){if(a.inArray(h,d)<0){e.fn2.apply(h)}})}}}};a.extend(a.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if(a.livequery.running&&a.livequery.queue.length){var c=a.livequery.queue.length;while(c--){a.livequery.queries[a.livequery.queue.shift()].run()}}},pause:function(){a.livequery.running=false},play:function(){a.livequery.running=true;a.livequery.run()},registerPlugin:function(){a.each(arguments,function(d,e){if(!a.fn[e]){return}var c=a.fn[e];a.fn[e]=function(){var f=c.apply(this,arguments);a.livequery.run();return f}})},run:function(c){if(c!=undefined){if(a.inArray(c,a.livequery.queue)<0){a.livequery.queue.push(c)}}else{a.each(a.livequery.queries,function(d){if(a.inArray(d,a.livequery.queue)<0){a.livequery.queue.push(d)}})}if(a.livequery.timeout){clearTimeout(a.livequery.timeout)}a.livequery.timeout=setTimeout(a.livequery.checkQueue,20)},stop:function(c){if(c!=undefined){a.livequery.queries[c].stop()}else{a.each(a.livequery.queries,function(d){a.livequery.queries[d].stop()})}}});a.livequery.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove");a(function(){a.livequery.play()});var b=a.prototype.init;a.prototype.init=function(d,f){var e=b.apply(this,arguments);if(d&&d.selector){e.context=d.context,e.selector=d.selector}if(typeof d=="string"){e.context=f||document,e.selector=d}return e};a.prototype.init.prototype=a.prototype})(jQuery);

/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

// JSDeferred 0.2.2 Copyright (c) 2007 cho45 ( www.lowreal.net )
// See http://coderepos.org/share/wiki/JSDeferred
function Deferred(){return(this instanceof Deferred)?this.init():new Deferred()}Deferred.ok=function(a){return a};Deferred.ng=function(a){throw a};Deferred.prototype={init:function(){this._next=null;this.callback={ok:Deferred.ok,ng:Deferred.ng};return this},next:function(a){return this._post("ok",a)},error:function(a){return this._post("ng",a)},call:function(a){return this._fire("ok",a)},fail:function(a){return this._fire("ng",a)},cancel:function(){(this.canceller||function(){})();return this.init()},_post:function(b,a){this._next=new Deferred();this._next.callback[b]=a;return this._next},_fire:function(a,c){var b="ok";try{c=this.callback[a].call(this,c)}catch(d){b="ng";c=d}if(c instanceof Deferred){c._next=this._next}else{if(this._next){this._next._fire(b,c)}}return this}};Deferred.parallel=function(d){var c=new Deferred(),a={},b=0;for(var e in d){if(d.hasOwnProperty(e)){(function(g,f){g.next(function(h){a[f]=h;if(--b<=0){if(d instanceof Array){a.length=d.length;a=Array.prototype.slice.call(a,0)}c.call(a)}}).error(function(h){c.fail(h)});b++})(d[e],e)}}if(!b){Deferred.next(function(){c.call()})}c.canceller=function(){for(var f in d){if(d.hasOwnProperty(f)){d[f].cancel()}}};return c};Deferred.wait=function(e){var b=new Deferred(),a=new Date();var c=setTimeout(function(){clearTimeout(c);b.call((new Date).getTime()-a.getTime())},e*1000);b.canceller=function(){try{clearTimeout(c)}catch(d){}};return b};Deferred.next_default=function(a){var b=new Deferred();var c=setTimeout(function(){clearTimeout(c);b.call()},0);b.canceller=function(){try{clearTimeout(c)}catch(d){}};if(a){b.callback.ok=a}return b};Deferred.next_faster_way_readystatechange=(!window.opera&&/\bMSIE\b/.test(navigator.userAgent))&&function(a){var f=new Deferred();var c=new Date().getTime();if(c-arguments.callee._prev_timeout_called<150){var e=false;var b=document.createElement("script");b.type="text/javascript";b.src="javascript:";b.onreadystatechange=function(){if(!e){f.canceller();f.call()}};f.canceller=function(){if(!e){e=true;b.onreadystatechange=null;document.body.removeChild(b)}};document.body.appendChild(b)}else{arguments.callee._prev_timeout_called=c;var g=setTimeout(function(){clearTimeout(g);f.call()},0);f.canceller=function(){try{clearTimeout(g)}catch(d){}}}if(a){f.callback.ok=a}return f};Deferred.next_faster_way_Image=((typeof(Image)!="undefined")&&document.addEventListener)&&function(a){var e=new Deferred();var b=new Image();var c=function(){e.canceller();e.call()};b.addEventListener("load",c,false);b.addEventListener("error",c,false);e.canceller=function(){b.removeEventListener("load",c,false);b.removeEventListener("error",c,false)};b.src="data:,/_/X";if(a){e.callback.ok=a}return e};Deferred.next=Deferred.next_faster_way_readystatechange||Deferred.next_faster_way_Image||Deferred.next_default;Deferred.call=function(b,a){a=Array.prototype.slice.call(arguments);b=a.shift();return Deferred.next(function(){return b.apply(this,a)})};Deferred.loop=function(e,a){var d={begin:e.begin||0,end:(typeof e.end=="number")?e.end:e-1,step:e.step||1,last:false,prev:null};var b,c=d.step;return Deferred.next(function(){function f(g){if(g<=d.end){if((g+c)>d.end){d.last=true;d.step=d.end-g+1}d.prev=b;b=a.call(this,g,d);if(b instanceof Deferred){return b.next(function(h){b=h;return Deferred.call(f,g+c)})}else{return Deferred.call(f,g+c)}}else{return b}}return(d.begin<=d.end)?Deferred.call(f,d.begin):null})};Deferred.register=function(b,a){this.prototype[b]=function(){return this.next(Deferred.wrap(a).apply(null,arguments))}};Deferred.wrap=function(a){return function(){var b=arguments;return function(){return a.apply(null,b)}}};Deferred.register("loop",Deferred.loop);Deferred.register("wait",Deferred.wait);Deferred.define=function(d,c){if(!c){c=["parallel","wait","next","call","loop"]}if(!d){d=(function b(){return this})()}for(var a=0;a<c.length;a++){var e=c[a];d[e]=Deferred[e]}return Deferred};(function(b){b.deferred=Deferred;var a=b.ajax;b.ajax=function(c){var e=b.deferred(),f={};b.extend(f,c);c.success=function(){if(f.success){f.success.apply(this,arguments)}e.call.apply(e,arguments)};c.error=function(){if(f.error){f.error.apply(this,arguments)}e.fail.apply(e,arguments)};a(c);return e}})(jQuery);

//www.ralliart.co.jp shared
(function(a){jQuery.fn.Topmenu=function(c){var b=this;var c=jQuery.extend({},c);b.each(function(){var d=a(this);d.removeClass("nojs").addClass("js");d.find("a").TopmenuA();d.find("li:has(ul)").TopmenuLi();d.find("ul.sub").hide()});return this};jQuery.fn.TopmenuA=function(d){var c=this;var d=jQuery.extend({},d);var b=function(){a(this).find("span.hover").stop(true,true).fadeIn("fast")};var e=function(){a(this).find("span.hover").stop(true,true).fadeOut("fast")};c.each(function(){var f=a(this);f.addClass("irp_").text("").append('<span class="hover ir"></span>').hover(b,e);f.find("span.hover").hide()});return this};jQuery.fn.TopmenuLi=function(d){var c=this;var d=jQuery.extend({},d);var b=function(){a(this).find("ul").stop(true,true).fadeIn("fast")};var f=function(){a(this).find("ul").stop(true,true).fadeOut("fast")};var e={sensitivity:3,interval:10,timeout:200,over:b,out:f};c.each(function(){var h=a(this);var g=h.find("ul.sub");g.find(".title").text("");h.hover(b,f)});return this}})(jQuery);(function(){jQuery.fn.Scroll_to_top=function(b){var c=this;var a=function(){$($.browser.safari?"body":"html").animate({scrollTop:0},500);return false};c.each(function(){var d=$(this);d.click(a)});return this}})(jQuery);(function(){jQuery.fn.AnimatedHover=function(c){var d=this;var b=function(){$(this).find("span.hover").stop(true,true).fadeIn("fast")};var e=function(){$(this).find("span.hover").stop(true,true).fadeOut("fast")};var a=function(f){f.addClass("irp_");f.find("span").addClass("ir");f.find("span.hover").hide()};d.each(function(){var f=$(this);f.append('<span class="normal"></span><span class="hover"></span>');a(f);f.hover(b,e)});return this}})(jQuery);
/*
 * Initialize
 */
$.deferred.define();ie6=null;jQuery(function(){ie6=jQuery.browser.msie&&jQuery.browser.version=="6.0";if(ie6){try{document.execCommand("BackgroundImageCache",false,true);$("div.footer > div.nav > ul > li:first-child").addClass("first-child")}catch(a){}}$("#topmenu").Topmenu();$("#onlineshop").AnimatedHover();$("div.pagetop > a").AnimatedHover().Scroll_to_top()});
