var version = deconcept.SWFObjectUtil.getPlayerVersion();

if(version["major"] < 8)
{
    document.write('<script type="text/javascript" src="/scripts/dropmenu.options.js"></script>');
    document.write('<script type="text/javascript" src="/manager/include/scripts/dropmenu.ent.js"></script>');
}


/* External Interface functions */
function openFlashMenu(str)
{
  //alert(str);
  $("#ent-top-flash").height(300);
}

function closeFlashMenu(str)
{
  //alert(str);
  $("#ent-top-flash").height(110);
}

function videoEnded(str)
{
	//THIS FUNCTION IS CALLED BY THE FLASH VIDEO 
	//PLAYER WHEN VIDEO FINISHES PLAYING.

	setTimeout('videoClose()',500);
}

function videoClose()
{
  document.getElementById("ent-mid-flash").style.visibility = "hidden";
  rotateBanner();
}


var scripts_isIE = jQuery.browser.msie;
var scripts_isIE6 = (scripts_isIE && jQuery.browser.version.substr(0,1)=="6");

function HomeBannerData(index, image, imgURL)
{

	this.isFaded = false;
	this.index = index;
	this.image = image;
	this.imgURL = imgURL;
	this.html = "";
	this.addLine = function(content) {
		this.html += (content + "\n");
	}
	this.writeBanner = function() {
		document.write(this.html);
	};

	this.addLine("<div id=\"slideshow"+this.index+"\" style=\"width:766px;position:absolute;left:0px;top:0px;z-index:0;visibility:hidden;\">");
	this.addLine("<a href=\""+this.imgURL+"\"><img src="+this.image+" border=\"0\" alt=\"\" title=\"\" /></a>");
	this.addLine("</div>");

}

function RotateBannerData(index)
{

	var data = bannerData[index];
	
	if (data != null) 
	{

		//alert("move banner from selected: "+selectedHomeBannerID+ " to index: "+index + " showing: "+showingBannerIndex);

		selectedHomeBannerID = index;
		
		var showing = $("#slideshow"+showingBannerIndex);
		var toShow = $("#slideshow"+index);

		//showing.css("display","none");
		toShow.css({"display":"none","z-index":"2","visibility":"visible"});
		toShow.fadeIn("slow", function() { 
			showing.css("z-index","0");
			//showing.css("display","none");
			toShow.css("z-index","1");
		});

		showingBannerIndex = index;
		
	}
}

function rotateBanner()
{
	var id = selectedHomeBannerID + 1;
	if (id >= bannerData.length) id = 0;
	RotateBannerData(id);
	resetBannerRotation();
}

function resetBannerRotation()
{
	setTimeout('rotateBanner();',7000);
}

