// JavaScript Document
var timeout = setTimeout('', 10);

function hideMenu()
{
	jQuery("div#nav ul li ul").fadeOut('fast');
}

jQuery(document).ready(function ()
{
	//jQuery('img[@src$=.png]').ifixpng(); 
	jQuery(document).pngFix();

	//Menu Drop Right
	jQuery("div#nav ul li ul").hide();
	jQuery("#nav_music").hover(function ()
	{
		jQuery("div#nav ul li ul").fadeIn('fast');
		clearTimeout(timeout);
	}, function ()
	{
		timeout = setTimeout("hideMenu()", 700);
	});
	jQuery("div#nav ul li ul").hover(function ()
	{
		clearTimeout(timeout);
	}, function ()
	{
		timeout = setTimeout("hideMenu()", 700);
	});
	jQuery("#largerLinks a").fancybox({padding: 0}); 
	jQuery("body.bio div#imageDivs div").click(function ()
	{
		jQuery("a#" + jQuery(this).attr('id').replace(/box/, 'photo')).click();										
	});

/*
	jQuery("a.preview").click(function ()
	{
		jQuery("#audio").html('');
		var name = 'http://www.epraxadev.com/joannekurman/previews/' + jQuery(this).attr('href') + '.mp3';
		jQuery("#audio").flash(
		{ src: 'http://www.epraxadev.com/joannekurman/flash/preview.swf',
				  width: 1,
				  height: 1,
				  wmode: 'transparent',
				  AllowScriptAccess: 'always',
				  flashvars: {previewUrl: name}
		});
		return false;
	});
*/
	jQuery("a.preview").each(function ()
	{
		//$(this).attr('href', 'http://joannekurman.myshopify.com/pages/preview?name='+ jQuery(this).attr('href'));
		//$(this).attr('target', 'musicFrame');
	});
	
	/*
		var topurl = window.location.href;
		var params = topurl .split('=');
		var name = 'http://www.epraxadev.com/joannekurman/previews/' + params[1] + '.mp3';
		jQuery("#previewAudio").html('');
		jQuery("#previewAudio").flash(
		{ src: '{{ 'preview.swf' | asset_url }}',
				  width: 5,
				  height: 5,
				  wmode: 'transparent',
				  AllowScriptAccess: 'always',
				  flashvars: {previewUrl: name}
		});
	*/

	jQuery("a.voiceOver").click(function ()
	{
		jQuery("#audio").html('');
		var name = 'media/voice-over.mp3';
		jQuery("#audio").flash(
		{ src: 'flash/preview.swf',
				  width: 1,
				  height: 1,
				  wmode: 'transparent',
				  AllowScriptAccess: 'always',
				  flashvars: {previewUrl: name}
		});
		return false;
	});

	jQuery("a.buyLink").click(function ()
	{
		jQuery(this).parent().submit();
		return false;
	});

});
