jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};


NAAN = {
	common: {
		getUrlParam: function(strParamName, currentUri) {
			currentUri = currentUri||false;
			strReturn = '';
			
			if( currentUri ) { procCurrentUri = currentUri; }
			else { procCurrentUri = location.href; }
			
			if ( procCurrentUri.indexOf("?") > -1 ){
				var strQueryString = procCurrentUri.substr(procCurrentUri.indexOf("?")).toLowerCase();
				var aQueryString = strQueryString.split("&");
				for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
					if ( aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ) {
						var aParam = aQueryString[iParam].split("=");
						strReturn = aParam[1];
						break;
					}
				}
			}
			return unescape(strReturn);
		},
		openPopup: function(url, title, width, height) {
			if (screen.availWidth) {
				popupCenterX = screen.availWidth / 2 - width / 2;
				popupCenterY = screen.availHeight / 2 - height / 2;
			}
			else {
				popupCenterX = 0;
				popupCenterY = 0;
			}
			
			popupWindow = window.open( url, title, 'width='+width+',height='+height+',status=no,location=no,left='+popupCenterX+',top='+popupCenterY+',screenX='+popupCenterX+',screenY='+popupCenterY );
			popupWindow.focus();
			
			return false;
		},
		openPopupLink: function(linkElem) {
			popupUrl = jQuery(linkElem).attr('href');
			popupTitle = jQuery(linkElem).attr('rel');
			popupSizeRaw = jQuery(linkElem).attr('rev');
			popupWidth = 400;
			popupHeight = 400;
			
			if( popupSizeRaw ) {
				var popupSizeArr = popupSizeRaw.split(',');
				popupWidth = popupSizeArr[0];
				popupHeight = popupSizeArr[1];
			}
			
			this.openPopup( popupUrl, popupTitle, popupWidth, popupHeight );
			
			return false;
		},
		getNextSaturday: function(giveDate) {
			giveDate = giveDate||false;

			if( giveDate ) { today = giveDate; }
			else { today = new Date(); }
		
			year = today.getFullYear();
			month = today.getMonth();
			day = today.getDate();
			dayOfWeek = today.getDay();
		
			if( dayOfWeek == 6 ) {
				newDay = day+7;
			}
			else {
				addDays = 6-dayOfWeek;
				newDay = day+addDays;
			}
		
			newDate = new Date( year, month, newDay );
			return( newDate );
		}
	},
	layout: {
		init: function() {
			this.correctContentSidebar();
			this.initMainNav();
		},
		correctContentSidebar: function() {
		  var contentId = '#containerContent'
		  var sidebarLeftId = '#sidebar';
		  var newContentHeight = 0;
		  var newSidebarLeftHeight = 0;
		  
		  var contentHeight = jQuery(contentId).height();
		  var sidebarLeftHeight = jQuery(sidebarLeftId).height();
		  var sidebarLeftCalcHeight = sidebarLeftHeight+50;
		  
		  if( sidebarLeftCalcHeight > contentHeight ) {
		  	jQuery(contentId).height(sidebarLeftCalcHeight+15+'px');
			contentHeight = sidebarLeftCalcHeight+15;
		  }
		  
		  jQuery(sidebarLeftId).height(contentHeight-50+'px');
		  
		  
		  return;
		},
		initMainNav: function() {
			jQuery("ul#mainNavList").superfish({
				animation: {height:'show'},
				autoArrows: false,
				dropShadows: false
			}).find('ul').bgIframe({opacity:false});
		}
	}
}



