ckdd.extend(ckSWFObj,ckSWFSlideshowObj);
function ckSWFSlideshowObj(gid) {
	var gigid = (arguments.length==2 ? arguments[1] : "");
	
	//inherited
	this.movieURL = "/ckcommon/imageSlideshow.swf";
	this.setBackgroundColor("#FFFFFF");
	
	//custom
	this.setGallery(gid,gigid);
	this.setMaxImageDim(300,200);
	this.set("padding",0);
	this.set("bCredits",false);
	this.set("bDateTaken",false);
	this.set("bCorners",false);
	this.set("bControls",true);
	this.set("shadowType","");  
	this.setImageTitleDescrLength(0,0);
		
	return this;
}

ckSWFSlideshowObj.prototype.set = function(sName,value) {
	this.addVariable(sName,value);
}
ckSWFSlideshowObj.prototype.get = function(sName) {
	if (this.aFlashvars[sName]) return(this.aFlashvars[sName])
	else return "";
}

ckSWFSlideshowObj.prototype.embed = function(containerID) {
	var extraW = 0;
	var extraH = 0;

	//these are the only required parameters as they determine the size of the movie to embed.
	if (this.get("padding") != "0") { extraW += (this.aFlashvars["padding"] * 2); extraH += (this.aFlashvars["padding"] * 2);}
	if (this.get("bCredits")=="true") extraH+=25;
	if (this.get("bDateTaken")=="true") extraH+=25;
	if (this.get("bCorners")=="true") { extraW+=4;	extraH+=4;	}
	if (this.get("bControls")=="true") { extraH+=45;}
	if (this.get("shadowType")=="outer") {extraW+=9; extraH+=9;};
	if (this.get("shadowType")=="drop") {extraW+=5; extraH+=5;};
	
	extraH += (this.maxImageTitleLength/100)*20;
	extraH += (this.maxImageDescrLength/100)*20;
	
	this.setMovieSize(this.maxImageW + extraW,this.maxImageH + extraH);
	ckSWFSlideshowObj.superClass.embed.call(this,containerID)
}

ckSWFSlideshowObj.prototype.setGallery = function(gid) {
	var gigid = (arguments.length==2 ? arguments[1] : "");
	this.set("galleryID",gid);
	this.set("galleryImageGroupID",gigid);
}
ckSWFSlideshowObj.prototype.setMaxImageDim = function(w,h) {
	this.maxImageW = parseInt(w);
	this.maxImageH = parseInt(h);
}

ckSWFSlideshowObj.prototype.setFade = function(fadeType,numSteps) {
	this.set("numFadeSteps",numSteps);
	this.set("fadeType",fadeType); 
}
ckSWFSlideshowObj.prototype.setImageTitleDescrLength = function(maxTitleLen,maxDescrLen) {
	this.maxImageTitleLength = maxTitleLen;
	this.maxImageDescrLength = maxDescrLen;
}

