// The following will run as soon as the page is loaded and the DOM is ready, but images might still be loading.

$(document).ready(function(){
								
$("#slideHolder ul.tabs").tabs("div.slides > div" , {effect: 'fade', clickable : 'true'}); 							

$('#innerfade').innerfade({ speed: 'slow', timeout: 8000, type: 'sequence', containerheight: '250px' }); 

// $('.prodFade').innerfade({ speed: 'slow', timeout: 10000, type: 'sequence', containerheight: '500px' }); 


$('#situGallery').innerfade({ speed: 'slow', timeout: 5000, type: 'random', containerheight: '480px' }); 
$('#prodGallery').innerfade({ speed: 'slow', timeout: 5000, type: 'random', containerheight: '480px' }); 

$("a.vid1").colorbox({slideshow:true , inline:true, transition:"elastic" , href:"#video-section-flash"});
$("a.vid2").colorbox({slideshow:true , inline:true, transition:"elastic" , href:"#video-section-flash2"});

// $("a.vid1").overlay({expose: {  color: '#000',  opacity: 0.9},  target: 'div#video-section'});
// $("a.vid2").overlay({expose: {  color: '#000',  opacity: 0.9},  target: 'div#video-section2'});


$("#tandcOuter").hide(); 	
$("a.tandc").overlay({expose: {  color: '#000',  opacity: 0.9},  target: 'div#tandcOuter'});


// if the function argument is given to overlay,
	// it is assumed to be the onBeforeLoad event listener

/*
$("img[rel]").each(function(i) { 
        $(this).overlay({ 
		expose: {  color: '#000',  opacity: 0.9},
		left: "center",
         // common configuration for each overlay 
         closeOnClick: true,
	});             
}); 
*/
$("#slideHolder a[rel]").colorbox({slideshow:true , transition:"elastic"});





$("a[title]:gt(1)").tooltip({

		// use div.tooltip as our tooltip
		tip: '.tooltip',

		// use the fade effect instead of the default
		effect: 'fade',

		// make fadeOutSpeed similar to the browser's default
		fadeOutSpeed: 100,

		// the time before the tooltip is shown
		predelay: 400,

		// tweak the position
		position: "top left",
		offset: [-13, 253]
	});



$("span[title]:gt(1)").tooltip({

		// use div.tooltip as our tooltip
		tip: '.tooltip2',

		// use the fade effect instead of the default
		effect: 'fade',

		// make fadeOutSpeed similar to the browser's default
		fadeOutSpeed: 100,

		// the time before the tooltip is shown
		predelay: 400,

		// tweak the position
		position: "top left",
		offset: [-13, 253]
	});


$("#talManAll").click(function()	{
				var checked_status = this.checked;
				$("input[@class=BAPtalentman]").each(function()
				{
					this.checked = checked_status;
				});
				return false;
			});	

$.validator.addMethod("labelInField",
					function(value, element, param) {
						return value != "" && value != param;
					},
					"This value is required"
);

$("#contactForm").validate();


$("table tr:odd").addClass("alt");

$('.rmv-dft-val').click(
	function() {
	if (this.value == this.defaultValue) {
	this.value = '';
	}
});

$('.rmv-dft-val').blur(
	function() {
	if (this.value == '') {
	this.value = this.defaultValue;
	}
});


    /*  Added by TC 03-06-11 :- Chris Moss    */
    if($('#mediaspace').length) {
        $('#mediaspace a#show-video').fancybox({
                                                'padding' : 10,
                                                'margin': 5,
                                                'scrolling': 'no',
                                                'autoScale' : true,
                                                'transitionIn' : 'fade',
                                                'transitionOut' : 'fade',
                                                onStart: function() {
                                                    $('#flashVideo').show();
                                                },
                                                onClosed: function() {
                                                    
                                                },
                                                onCleanup : function() {
                                                    $('#flashVideo').hide();
                                                }
                                                });
    }



// close
});
