/*  ================================================================================
 jQuery Plugins
================================================================================  */



/*  ================================================================================
 *
 *  jQuery Page Scroller -version 3.0.8
 *  http://coliss.com/articles/build-websites/operation/javascript/296.html
 *  (c)2011 coliss.com
 *
 *  この作品は、クリエイティブ・コモンズの表示 2.1 日本ライセンスの下で
 *  ライセンスされています。
 *  この使用許諾条件を見るには、http://creativecommons.org/licenses/by-sa/2.1/jp/を
 *  チェックするか、クリエイティブ･コモンズに郵便にてお問い合わせください。
 *  住所は：559 Nathan Abbott Way, Stanford, California 94305, USA です。
 *
================================================================================  */


/*  ================================================================================
TOC
============================================================
Ooption
Page Scroller
============================================================
this script requires jQuery 1.3-1.4.4(http://jquery.com/)
================================================================================  */


/*  ================================================================================
Ooption
================================================================================  */
var virtualTopId = "top",
    virtualTop,
    adjTraverser,
    adjPosition,
    callExternal = "pSc",
    delayExternal= 200,
    adjSpeed = 1;

/* option 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 C=$.H.C,w=$.H.w,F=$.H.F,A=$.H.A;$.H.1P({w:c(){3(!6[0])1H();3(6[0]==h)b 1K.1O||$.1D&&5.z.1x||5.f.1x;3(6[0]==5)b((5.z&&5.1G=="1s")?5.z.1u:5.f.1u);b w.1e(6,1f)},C:c(){3(!6[0])1H();3(6[0]==h)b 1K.1N||$.1D&&5.z.1F||5.f.1F;3(6[0]==5)b((5.z&&5.1G=="1s")?5.z.1d:5.f.1d);b C.1e(6,1f)},F:c(){3(!6[0])b 17;7 j=5.M?5.M(6[0].u):5.1h(6[0].u);7 k=1o 1r();k.x=j.19;1q((j=j.1j)!=V){k.x+=j.19}3((k.x*0)==0)b(k.x);g b(6[0].u)},A:c(){3(!6[0])b 17;7 j=5.M?5.M(6[0].u):5.1h(6[0].u);7 k=1o 1r();k.y=j.1m;1q((j=j.1j)!=V){k.y+=j.1m}3((k.y*0)==0)b(k.y);g b(6[0].u)}})})(1Q);$(c(){$(\'a[q^="#"], 20[q^="#"]\').22(\'.1k a[q^="#"], a[q^="#"].1k\').1a(c(){7 i=Q.21+Q.1Z;7 I=((6.q).25(0,(((6.q).13)-((6.15).13)))).R((6.q).1C("//")+2);3(i.G("?")!=-1)Y=i.R(0,(i.G("?")));g Y=i;3(I.G("?")!=-1)X=I.R(0,(I.G("?")));g X=I;3(X==Y){d.12((6.15).23(1));b 1T}});$("f").1a(c(){d.L()})});6.r=V;7 d={14:c(B){3(B=="x")b(($(5).w())-($(h).w()));g 3(B=="y")b(($(5).C())-($(h).C()))},W:c(B){3(B=="x")b(h.18||5.f.v||5.f.N.v);g 3(B=="y")b(h.1S||5.f.1c||5.f.N.1c)},P:c(l,m,D,p,o){7 r;3(r)J(r);7 1A=16*1X;7 S=d.W(\'x\');7 O=d.W(\'y\');3(!l||l<0)l=0;3(!m||m<0)m=0;3(!D)D=$.1E.1Y?10:$.1E.1W?8:9;3(!p)p=0+S;3(!o)o=0+O;p+=(l-S)/D;3(p<0)p=0;o+=(m-O)/D;3(o<0)o=0;7 U=E.1J(p);7 T=E.1J(o);h.1U(U,T);3((E.1I(E.1v(S-l))<1)&&(E.1I(E.1v(O-m))<1)){J(6.r);h.1i(l,m)}g 3((U!=l)||(T!=m))6.r=1n("d.P("+l+","+m+","+D+","+p+","+o+")",1A);g J(6.r)},L:c(){J(6.r)},24:c(e){d.L()},12:c(n){d.L();7 s,t;3(!!n){3(n==1M){s=(K==0)?0:(K==1)?h.18||5.f.v||5.f.N.v:$(\'#\'+n).F();t=((K==0)||(K==1))?0:$(\'#\'+n).A()}g{s=(1y==0)?0:(1y==1)?($(\'#\'+n).F()):h.18||5.f.v||5.f.N.v;t=1B?($(\'#\'+n).A())+1B:($(\'#\'+n).A())}7 11=d.14(\'x\');7 Z=d.14(\'y\');3(((s*0)==0)||((t*0)==0)){7 1t=(s<1)?0:(s>11)?11:s;7 1w=(t<1)?0:(t>Z)?Z:t;d.P(1t,1w)}g Q.15=n}g d.P(0,0)},1z:c(){7 i=Q.q;7 1l=i.1C("#",0);7 1b=i.1V(1g);3(!!1b){1p=i.R(i.G("?"+1g)+4,i.13);1R=1n("d.12(1p)",1L)}3(!1l)h.1i(0,0);g b 17}};$(d.1z);',62,130,'|||if||document|this|var||||return|function|coliss||body|else|window|usrUrl|obj|tagCoords|toX|toY|idName|frY|frX|href|pageScrollTimer|anchorX|anchorY|id|scrollLeft|width|||documentElement|top|type|height|frms|Math|left|lastIndexOf|fn|anchorPath|clearTimeout|virtualTop|stopScroll|getElementById|parentNode|actY|pageScroll|location|slice|actX|posY|posX|null|getWindowOffset|anchorPathOmitQ|usrUrlOmitQ|dMaxY||dMaxX|toAnchor|length|getScrollRange|hash||true|pageXOffset|offsetLeft|click|checkPageScroller|scrollTop|scrollHeight|apply|arguments|callExternal|all|scroll|offsetParent|nopscr|checkAnchor|offsetTop|setTimeout|new|anchorId|while|Object|CSS1Compat|setX|scrollWidth|abs|setY|clientWidth|adjTraverser|initPageScroller|spd|adjPosition|indexOf|boxModel|browser|clientHeight|compatMode|error|floor|ceil|self|delayExternal|virtualTopId|innerHeight|innerWidth|extend|jQuery|timerID|pageYOffset|false|scrollTo|match|opera|adjSpeed|mozilla|pathname|area|hostname|not|substr|cancelScroll|substring'.split('|'),0,{}));
/*  ================================================================================
 * SudoSlider
 * http://webbies.dk/SudoSlider/
 * @version: 2.0
================================================================================  */
(function(b){b.fn.sudoSlider=function(j){if(typeof(j)!="object"&&j!=""&&j){return this.each(function(){b(this).trigger("sudoSliderEvent",[j])})}else{var r={prevNext:true,prevHtml:'<a href="#" class="prevBtn"> previous </a>',nextHtml:'<a href="#" class="nextBtn"> next </a>',controlsShow:true,controlsAttr:'id="controls"',controlsFadeSpeed:"400",controlsFade:true,insertAfter:true,firstShow:false,firstHtml:'<a href="#" class="firstBtn"> first </a>',lastShow:false,lastHtml:'<a href="#" class="lastBtn"> last </a>',numericAttr:'class="controls"',numericText:["1"],vertical:false,speed:"800",ease:"swing",auto:false,pause:"4000",continuous:false,clickableAni:false,numeric:false,updateBefore:false,history:false,speedhistory:"400",autoheight:true,customLink:false,fade:false,crossFade:true,fadespeed:"1000",ajax:false,loadingText:false,preloadAjax:false,startSlide:false,imgAjaxFunction:false,docAjaxFunction:false,beforeAniFunc:false,afterAniFunc:false,uncurrentFunc:false,currentFunc:false};var j=b.extend(r,j);var D=j.controlsFadeSpeed;var G=j.controlsFade;var w=j.firstShow;var s=j.lastShow;var c=j.vertical;var g=j.speed;var m=j.ease;var H=j.auto;var A=j.pause;var d=j.continuous;var u=j.prevNext;var h=j.numeric;var l=j.numericAttr;var f=j.numericText;var q=j.history;var k=j.speedhistory;var e=j.autoheight;var I=j.customLink;var o=j.fade;var t=j.crossFade;var C=j.fadespeed;var E=j.updateBefore;var i=j.ajax;var F=j.startSlide;var x=j.imgAjaxFunction;var v=j.docAjaxFunction;var n=j.beforeAniFunc;var z=j.afterAniFunc;var y=j.uncurrentFunc;var B=j.currentFunc;return this.each(function(){var ax=true;if(H){d=true}var M=b(this);var ai=M.children("ul");var ah=ai.children("li");var ap=ah.length;var an=ah.eq(0).width();var aA=M.height();if(i){if(ai.length==0){M.append("<ul></ul>");ai=M.children("ul")}if(i.length>ap){for(var az=1;az<=i.length-ap;az++){ai.append("<li><p>"+O()+"</p></li>")}ah=ai.children("li");ap=ah.length;an=ah.eq(0).width()}}function O(){var aF=["Spinning up the hamster","&pi; &times; 1337% == 42","Programming the flux capacitor","The last time I tried this the monkey didn't survive","Testing data on Timmy... ... ... We need another Timmy","Warming up Large Hadron Collider","It looks like you're waiting for something to load"];return j.loadingText?j.loadingText:(aF[Math.round(Math.random()*(aF.length-1))]+"...")}var ao=0;var ad=ao;var aw=ao;var aD=ap-1;var ay=true;var av=false;var J=false;var K=false;var U=0;var P=new Array();var W=false;var aE=false;M.css("overflow","hidden");if(M.css("position")=="static"){M.css("position","relative")}ah.css("float","left");for(var az=0;az<ap;az++){if(f[az]==undefined){f[az]=(az+1)}if(i&&i[az]==undefined){i[az]=false}}if(d){if(c){ai.prepend(ah.filter(":last-child").clone().css("margin-top","-"+aA+"px"));ai.append(ah.filter(":nth-child(2)").clone());ai.height((ap+1)*aA)}else{ai.prepend(ah.filter(":last-child").clone().css("margin-left","-"+an+"px"));ai.append(ah.filter(":nth-child(2)").clone());ai.width((ap+1)*an)}if(i){if(i[0]){aj("last",0,false,0)}if(i[ap-1]){aj("first",(ap-1),false,0);aj(aD,aD,false,0);i[ap-1]=false}}}else{if(c){ai.height(ap*aA)}else{ai.width(ap*an)}}if(j.preloadAjax){for(var az=0;az<=ap-subtract;az++){if(i[az]){aj(az,az,false,0);i[az]=false}}}if(j.controlsShow){var ab=b("<span "+j.controlsAttr+"></span>");if(j.insertAfter){b(M).after(ab)}else{b(M).before(ab)}var ac=j.controlsBefore;if(h){W=ab.prepend("<ol "+l+"></ol>").children();for(var az=0;az<ap;az++){P[az]=b(document.createElement("li")).attr({rel:(az+1)}).html('<a href="#"><span>'+f[az]+"</span></a>").appendTo(W).click(function(){aq(b(this).attr("rel")-1,true);return false})}}if(w){var ae=al(j.firstHtml,"first")}if(s){var T=al(j.lastHtml,"last")}if(u){var aC=al(j.nextHtml,"next");var R=al(j.prevHtml,"prev")}}function aq(aG,aF){if(!aE){if(o){V(aG,aF)}else{au(aG,aF,true)}}}function al(aG,aH){var aF=b(aG);ab.prepend(aF);aF.click(function(){aq(aH,true);return false});return aF}D=L(D);g=L(g);A=L(A);k=L(k);C=L(C);function L(aF){if(parseInt(aF)){var aG=parseInt(aF)}else{switch(aF){case"fast":var aG=200;break;case"normal":var aG=400;break;case"medium":var aG=400;break;case"slow":var aG=600;break;default:var aG=400}}return aG}function Z(aG,aF){aG.each(function(){var aI=(this.tagName.toLowerCase()==="img")?b(this):b("img",this),aJ=this,aH=0,aK=function(){if(typeof aF==="function"){aF(aJ)}};if(aI.length){aI.each(function(){var aL=this,aM=function(aN){if((aL.complete)||(aL.readyState=="complete"&&aN.type=="readystatechange")){if(++aH===aI.length){aK()}}else{if(aL.readyState===undefined){b(aL).attr("src",b(aL).attr("src"))}}};b(aL).bind("load readystatechange",function(aN){aM(aN)});aM({type:"readystatechange"})})}else{aK()}})}function X(aF){var aI=new Array(".jpg",".png",".bmp",".gif");var aJ=false;while(aF.indexOf("\\")!=-1){var aF=aF.slice(aF.indexOf("\\")+1)}var aH=aF.slice(aF.indexOf(".")).toLowerCase();for(var aG=0;aG<aI.length;aG++){if(aI[aG]==aH){aJ=true;break}}return aJ}function af(aK,aJ,aF){if(aF){var aI=aC;var aG=T;var aL="next";var aH="last";var aM=s}else{var aI=R;var aG=ae;var aL="prev";var aH="first";var aM=w}if(!d){if(u){aI.fadeTo(aJ,aK,function(){if(aK==0){b(this).hide()}})}if(aM){aG.fadeTo(aJ,aK,function(){if(aK==0){b(this).hide()}})}if(I){b(I).filter(function(aN){return(b(this).attr("rel")==aL||b(this).attr("rel")==aH)}).fadeTo(aJ,aK,function(){if(aK==0){b(this).hide()}})}}}function N(aF,aG){if(aF==0){af(0,aG,false)}else{af(1,aG,false)}if(aF==aD){af(0,aG,true)}else{af(1,aG,true)}}function Q(aG){aG=parseInt((aG>aD)?aG=0:((aG<0)?aG=aD:aG))+1;for(var aF=0;aF<P.length;aF++){ar(P[aF],aG)}if(I){ar(I,aG)}}function ar(aG,aF){b(aG).filter(".current").removeClass("current").each(function(){if(b.isFunction(y)){y.call(this,b(this).attr("rel"))}});b(aG).filter(function(){return b(this).attr("rel")==aF}).addClass("current").each(function(aH){if(b.isFunction(B)){B.call(this,aF)}})}function Y(aG){var aH=0;for(var aF=0;aF<=ap;aF=aF+1){if(f[aF]==aG){aH=aF}}return aH}function S(aG,aH){if(aG==ap){aG=0}var aI=ah.eq(aG);var aF=aI.height();if(aF!=0){ak(aF,aH)}Z(aI,function(aJ){aF=b(aJ).height();if(aF!=0){ak(aF,aH)}})}function ak(aF,aG){M.animate({height:aF},{queue:false,duration:aG,easing:m})}function aB(){if(ao>aD){ao=0}if(ao<0){ao=aD}if(!E){Q(ao)}if(c){ai.css("margin-top",(ao*aA*-1))}else{ai.css("margin-left",(ao*an*-1))}ay=true;if(q&&av){window.location.hash=f[ao]}if(!J){if(b.isFunction(z)){z.call(ah.eq(ao),ao+1)}}}function ag(aF,aH){var aG=ao;switch(aF){case"next":aG=(aH>=aD)?(d?aG+1:aD):aG+1;break;case"prev":aG=(ao<=0)?(d?aG-1:0):aG-1;break;case"first":aG=0;break;case"last":aG=aD;break;default:aG=parseInt(aF);break}return aG}function aj(aI,aF,aL,aK){var aH=false;if(parseInt(aI)||aI==0){aH=ah.eq(aI)}else{if(aI=="last"){aH=b("li:last",M)}else{aH=b("li:first",M)}}var aG=(J)?(!t?parseInt(C*(2/5)):C):aK;var aJ=aF+1;if(X(i[aF])){aH.html(" ").append(b(new Image()).attr("src",i[aF]));Z(aH,function(aN){var aP=b(aN).children();var aO=aP.width();var aM=aP.height();aP.attr({oldheight:aM,oldwidth:aO});if(aO>an){aP.animate({width:an,height:(aM/aO)*an},0)}if(b.isFunction(x)){x.call(b(aN),aJ)}if(e&&aL){S(ao,aG)}})}else{aH.load(i[aF],function(aO,aM,aP){if(aM=="error"||!b(this).html()){b(this).html("Sorry but there was an error: "+(aP.status?aP.status:"no content")+" "+aP.statusText)}if(aM!="error"&&b.isFunction(v)){v.call(b(this),aJ)}var aN=b(this).height();if(e&&aL){S(aF,aG)}})}}function V(aJ,aI){if(aJ!=ao&&!aE){if(ay){K=false;if(aI){clearTimeout(at)}if(E){Q(ag(aJ,ad))}ay=!aI;var aK=(!aI&&!H&&q)?C*(k/g):C;var aM=ag(aJ,ad);if(aM>aD){aM=0}if(aM<0){aM=aD}if(G){N(aM,D)}if(e){if(i){if(!i[aM]){S(aM,C)}}else{S(aM,C)}}var aL=ah.eq(aM);if(b.isFunction(n)){n.call(aL,aM+1)}if(t){var aH=aL.clone().prependTo(M).css({"z-index":"100000",position:"absolute","list-style":"none",top:"0",left:"0"});if(i[aM]){aj(0,aM,false,aK);if(X(i[aM])){aj(aM+1,aM,false,aK);Z(ah.eq(aM+1),function(){if(e){S(aM,C)}})}else{aj(aM+1,aM,true,aK)}i[aM]=false}aH.hide().fadeIn(C,function(){ay=true;J=true;au(aJ,false,false);b(this).remove();if(q&&aI){window.location.hash=f[ao]}J=false;if(b.isFunction(z)){z.call(aL,aM+1)}})}else{var aG=parseInt((aK)*(3/5));var aF=aK-aG;M.children().fadeTo(aF,0.00001,function(){ay=true;J=true;au(aJ,false,false);ay=!aI;M.children().fadeTo(aG,1,function(){if(q&&aI){window.location.hash=f[ao]}ay=true;J=false;if(b.isFunction(z)){z.call(aL,aM+1)}})})}}}}function au(aG,aJ,aM){if(ay&&!aE){K=false;ay=(!aJ&&!H)?true:j.clickableAni;av=aJ;ad=ao;ao=ag(aG,ad);if(E){Q(ao)}var aL=Math.sqrt(Math.abs(ad-ao));var aK=parseInt(aL*g);if(!aJ&&!H){aK=parseInt(aL*k)}if(!aM){aK=0}var aI=ao;if(ao>aD){aI=0}if(ao<0){aI=aD}if(i){if(i[aI]){aj(aI,aI,true,aK);i[aI]=false;K=true}if(!J){var aF=0;if(ad>ao){for(a=ao;a<=ad;a++){if(a<=aD&&a>=0){if(i[a]){aj(a,a,false,aK);i[a]=false;aF++}}if(aF==10){a=ad}}}else{for(a=ad;a<=ao;a++){if(a<=aD&&a>=0){if(i[a]){aj(a,a,false,aK);i[a]=false;aF++}}if(aF==10){a=ao}}}}if((aI+1<=aD)&&!ax){if(i[aI+1]){aj(aI+1,aI+1,false,0);i[aI+1]=false}}if(aI-1>=0&&!ax){if(i[aI-1]){aj(aI-1,aI-1,false,0);i[aI-1]=false}}}if(!J){if(b.isFunction(n)){n.call(ah.eq(aI),aI+1);if(ao==-1||ao==ap){n.call(ai.children("li").eq((ao==-1)?0:-1),aI+1)}}}if(!c){if(e&&!J&&!K){S(ao,aK)}p=(ao*an*-1);ai.animate({marginLeft:p},{queue:false,duration:aK,easing:m,complete:aB})}else{p=(ao*aA*-1);ai.animate({marginTop:p},{queue:false,duration:aK,easing:m,complete:aB})}if(G){var aH=D;if(!aJ&&!H){aH=(k/g)*D}if(!aM){aH=0}if(J){aH=parseInt((C)*(3/5))}N(ao,aH)}if(aJ){clearTimeout(at)}if(H&&aG=="next"&&!aJ){at=aa(A+g)}}}var at;if(H){at=aa(A)}function aa(aF){return setTimeout(function(){aq("next",false)},aF)}if(I){b(I).live("click",function(){var aF=b(this).attr("rel");if(aF){am(aF)}return false})}M.bind("sudoSliderEvent",function(aG,aF){am(aF);return false});function am(aF){if(aF=="stop"){clearTimeout(at)}else{if(aF=="start"){at=aa(A);H=true}else{if(aF=="block"){ay=false}else{if(aF=="unblock"){ay=true}else{if(aF=="action"){alert("The slider just performed an action")}else{if(aF=="destroy"){ab.remove();aE=true;b(I).die("click");if(d){ai.children("li").eq(0).remove();ai.children("li").eq(-1).remove()}}else{if(ay){aq((aF==parseInt(aF))?aF-1:aF,true)}}}}}}}}ax=false;if(q){b.address.init(function(aG){var aF=Y(aG.value);au(aF,false,false)}).change(function(aG){var aF=Y(aG.value);if(aF!=ao){aq(aF,false)}})}else{if(F){au(F-1,false,false)}else{au(0,false,false)}}})}}})(jQuery);


