//jQuery().ready(function() {
//document.observe("dom:loaded", function() { console.log("r") });
	//console.log("r");

/*
	AudioPlayer.setup("/bd-mall/audio-player/player.swf", {  
	    width: 200  
	}); 
*/
//});



function audioPreview(filename) {
	//console.log(filename);

	this.playerSpecs = 
		{
			//pathToPlayer:"/bd-mall/mediaplayer/player.swf",
			//pathToPlayer:"/bd-mall/niftyplayer/niftyplayer.swf",
			pathToPlayer:"/bd-mall/audio-player/player.swf",
			version:"9.0.115",
			controllerHeight:20
		}

	this.flashvars = 
		{
			//file:"/system-blue/publishing/audio/" + filename, 
			
			soundFile:"/system-blue/publishing/audio/" + filename,
			titles:"sample",
			remaining:"yes",
			
			//image:myObj.poster, 
			//fullscreen:true,
			autostart:false,
			skin:"/bd-mall/mediaplayer/skins/simple.swf"
		}
		
	this.params = 
		{
			wmode:"transparent", 
			//allowfullscreen:true,
			allowscriptaccess:"always"
		}
		
	this.attributes =
		{
			name:"audioPreview"
			//name:myObj.replaceElement
		}
		
	this.setFullscreen = function(trueFalse) {
			this.flashvars.fullscreen = trueFalse;
			this.params.allowfullscreen = trueFalse;
		}
	
	this.setAutostart = function(trueFalse) {
			this.flashvars.autostart = trueFalse;
		}
	
	this.render = function() {
			//console.log("rendering...");
			var height = 30;
		
			swfobject.embedSWF(this.playerSpecs.pathToPlayer, this.attributes.name, 200, height, this.playerSpecs.version, false, this.flashvars, this.params, this.attributes);
		}
}


//for random image on front door
function randomF1() {
	f1.sort(function() {return 0.5 - Math.random()});
	//console.log(f1[0]);
	
	var output = '<a href="' + f1[0].url + '"><img src="' + f1[0].image + '" /></a>';
	document.write(output);
}
