// JavaScript Document
$(document).ready(function(){
jQuery("#mycarousel").jcarousel({
        orientation: "vertical",
        itemVisible: 7,
        itemScroll: 4,
        scrollAnimation: "300"
    });
						   

$("#thumb_column li").attr("class", "transparent");

$("#thumb_column li").click(function() {
		 $("#displaybox").css({"background-image": 'url(portfolio/' + $(this).attr('source') + ')' });
		 $("#expand_button a").attr("link","portfolio/" + $(this).attr('source')); 
		 $("#expand_button p").empty().append( $(this).attr('description'));
 		 $("#hidden").attr("src","portfolio/" + $(this).attr('source'));

		 });

$("#expand_button a").click(function() {
									 if ($(this).attr('link'))
									 {
									 var href = $(this).attr('link');
									 var description = $("#expand_button p").text();
									 var width = $("#hidden").width();
									 var height = $("#hidden").height();
									 new_window = window.open(href,'popup','width=' + width + ',height=' + height + 'toolbar=no,scrollbars=no,menubar=no');
									 new_window.document.write("<HTML><HEAD><TITLE>Jacob Johnson - Portfolio</TITLE>");
									 new_window.document.write("<script type=\"text/javascript\"> function resize(){ window.resizeTo(" + width + "," + height + "); }</script>");
 									 new_window.document.write("<link href=\"popup.css\" rel=\"stylesheet\" type=\"text/css\"></HEAD><BODY onLoad=\"resize()\">");
									 new_window.document.write("<a href=\"javascript:window.close()\"><img src=\"" + href + "\" title=\"" + description +"\" id=\"popup_img\">");
									 new_window.document.write("</BODY></HTML>");
									 new_window.document.close();
									 }
									 });


$("#thumb_column li").mouseover(function() {
								// $(this).fadeTo('25', 1);
								$("#thumb_column li").attr("class", "transparent");
								$(this).prev().attr("class", "half");
								$(this).attr("class", "opaque");
								$(this).next().attr("class", "half");
								  
								  		 });
/*$("#thumb_column li").mouseout(function() {
								//$(this).fadeTo('25', .5);
								$(this).prev().attr("class", "opaque");
								$(this).attr("class", "transparent");
								$(this).next().attr("class", "opaque");
								 
								  		 });
*/


});