$(document).ready(function(){	
    $("#slider2").sudoSlider({ 
        numeric: true,
        prevNext: true,
	    startSlide: 1,
    	updateBefore: true,
    	auto:true,
        numericText:['入口', '受付', '治療室', '院内', '待合室', '猫グッズ']
   });
});
/*  ================================================================================
 * switchHat.js 0.10
 * http://css-happylife.com/
 * Author:Takashi Hirasawa
================================================================================  */
(function($) {

	//設定（コメントアウトすれば機能停止）
	$(function(){
		$.uHat.switchHat();
		$.uHat.close();
		$.uHat.openAll();
	});

	$.uHat = {

		// 折りたたみ
		switchHat: function(settings) {
			uHatConA = $.extend({
				switchBtn: '.switchHat',
				switchContents: '.switchDetail',
				switchClickAddClass: 'nowOpen'
			}, settings);
			$(uHatConA.switchContents).hide();
			$(uHatConA.switchBtn).addClass("switchOn").click(function(){
				var index = $(uHatConA.switchBtn).index(this);
				$(uHatConA.switchContents).eq(index).slideToggle("slow");
				$(this).toggleClass(uHatConA.switchClickAddClass);
			}).css("cursor","pointer");
		},

		// 下の方に閉じるボタンを表示する
		close: function(settings) {
			uHatConB = $.extend({
				closeBtnSet: uHatConA.switchContents,
				apCloseBtn: '<span>X 閉じる</span>'
			}, settings);
			$(uHatConB.closeBtnSet).append('<p class="closeBtnHat">'+uHatConB.apCloseBtn+'</p>');
			$(".closeBtnHat").children().click(function(){
				$(this).parents(uHatConA.switchContents).fadeOut("slow");
				$(this).parents().prev().contents(uHatConA.switchBtn).removeClass(uHatConA.switchClickAddClass);
			}).css("cursor","pointer");
		},

		// 全部開くボタン
		openAll: function(settings) {
			uHatConC = $.extend({
				openAllBtnClass: '.allOpenBtn',
				switchBtn: uHatConA.switchBtn,
				openContents: uHatConA.switchContents
			}, settings);
			$(uHatConC.openAllBtnClass).addClass("switchOn").toggle(
				function(){
					$(this).addClass(uHatConA.switchClickAddClass);
					$(uHatConC.openContents).slideDown("slow");
					$(uHatConC.switchBtn).addClass(uHatConA.switchClickAddClass);
				},
				function(){
					$(this).removeClass(uHatConA.switchClickAddClass);
					$(uHatConC.openContents).slideUp("slow");
					$(uHatConC.switchBtn).removeClass(uHatConA.switchClickAddClass);
				}
			).css("cursor","pointer");
		}

	};

})(jQuery);


