/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b}});
/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Â© 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */


 /**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);


/**
 * jQuery.LocalScroll - Animated scrolling navigation, using anchors.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/11/2009
 * @author Ariel Flesler
 * @version 1.2.7
 **/
(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$('<a> </a>').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);


/*
 * jQuery.SerialScroll - Animated scrolling of series
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 06/14/2009
 * @author Ariel Flesler
 * @version 1.2.2
 * http://flesler.blogspot.com/2008/02/jqueryserialscroll.html
 */
(function(a){var b=a.serialScroll=function(c){return a(window).serialScroll(c)};b.defaults={duration:1e3,axis:"x",event:"click",start:0,step:1,lock:!0,cycle:!0,constant:!0};a.fn.serialScroll=function(c){return this.each(function(){var t=a.extend({},b.defaults,c),s=t.event,i=t.step,r=t.lazy,e=t.target?this:document,u=a(t.target||this,e),p=u[0],m=t.items,h=t.start,g=t.interval,k=t.navigation,l;if(!r){m=d()}if(t.force){f({},h)}a(t.prev||[],e).bind(s,-i,q);a(t.next||[],e).bind(s,i,q);if(!p.ssbound){u.bind("prev.serialScroll",-i,q).bind("next.serialScroll",i,q).bind("goto.serialScroll",f)}if(g){u.bind("start.serialScroll",function(v){if(!g){o();g=!0;n()}}).bind("stop.serialScroll",function(){o();g=!1})}u.bind("notify.serialScroll",function(x,w){var v=j(w);if(v>-1){h=v}});p.ssbound=!0;if(t.jump){(r?u:d()).bind(s,function(v){f(v,j(v.target))})}if(k){k=a(k,e).bind(s,function(v){v.data=Math.round(d().length/k.length)*k.index(this);f(v,this)})}function q(v){v.data+=h;f(v,this)}function f(B,z){if(!isNaN(z)){B.data=z;z=p}var C=B.data,v,D=B.type,A=t.exclude?d().slice(0,-t.exclude):d(),y=A.length,w=A[C],x=t.duration;if(D){B.preventDefault()}if(g){o();l=setTimeout(n,t.interval)}if(!w){v=C<0?0:y-1;if(h!=v){C=v}else{if(!t.cycle){return}else{C=y-v-1}}w=A[C]}if(!w||t.lock&&u.is(":animated")||D&&t.onBefore&&t.onBefore(B,w,u,d(),C)===!1){return}if(t.stop){u.queue("fx",[]).stop()}if(t.constant){x=Math.abs(x/i*(h-C))}u.scrollTo(w,x,t).trigger("notify.serialScroll",[C])}function n(){u.trigger("next.serialScroll")}function o(){clearTimeout(l)}function d(){return a(m,p)}function j(w){if(!isNaN(w)){return w}var x=d(),v;while((v=x.index(w))==-1&&w!=p){w=w.parentNode}return v}})}})(jQuery);


