/*
	
	Project Name Global Javascript Functions
	Auhthor: ISITE Design

*/

// globals set for jsLint
/*globals $,jQuery,window,setTimeout,document,console */

// jquery no conflict. use $j or jQuery outside of ready function
var $j = jQuery.noConflict();
var GGO = GGO || {};

GGO.settings = {
	supportgoal : 150000
}


// jQuery document ready
jQuery(function ($) {

	// JS enabled
	$('html').addClass('js');
	
	// Few setups for IE6
	if (document.all) {
		//add class to drop downs and buttons 
	    $('#nav li, button').hover(
			function () {
				$(this).addClass('over');
			},
			function () {
				$(this).removeClass('over');
			}
	    );
	}// if document.all
	
	$('.callout.support .meter').setMeter();
	
});// document ready


// application logic


// jQuery plugins

jQuery.fn.setMeter = function () {
	var $meter = jQuery(this),
		val = parseInt($meter.text().replace(',', '')),
		percent = 0;
	
	if (val > 0) {
		percent = Math.round(val / GGO.settings.supportgoal * 10);
		$meter.addClass('raised' + percent + '0');
	}
}


// etc



// IE6 fixes
// make sure IE has the abbr and acronym tag
if (document.all) {
	document.createElement("abbr");
	document.createElement("acronym");
}
// prevent IE6 flicker
try {
	document.execCommand('BackgroundImageCache', false, true);
} catch (e) {}
