/**
 * @author Kuma
 */

 $('document').ready(function(){
 	
	$('div#landing').show();
 	
	$('div#nav_bz').click(function(){
		doNav('bz', '#47431A');
	});
	
	$('div#nav_ar').click(function(){
		doNav('ar', '#28491A');
	});
	
	$('div#nav_lc').click(function(){
		doNav('lc', '#4C1B37');
	});
	
	$('div#nav_ps').click(function(){
		doNav('ps', '#1A3349');
	});
	
	getContent();

 });

function doNav(doDiv, color){
	
	$('div.texty').hide();
	$('img.imagy').hide();
	$('div#landing').hide();
		var doImage = 'url("images/' + doDiv + '_img.png")';
		var doCntr = 'url("images/cntr_' + doDiv + '.png")';
		var doText = 'div#' + doDiv + '_text';
	$('div#ds_image').css('background', doImage).hide().fadeIn('slow');
	$('div#nav_cntr').css('background', doCntr).hide().show();
	$(doText).hide().fadeIn('slow');
	$('div.color_runner').css('background-color', color).hide().fadeIn('slow');
}

function getContent(){
	
	try {
		$.ajax({
				type: "GET",
				url: "../content/index.php",
				cache: false,
				error: function (XMLHttpRequest, textStatus, errorThrown) {
					alert('Error: ' + errorThrown);
					},
				success: function(html){
					//var typescript = $(html).find()
					$('div#content').html(html).show();
					}
			});
	}
	catch (e){
		alert(e);
	}
}
