function deleteSlideshow(theWrapper, thePlaceholder, thePlayerId) {
swfobject.removeSWF(thePlayerId);
var tmp = $("div#" + theWrapper).attr('id');

if (tmp) { $("div#" + tmp).html('<div id="' + thePlaceholder + '"></div>'); 

}

}


function createSlideshow(thePlaceholder, thePlayerId, theFile) {
if(!theFile || theFile==''){var theFile = 'x';}
if(theFile == 'x'){var autoStart = 'false';} else {var autoStart = 'true';}

var flashvars = {
file:"slideshow_xml.php?gal="+theFile, 
autostart:autoStart,
shownavigation:"false",
height:"288",
width:"352",
controlbar:"none",
transition:"bgfade",
showicons:"false",
icons:"false"
}

var params = {
allowfullscreen:"true", 
allowscriptaccess:"always",
height:"288",
width:"352"
}

var attributes = {
id:thePlayerId,  
name:thePlayerId
}

swfobject.embedSWF("flash/imagerotator.swf", thePlaceholder, "352", "288", "9", false, flashvars, params, attributes);

}


function initSlideshow(theFile) { 
deleteSlideshow('wrapper', 'placeholder1', 'player1'); 
createSlideshow('placeholder1', 'player1', theFile);

}

