$(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'
									});

	/** Handle upholstery/finishing images in the shortlist form */
    $("a[rel^='shortlist-lightbox']").lightBox({
                                           overlayBgColor: '#000',
                                          overlayOpacity: '0.7'
                                 });
    $("a[rel^='shortlist-lightbox']").click(function(){
    														$('#overlay').css({"z-index":"999"});
    												  });                                                   
    $("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('f_itemT', 'f_itemM'),
                                                            												alt: $(this).attr('alt')
                                                            											});

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