$(function() {
	

/**########################### Handle images etc #################################*/
    $('#main-image-lightbox').lightBox({
                                                overlayBgColor: '#000',
                                                overlayOpacity: '0.7'
                                        });

	/** Handle upholstery/finishing images on page */
    $("a[rel^='lightbox']").lightBox({
                                        overlayBgColor: '#000',
                                        overlayOpacity: '0.7'
									});

                                                
    $("img[id^='project-thumb-image-']").attr("style", "cursor:pointer")
                                        .click(function(){
                                                            thumbSrc = $(this).attr('src');                                       
                                                            /** Replace main thumb image */
                                                            $("img[id^='project-main-image-tag']").attr({
                                                            												src: thumbSrc.replace('w_listT', 'f_itemM'),
                                                            												alt: $(this).attr('alt')
                                                            											});

															/** */
															$("#project-detailed-code").html($(this).attr('title'));
															/** Replace light box image */
                                                            $('#main-image-lightbox').attr({
                                                            									href: thumbSrc.replace('w_listT', 'f_itemL'),
                                                            									title: $(this).attr('title')
                                                            								});
                                                        });
    $("div.scrollable").scrollable({
    	next: 'a.nextg',
        prev: 'a.prevg',            
    	size: 4
    });
    
	$('.items a[rel^=lightbox]').lightBox();
});  


