$(document).ready(function(){


/*-----------------
Menu
------------------*/


	$('div.clickBar').click(function() {
	$('div.barContent').slideUp('normal');	
	$(this).next("div").slideDown('normal');
	});
	$("div.barContent").hide();
	
	//$("div.barContent:eq(0)").animate({height: "show"}, 1500, "easeInQuad", function(){});
	//always add more with additional galleries to restup the flow
//$("div.barContent:eq(1),div.barContent:eq(2),div.barContent:eq(3),div.barContent:eq(4),div.barContent:eq(5)").slideDown(200).slideUp(1000);
	


/*-----------------
core subject Fade
------------------*/

$('#foot img').each(function() {
            $(this).hover(function() {
                $(this).animate({ opacity: 0.3 }, 500);
            },
           function() {
               $(this).stop().animate({ opacity: 1.0 }, 500);
           });
        });




/*-----------------
colour cores by page no
------------------*/
var qlevel  = (window.location.search.substr(8).toLowerCase());
//alert(qlevel)

$("div.clickBar").click(function(event) {
	$(this).css({opacity: 1.0});
	$(".clickBar").not(this).css({opacity: 0.4});
	$(this).animate({ backgroundColor: "#ffffff" }, 300)
	.animate({ backgroundColor: "#a8a18e" }, 300)
	.animate({ backgroundColor: "#eeedec" }, 300);

/*--------------- Footer play --------------
		var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';
		$('#foot').animate( { backgroundColor: hue }, 2300);
--------------------------------------------*/

});

/*-----------------
development


$(window).resize(function(){

  $('div.folio1').css({
   position:'absolute',
   left: ($(window).width() 
     - $('div.folio1').outerWidth())/2,
   top: ($(window).height() 
     - $('div.folio1').outerHeight())/2
  });
		
 });
 
 // To initially run the function:
 $(window).resize();

------------------*/

function myFunc() {
    alert("Opened!");
}
/*-----------------
Folio
------------------*/

function extractName(url) 
{ 
  return url.substring(url.lastIndexOf("\/")+1); 
} 


$(".clickBar").click(function() {
//alert( $(this).next("div").find("img").eq(0).attr("src") );
//$(this).find("div.barContent img").fancybox().trigger('click'); 
//setTimeout(function() {$(this).next("div").find("a").fancybox().trigger('click'); }, 2500); 
//var startmeup = ($(this).next("div").find("a").eq(0).attr('rel'));
//$(this).next("div").find("a").fancybox().trigger('click');
});


	$("a[rel=sette_g],a[rel=100_g],a[rel=chelsea_g],a[rel=park_g],a[rel=pdg_g]").fancybox({
	'padding'	: 0,
	'transitionIn'	: 'elastic',
	'transitionOut'	: 'elastic',
	overlayOpacity: 0.9,
	'titlePosition'	: 'over',
	'titleFormat'	: function(title, currentArray, currentIndex, currentOpts) {
	//return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + '      - ' + extractName(this.href); + '</span>';
	//return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length  + '</span>';
	return '<span id="fancybox-title-over"></span>'
	}
	});


/*-----------------
Footer stuff
------------------*/
	$('#foot a').attr("target","_blank");
	$('#foot img').attr("align","absmiddle");

});

