// Icons
$(document).ready(function(){

	$("a[@href$=pdf]").addClass("pdf");

	$("a[@href$=zip]").addClass("zip");

	$("a[@href$=psd]").addClass("psd");
	
//	$("a:not([@href*=http://www.webdesignerwall.com])").not("[href^=#]")
//		.addClass("external")
//		.attr({ target: "_blank" });

});

// Toggle
$(document).ready(function(){

	$("#toggle h2").append('<span></span>')

	$(".thumbs a").click(function(){
	
		var largePath = $(this).attr("href");
		var largeAlt = $(this).attr("title");
		
		$("#largeImg").attr({ src: largePath, alt: largeAlt });
		
		$("h2 span").html(" (" + largeAlt + ")"); return false;
	});
	
});

// Fancy Box
$(document).ready(function() {

 	$(".screenshot a").fancybox({
 	'hideOnContentClick': true,
 	'zoomSpeedIn': 500,
 	'zoomSpeedOut': 1000,
 	'overlayShow': true
 	});

});

// Portfolio Rt Column Nav
function collapseItem(id)
{
  var collapsable = document.getElementById('collapsable' + id);
  var node = document.getElementById('pic_' + id);
  var namer = node.src;
  collapsable.className = 'collapsed';
  node.src = namer.replace (/open.gif/,"close.gif");
  setCookie(id,'collapsed');
}

function expandItem(id)
{
  var collapsable = document.getElementById('collapsable' + id);
  var node = document.getElementById('pic_' + id);
  var namer = node.src;
  collapsable.className = 'collapsable';
  node.src = namer.replace (/close.gif/,"open.gif");
  setCookie(id,'expanded');
}

function changeCollapse(id)
{
  var collapsable = document.getElementById('collapsable' + id);
if (collapsable.className == 'collapsable')
{
  collapseItem (id);
}
else
{
  expandItem (id);
}
}
