$(function(){
	$.superbox.settings = {
		closeTxt: "X",
		loadTxt: "Loading ...",	
		overlayOpacity: 1.0
	};
	$.superbox();
});

$(document).ready(function(){ 	

	if($(location).attr('hash') != '') {
		$.scrollTo( '#top', 0 );
		$.scrollTo( $(location).attr('hash'), 0, {offset: -160});
	}

	$("#projects_slider").easySlider ({
		prevText: 'previous&nbsp;|',
		nextText: 'next',
		continuous: true,
		speed: 1500
	});
	
	$('a.anchor').click(function(event){ 
		event.preventDefault();	
		var goto = $(this).attr('hash');
		$.scrollTo( goto, 800, {offset: -160});
	});	
	
	$('#bb_bold').click(function() {
		insertUBB('[b]','[/b]','ctrl_comment');
	});	
	$('#bb_italic').click(function() {
		insertUBB('[i]','[/i]','ctrl_comment');
	});	
	$('#bb_underline').click(function() {
		insertUBB('[u]','[/u]','ctrl_comment');
	});	
	$('#bb_strike').click(function() {
		insertUBB('[strike]','[/strike]','ctrl_comment');
	});	
	$('#bb_url').click(function() {
		ubb('link','ctrl_comment');
	});	
	$('#bb_img').click(function() {
		ubb('img','ctrl_comment');
	});	
	$('#bb_quote').click(function() {
		insertUBB('[quote]','[/quote]','ctrl_comment');
	});	
	$('#bb_zmilies').click(function() {
		$('#zmiliebar').toggle();
	});	
	$('#zmiliebar img').click(function() {
		tag = $(this).attr('title');
		insertUBB(' '+tag+' ','','ctrl_comment');
	});
	
});