/*
	ShiftBox plug-in for jQuery
	version 1.1
	by Greg Perham

	I'm not sure about licensing, so do whatever you want with it, but please leave the information above if you use it as-is, or note something like "Based on ShiftBox by Greg Perham" if you modify it enough to make it your own.
*/
(function($){function shiftBoxConfig(b,c){ShiftBox={'config':{'speed':'slow'},'Id':[],'originalW':[],'targetW':[],'diff':[],'barMove':[],'barOrig':[]};if(c)$.extend(ShiftBox.config,c);var d=b.attr('id')?b.attr('id'):b.attr('id')='shiftBox'+ShiftBox.Id.length;ShiftBox.Id[d]=d;ShiftBox.barOrig[d]=parseInt(b.children('.shiftbox-bar').css('margin-left'));b.children('.shiftbox-frame').each(function(i){var a=this.id?this.id:this.id=ShiftBox.Id[d]+'-frame'+i;ShiftBox.originalW[a]=$(this).outerWidth();ShiftBox.targetW[a]=$(this).find('.shiftbox-content').outerWidth(true);ShiftBox.diff[a]=ShiftBox.targetW[a]-ShiftBox.originalW[a];ShiftBox.barMove[a]=($(this).hasClass('shift-left'))?ShiftBox.barOrig[d]-ShiftBox.diff[a]:ShiftBox.barOrig[d]+ShiftBox.diff[a]})};$.fn.shiftBox=function(a){this.each(function(){shiftBoxConfig($(this),a)});return this};$.fn.shiftBoxIn=function(b){this.each(function(){sbId=$(this).parent().attr('id');if(!ShiftBox.Id[sbId])shiftBoxConfig($(this).parent(),b);activeId=this.id;$(this).siblings('.shiftbox-frame').each(function(){var a=ShiftBox.originalW[this.id]-ShiftBox.diff[activeId];$(this).animate({width:a},ShiftBox.config.speed)});$(this).animate({width:ShiftBox.targetW[activeId]},ShiftBox.config.speed);$(this).siblings('.shiftbox-bar').animate({marginLeft:ShiftBox.barMove[activeId]},ShiftBox.config.speed)});return this};$.fn.shiftBoxOut=function(a){this.each(function(){sbId=$(this).attr('id');if(!ShiftBox.Id[sbId])shiftBoxConfig($(this),a);$(this).children('.shiftbox-frame').each(function(){$(this).stop().animate({width:ShiftBox.originalW[this.id]},ShiftBox.config.speed)});$(this).children('.shiftbox-bar').stop().animate({marginLeft:ShiftBox.barOrig[sbId]},ShiftBox.config.speed)});return this}})(jQuery);


/*
  CodaSlider
*/
function codaSlider(){var c=$('#slider .scrollContainer > div');var d=$('#slider .scrollContainer');var e=true;if(e){c.css({'float':'left','position':'relative'});d.css('width',c[0].offsetWidth*c.length)}var f=$('#slider .scroll').css('overflow','hidden');f.before('<img class="scrollButton scrollLeft" src="img/arrow-left.png" />').after('<img class="scrollButton scrollRight" src="img/arrow-right.png" />');function selectNav(){$(this).parents('ul:first').find('a').removeClass('selected').end().end().addClass('selected')}$('#slider .sliderNav').find('a').click(selectNav);function trigger(a){var b=$('#slider .sliderNav').find('a[href$="'+a.id+'"]').get(0);selectNav.call(b)}if(window.location.hash){trigger({id:window.location.hash.substr(1)})}else{$('ul.sliderNav a:first').click()}var g=parseInt((e?d.css('paddingTop'):d.css('paddingLeft'))||0)*-1;var h={target:f,items:c,navigation:'.sliderNav a',prev:'img.scrollLeft',next:'img.scrollRight',axis:'xy',onAfter:trigger,offset:g,duration:500,easing:'swing'};$('#slider').serialScroll(h);$.localScroll(h);h.duration=1;$.localScroll.hash(h)};


/*
	UnHover function
*/
(function($) {
	$.fn.unhover = function() {
		this.each(function() {
			$(this).addClass('unhover').mouseout(function(){
				$(this).removeClass('unhover');
			});
		});
		return this;
	};
})(jQuery);


/*
    Based on Email Antileech Script by Frederic Andrieux & Boweries Inc. Ltd. (c)2002 -->
*/
function sendmail (address, subject) {
address = address.split(".split.");
address = address.join("@");
mail_win = window.open ('mailto:'+address+'?subject='+subject);
mail_win.close();
return false;
}
/*  End Email Antileech Script  */


(function($) {
/*
	UnHover function
*/
	$.fn.unhover = function() {
		this.each(function() {
			$(this).addClass('unhover').mouseout(function(){
				$(this).removeClass('unhover');
			});
		});
		return this;
	};
})(jQuery);


/*
	Drawer functions
*/
function loadDrawer(content) {
	$('#home-special').animate({marginTop:32}, 'slow').removeClass('drawer-closed');
	if ( $('#drawer').hasClass('open') ) {
		$('#drawer').stop().removeClass('open').animate( {top: '-'+drawerheight}, 'slow', 'swing', function(){
			// after drawer closes
			openDrawer(content);
		});
	} else {openDrawer(content);}
	var a = draweroffset + drawerheight * 2 + 6;
	var b = $(window).scrollTop() + $(window).height();
	if ( a > b ) $(window).scrollTo($('#shiftBox'), 'slow'); //$(window).scrollTo( (a - $(window).height()), 'slow');
}

