var fadeAmount = 0.80;

jQuery.preloadImages = function(){
  for(var i = 0; i < arguments.length; i++){
    jQuery("<img>").attr("src", arguments[i]);
  }
}

$(document).ready(function(){

	$('#team_pop').popupmenu({
				target: "#team_pop_menu", 
				time: 300 });
	$('#more_pop').popupmenu({
		 		target: "#more_pop_menu", 
				time: 300 });
	$('#home_pop').popupmenu({
		 		target: "#home_pop_menu", 
				time: 300 });
	$('#puppy_pop').popupmenu({
		 		target: "#puppy_pop_menu", 
				time: 300 });

	$.preloadImages("images/home.png","images/home_hover.png","images/home_current.png");
	
	$("#logo").click(
	function() {
		url = "http://www.trailroc.com";
		window.location = url;
	});
	
	$(".stripe tr:nth-child(odd)").addClass("odd");
	$(".stripe tr:nth-child(even)").addClass("even");

	$('a.lightbox').lightBox({
		containerResizeSpeed: 0,
		fixedNavigation:true
    });
		
	$('.home_link').prepend('<img class="home_img" src="'+ house +'">')
	
	if(house != "images/home_current.png") {
		$('.home_link').hover(
		function() {
			$(this).find('.home_img').attr("src","images/home_hover.png");
		},
		function() {
			$(this).find('.home_img').attr("src",house);
		});
	}
	
	/*$(".inline_image").each(function (i) {
		img_title = "<p style='font-size:12px;text-align:center'>" + $(this).parent("a").attr("title") + "</p>";
     	img_width = $(this).attr("width") + 10 + "px";
     	if($(this).hasClass("right")) $(this).parent().wrap("<div class='inline_image_wrapper_r dialog'></div>").parent().append(img_title);
		else $(this).parent().wrap("<div class='inline_image_wrapper_l dialog'></div>").parent().append(img_title);
		$(this).parent().parent().css("width",img_width);
     });*/

	$(".dialog").corner();
	$("#profile_stats_box").corner();
	$("#footer").corner("bottom");
	
	//$("a").each(function(i) {
	//	if($(this).attr("href").search("trailroc.com") == -1 && $(this).attr("href").search("/") != 0) {
	//		$(this).attr("target","_blank");
	//	}
	//});
	



});

	
if ( window.addEventListener ) {
        var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
        window.addEventListener("keydown", function(e){
                kkeys.push( e.keyCode );
                if ( kkeys.toString().indexOf( konami ) >= 0 )
                        window.location = "secret.php";
        }, true);
}

function showMoreTags() {
	obj=document.getElementById("more_tags");
	obj.style.display = 'inline';
	obj=document.getElementById("more_tags_link");
	obj.style.display = 'none';
}	
	

	
	