
	window.addEvent('domready', createSWF);

	var swf;

	function createSWF()
	{

	var flash_path = local_path+"local/swf/index.swf";
	var so = new SWFObject(flash_path, "Flash_Panel", 990, 90, "8", "#FFFFFF");
		so.addVariable("isExpandable",true);
        so.addVariable("local_path", local_path);
		so.addParam("allowScriptAccess", "always");
		so.addParam("name", "Flash_Panel");
		so.write("top_banner");
		swf = so;
	}

	contract = function(){
		toggle_flash('contract');
	}
	expand = function(){
		toggle_flash('expand');
	}

	function isIE()
	{
		if (navigator.appName.indexOf("Microsoft") != -1) {
			var variable = true;
		}
		else
		{
			var variable = false;
		}

		return variable;

	}

	toggle_flash = function(mode){
		var animate = new Chain();
		var destination_height = (mode == "expand") ? 360 : 90;

		var animation1 = function(){
			var growDiv = new Fx.Style($("top_banner"),
			'height', {duration: 500});
			growDiv.start(destination_height);
		};


		var animation2 = function(){

			var obj = document.getElementById("Flash_Panel");

			if(!isIE())
			{
				var growDiv = new Fx.Style($(obj),
				'height', {duration: 500});
				growDiv.start(destination_height);
			}
			else
			{

				var actual_height = obj.style.height;

				if(destination_height > 90)
				{
					actual_height = 90;
				} else {
					actual_height = 360;
				}

				t1 = new  Tween(obj.style,'height',
					  Tween.strongEaseOut,
					  actual_height,
					  destination_height, 1, 'px');
				t1.start();

			}

		};


		if (isIE()) {
			//alert("ie");
			var delayOpen  = 500;
			var delayClose = 10;
		}
		else {
			//alert("ff");
			var delayOpen = 50;
			var delayClose = 50;
		}

		animate.chain(  (mode == "expand") ? animation1 : animation2);
		animate.chain(  (mode == "expand") ? animation2 : animation1);
		animate.callChain();

		animate.callChain.delay(delayOpen, animate);
		animate.callChain.delay(delayClose, animate);

	}
