function showIt(id) {
	$("#"+id).fadeIn();
}

function hideIt(id) {
	$("#"+id).fadeOut();
}

/* SHOWS JS */
function showTourInfo(id) {
	if($("#"+id).css("display")=="none"){
		$("#"+id).clone().prependTo(".tourdates");
		showIt(id);
		$("#"+id).draggable({ cursor: 'move', opacity: 0.55});
		$("#"+id).css("top","200px");
	}
	tourToTop(id);
}
	
function tourToTop(id) {
	tourDetails = $('#content .info');
	tourDetails.each(function() {
		$(this).css("zIndex","999");					  
	});
	$("#"+id).css("zIndex","1000");
}

/* RECORDS JS */
function toTop(rec) {
	$('.detail').each(function() {
		$(this).css("zIndex","999");
	});
	$("#"+rec).css("zIndex","1000");	
}

function showRecord(rec) {
	//$("#"+rec).style.display="block";
	$("#"+rec).css("width","180px");
	$("#"+rec).css("height","300px");
	if($("#"+rec).children('.hide').length>0){
		$("#"+rec).children('.hide').css("display","block");
	}
	$("#"+rec).fadeIn();
	toTop(rec);
	$("#"+rec).draggable({ cursor: 'move', opacity: 0.55, handle: '.dragimg'});
}	

function hideRecord(rec) {
	$("#"+rec).fadeOut();
	$("#"+rec).children('.info').css("display","none");
	$("#"+rec).children('.tracks').css("display","none");
}

function showInfo(rec) {
	$("#"+rec).children('div.tracks').css("display","none");
	if($("#"+rec).children('.hide')){
		$("#"+rec).children('.hide').css("display","none");
	}
	$("#"+rec).children('div.info').css("display","block");
	$("#"+rec).children('a.mini').css("display","inline");
	$("#"+rec).css("height","auto");
	$("#"+rec).css("width","600px");
}

function showTracks(rec) {
	$("#"+rec).children('div.info').css("display","none");
	if($("#"+rec).children('.hide')){
		$("#"+rec).children('.hide').css("display","none");
	}
	$("#"+rec).children('div.tracks').css("display","block");
	$("#"+rec).children('a.mini').css("display","inline");
	$("#"+rec).css("height","auto");
	$("#"+rec).css("width","600px");
	}
function showMini(rec) {
	$("#"+rec).children('div.tracks').css("display","none");
	if($("#"+rec).children('.hide')){
		$("#"+rec).children('.hide').css("display","block");
	}
	$("#"+rec).children('div.info').css("display","none");
	$("#"+rec).children('a.mini').css("display","none");
	$("#"+rec).css("height","300px");
	$("#"+rec).css("width","180px");
}

function initRecords() {
	// Hide all the detail divs and track layers
	$('.detail').css("display","none");
	$('.tracks').css("display","none");
	$('.info').css("display","none");
	$('#record-detail-wrap').css("display","block");
}


/* SHOP JS */
function initShop() {
	initRecords();
	initWares();
}
	
function initWares() {
	// Hide all the detail divs and track layers
	$('.detail').each(function(s){
		$(s).css("display","none");
	});
	// Hide all the detail divs and track layers
	$('#loading_wares_wrap').css("display","block");	
}

function showShop(state) {
	if($('#records').css("display")=="block" && state=="wares"){
		$("#records").hide();
		$("#wares").show();
		
	} else if (state=="records"){
		$("#records").show();
		$("#wares").hide();
	}
}
	
function showWares(id) {
	$("#"+id).fadeIn();
	waresToTop(id);
	$("#"+id).draggable({ cursor: 'move', opacity: 0.55, handle: '.dragimg'});		
}		

function waresToTop(id) {
	$("#content .detail").each(function() {
		$(this).css("zIndex","999");					  
	});
	$("#"+id).css("zIndex","1000");
}	

/* BIO JS */	
function showPhoto(photo,credit) {
	$('#lg-photo').attr("src","images/"+photo+".jpg");
	$('#credit').html(credit);
	}

/* AVIARY JS */

function hideMedia() {
	$('#avmedia').css("display","none");
}

function showMedia(id) {
	$('#avmedia').css("display","block");
	$('#avmedia .media').each(function() {
		$(this).css("display","none");
	});
	$("#"+id).css("display","block");
}

function initMedia() {
	var thisMedia = "";
	thisMedia = location.hash;
	thisMedia = thisMedia.substr(1);
 	if(thisMedia != "") {
		showMedia(thisMedia);
	}
}
