function flashWritten(e) { 
	if (!e || ( e && !e.success) ) { 
		$("#paragonHomeFlashAlt").css({height:420,overflow:'hidden',position:'relative'});
		$("#paragonHomeFlashAlt img").css( {position:'absolute', top:0, left:950, opacity:0} ).first().animate({left:0,opacity:1}, 1000, null, function () {  animateHeader( this ) } );
	}
}
var animateHeader = function (old) {
	var obj = $(old).css( "z-index", 100 ).delay(5000).animate({left:-970,opacity:0}, 777 ).next();
	if ( $(old).next().length == 0 ) { obj = $("#paragonHomeFlashAlt img").first() }
	//if (console.log) console.log($(old).attr('src'), obj.attr('src') );
	$(obj).css( {"z-index": 1000, left: 950, display:"block", opacity:0 } ).delay(5000).animate({left:-15, opacity:1}, 777, null, function () {  animateHeader( this ) } );								  
}

var flashVars = {
	// Path to the location of all Flash Assets to be loaded. Leave blank if movies are in separate locations.
	assetsPath: "/Images/homeflash/",

	// OPTIONAL: Prefix for flashVars of SWFs to be loaded. If not set, will default to "flash".
	swfVarPrefix: "flash",

	// FlashVar references to Movies to load should begin with either the string set in the swfVarPrefix flashVar,
	// or if that flashVar is not set, then these flashVars references should defalt to "mov" -- eg: "movTwo"
	flashPlay: "play.swf",
	flashEntertain: "entertain.swf",
	flashDine: "dine.swf",
	flashRelax: "relax.swf",
	flashStay: "stay.swf",

	// Order in which to serve the Flash Movies, separated by commas -- eg: "movOne, movTwo";
	// These must also be the same as id's of the div's with class "flashBlock"
	swfOrder: escape("flashPlay,flashEntertain,flashDine,flashRelax,flashStay"),
	htmlPageAsset: "/Home.aspx"
};

$(document).ready(init);

function init(){
	var params = { menu: "false", wmode:"opaque", bgcolor:"#000000" };
	var atts = { id: "paragonHomeFlash", name: "paragonHomeFlash" };
	swfobject.embedSWF("/Images/homeflash/paragonHomeShell.swf", "paragonHomeFlashAlt", "945", "450", "9.0", "expressInstall.swf", flashVars, params, atts, flashWritten);
	
	
	$(".flickr_badge_image a").attr("target", "_blank");
}
