$(function() {
	// SLIDER -----------------------------------------------------------------
	 $('#slider1')
	  .anythingSlider({
	   width          : 940,
	   height         : 350,
	   toggleControls : false,
	   startStopped   : false,
	   delay               : 11000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
	   animationTime       : 300,       // How long the slideshow transition takes (in milliseconds)
	   theme          : 'metallic',
		navigationFormatter : function(index, panel){
		  return index; // This would have each tab with the text 'Panel #X' where X = index
		 }	   
	   //navigationFormatter : function(i, panel){
		//return '<img src="images/th-slide-' + ['civil-1', 'env-1', 'civil-2', 'env-2'][i - 1] + '.jpg">';
	   //}
	  })
	  // target all images inside the current slider
	  // replace with 'img.someclass' to target specific images
	  .find('.panel:not(.cloned) img') // ignore the cloned panels
	   .attr('rel','group')            // add all slider images to a colorbox group
	   .colorbox({
		 width: '90%',
		 height: '90%',
		 href: function(){ return $(this).attr('src'); },
		 // use $(this).attr('title') for specific image captions
		 title: 'Press escape to close',
		 rel: 'group'
	   });
	   
	   	// form control
		// clear form field when clicked on or focused on
	   	$('fieldset p input, fieldset p textarea').focus(function() {
			$(this).val('');
		});
		
		$('a#addPart').click(function() {
			$('div#parts').append('<span class="part"><input type="text" size="15" name="partNum[]" id="partNum" class="required inline" value="" /><input type="text" size="15" name="altNum[]" id="altNum" class="required inline" value="" /><input type="text" size="15" name="desc[]" id="desc" class="required inline" value="" /><input type="text" size="15" name="qty[]" id="qty" class="required inline" value="" /><input type="text" size="15" name="actype[]" id="actype" class="required inline" value="" /></span>');
			return false;
		});
});
