/**

 * the studio javascript functions 

 */ 



function initTheStudio() {

	showStudioLoader();

	loadTheStudio('home.html');

	initClickables();

  initImageToggle();

	initSWF();
	//initMenu();

}


function initSWF() {

   var so = new SWFObject("sounds/playerLoopMini.swf", "mymovie", "75", "30", "7", "#FFFFFF");

   so.addVariable("autoPlay", "yes");

   so.addVariable("soundPath", "sounds/loop.swf");

   so.write("flashPlayer");

}


function showStudioLoader() {

  $('#content').html(

    '<div id="studioLoader" />'

  );

}



function loadTheStudio(page) {

  $('#content').fadeOut('slow', function() {    

    $.get(page, function(data) {

      $('#content').html(data);

      $('#content').fadeIn('slow');

    });

    showStudioLoader();

  }); 

}



function initImageToggle() {

  $("#menu_space").hover(

    function(){$(this).css("backgroundImage",'url(images/button2_space.png)');},

    function(){$(this).css("backgroundImage",'url(images/button_space.png)');}

  );

  $("#menu_location").hover(

    function(){$(this).css("backgroundImage",'url(images/button2_location.png)');},

    function(){$(this).css("backgroundImage",'url(images/button_location.png)');}

  );

  $("#menu_gallery").hover(

    function(){$(this).css("backgroundImage",'url(images/button2_gallery.png)');},

    function(){$(this).css("backgroundImage",'url(images/button_gallery.png)');}

  );

 

}



function initClickables() {

  $("#menu_space").click(function(){loadTheStudio('space.html');});

  $("#menu_location").click(function(){loadTheStudio('location.html');});

  $("#menu_gallery").click(function(){loadTheStudio('gallery.html');});

  $("#menu_gallery1").click(function(){loadTheStudio('gallery_dec.html');});

  $("#logo").click(function(){loadTheStudio('home.html');});

  $("#logo").mouseover(function(){

    $(this).fadeTo(500, 0.2, function(){$(this).fadeTo(500, 1.0)})

  });

}