

//Show off tabs
$(document).ready(function() {
	$('#tab1').delay(500).animate({top:"-60px"}).delay(50).animate({top:"-10px"});
	$('#tab2').delay(600).animate({top:"-60px"}).delay(50).animate({top:"-10px"});
	$('#tab3').delay(700).animate({top:"-60px"}).delay(50).animate({top:"-10px"});
	$('#tab4').delay(800).animate({top:"-60px"}).delay(50).animate({top:"-10px"});
	$('#tab5').delay(900).animate({top:"-60px"}).delay(50).animate({top:"-10px"});
// Mouse Over Mouse Out Tabs
	$('.tab').hover(function() {
			$(this).stop().animate({top:"-51px"},{queue:false});},
		function() { 
			$(this).stop().animate({top:"-10px"},{queue:false});
	}); 
});


function getShow(button,page,item) { // Transition full content
 $(document).ready(function(){
	if ($.browser.msie && $.browser.version <= 8) { // Detect IE 8 or below and change button function
		 location.href = "?p="+item;
	} else {
		$('#'+button+item).attr('disabled','disabled'); // Disable Button
		$('#'+page+item).empty().html('<img class="loading" src="wp-content/themes/dliberty/img/loading.gif" /><br/>Loading Content... Please Wait... <br/>');
		$('#'+page+item).load('?p='+item+'&getShow=1&type=0',function(response, status, xhr) {
			if (status == 'error') {
			var msg = 'Sorry but there was an error: ';
			$(this).html(msg + xhr.status + ' ' + xhr.statusText);
			} else {
				$('#'+page+item).fadeIn('slow'); // Fadein Content
				$('#'+button+item).attr('value','Excerpt Only'); // Change Button
				$('#'+button+item).addClass('buttonshow'); // Add Class to button
				$('#'+button+item).attr("onclick","getHide('"+button+"','"+page+"',"+item+");"); // Change Action
				$('#'+button+item).removeAttr("disabled"); // Enable Button
			};
		});
	
	}
});
}

function getHide(button,page,item) { // Transition excerpt content
 $(document).ready(function(){
		$('#'+button+item).attr('disabled','disabled'); // Disable Button
		$('#'+page+item).empty().html('<img class="loading" src="loading.gif" /><br/>Loading Content... Please Wait... <br/>');
		
		$('#'+page+item).load('?p='+item+'&getShow=1&type=1',function(response, status, xhr) {
			if (status == 'error') {
			var msg = 'Sorry but there was an error: ';
			$(this).html(msg + xhr.status + ' ' + xhr.statusText);
			} else {
				$('#'+page+item).fadeIn('slow');  // Fadein Content
				$('#'+button+item).attr('value','Full Story'); // Change Button
				$('#'+button+item).attr("onclick","getShow('"+button+"','"+page+"',"+item+");"); // Change Action
				$('#'+button+item).removeAttr("disabled"); // Enable Button
			};
		});
		
 });
}

function catShow(item) {
 $(document).ready(function(){ 
	if ($.browser.msie && $.browser.version <= 8) { // Detect IE 8 or below and change button function
		 location.href = "?p="+item;
	} else {
		$('.nav-highlight').removeClass('nav-highlight');
		$('.cata-item-'+item).addClass('nav-highlight');
		$('.cat-body').empty().html('<img class="loading" src="/loading.gif" /><br/>Loading Content... Please Wait... <br/>');
		$('.cat-body').load('?p='+item+'&getShow=1&type=0',function(response, status, xhr) {
			if (status == 'error') {
			var msg = 'Sorry but there was an error: ';
			$(this).html(msg + xhr.status + ' ' + xhr.statusText);
			} else {
		
			};
		});
	}
 });
}



