$(document).ready(function(){
$('#slider1').anythingSlider({
  // Appearance
  width               : 990,      // Override the default CSS width
  height              : null,      // Override the default CSS height
  resizeContents      : true,      // If true, solitary images/objects in the panel will expand to fit the viewport
  
  toggleControls : false,


  // Navigation
  startPanel          : 1,         // This sets the initial panel
  hashTags            : false,      // Should links change the hashtag in the URL?
  buildArrows         : false,      // If true, builds the forwards and backwards buttons
  buildNavigation     : true,      // If true, builds a list of anchor links to link to each panel
  navigationFormatter : null,      // Details at the top of the file on this use (advanced use)
  forwardText         : "&raquo;", // Link text used to move the slider forward (hidden by CSS, replaced with arrow image)
  backText            : "&laquo;", // Link text used to move the slider back (hidden by CSS, replace with arrow image)

  // Slideshow options
  autoPlay            : true,      // This turns off the entire slideshow FUNCTIONALY, not just if it starts running or not
  startStopped        : false,     // If autoPlay is on, this can force it to start stopped
  pauseOnHover        : true,      // If true & the slideshow is active, the slideshow will pause on hover
  resumeOnVideoEnd    : true,      // If true & the slideshow is active & a youtube video is playing, it will pause the autoplay until the video has completed
  stopAtEnd           : false,     // If true & the slideshow is active, the slideshow will stop on the last page
  playRtl             : false,     // If true, the slideshow will move right-to-left
  startText           : "Start",   // Start button text
  stopText            : "Stop",    // Stop button text
  delay               : 5000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
  animationTime       : 600,       // How long the slideshow transition takes (in milliseconds)
  easing              : "linear"    // Anything other than "linear" or "swing" requires the easing plugin
 
  })
  
/* this "custom" code is the equivalent of the base caption functions */
  .anythingSliderFx({
   inFx: {
    '.caption-top'    : { top: 0, opacity: 0.8, duration: 400 },
    '.caption-right'  : { bottom: 15, opacity: 0.8, duration: 400 },
    '.caption-bottom' : { bottom: 0, opacity: 0.6, duration: 400 },
    '.caption-left'   : { left: 0, opacity: 0.8, duration: 400 }
   },
   outFx: {
    '.caption-top'    : { top: -50, opacity: 0, duration: 350 },
    '.caption-right'  : { bottom: -150, opacity: 0, duration: 350 },
    '.caption-bottom' : { bottom: -50, opacity: 0, duration: 350 },
    '.caption-left'   : { left: -150, opacity: 0, duration: 350 }
   }
  })
  
  /* add a close button (x) to the caption */
//  .find('div[class*=caption]')
//    .css({ position: 'absolute' })
//    .prepend('<span class="close">x</span>')
//    .find('.close').click(function(){
//     var cap = $(this).parent(),
//       ani = { bottom : -50 }; // bottom
//      if (cap.is('.caption-top')) { ani = { top: -50 }; }
//      if (cap.is('.caption-left')) { ani = { left: -150 }; }
//      if (cap.is('.caption-right')) { ani = { right: -150 }; }
//      cap.animate(ani, 400, function(){ cap.hide(); } );
//    });
  
  
});



//	$('#slider1')
//	.anythingSlider({
//		width          : 400,
//		height         : 300,
//		startStopped   : true,
//		toggleControls : true,
//		theme          : 'metallic',
//		navigationFormatter : function(i, panel){
//			return '<img src="images/th-slide-' + ['civil-1', 'env-1', 'civil-2', 'env-2'][i-1] + '.jpg">';
//		}
//	})
//	.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'
//		});


// initialise inpuBehave 
function inputBehave(who,how){
if(how==1) who.value=''
else if(who.value=='') who.value=who.defaultValue
};


// Dropdown menu using superfish
//jQuery(document).ready(function($) {
//	$('ul.sf-menu').supersubs({
//		minWidth: 		15,						// requires em unit.
//		maxWidth: 		25,						// requires em unit.
//		extraWidth: 	1						// extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
//    }).superfish({
//		hoverClass:		'sfHover',			// the class applied to hovered list items 
//	//	pathClass:		'overideThisToUse',		// the class you have applied to list items that lead to the current page 
//		pathLevels:		3,						// the number of levels of submenus that remain open or are restored using pathClass 
//		delay:			400,					// the delay in milliseconds that the mouse can remain outside a submenu without it closing 
//		animation:		{opacity:'false',height:'show'},		// an object equivalent to first parameter of jQuery's .animate() method 
//		speed:			'fast',				// speed of the animation. Equivalent to second parameter of jQuery's .animate() method 
//		autoArrows:		true,					// if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance 
//		disableHI:		false,					// set to true to disable hoverIntent detection 
//		dropShadows: true // disable drop shadows 
//	});
//});




// remap jQuery to $
(function($){

})(this.jQuery);


// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};

// catch all document.write() calls
(function(doc){
  var write = doc.write;
  doc.write = function(q){ 
    log('document.write(): ',arguments); 
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);


$(document).ready(function(){
						   $(".arrow a").fadeTo("fast", 0.3); // This sets the opacity of the thumbs to fade down to 30% when the page loads
						   $(".arrow a").hover(function(){
						   $(this).fadeTo("normal", 1.0); // This should set the opacity to 100% on hover
						   },function(){
						   $(this).fadeTo("fast", 0.3); // This should set the opacity back to 30% on mouseout
							   	});
});




//    $('div.one_fourth').filter(function(index){
//         return (index%4 == 3);
//        }).addClass('omega');
