		$(document).ready(function(){
			

			
			$(".f_popup A").bind('click', function(){
				if( $(".f_hidden").css('display') == "none" ) $(".f_hidden").fadeIn();
				else $(".f_hidden").fadeOut();
				return false;	
			});
			
			if( $("#ill").size() ){
				$("#home_ill").height( $("#ill").height() );
			}
			
			$("#a_logo").css('opacity', '0.8');
			$("#a_logo")
			.bind('mouseenter', function(){
				$(this).animate({
					opacity: 1
				}, 500);
			})			
			.bind('mouseleave', function(){
				$(this).animate({
					opacity: 0.8
				}, 500);
			});
			
			if( $("#home_lm .homepage_left_menu").size() ){
				$("#home_lm").height( $(".homepage_left_menu").height() );
			}
			
			$("UL.work_thumbs LI A DIV.mask").css('opacity', 0).css('display','block');
			$("UL.work_thumbs LI A")
			.bind('mouseenter', function(){
				this_div_h 		= $("DIV.mask", this).height();
				this_span_h 	= $("DIV.mask SPAN", this).height();
				span_margin_top = parseInt((this_div_h - this_span_h) / 2);
				$("DIV.mask SPAN", this).css('margin-top', span_margin_top );
				$("DIV.mask", this).animate({
					opacity: 0.7
				}, 300);
			})			
			.bind('mouseleave', function(){
				$("DIV.mask", this).animate({
					opacity: 0
				}, 300);
			});
			
			
			bg_selected_works = "";
			$("DIV#selected_works UL LI A")
			.bind('mouseenter', function(){
				
				hover_bg = "#2b2a2a";
				if( $("DIV#bg.white").size() ){ hover_bg = "#aaaaaa"; }
				
				if( bg_selected_works == "" ){ bg_selected_works = $(this).css('background-color'); }
				$(this).animate({ backgroundColor: hover_bg }, 500);
			})			
			.bind('mouseleave', function(){
				$(this).animate({ backgroundColor: bg_selected_works }, 500);
			});
			
			
			$("DIV#detail_page DIV#arrow_left A , DIV#detail_page DIV#arrow_right A").css('opacity','0').css('display', 'block');
			$("DIV#detail_page DIV#arrow_left A").bind('click', km_slider_goto_prev );
			$("DIV#detail_page DIV#arrow_right A").bind('click', km_slider_goto_next );
			if( $("#work_panel").size() ){
				$(document).keydown(function(e) {
				  if(e.keyCode == 37) { // left
				    km_slider_goto_prev();
				  }
				  else if(e.keyCode == 39) { // right
				    km_slider_goto_next();
				  }
				});				
			}

			$("#arrow_left, #arrow_right")
			.bind('mouseenter', function(){
				$("A", this).animate({
					opacity: 1
				}, 300);	
			}).bind('mouseleave', function(){
				$("A", this).animate({
					opacity: 0
				}, 300);	
	
			});




			km_slider_init();
						
			if( $("#detail_text").size() ){
				//if( $("#detail_text P").size() == 0 ){ $("#detail_text").append('<p></p>'); }
				//$("#detail_text P:first").prepend('<span id="page_num"></span> | ');
				
				//if( $("#detail_text P").size() == 0 ){ $("#detail_text").append('<p></p>'); }
				$("#detail_text").prepend('<span id="page_num"></span>');
				
				km_update_page_text(1);
			}
			
			if( $("#nav_desc li").size() ){
				//update_img_desc_text( $("#work_panel img:first").attr('title') );
				update_img_desc_text( 0 );
			}
						
			$(window).bind('resize', window_resize_f);
			window_resize_f();
			
		

		});
