 $(document).ready(function(){
 	
	// Initialize Watermark Plugin
	$('input[type=text], textarea').simpleWaterMark('watermark');
    
	// PNG Fix
	$(document).pngFix(); 
	
	$("#getaquote").colorbox({
		
		href:"/enquiry",
		
		width:"300px",
		
		height:"300px"
		
	});
	
	/*
	$("#getaquote").fancybox({ 
	
		'frameWidth': 640,
		
		'frameHeight': 280,
		
		'zoomSpeedIn': 300,
		
		'zoomSpeedOut': 300,
		
		'overlayShow': true,
		
		'imageScale': false,
		
		'centerOnScroll': true,
		
		'hideOnContentClick': false
		
	});
	*/

});

function workSwitch(casePosition, clicked){
	
	if (typeof timer != 'undefined') {
		
		clearTimeout(timer);
		
	}
	
	if (casePosition == $('#bannerLeftBottom li').children().size()){
		
		casePosition = 0;
		
	}
	
	case_name = work[casePosition]['name'];
	
	case_slug = work[casePosition]['slug'];
	
	case_banner = work[casePosition]['banner'];

	$("#bannerLeftTop img").fadeOut(250, function(){
		
		$("#bannerLeftTop img").attr("src","/uploads/work/"+case_banner);
		
	}).fadeIn(500);
	
	$("#bannerName").fadeOut(250, function(){
		$("#bannerName").html(case_name + '<span>more information ></span>')
	}).fadeIn(500);

	if (clicked == 0) {
	
		setTimeout("$('#bannerLeftBottom li').removeClass('selected')", 250);
		
		setTimeout("$('#bannerLeftBottom li:eq(" + casePosition + ")').addClass('selected')", 250);
		
	}
	else {
		
		$('#bannerLeftBottom li').removeClass('selected');
		
		$('#bannerLeftBottom li:eq(' + casePosition + ')').addClass('selected');
		
	}
	
	$("#bannerLeftTop a").attr("href", "/portfolio/"+case_slug);
	
	casePosition++;
	
	timer = setTimeout("workSwitch(" + casePosition + ",0)", 5000);
	
}
