$(document).ready(function() {
	$('#slideshow_box div.slideshow:gt(0)').hide();
	$("#slideshow_bullets a:first").addClass("active");
	setInterval(
		function(){
			$('#slideshow_bullets a').removeClass('active');
			$('#slideshow_bullets .slideshow_bullet_'+$('#slideshow_box .slideshow:first').next('div.slideshow').find('span').attr('class')).addClass("active");
			$('#slideshow_box div.slideshow').hide();
			$('#slideshow_box .slideshow:first')
				.fadeOut()
				.next('div.slideshow').fadeIn(1000)
				.end().appendTo('#slideshow_box');
		}, 
		10000
	);
	$('#slideshow_bullets a').click(function(){
		if ($(this).hasClass('active')) return false;
		$('#slideshow_bullets a').removeClass('active');
//		'slideshow_'+$(this).attr('rel');
		$(this).addClass("active");
		$('#slideshow_box div.slideshow').hide();
		$('#slideshow_box div.slideshow_'+$(this).attr('rel')).fadeIn(1000);
//		$('#slideshow_box div.slideshow_c2a').appendTo('#slideshow_box');
		return false;
	});
	
});

$(function() {
    var ele   = $('#projects');
    var speed = 25, scroll = 5, scrolling;
    
    $('.scroll-up').mouseenter(function() {
        // Scroll the element up
        scrolling = window.setInterval(function() {
            ele.scrollTop( ele.scrollTop() - scroll );
        }, speed);
    });
    
    $('.scroll-down').mouseenter(function() {
        // Scroll the element down
        scrolling = window.setInterval(function() {
            ele.scrollTop( ele.scrollTop() + scroll );
        }, speed);
    });
    
    $('.scroll-up, .scroll-down').bind({
        click: function(e) {
            // Prevent the default click action
            e.preventDefault();
        },
        mouseleave: function() {
            if (scrolling) {
                window.clearInterval(scrolling);
                scrolling = false;
            }
        }
    });
});

//DIALOG GET A QUOTE
 function show_form() {
	$(function(){
		// Dialog			
		$('#dialog').dialog({
			autoOpen: false,
			width: 600
		});
		$('#dialog').dialog('open');
	});
}


