$(document).ready(function() {

$("#nav li.nav_category ul").hide();




var open = 0;
$("#nav li.nav_category > a").click(function() {
	$('ul.'+$(this).parent().attr('id')).show("slide", {direction: "up"}, 300);
	$('ul.'+$(this).parent().attr('id')).css("z-index", "9");
	open = 1;
	return false;
});


$("#nav li.nav_category").hover(function() {
	$('#'+$(this).attr('id')+'> a').css("color", "#fff");
	$('#'+$(this).attr('id')+'> a').css("background-image", "url(../images/menu_hover.jpg)");
}, function() {
	
	$('#'+$(this).attr('id')+'> a').css("color", "#4e4e4e");
	$('#'+$(this).attr('id')+'> a').css("background-image", "none");
	$('#'+$(this).attr('id')+'> a').css("background-color", "#c6d0fb");
	if (open ==1) {
	$('ul.'+$(this).attr('id')).hide("slide", {direction: "up"}, 600);
	open = 0;
	}
	
});
$("#nav li a").css("letter-spacing", "-1px")


$.each($.browser, function(i, val) {
   if (i=='opera' && val==true){ $("#nav li a").css("letter-spacing", "-2px");}
});


var zIndexNumber = 900;
$('div').each(function() {
	$(this).css('zIndex', zIndexNumber);
	zIndexNumber -= 10;
});

$('div#fancy_overlay').css('zIndex', '910');
$('div#fancy_loading').css('zIndex', '910');
$('div#fancy_wrap').css('zIndex', '920');
$('div#fancy_outer').css('zIndex', '930');
$('div#fancy_inner').css('zIndex', '940');
$('div#fancy_loading_overlay').css('zIndex', '910');
$('div#fancy_content').css('zIndex', '950');
$('div#fancy_div').css('zIndex', '950');
$('img#fancy_img').css('zIndex', '950');
$('div#fancy_close').css('zIndex', '980');
$('a#fancy_left, a#fancy_right').css('zIndex', '970');
$('div#fancy_bg').css('zIndex', '920');
$('div.fancy_bg').css('zIndex', '920');
$('div#fancy_title').css('zIndex', '950');

$("#photos").cycle({ 
    fx:    'fade', 
    speed:  2500 
});

$(".photos").cycle({ 
    fx:    'fade', 
    speed:  2500 
});

$("#photos_main").cycle({ 
    fx:    'fade', 
    speed:  2500 
});


$(".accordion").accordion({ autoHeight: false, collapsible: true, header: '.accordionheader', active: false });


$("#show_posts").click(function() {
		$("#downloads_container").css('display', 'none');
		$("#posts_container").css('display', 'block');
		return false;	
});
$("#show_downloads").click(function() {
		$("#posts_container").css('display', 'none');
		$("#downloads_container").css('display', 'block');	
		return false;
});




});
