function show(id) {
	jQuery(id).show();
}

function hide(id) {
	jQuery(id).hide();
}


function collapse(id) {
	jQuery(id).slideUp(250, 'easeOutQuad');
}

function expand(id) {
	jQuery(id).slideDown(250, 'easeOutQuad');
}


function collapse_and_enable(collapse, enable) {
	jQuery(collapse).slideUp(250, 'easeOutQuad');
	jQuery(enable).removeClass('disabled');
}

function expand_and_disable(expand, disable) {
	jQuery(expand).slideDown(250, 'easeOutQuad');
	jQuery(disable).addClass('disabled');
}




// Style Buttons in ie
// FOR:  adding inline styles to buttons to make them work in IE 6 + 7 (but not 8, ie8 is fine)

function style_buttons_for_ie()	{
	
	jQuery('button.btn').each(function() {
		
	// i X Positioning
		var spanW 		= jQuery(this).children('span').width();
		var iW			= jQuery(this).children('i').width();
		var XPos		= spanW+iW;
		var XPosNum		= '-' + XPos + 'px';

		
	// i Y Positioning		
		var iH			= jQuery(this).children('i').height();
		var iYPos		= '-' + iH + 'px'
		
	// Button Width
		var bW			= spanW+iW + 'px'		
		
		if (Object.prototype.toString.call(self.JSON) === "[object JSON]"){ 
			// IE8: Dont fix anything			
		}		
		
		else if (typeof document.body.style.maxHeight === "undefined") {		
			// ie6: Add inline styles			
			jQuery(this).each(function()	{
				jQuery(this).children('i').css({'position' : 'relative', 'right' : XPosNum, 'top' : iYPos});
				jQuery(this).css({'height' : iH, 'width' : bW, 'overflow' : 'hidden', 'white-space' : 'nowrap', 'margin-right' : iW});
			})	

		} else {
			// ie7 (same fix as ie6 fix)
			
			jQuery(this).each(function()	{
				jQuery(this).children('i').css({'position' : 'relative', 'right' : XPosNum, 'top' : iYPos});
				jQuery(this).css({'height' : iH, 'width' : bW, 'overflow' : 'hidden', 'white-space' : 'nowrap', 'margin-right' : iW})
			})

		}
	
	});

};


function h_align()	{

	diff		=	(jQuery('.features #banner li.two').width())-(jQuery('.features #banner .text').width());
	left		=	(diff/2);
	
	jQuery('.features #banner .text').css({'position' : 'relative', 'left' : left});
	
};

function trigger_tab(id)	{

	jQuery('.tabbed-content').hide();				// Hide All Tabs
	jQuery('#' + id).show();							// Show the correct tab
	jQuery('.nav-tabbed li').removeClass('active');	// Remove .active from all li's
	jQuery('#link' + id).addClass('active');			// Add .active to the correct li

};

function style_buttons_for_ie()	{
	
	jQuery('button.btn').each(function() {
		
	// i X Positioning
		var spanW 		= jQuery(this).children('span').outerWidth();
		var iW			= jQuery(this).children('i').outerWidth();
		 //trace(iW);
		var XPos		= spanW+iW;
		// trace(XPos);
		var XPosNum		= XPos + 'px';
		// trace(XPosNum);

		
	// i Y Positioning		
		var iH			= jQuery(this).children('i').height();
		//trace(iH);
		var iYPos		= '-' + iH + 'px'
		//trace(iYPos);
		
	// Button Width
		var bW			= spanW+iW + 'px'
		//trace(bW)
		
		//alert ("iW: " + iW);
		//alert ("spanW: " + spanW);
		
		if (Object.prototype.toString.call(self.JSON) === "[object JSON]"){ 
			// IE8: Dont fix anything
			// trace('Browser: IE8');
			
		}		
		else if (typeof document.body.style.maxHeight === "undefined") {		
			// ie6: Add inline styles
			
			jQuery(this).each(function()	{
				//alert("is ie 6");
				//alert("iW" + iW);
				//alert("iYPos: " + iYPos);
				//trace('Browser:  IE6 ');
				jQuery(this).children('i').css({position : 'relative', left : spanW, top : iYPos});
				//jQuery(this).css({height : iH, width : bW, overflow : 'hidden'});
			})
	

		} else {
			// ie7 (same fix as ie6 fix)
			
			jQuery(this).each(function()	{
				//trace('Browser:  IE6 ');
				jQuery(this).children('i').css({'position' : 'relative', 'right' : XPosNum, 'top' : iYPos});
				jQuery(this).css({'height' : iH, 'width' : bW, 'overflow' : 'hidden'})
			})

		}
		
		
		
	
		
		
		

	
	
	});

};







jQuery(document).ready(function() {

	jQuery("body").addClass("has-js");
	h_align();
	
	if(jQuery.browser.msie) {

		style_buttons_for_ie();
		
	} else {
		
	}
	
});









