$(document).ready(function(){

	/**
	 * Lightbox
	 */
	$('a[@rel*=lightbox]').lightBox();

//	$('a[@rel*=lightbox]').lightBox();


	$("#all_def").hide();
	$("#showLink").show();

	$("#toggleDiv").click(function () {
		$(".showHideLink").toggle();
		if ($("#all_def").is(":hidden")) {
			$("#all_def").slideDown("normal");
		} else {
			$("#all_def").slideUp("normal");
		}
	});

	/**
	 * Portfolio imagefader
	 */
	$('#portfolioShow').innerfade({
		speed: 'slow',
		timeout: 4000,
		type: 'sequence',
		containerheight: '390px'
	});

	/**
	 * Columnize text
	 */
//	$('.columns').columnize({ width:345, height: 110, overflow: false});

	/**
	 * show / hide definitions on mouseover
	 */

	// choose text for the show/hide link - can contain HTML (e.g. an image)
//	var showText='<img src="'+strImgPath+'bg_tags.gif" />';
//	var hideText='<img src="'+strImgPath+'bg_tags_hover.gif" />';

	// initialise the visibility check
	var definition_is_visible = false;
	var link_is_visible = false;
	// append show/hide links to the element directly preceding the element with a class of "toggle"
//	$('.definitionsToggle').prev().append('<a href="#" class="toggleLink">'+showText+'</a>');

	// hide all of the elements with a class of 'toggle'
	$('.definitionBox').hide();
	$('.linkBox').hide();

	// capture mouseover on the toggle links
	$('a.definitionSwitch').mouseover(function() {
		// switch visibility
//		definition_is_visible = !definition_is_visible;
		// toggle the display - uncomment the next line for a basic "accordion" style
		$(this).parent().parent().find('.definitionBox').slideDown('slow');
		// return false so any link destination is not followed
	});
	$('a.definitionSwitch').click(function() {
		return false;
	});

	// capture mouseover on the toggle links
	$('a.linkSwitch').mouseover(function() {

		// switch visibility
//		link_is_visible = !link_is_visible;
		// toggle the display - uncomment the next line for a basic "accordion" style
		$(this).parent().parent().find('.definitionBox').slideUp('slow');
		$(this).parent().parent().find('.linkBox').slideDown('slow');
//		$(this).find('.linkBox').show();
		// return false so any link destination is not followed
	});

	$('a.linkSwitch').hover(function(){},function() {
//		alert('sdjkebjk');
		// switch visibility
//		definition_is_visible = !definition_is_visible;
		$(this).parent().parent().find('.linkBox').slideUp('slow');

	});
	// hide div on mouseout
	$('div.itemBox').hover(function(){},function() {
		// switch visibility
//		definition_is_visible = !definition_is_visible;
		$(this).find('.definitionBox').slideUp('slow');
	});

	$("img").lazyload({
   	 placeholder : strImgPath+"blank.gif"
	});

});
