function over(element) {
    element.animate({
        "opacity":"0.99"
    },250);
}

function out(element) {
    jQuery(".download_beskrivelse").stop();
    element.css({
        "opacity":"0.0"
    });
}


// Use this example, or...
jQuery(document).ready(function(){

//	jQuery('a[@rel*=lightbox]').lightBox();
	jQuery('.casual').lightBox();
	jQuery('.medm').lightBox();
	jQuery('.retouch').lightBox();
	jQuery('.metroplex').lightBox();
	jQuery('.digitals').lightBox();
	jQuery('.svs').lightBox();	
	jQuery('.cbs').lightBox();
	jQuery('.logos').lightBox();
	jQuery('.trakax').lightBox();

});


//lightbox(); // Select all links that contains lightbox in the attribute rel
/* This, or...
$('#gallery a').lightBox(); // Select all links in object with gallery ID
// This, or...
$('a.lightbox').lightBox(); // Select all links with lightbox class
// This, or...
$('a').lightBox(); // Select all links in the page
// ... The possibility are many. Use your creative or choose one in the examples above
*/

jQuery(document).ready(function(){
	

	
	jQuery(".download_beskrivelse").not("h2,img,p").css({"opacity":"0"});
	
	jQuery("#submenu li").each( function() {
			jQuery(this).unbind('click');
	});
	
	jQuery(".show_case a").each(function(){
	    var element = jQuery(this).parent().find(".download_beskrivelse");
	    jQuery(this).bind('mouseenter', function() {
	        over(element);
	    }).bind('mouseleave',function(){
	        out(element);
	    });       
	});
	
	// add the event listeners
	jQuery("#everything").bind('click', function() {
		jQuery(".show_case").show(800, function() {
			jQuery(this).find("p, h2").fadeIn(500);
		});
		jQuery(".clicked").removeClass("clicked");
		setClicked(jQuery("#everything"));
		return false;
	});
	
	jQuery("#websites").bind("click", function() {
		// hide the wallpaper divs
		jQuery(".show_case").not(".website").each( function() {
			jQuery(this).find("p, h2").fadeOut(500, function() {
				jQuery(this).parent().not(".download_beskrivelse").hide(500);
			});
		});
		
		window.setTimeout(function() {
			// show the icon divs.
			jQuery(".website").show(800, function() {
				jQuery(this).find("p, h2").fadeIn(500);
			});
		}, 1100);
						
		jQuery(".clicked").removeClass("clicked");
		setClicked(jQuery("#websites"));
		return false;
	});
	
	jQuery("#logos").bind("click", function() {
		// hide the wallpaper divs
		jQuery(".show_case").not(".logo").each( function() {
			jQuery(this).find("p, h2").fadeOut(500, function() {
				jQuery(this).parent().not(".download_beskrivelse").hide(500);
			});
		});
		
		window.setTimeout(function() {
			// show the icon divs.
			jQuery(".logo").show(800, function() {
				jQuery(this).find("p, h2").fadeIn(500);
			});
		}, 1100);
						
		jQuery(".clicked").removeClass("clicked");
		setClicked(jQuery("#logos"));
		return false;
	});
	
	jQuery("#icons").bind("click", function() {
		// hide the wallpaper divs
		jQuery(".show_case").not(".icon").each( function() {
			jQuery(this).find("p, h2").fadeOut(500, function() {
				jQuery(this).parent().not(".download_beskrivelse").hide(500);
			});
		});
		
		window.setTimeout(function() {
			// show the icon divs.
			jQuery(".icon").show(800, function() {
				jQuery(this).find("p, h2").fadeIn(500);
			});
		}, 1100);
						
		jQuery(".clicked").removeClass("clicked");
		setClicked(jQuery("#icons"));
		return false;
	});
});