$(function(){
	$.uHat.switchHat({
		switchBtn: 'dl.faq dt',
		switchContents: 'dl.faq dd'
	});
	//$.uHat.close();
	$.uHat.openAll();
});
/*  ================================================================================
 * scrolltotop
 * http://another-step.com/2010/08/14/29/
================================================================================  */
var scrolltotop={

	//startline: Integer. Number of pixels from top of doc scrollbar is scrolled before showing control
	setting: {startline:100},

	state: {isvisible:false, shouldvisible:false},

	togglecontrol:function(){

		var scrolltop=jQuery(window).scrollTop()

		this.state.shouldvisible=(scrolltop>=this.setting.startline)? true : false
		if (this.state.shouldvisible && !this.state.isvisible){
			jQuery("#pageTop,#twitter,#facebook,#gplus").fadeIn("fast");
			this.state.isvisible=true;

		}
		else if (this.state.shouldvisible==false && this.state.isvisible){
			jQuery("#pageTop,#twitter,#facebook,#gplus").fadeOut("fast");
			this.state.isvisible=false;
		}
	},

	init:function(){
		jQuery(document).ready(function($){
			jQuery("#pageTop,#twitter,#facebook,#gplus").hide();
			var mainobj=scrolltotop;

			$(window).bind('scroll resize', function(e){
				mainobj.togglecontrol();
			})
		})
	}
}
scrolltotop.init();
