$(function() {
	$('#col-1 a[rel="lightbox"]').lightBox();
	$('#col-2 a[rel="lightbox"]').lightBox();
	$('#col-3 a[rel="lightbox"]').lightBox();
	$("#videotabs").tabs();
	$('#contactlink').bind('click', function(){
		$('#contactlink-content').dialog({
			width: 460,
			height: 300
		});
		$('#contactlink-content').dialog('open');
		return false;
	}).hover(
		function(){ 
			$(this).addClass("ui-state-hover"); 
		},
		function(){ 
			$(this).removeClass("ui-state-hover"); 
		}
	);
	$('#header h1').click(function(){
		$('#contactlink').trigger('click');
	})
	$('.open-panel').bind('click', function(){
		var id = '#' + $(this).attr('href').split('_')[1];
		var title = $(this).attr('title');
		$(id).dialog({
			width: 880,
			height: 'auto',
			// position: ['center', 200],
			title: title,
			close: function() {
				$('.youtube').show()
				document.location.hash = '#top';
			},
			open: function() {
				$('.youtube').hide()
			}
		});
		$(id).dialog('open');
	});
	var hsh = document.location.hash + '';
	if (hsh.length > 0) {
		$('a[href~='+hsh+']').trigger('click');
	}

});