function writeFlash(theLang, theDomain, thePollDuration){
	var theHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" type="application/x-shockwave-flash" id="Client">';
	theHTML += '<param name="movie" value="Client.swf" />';
	theHTML += '<param name="quality" value="high" />';
	theHTML += '<param name="bgcolor" value="#ffffff" />';
	theHTML += '<param name="wmode" value="transparent" />';
	theHTML += '<param name="FlashVars" value="chosenLanguage=' + theLang + '&flashVarsDomain=' + theDomain + '&flashVarsPollDuration=' + thePollDuration + '">';
	theHTML += '<param name="menu" value="false" />';
	theHTML += '<embed src="Client.swf" quality="high" bgcolor="#ffffff" wmode="transparent" menu="false" FlashVars="chosenLanguage=' + theLang + '&flashVarsDomain=' + theDomain + '&flashVarsPollDuration=' + thePollDuration + '" width="100%" height="100%" name="Client" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	theHTML += '</object>';
	document.getElementById('flashContainer').innerHTML = theHTML;
}

function writeScroller(){
	var theHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="575" height="55" type="application/x-shockwave-flash" id="Scroller">';
	theHTML += '<param name="movie" value="Scroller.swf" />';
	theHTML += '<param name="quality" value="high" />';
	theHTML += '<param name="bgcolor" value="#ffffff" />';
	theHTML += '<param name="wmode" value="transparent" />';
	theHTML += '<param name="menu" value="false" />';
	theHTML += '<embed src="Scroller.swf" quality="high" bgcolor="#ffffff" wmode="transparent" menu="false" width="575" height="55" name="Scroller" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	theHTML += '</object>';
	document.getElementById('scrollerContainer').innerHTML = theHTML;
}

function flashString(movie, w, h){
	var theHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash">';
	theHTML += '<param name="movie" value="' + movie + '" />';
	theHTML += '<param name="quality" value="high" />';
	theHTML += '<param name="wmode" value="transparent" />';
	theHTML += '<param name="menu" value="false" />';
	theHTML += '<embed src="' + movie + '" quality="high" bgcolor="#ffffff" wmode="transparent" menu="false" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	theHTML += '</object>';
	return theHTML;
}

function imageString(image, link){
	var theHTML = '<a href="' + link + '" target="_blank"><img src="' + image + '" border="0"></a>';
	return theHTML;
}

var topPointer = 0, leftPointer = 0, rightPointer = 0;
function rotateBanners(which){
	var targetArray = eval(which + 'Banners');
	var targetPointer = eval(which + 'Pointer');
	var targetContainer = ge(which + 'BannerContainer');
	if (targetArray.length > 0){
		var elementArray = targetArray[targetPointer];
		if (elementArray[5] == '0'){
			if (Right(elementArray[0], 3) == 'swf')
				targetContainer.innerHTML = flashString(elementArray[0], elementArray[1], elementArray[2]);
			else
				targetContainer.innerHTML = imageString(elementArray[0], elementArray[3]);
		} else {
		    if (elementArray[0].indexOf('<script') == 0)
		        targetContainer.innerHTML = '<iframe src="scriptLoader.aspx?script=' + escape(elementArray[0]) + '" frameborder="0" width="' + elementArray[1] + '" height="' + elementArray[2] + '" style="margin:0"></iframe>'
		    else
			    targetContainer.innerHTML = elementArray[0];
		}
		if (targetPointer == targetArray.length - 1)
			targetPointer = 0;
		else
			targetPointer++;
		eval(which + 'Pointer = ' + targetPointer);
		if (targetArray.length > 1)
			setTimeout("rotateBanners('" + which + "');", elementArray[4] * 1000);
	} else
		targetContainer.innerHTML =	'&nbsp;';
}

function beginBannersRotation(){
	rotateBanners('top');
	rotateBanners('left');
	rotateBanners('right');
}