var redscout = new function(){
	
	var _self;
	
	var twitterUrl;
	var gridTiles;
	var workSubnav;
	var designSubnav;
	var venturesSubnav;
	var currentSection;
	
	var nowDeepLink;
	
	var colors;
	
	return {
		
		start:function(){
			jQuery('#grid').css({
				'opacity':0,
				'visibility':'visible'
			});
			_self = this;
			_self.workSubnav = "";
			_self.designSubnav = "";
			_self.venturesSubnav = "";
			_self.twitterUrl = "/twitter2.php";
			_self.currentSection = "";
			_self.nowDeepLink = "";
			
			_self.colors = [
				{'section':'design','color':'rgba(166, 143, 244, 1)'},
				{'section':'about','color':'rgba(150, 205, 237, 1)'},
				{'section':'work','color':'rgba(61, 229, 219, 1)'},
				{'section':'now','color':'rgba(159, 228, 137, 1)'},
				{'section':'ventures','color':'rgba(228, 233, 82, 1)'},
				{'section':'contact','color':'rgba(253, 139, 127, 1)'}
			];
			
			//INITIALIZE NAV WIDTH
			if(jQuery(window).width() > 1200){
				jQuery('#navcontainer, #subnavcontainer').width(1180);
			}else{
				jQuery('#navcontainer, #subnavcontainer').width(940);
			}
			
			//RANDOMIZE GRID
			redscout.gridTiles = jQuery('.tile');
			redscout.initializeGrid();
			
			//ACTIVATE MASONRY
			jQuery('#grid').masonry({
				itemSelector : '.tile',
				isAnimated: false,
				isFitWidth: true,
				animationOptions: {
					duration: 500,
					easing: 'easeOutQuad',
					queue: false
				}
			});
			
			//ENABLE NAV ACTIONS
			jQuery('#nav a').each(function(i, obj){
				var link = jQuery(obj);
				link.click(function(){
					jQuery.address.value(jQuery(this).attr('rel'));
					link.blur();
					return false;
				});
			});
			
			//CYCLE NOW COLORS}
			var nowInterval = setInterval('redscout.nowColor()', 1000);
		},
		
		nowColor:function(index){
			var _random = Math.floor(Math.random()*redscout.colors.length);
			var _color = redscout.colors[_random].color;
			jQuery('#nav .now a').css('color', _color);
		},
		
		initializeGrid:function() {
			redscout.gridTiles.sort(function() { return 0.5 - Math.random();});
			jQuery('#grid').html(redscout.gridTiles);
			var _array = [];
			jQuery(redscout.gridTiles).each(function(i, obj){
				if(jQuery(obj).hasClass('blurb') || jQuery(obj).children().first().hasClass('now') || jQuery(obj).hasClass('tweet')){
					_array.push(obj);
				}
			});
			_array.push(redscout.gridTiles.slice(0,3));
			_array.sort(function() { return 0.5 - Math.random();});
			jQuery(_array).each(function(i, obj){
				jQuery('#grid').prepend(obj);
			});
			redscout.enableTiles();
			redscout.loadDynamicSubnav();
			jQuery('#grid').animate({opacity:1}, {duration:500});
			redscout.resize();
		},
		
		loadDynamicSubnav:function(){
			redscout.workSubnav = "<h2>";
			redscout.designSubnav = "<h2>";
			redscout.venturesSubnav = "<h2>";
			jQuery(redscout.gridTiles).each(function(i, obj){
				if(jQuery(obj).children().first().hasClass('work')){
					redscout.workSubnav += "<a href='#/work?page="+jQuery(obj).attr('id')+"'>"+jQuery(obj).find('h3').html()+"</a>";
				}else if(jQuery(obj).children().first().hasClass('design')){
					redscout.designSubnav += "<a href='#/design?page="+jQuery(obj).attr('id')+"'>"+jQuery(obj).find('h3').html()+"</a>";
				}else if(jQuery(obj).children().first().hasClass('ventures')){
					redscout.venturesSubnav += "<a href='#/ventures?page="+jQuery(obj).attr('id')+"'>"+jQuery(obj).find('h3').html()+"</a>";
				}
			});
			redscout.workSubnav += "</h2>";
			redscout.designSubnav += "</h2>";
			redscout.venturesSubnav += "</h2>";
		},
		
		disableTiles:function(){
			jQuery('.tile').each(function(i, obj){
				jQuery(obj).unbind();
			});
		},
		
		enableTiles:function(){
			//ENABLE GRID ACTIONS
			jQuery('.tile').each(function(i, obj){
				if(jQuery(obj).hasClass('tweet')){
					jQuery(obj).css('cursor', 'pointer');
					jQuery(obj).click(function(){
						_self.nowDeepLink = jQuery(obj).find('.headlineID').html();
						document.location.href = '/#/now/';
					});
				}else if(jQuery(obj).children().first().hasClass('now')){
					var _h = jQuery(this).height();
					var _rand = Math.floor(Math.random()*10);
					jQuery(obj).mouseenter(function(){
						jQuery(this).find('.overlay').animate({top:0}, {duration:350, queue:false, easing:'easeOutExpo'});
					});
					jQuery(obj).mouseleave(function(){
						jQuery(this).find('.overlay').animate({top:_h-7}, {duration:350, queue:false, easing:'easeInExpo'});
					});
					jQuery(obj).click(function(){
						_self.nowDeepLink = jQuery(obj).find('.headlineID').html();
						document.location.href = '/#/now/';
					});
					jQuery(this).find('.overlay').animate({top:_h, height:_h, opacity:1}, 0);
					jQuery(this).find('.overlay').delay(_rand*50).animate({top:_h-7}, 250);
				}else{
					var _h = jQuery(this).height();
					var _rand = Math.floor(Math.random()*10);
					jQuery(obj).mouseenter(function(){
						jQuery(this).find('.overlay').animate({top:0}, {duration:350, queue:false, easing:'easeOutExpo'});
					});
					jQuery(obj).mouseleave(function(){
						jQuery(this).find('.overlay').animate({top:_h-7}, {duration:350, queue:false, easing:'easeInExpo'});
					});
					jQuery(obj).click(function(){
						document.location.href = '/#/'+(jQuery(obj).find('span').html().toLowerCase())+'?page='+jQuery(obj).attr('id');
					});
					jQuery(this).find('.overlay').animate({top:_h, height:_h, opacity:1}, 0);
					jQuery(this).find('.overlay').delay(_rand*50).animate({top:_h-7}, 250);
				}
			});
		},
		
		handleNav:function(arg, loadContent) {
			_self.currentSection = arg;
			if(loadContent){
				// _self.animateNavArrow();
			}else{
				if(arg != 'login'){
					//LOAD & SHOW SUBNAV
					if(arg == 'now'){
						redscout.loadNow();
					}else{
						redscout.nowDeepLink = "";
						redscout.closeTop();
						setTimeout(function(){
							redscout.showSubnav(arg);
						}, 1000);
					}
					// REMOVE STATIC IMAGES
					jQuery('.tile').each(function(i, obj){
						if(jQuery(obj).hasClass('static') || jQuery(obj).hasClass('info')){
							jQuery(obj).animate({'opacity':0}, {duration:150, complete:function(){
								jQuery(this).remove();
							}});
						}
					});
					var _data = {};
					if(arg == "work" || arg == "design" || arg == "ventures"){
						_data = {
							"podName":arg + "_static_images",
							"aboutName":arg + "_about"
						};
					}else{
						_data = {"podName":arg + "_static_images"};
					}
					jQuery.ajax({
						type: "get",
						url: "/ajax/static-images.php",
						data: _data,
						success: function(response) {
							jQuery(window).scrollTop(0);
							jQuery('#grid').prepend(response);
							//LAYOUT MATCHED FILTER
							jQuery(redscout.gridTiles).each(function(i, obj){
								if(jQuery(obj).children().first().hasClass(arg)){
									jQuery('#grid').prepend(obj);
									jQuery(obj).animate({'opacity':1}, {duration:250});
								}else{
									jQuery(obj).animate({'opacity':0}, {duration:150, complete:function(){
										//
									}});
								}
							});
							//SHOW OVERLAY FOR INFO TILE
							var _array = [];
							var _staticTiles = [];
							_v = jQuery.address.path().split('/')[1];
							jQuery('.tile').each(function(i, obj){
								if(jQuery(obj).hasClass('info')){
									jQuery(obj).find('.overlay').css({
										'height': jQuery(obj).height(),
										'top':0
									}).addClass(_v).find('span').html(_v.toUpperCase());
									_array.push(obj);
								}else if(jQuery(obj).children().first().hasClass(_v)){
									_array.push(obj);
								}else if(jQuery(obj).hasClass('static')){
									_staticTiles.push(obj);
								}
							});
							// RANDOMIZE
							_staticTiles.sort(function() { return 0.5 - Math.random();});
							jQuery(_staticTiles).each(function(i, obj){
								jQuery('#grid').prepend(obj);
							});
							_array.sort(function() { return 0.5 - Math.random();});
							jQuery(_array).each(function(i, obj){
								jQuery('#grid').prepend(obj);
							});
							// ANIMATE
							jQuery('#grid').masonry('reload');
							if(arg == 'about'){
								setTimeout(function(){
									jQuery('#about_redscout').find('.overlay').click(function(){
										document.location.href = '/#/'+(jQuery('#about_redscout').find('span').html().toLowerCase())+'?page='+jQuery('#about_redscout').attr('id');
									});
								}, 500);
							}
						}
					});
					//ANIMATE ARROW
	  				// _self.animateNavArrow();
				}else{
					//LOAD PRIVATE PORTFOLIO INPUT FIELD
					jQuery('#login a').hide();
					var input = jQuery('<form id="passcode" onsubmit="redscout.privateSubmit();return false;"><input type="password" /></form>');
					jQuery('#login').append(input);
					input.focus();

				}
			}
			//STYLE ACTIVE NAV BUTTON
			jQuery('#nav a').each(function(i, obj){
				if(jQuery(obj).parent().attr('id') != 'login'){
					if(jQuery(obj).parent().hasClass(arg)){
						var _color;
						jQuery(redscout.colors).each(function(i, obj){
							if(obj.section == arg){
								_color = obj.color;
							}
						});
						var _colorStr = '2px solid ' + _color;
						jQuery(obj).parent().css({
							'border': _colorStr,
							'margin': 0
						});
						jQuery(obj).addClass('active');
					}else{
						var _color = "rgba(0, 0, 0, .3)";
						jQuery(obj).parent().css({
							'border': 'none',
							'margin': 2
						});
						jQuery(obj).removeClass('active');
					}
				}
			});
		},
		
		privateSubmit:function(){
			var _code = jQuery('input').attr('value');
			jQuery.ajax({
				type: "get",
				url: "/ajax/private.php",
				data: {
					"id":_code
				},
				success: function(response) {
					jQuery('#grid').html(response).masonry('reload');
					redscout.enableTiles();
					jQuery('#nav li').each(function(i, obj){
						if(jQuery(obj).attr('id') != "login"){
							jQuery(obj).hide();
						}
					});
					jQuery('#login form').remove();
					jQuery('#login a').html('LOG OUT');
					jQuery('#login a').show().click(function(){
						window.location = "/";
					});
				}
			});
		},
		
		animateNavArrow:function(){
			if(redscout.currentSection.length > 0){
				var _left = jQuery('#nav').position().left + jQuery('#nav .' + redscout.currentSection).position().left+(jQuery('#nav .'+_self.currentSection).width()/2)+3;
				setTimeout(function(){
					jQuery('#nav-arrow').animate({'height':11, left:_left}, {duration:500, easing:'easeInOutCubic'});
				}, 250);
			}
		},
		
		showSubnav:function(arg, shortcut) {
			if(shortcut){
				
			}else{
				jQuery('#content .panels').css('left', 0).empty();
			}
			var _delay;
			jQuery('#detail-drop-shadow-top').css('opacity', .5);
			switch(arg){
				case 'now':
					jQuery('#subnav span.content').html("<h2 style='padding-left:20px;'>All the latest news from Redscout.</h2>");
					jQuery('#top-layer .top-background, #top-layer .bottom-background').removeClass('light');
					jQuery('#top-layer .top-background, #top-layer .bottom-background').addClass('dark');
					_delay = 300;
					break;
				case 'about':
					jQuery('#subnav span.content').html("<h2><a href='#/about?page=about_redscout'>About Redscout</a><a href='#/about?page=about_people'>People</a><a href='#/about?page=press' class='last'>Press</a></h2>");
					jQuery('#top-layer .top-background, #top-layer .bottom-background').removeClass('dark');
					jQuery('#top-layer .top-background, #top-layer .bottom-background').addClass('light');
					_delay = 0;
					break;
				case 'contact':
					jQuery('#subnav span.content').html("<h2><a href='#/contact?page=offices'>Offices</a><a href='#/contact?page=recommendations' class='last'>Recommendations</a></h2>");
					jQuery('#top-layer .top-background, #top-layer .bottom-background').removeClass('dark');
					jQuery('#top-layer .top-background, #top-layer .bottom-background').addClass('light');
					_delay = 0;
					break;
				case 'work':
					jQuery('#subnav span.content').html(redscout.workSubnav);
					jQuery('#top-layer .top-background, #top-layer .bottom-background').removeClass('dark');
					jQuery('#top-layer .top-background, #top-layer .bottom-background').addClass('light');
					_delay = 0;
					break;
				case 'design':
					jQuery('#subnav span.content').html(redscout.designSubnav);
					jQuery('#top-layer .top-background, #top-layer .bottom-background').removeClass('dark');
					jQuery('#top-layer .top-background, #top-layer .bottom-background').addClass('light');
					_delay = 0;
					break;
				case 'ventures':
					jQuery('#subnav span.content').html(redscout.venturesSubnav);
					jQuery('#top-layer .top-background, #top-layer .bottom-background').removeClass('dark');
					jQuery('#top-layer .top-background, #top-layer .bottom-background').addClass('light');
					_delay = 0;
					break;
			}
			jQuery('#subnav h2').children().last().addClass('last');
			var _v = jQuery.address.queryString().split('page=')[1];
			setTimeout(function(){
				jQuery('#navbar').animate({height:157}, {duration:500, easing:'easeOutExpo', queue:false});
				jQuery('#container').animate({top:60}, {duration:500, easing:'easeOutExpo', queue:false});
				jQuery('#detail-drop-shadow-top').animate({height:36}, {queue:false, duration:500, easing:'easeOutExpo'});
			}, _delay);
			jQuery('#subnav .close').click(function(){
				window.history.back();
				// redscout.closeTop();
			});
			if(arg != 'contact') jQuery('#content, .navi, .arrows, #sidebar').remove();
			redscout.resize();
		},
		
		hideSubnav:function() {
			jQuery('#navbar').animate({height:100}, {duration:500, easing:'easeOutExpo', queue:false});
			jQuery('#container').animate({top:0}, {duration:500, easing:'easeOutExpo', queue:false});
			jQuery('#detail-drop-shadow-top').animate({height:0}, {queue:false, duration:500, easing:'easeOutExpo'});
			
		},
		
		loadNow:function(){
			jQuery('.content-drawer').animate({top:101, height:0}, {queue:false, duration:500, easing:'easeOutExpo'});
			jQuery('#spacer').animate({height:0}, {queue:false, duration:500, easing:'easeOutExpo'});
			var _h = jQuery(window).height();
			jQuery('#top-layer .top-background, #top-layer .bottom-background').removeClass('light');
			jQuery('#top-layer .top-background, #top-layer .bottom-background').addClass('dark');
			jQuery('#top-layer .top-background').css({top:-(_h)/2});
			jQuery('#top-layer .bottom-background').css({top:_h/2});
			jQuery('#top-layer').show();
			var _h = jQuery('#top-layer .top-background').height();
			jQuery('#top-layer .top-background').css('top', -_h);
			jQuery('#top-layer .top-background').animate({top:0}, {duration:250, easing:'easeOutSine', queue:false});
			jQuery('#top-layer .bottom-background').animate({top:0}, {duration:250, easing:'easeOutSine', queue:false, complete:function(){
				redscout.loadNowFeeds();
			}});
			redscout.showSubnav('now');
		},
		
		loadContent:function(obj){
			jQuery('#content, .navi, .arrows, #sidebar').remove();
			if(obj != null){
				var _id = jQuery(obj).attr('id').toLowerCase();
				jQuery.address.parameter('page', _id);
				
				var _podName = jQuery(obj).attr('data');
				var _section = jQuery(obj).children().first().find('span').html().toLowerCase();
				if(parseInt(jQuery('#navbar').css('height')) < 157){
					redscout.showSubnav(_section, true);
				}
				var _h = jQuery(window).height();
				jQuery('#top-layer .top-background, #top-layer .bottom-background').removeClass('dark');
				jQuery('#top-layer .top-background, #top-layer .bottom-background').addClass('light');
				jQuery('#top-layer .top-background').css({top:0, opacity:0});
				jQuery('#top-layer .bottom-background').css({top:0, opacity:0});
				jQuery('#top-layer').show();
				jQuery('#top-layer .top-background').animate({opacity:1}, {duration:650, easing:'easeOutQuart', queue:false});
				jQuery('#top-layer .bottom-background').animate({opacity:1}, {duration:650, easing:'easeOutQuart', queue:false});
				jQuery('.content-drawer').animate({height:488, top:158}, {queue:false, duration:650, easing:'easeOutQuart'});
				jQuery('#spacer').animate({height:488}, {queue:false, duration:650, easing:'easeOutQuart'});
				
				jQuery.ajax({
					type: "get",
					url: "/ajax/detail.php",
					data: {
						"podName":_podName,
						"id":_id
					},
					success: function(response) {
						jQuery(".content-drawer").prepend(response);
						jQuery(".content-drawer #content .panels .panel").each(function(i, obj){
							//REMOVE EMPTY PANELS
							if(jQuery(obj).find('.hero').html().length < 1){
								jQuery(this).remove();
							}
							//REMOVE EMPTY ELEMENTS
							jQuery(obj).find('p').each(function(i, obj){
								if(jQuery(obj).html().length == 0){
									jQuery(this).remove();
								}
							});
						});
						//ACTIVATE SCROLLABLE CONTENT
						if(jQuery('.panel').length > 1){
							if(jQuery('.navi').length == 0){
								var navi = jQuery("<div class='navi'>");
								jQuery('.content-drawer').append(navi);
								var arrows = jQuery("<div class='arrows'><a class='prev'></a><a class='next'></a></div>");
								jQuery('.content-drawer').append(arrows);
							}
							jQuery('#content').scrollable({easing: 'easeOutQuart', speed: 300, circular: true}).navigator('.navi');
							setTimeout(function(){
								jQuery('.navi').css('left', (jQuery('#content').offset().left + (jQuery('.hero').width()/2)) - (jQuery('.navi').children().length * 6));
							}, 500);
						}
						if(response.indexOf('contentMap')>-1){
							var _contactSection = jQuery.address.queryString().split('page=')[1];
							if(_contactSection == "offices"){
								jQuery.getScript("/wp-content/themes/redscout/js/map.js", function() {
									map.start();
								});
							}else{
								jQuery.getScript("/wp-content/themes/redscout/js/map.js", function() {
									map.start(true);
								});
							}
						}
						//SET SUBNAV ITEM TO ACTIVE
						redscout.updateSubNav();
						
						//ADD navi actions to press section subnav
						if(jQuery('.press').length > 0){
							jQuery('#sidebar.copy .link').each(function(i, obj){
								jQuery(obj).css('cursor', 'pointer');
								jQuery(obj).click(function(){
									jQuery('#content').scrollable().seekTo(i);
								});
							});
						}
					}
				});
			}
		},
		
		updateSubNav:function(){
			var _v = jQuery.address.queryString().split('page=')[1]
			jQuery(jQuery('#subnav h2').children()).each(function(i, obj){
				if(jQuery(obj).html().toLowerCase().replace(" ", "_") == _v){
					jQuery(obj).addClass('active');
				}else{
					jQuery(obj).removeClass('active');
				}
			});
		},
		
		loadNowFeeds:function() {
			jQuery.ajax({
				type: "get",
				url: "/ajax/now.php",
				success: function(response) {
					jQuery('html').css('background', 'black');
					jQuery('#container, #top-layer').hide();
					var _holder = jQuery('<div id="content" class="nowContainer">');
					_holder.html(response);
					// var _array = [];
					// jQuery(_holder).find('.post-container').each(function(i, obj){
					// 	var _date = new Date(jQuery(obj).find('.datetime').attr('data'));
					// 	jQuery(obj).data({'time':_date.getTime()})
					// 	_array.push(obj);
					// });
					// _array.sort(
					// 	function(a,b) {
					// 		return  jQuery(b).data().time - jQuery(a).data().time;
					// 	}
					// );
					// var _content = jQuery('<div id="content" class="now">');
					// jQuery(_array).each(function(i, obj){
					// 	jQuery(_content).append(obj);
					// });
					jQuery('body').append(_holder);
					if(redscout.nowDeepLink != ""){
						var escDL = escape(redscout.nowDeepLink);
						jQuery('.post-container').find('.deeplinkAnchor').each(function(i,obj){
							if(escape(jQuery(obj).attr('rel')) == escDL){
								var _position = jQuery(obj).offset().top - 220;
								jQuery('html,body').animate({scrollTop:_position}, 400);
							}
						});
					}
				}
			});
		},
		
		closeTop:function(){
			var _h = jQuery(window).height();
			if(jQuery('#top-layer .top-background').hasClass('dark')){
				jQuery('#container, #top-layer').show();
				jQuery('html').css('background', 'white');
				setTimeout(function(){
					jQuery('#content').hide();
					jQuery('#top-layer .top-background').animate({top:-(_h-200)/2}, {queue:false, duration:150, easing:'easeOutSine'});
					jQuery('#top-layer .bottom-background').animate({top:_h}, {queue:false, duration:150, easing:'easeOutSine', complete:function(){
						jQuery('#top-layer').hide();
						jQuery('#spacer').animate({height:0}, {queue:false, duration:500, easing:'easeOutExpo'});
					}});
				}, 150);
			}else{
				jQuery('.content-drawer').animate({top:101, height:0}, {queue:false, duration:500, easing:'easeOutExpo', complete:function(){
					jQuery('#top-layer .top-background').css({queue:false, opacity:1});
					jQuery('#top-layer .bottom-background').css({queue:false, opacity:1});
					jQuery('#top-layer').hide();
				}});
				jQuery('#spacer').animate({height:0}, {queue:false, duration:500, easing:'easeOutExpo'});
				setTimeout(function(){
					jQuery('#top-layer .top-background').animate({queue:false, opacity:0}, {duration:150, easing:'easeOutSine'});
					jQuery('#top-layer .bottom-background').animate({queue:false, opacity:0}, {duration:150, easing:'easeOutSine'});
				}, 150);
			}
			redscout.hideSubnav();
		},
		//ADDRESS STUFF
		addressInit:function(){
			if(jQuery.address.path() != "/"){
				redscout.addressLoad();
			}
			// ADD TIMEOUT TO CREATE LISTENER SO WE DON'T LOAD SHIT ON PAGE INIT
			setTimeout(function(){
				jQuery.address.change(function(event){
					redscout.addressLoad();
				});
			}, 1000);

		},

		addressLoad:function(obj){
			_v = jQuery.address.path().split('/')[1];
			if(_v != "" && jQuery.address.queryString().length == 0){
				_self.handleNav(_v);
			}else if(_v == "contact"){
				var _contactSection = jQuery.address.queryString().split('page=')[1];
				if(jQuery('#contentMap').length == 0){
					// NO MAP YET
					setTimeout(function(){
						jQuery(redscout.gridTiles).each(function(i, obj){
							if(jQuery(obj).attr('id') == "offices"){
								redscout.loadContent(obj);
							}
						});
					}, 1000);
					_self.handleNav(_v);
				}else{
					if(_contactSection == "recommendations"){
						map.toggleView('recommendations');
						redscout.updateSubNav();
					}else{
						map.toggleView('offices');
						redscout.updateSubNav();
					}
				}
			}else if(_v != "" && jQuery.address.queryString().length > 0){
				_self.handleNav(_v, true);
				_v = jQuery.address.queryString().split('page=')[1];
				jQuery(redscout.gridTiles).each(function(i, obj){
					if(jQuery(obj).attr('id') == _v){
						redscout.loadContent(obj);
					}
				});
			}else if(_v == "private"){
				
			}else if(_v == ""){
				window.location.href = "/";
			}
		},
		
		//RESIZE
		resize:function(){
			setTimeout(function(){
				var _w;
				if(jQuery('#top-layer .top-background').hasClass('dark')){
					_w = (jQuery(window).width()-100 < 960) ? 960 : jQuery(window).width()-100;
					jQuery('#navcontainer').css('left', 15);
					jQuery('#subnavcontainer').css('left', 10);
				}else{
					_w = (jQuery('#grid').width()-20 < 960) ? 960 : jQuery('#grid').width()-20;
					jQuery('#navcontainer, #subnavcontainer').css('left', 0);
				}
				// jQuery('#navcontainer, #subnavcontainer').width(_w);
				jQuery('#navcontainer, #subnavcontainer').animate({width:_w},{duration:350, queue:false, easing:'easeOutExpo', complete:function(){
					_self.animateNavArrow();
				}});
			}, 500);
		},
		
		popupShare:function(url, title) {
			if(!window.screenX && !window.screenY) {
				window.screenX = window.screenLeft;
				window.screenY = window.screenTop;
			}
			var popupPosition = {
				x: (window.screenX + window.innerWidth / 2.0),
				y: (window.screenY + window.innerHeight / 2.0)
			};
			var DEFAULT_POPUP_SHARING = 'menubar=0, resizable=0, location=0, toolbar=0, status=0, scrollbars=1, titlebar=0, left=' + (popupPosition.x - 225) + ', top=' + (popupPosition.y - 250) + ', width=550, height=500';
			window.open(url, title, DEFAULT_POPUP_SHARING);
		}
	}
}
