/*================================================
-Main.js Document;
================================================*/

$(document).ready(function(){	
      var sudoSlider = $(".slider").sudoSlider({ 
         fade: true,
         auto: true,
         pause: '6000'
      });
   });
   
   
   
$(function() {	
   $(".slidetabs").tabs(".images > div", {

	// enable "cross-fading" effect
	effect: 'fade',
	fadeOutSpeed: "slow",

	// start from the beginning after the last tab
	rotate: true,
        tabs: 'a.tab',
        current: 'active-nav-slider'
        
// use the slideshow plugin. It accepts its own configuration
}).slideshow( {
          'autoplay' : true,
          'interval' : 4000
          }

);
    });
   
$(function() {

$(".scrollable").scrollable();

$(".items img").click(function() {

	// see if same thumb is being clicked
	if ($(this).hasClass("active")) { return; }

	// calclulate large image's URL based on the thumbnail URL (flickr specific)
	var url = $(this).attr("src").replace("-button", "");

	// get handle to element that wraps the image and make it semi-transparent
	var wrap = $("#image_wrap").fadeTo("medium", 0.5);

	// the large image from www.flickr.com
	var img = new Image();


	// call this function after it's loaded
	img.onload = function() {

		// make wrapper fully visible
		wrap.fadeTo("fast", 1);

		// change the image
		wrap.find("img").attr("src", url);

	};

	// begin loading the image from www.flickr.com
	img.src = url;

	// activate item
	$(".items img").removeClass("active");
	$(this).addClass("active");

// when page loads simulate a "click" on the first image
}).filter(":first").click();
});


$(function() { 

$("#accordion").tabs("#accordion div.pane", {tabs: 'h3', effect: 'slide', initialIndex: null});
});


$(document).ready(function() {
 
//* Inner style
$('.comment-title li:first').addClass('comment-title-li-first');
$('.specialise li:last').addClass('specialise-li-last');
inputReseter($('.sign-up-input'), 'Enter Your Email Address');   




//* Target Blank -----------------------------------------------------*/

$(function() {
	    $('a[rel*=external]').click( function() {
	        window.open(this.href);
	        return false;
	    });
	});

	
//* Nav -----------------------------------------------------*/
//...

});


function inputReseter(jqObj, iniVal){
	$(jqObj).focus(function(){
		value = $(this).val();
		if( value == iniVal ){
			$(this).val('');
		}else{
		// user has ented input, do nothing
		}
	});
	$(jqObj).blur(function(){
		if($(this).val() === ''){
			$(this).val(iniVal);
		}else{
		// user has ented input, do nothing
		}
	});
}





