$(document).ready(function() {if(swfobject.hasFlashPlayerVersion("1")) {$('#musicplayerbox').slideDown('30000'); }var hash = window.location.hash.substr(1);      var href = $('#menu li a').each(function(){  	var href = $(this).attr('href');	if (hash==""){		var toLoad = 'index.html #content'; 		$('#content').load(toLoad), function() {		$('#slideShow').imageScroller( {loading:'Loading...',direction:'left',speed:'10000'});		}	} else if(hash==href.substr(0,href.length-5)){  	var toLoad = hash+'.html #steal';	$('#content2').load(toLoad, function() {		$('#galleria').galleria({        extend: function(options) {            Galleria.log(this) // the gallery instance            Galleria.log(options) // the gallery options            this.bind(Galleria.IMAGE, function(e) {                Galleria.log(e) // the event object may contain custom objects, in this case the main image                Galleria.log(e.imageTarget) // the current image                $(e.imageTarget).click(this.proxy(function() {                   this.openLightbox();                 }));            });        }    });	});		$(this).addClass("current");		$('#page').hide();		$('#topSpace').hide();		$('#blackBG').hide();		$('#page2').show();		$('#topMenu').show();	} else if(hash.substr(0,4)=="cds_"){ 	var toLoad = hash+'.html #steal';	$('#content2').load(toLoad, function() {		$('#galleria').galleria({        extend: function(options) {            Galleria.log(this) // the gallery instance            Galleria.log(options) // the gallery options            this.bind(Galleria.IMAGE, function(e) {                Galleria.log(e) // the event object may contain custom objects, in this case the main image                Galleria.log(e.imageTarget) // the current image                $(e.imageTarget).click(this.proxy(function() {                   this.openLightbox();                 }));            });        }    });	});		$('#page').hide();		$('#topSpace').hide();		$('#blackBG').hide();		$('#page2').show();		$('#topMenu').show();	} else if(hash.substr(0,6)=="books_"){ 	var toLoad = hash+'.html #steal';	$('#content2').load(toLoad, function() {		$('#galleria').galleria({        extend: function(options) {            Galleria.log(this) // the gallery instance            Galleria.log(options) // the gallery options            this.bind(Galleria.IMAGE, function(e) {                Galleria.log(e) // the event object may contain custom objects, in this case the main image                Galleria.log(e.imageTarget) // the current image                $(e.imageTarget).click(this.proxy(function() {                   this.openLightbox();                 }));            });        }    });	});		$('#page').hide();		$('#topSpace').hide();		$('#blackBG').hide();		$('#page2').show();		$('#topMenu').show();	} else {		}	}); 		$('.homeLink').live('click', function(){  	var toLoad = $(this).attr('href')+' #steal';      window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);  	$('#topSpace').fadeOut('400');	$('#copyright').fadeOut('400');	$('#page').fadeOut('400', function() {			$('#blackBG').fadeOut('400');	$('#topMenu').slideDown('400', function() {		$('#page2').fadeIn('400');		$('#content2').empty();		$('#content2').load(toLoad, function() {		$('#content2').fadeIn('400');		$('#copyright').fadeIn('400');		$('#galleria').galleria({        extend: function(options) {            Galleria.log(this) // the gallery instance            Galleria.log(options) // the gallery options            this.bind(Galleria.IMAGE, function(e) {                Galleria.log(e) // the event object may contain custom objects, in this case the main image                Galleria.log(e.imageTarget) // the current image                $(e.imageTarget).click(this.proxy(function() {                   this.openLightbox();                 }));            });        }    });			});		});	});    return false;	});$('.topLink').live('click', function(){  	var toLoad = $(this).attr('href')+' #steal';  	window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);	$('#content2').animate({opacity: 'hide', height: 'hide'}, '400', function() {		$('#content2').empty();		$('#content2').load(toLoad, function() {		$('#content2').animate({opacity: 'show', height: 'show'}, '400');		$('#galleria').galleria({        extend: function(options) {            Galleria.log(this) // the gallery instance            Galleria.log(options) // the gallery options            this.bind(Galleria.IMAGE, function(e) {                Galleria.log(e) // the event object may contain custom objects, in this case the main image                Galleria.log(e.imageTarget) // the current image                $(e.imageTarget).click(this.proxy(function() {                   this.openLightbox();                 }));            });        }    });		});	});	return false;	});	$('#cdsLink').live('click', function(){  	var toLoad = $(this).attr('href')+' #steal';  	window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);	$('#content2').fadeOut('400', function() {		$('#content2').empty();		$('#content2').load(toLoad, function() {		$('#content2').fadeIn('400');		});	});	return false;});$('#returnLink').live('click', function(){  	var toLoad = $(this).attr('href')+' #steal';  	window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);	$('#content2').animate({opacity: 'hide', height: 'hide'}, '400');	$('#copyright').fadeOut('400');	$('#page2').slideUp('200', function() {			$('#blackBG').fadeIn('400');			$('#topMenu').slideUp('400', function() {				$('#topSpace').fadeIn('400');				$('#page').fadeIn('400');				$('#copyright').fadeIn('400');		});	});	return false;	});	$('.click').live('click', function() {	if ($(this).next().css('display') == 'none') {		$(".video").slideUp('slow');		$(this).next().slideDown('slow');		$("#topSpacer").slideUp('slow');	} else {		$(".video").slideUp('slow');		$("#topSpacer").slideDown('slow');	}});$('.more').live('click', function() {		$('#end').slideToggle('slow');		$('.more').toggle('fast');});$('#cdsonlyClick').live('click', function() {		$('#cdsbooks').fadeOut('400', function() {		$('#cdsonly').fadeIn('400');		$('#back').fadeIn('400');		});		});		$('#booksonlyClick').live('click', function() {		$('#cdsbooks').fadeOut('400', function() {		$('#booksonly').fadeIn('400');		$('#back').fadeIn('400');		});		});		$('.buynow').live('click', function() {		$('#paypalBlack').fadeToggle('400', function() {		$('#paypalPopup').fadeToggle('400');	});	});		$('#paypalBlack').live('click', function() {		$('#paypalPopup').fadeOut('400', function() {		$('#paypalBlack').fadeOut('400');	});});});
