/**
 * Created by IntelliJ IDEA.
 * User: dab39303
 * Date: 1/28/11
 * Time: 10:03 AM
 * Duplication of uberBar Script with changes for the div
 */

/*
 * jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
 *
 * Uses the built In easIng capabilities added In jQuery 1.1
 * to offer multiple easIng options
 *
 * Copyright (c) 2007 George Smith
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 */

// t: current time, b: begInnIng value, c: change In value, d: duration

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}('m.X(m.q,{T:9(x,t,b,c,d){6 c*(t/=d)*t+b},Q:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},Y:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},Z:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},16:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},P:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},12:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},13:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},18:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},M:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},B:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},C:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},F:9(x,t,b,c,d){6-c*8.A(t/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x,t,b,c,d,s){e(s==v)s=1.k;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},17:9(x,t,b,c,d,s){e(s==v)s=1.k;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.y))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.y))+1)*t+s)+2)+b},z:9(x,t,b,c,d){6 c-m.q.u(x,d-t,0,c,d)+b},u:9(x,t,b,c,d){e((t/=d)<(1/2.i)){6 c*(7.n*t*t)+b}j e(t<(2/2.i)){6 c*(7.n*(t-=(1.5/2.i))*t+.i)+b}j e(t<(2.5/2.i)){6 c*(7.n*(t-=(2.S/2.i))*t+.R)+b}j{6 c*(7.n*(t-=(2.U/2.i))*t+.W)+b}},V:9(x,t,b,c,d){e(t<d/2)6 m.q.z(x,t*2,0,c,d)*.5+b;6 m.q.u(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,71,'||||||return||Math|function|||||if|var|PI|pow|75|else|70158|sin|jQuery|5625|sqrt||easing|asin|||easeOutBounce|undefined|abs||525|easeInBounce|cos|easeOutQuint|easeInOutQuint|easeOutSine|easeInOutElastic|easeInSine|easeInElastic|easeInOutExpo|easeOutExpo|easeInExpo|easeInCirc|easeOutCirc|easeInQuint|easeInOutCirc|easeOutElastic|easeInOutCubic|easeOutQuad|9375|25|easeInQuad|625|easeInOutBounce|984375|extend|easeInOutQuad|easeInCubic||easeInOutSine|easeInQuart|easeOutQuart|easeInBack|easeOutBack|easeOutCubic|easeInOutBack|easeInOutQuart'.split('|'),0,{}))

$(document).ready(function() {
	(function() {
		//settings
		var fadeSpeed = 1000, fadeTo = 0.0, topDistance = 100;
        // Start hidden,

        var
            lostdivME = function () { $('#lost').animate({opacity: 'hide',height: 'hide'}, fadeSpeed);},
            lostdivML = function () {$('#lost').animate({height: "show", opacity:'show'},{easing: 'easeOutElastic', duration: fadeSpeed*3});};

		var insideLost = false;

		//do
		$(window).scroll(function() {
			var position = $(window).scrollTop();
			if(position > topDistance && !insideLost) {
				//add events
                lostdivML();
				insideLost = true;
			}
			else if (position < topDistance){
                lostdivME();
				insideLost = false;
			}
		});
	})();
});
