var bannerHolder = document.getElementById("bannerContainer");
	bannerHolder.style.position = "relative";
	bannerHolder.style.display = "block";
	bannerHolder.style.width = expandBannerWidth + "px";
	bannerHolder.style.height = expandBannerMinHeight + "px";

var banner = document.getElementById(expandBannerDivHolder);
	banner.style.overflow = "hidden";
	banner.style.position = "absolute";
	banner.style.top = "0";
	banner.style.left = "0";
	banner.style.display = "block";
	banner.style.width = expandBannerWidth + "px";
	banner.style.height = expandBannerMaxHeight + "px";
	banner.style.clip = "rect(auto, auto, " + expandBannerMinHeight + "px, auto)";
	banner.style.zIndex = "99";

// SWFObject
var so = new SWFObject(expandBannerPath, expandBannerId, expandBannerWidth + "px", expandBannerMaxHeight + "px", expandBannerFlashVersion, expandBannerBackgroundColor);
	so.addParam("scale", "noscale");
	so.addParam("wmode", "transparent");
	so.addParam("allowFullScreen", "true");
	so.addParam("allowScriptAccess", "sameDomain");
	
	so.addVariable("swf_expandBannerWidth", expandBannerWidth);
	so.addVariable("swf_expandBannerMinHeight", expandBannerMinHeight);
	so.addVariable("swf_expandBannerMaxHeight", expandBannerMaxHeight);
	so.addVariable("swf_expandBannerSlidingDuration", expandBannerSlidingDuration);
	
	so.write(expandBannerDivHolder);
	
// This following line is here to correct a bug of IE	
	banner.style.clip = "rect(auto, auto, " + expandBannerMinHeight + "px, auto)";

// Function to minimize the banner
function minimizeBanner(){
	var ban = document.getElementById(expandBannerDivHolder);
		ban.style.clip = "rect(auto, auto, " + expandBannerMinHeight + "px, auto)";
}

// Function to maximize the banner
function maximizeBanner(){
	var ban = document.getElementById(expandBannerDivHolder);
		ban.style.clip = "rect(auto, auto, " + expandBannerMaxHeight + "px, auto)";
	cInit();
}

// This function call the Actionscript function toExpand()
function cInit(){
	thisMovie(expandBannerId).toExpand();
}

// This function call the Actionscript function toCollapse()
function cBack(){
	thisMovie(expandBannerId).toCollapse();
}

// Check browser
function thisMovie(movieName) {
	if(navigator.appName.indexOf("Microsoft") != -1){
		return window[movieName]
	}else{
		return document[movieName]
	}
}