function openDrawer(content) {
	prevContent = typeof(prevContent) == 'undefined' ? 'default' : prevContent;
	if (prevContent != content) {
		$('#drawer-content').load(content, function(){
			$('#drawer').addClass('open').animate( {top: '0'}, 'slow', 'swing', function(){
				if(typeof _gaq != 'undefined') _gaq.push(['_trackPageview',content]);
				if( $('#slider').length > 0 ) {
					codaSlider();
					$('#slider div.scroll').bind('click', function(){
						$('img.scrollRight').click();
					});
				};
			});
		});
		prevContent = content;
	} else {
		$('#drawer').addClass('open').animate( {top: '0'}, 'slow', 'swing' );
	}
}


/*
   preload images [note IE 6&7 error when setting style with attr() ]
*/
var logobar = $('<img />').attr({id: "logobar", src: "img/logobar.jpg"}).css({position: "absolute", top: 0, left: "-6px", "z-index": 1});
var preload1 = $('<img />').attr({src: "img/logo.png"});
var preload2 = $('<img />').attr({src: "img/menubox-over.png"});
var preload3 = $('<img />').attr({src: "img/starburst2.png"});
var	starburst = $('<img />').attr({src: "img/starburst.png"})
		.css({height:0, width:0, marginTop: "50%", marginLeft: "50%"});

/*
	main document.ready
*/
$(document).ready(function(){
	$('#container').prepend(logobar);
	$('#starburst').text('').css({backgroundImage: 'none', display: 'block', 'text-indent': 0});

	$('#shiftBox').shiftBox();

	/*
		attach drawer actions
	*/
	if($('#drawer').length > 0) {
		drawerheight = parseInt( $('#drawer').css('height') );
		draweroffset = $('#drawer').offset().top || 0;
	
		$('.shiftbox-frame').click(function(){
			$(this).shiftBoxIn();
			var file = 'html/' + $(this).attr('id') + '.html';
			loadDrawer(file);
		});
	}

	/*
		attach click actions to nav
	*/
	$('#nav a:eq(0)').click(function(){
		$(this).unhover();
		$('#clothing').shiftBoxIn();
		return false;
	});
	$('#nav a:eq(1)').click(function(){
		$(this).unhover();
		$('#food').shiftBoxIn();
		return false;
	});
	$('#nav a:gt(1)').click(function(){
		$(this).unhover();
		$('#shiftBox').shiftBoxOut();
	});
	$('#nav a[rel!="external"]').click(function(ev) {
		var href = $(this).attr('href');
		href = href.split('/');
		href = href[href.length-1];
		var file = 'html/' + href + '.html';
		loadDrawer(file);
		ev.preventDefault();
	});

}); // end document.ready


$(window).load(function(){
/*
	fade out logobar after page finishes loading
	pop in starburst
*/
	setTimeout(function(){
		$('#logobar').fadeOut(3000);
		$('#starburst').append(starburst)
		.children('img').attr({id: 'star'}).animate({
				height: "100%",
				width: "100%",
				marginTop: 0,
				marginLeft: 0
			}, 1500, 'easeOutElastic',
				function(){
					// clean up 
					$(this).parent().css('backgroundImage', '').end().remove();					
				}
		);
	}, 300);
});


/*
  Google Analytics browser dimensions
  Note that while this is implimented, bounce rate for the page is (closer to) 0
  http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html#implementationConsiderations
*/
var getDimensions = function() {
	$(document).unbind('click', getDimensions);  // don't need to call more than once per visit

	var winW = $(window).width();
	var winH = $(window).height();
	var dim = winW + 'x' + winH;
	var wStr =	dim + ':width';
	var hStr =  dim + ':height';

	if (typeof _gaq != 'undefined') {
		_gaq.push(['_trackEvent',
			'Browser Dimensions',
			'Load Width',
			wStr,
			winW
		]);
		_gaq.push(['_trackEvent',
			'Browser Dimensions',
			'Load Height',
			hStr,
			winH
		]);
	};
};

$(document).bind('click', getDimensions);

