// browser detection
function browserStats() {
  var ua = " " + navigator.userAgent.toLowerCase();
  this.nn = ua.indexOf( "mozilla" ) > 0;
  this.safari = ua.indexOf( "safari" ) > 0;
  ua.indexOf( "compatible" ) > 0 ? this.nn = false : "";
  this.ie = ua.indexOf( "msie" ) > 0;
  this.version = parseInt( navigator.appVersion );
  this.mac = ua.indexOf( "mac" ) > 0;
  this.ie ? ua.indexOf( "msie 5" ) > 0 ? this.version = 5 : "" : "";
  this.ie ? ua.indexOf( "msie 6" ) > 0 ? this.version = 6 : "" : "";
  return this;
}
var b = new browserStats();

//dhtml functions
var d=document; var _a=(d.all)?1:0; var l=(!d.getElementById && b.nn)?1:0;
function getE(e,f){if(l){f=(f)?f:self;V=f.document.layers;if(V[e])return V[e];for(W=0;W<V.length;)t=getE(e,V[W++]);return t;}if(_a)return d.all[e];return d.getElementById(e);}
function showE(e){e=getE(e);if(l)e.visibility='show';else e.style.visibility='visible';}
function hideE(e){e=getE(e);if(l)e.visibility='hide';else e.style.visibility='hidden';}
function getX(e){e=getE(e);if(l)return e.left;else return e.style.left;}
function setX(e,x){e=getE(e);if(l)e.left=x;else e.style.left=x;}
function getY(e){e=getE(e);if(l)return e.top;else return e.style.top;}
function setY(e,y){e=getE(e);if(l)e.top=y;else e.style.top=y;}
function setZ(e,z){e=getE(e);if(l)e.zIndex=z;else e.style.zIndex=z;}
function setW(e,w){e=getE(e);if(l)e.clip.width=w;else e.style.width=w;}
function getW(e){e=getE(e);if(l)return e.document.width;if(_a)return e.scrollWidth;return e.offsetWidth;}
function setH(e,h){e=getE(e);if(l)e.clip.height=h;else e.style.height=h;}
function getH(e){e=getE(e);if(l)return e.document.height;if(_a)return e.scrollHeight;return e.offsetHeight;}
function setC(e,t,r,b,x){e=getE(e);if(l){X=e.clip;X.top=t;X.right=r;X.bottom=b;X.left=x;}else e.style.clip='rect('+t+' '+r+' '+b+' '+x+')';}
function writeH(e,h){e=getE(e);if(l){Y=e.document;Y.write(h);Y.close();}else e.innerHTML=h;}
function getMouseX(e){if(_a)return event.clientX;return e.pageX;}
function getMouseY(e){if(_a)return event.clientY;return e.pageY;}
function getScrollX(){if(_a)return d.body.scrollLeft;return window.pageXOffset;}
function getScrollY(){if(_a)return d.body.scrollTop;return window.pageYOffset;}

//universal image swap function
function swapImg(aIN, aIS, aDA){var dA = "";if(document.layers && aDA){for( var i = 0; i < aDA.length; i++ ){dA += 'document.' + aDA[i] + '.';}eval(dA + 'document.' + aIN + '.src ="' + aIS + '";');return true;}else{document[aIN].src = aIS;}}

(function() {

	var window = this, undefined;

	var global = window.global = {
   
	    // ===========================================
			// Initializer
	    // ===========================================
	    init: function() {
	        // Allow console.log debugging cross all browsers
	        try { console.log('...global is now running...'); } catch(e) { window.console = { log: function() {} }; };
					
					//$('.'+page).removeClass('nav');
					//$('.'+page).addClass('pageOn');
					
					//if(subNav != ''){
						//$('.sub_'+page+' .'+subNav+' a').addClass('on');
					//}
					
					
					
					
			jQuery('.read_more').click(function() {
				jQuery('.more_content').slideUp('normal');
				jQuery('.read_more').html('More Info');
				jQuery('.read_more').removeClass('more_link');
				jQuery('.read_more').addClass('action_link');
				
				if(jQuery(this).next().is(':hidden') == true) {
					jQuery(this).next().slideDown('normal');
					jQuery(this).html('Less Info');
					jQuery(this).removeClass('action_link');
					jQuery(this).addClass('more_link');
				} 
			});
			
			jQuery(".prev").bind({
				mouseenter: function() {
                    jQuery(this).addClass('prev_over');
                },
                mouseleave: function() {
                    jQuery(this).removeClass('prev_over');
                }
          	});
			
			jQuery(".next").bind({
				mouseenter: function() {
                    jQuery(this).addClass('next_over');
                },
                mouseleave: function() {
                    jQuery(this).removeClass('next_over');
                }
          	});
	    },
		
			curDate: function() {
	    	var m_names = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");    	
	    	var d = new Date();
				var curr_date = d.getDate();
				var curr_month = d.getMonth();
				var curr_year = d.getFullYear();
				console.log(m_names[curr_month] + " " + curr_date + ", " + curr_year);
				jQuery('#date_display').html(m_names[curr_month] + " " + curr_date + ", " + curr_year);
	    }
	};
	

	// ===========================================
	// ready load
	// =========================================== 
	jQuery(document).ready(function () {
	
		// init object
		global.init();
		jQuery('ul.sf-menu').superfish();
		global.curDate();
	
	});
})();





