if (!window.console || !console.firebug)
{
    var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
    "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];

    window.console = {};
    for (var i = 0; i < names.length; ++i)
        window.console[names[i]] = function() {}
}
$(function() { 
		// =========================================
		// Make external links open in a new window 
		// =========================================
		$('a[href^="http"]').not('[href*="' + location.host + '"]')
			.each(function() {
				var $this = $(this);
				var oldtitle = $this.attr("title");
				$this.attr({target: "_blank", title: (oldtitle.length) ? "Opens in a new window: " + oldtitle : "Opens in a new window"})
				.click(function(){ // Add Analytics tracking to external links
					if(_gaq) { _gaq.push(['_trackEvent', 'outgoing_links', this.href]); }
					}); // END Add Analytics tracking to external links
			 });
		
		// Add Analytics tracking to document links
		$('a[href$=".pdf"], a[href$=".doc"], a[href$=".xls"], a[href$=".ppt"], a[href$=".rtf"]').click(function(){ 
			if (_gaq) { _gaq.push(['_trackEvent', 'downloads', this.href]); }
			}); // END Add Analytics tracking to document links
	if( !Modernizr.inputtypes.date ) {
		Date.firstDayOfWeek = 0;
		$('input[type=date]').datePicker().val(new Date().asString());
	}

	if( !Modernizr.input.placeholder ) {
		$('input[placeholder]').placeholder({blankSubmit:true});
	}
	
	$('form.validate').each(function(){
						$(this).validate();
									 });
	$('#promo > div').after('<div id="pager" />').cycle({pager:'#pager',pause:true,timeout:6000});
});
