function writeFlash(file, width, height) {
	widthCode = width ? 'WIDTH="'+width+'"' : '';
	heightCode= height ? 'HEIGHT="'+height+'"' : '';

	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	 document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
	 document.write(''+widthCode+' '+heightCode+' id="'+file+'" ALIGN="">');
	 document.write('<PARAM NAME=movie VALUE="'+file+'"> <PARAM NAME=quality VALUE=high> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" />');
	 document.write('<param name="menu" value="false" /><param name="quality" value="high" /><param name="scale" value="noborder" />'); 
	 document.write('<EMBED src="'+file+'" quality=high '+widthCode+' '+heightCode+' NAME="'+file+'" ALIGN=""');
	 document.write('menu="false" quality="high" scale="noborder" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	document.write('</OBJECT>');
}

	// Login Form
	
	function login() {
		document.forms.Login.submit();
	}


		// Dynamic Menues
	var menus = new Array();
	var visible = new Object();
	var names = new Array();
	var refs = new Array();
	
	var tempTr;
	var hideTimer;
	
	function showMenu(menuName, tr, event) {
		clearTimeout(hideTimer);
		if (tempTr == tr) {
			return;
		}
		
		tempTr = tr;

		visible[menuName] = false;
		for (var name in visible) {
			visible[name] = false;
		}
		visible[menuName] = true;
		refs[menuName] = tr;
		checkMenu(event);
	};

	function hideMenu(menuName, tr) {
		clearTimeout(hideTimer);
		visible[menuName] = false;
		hideTimer = setTimeout('checkMenu()', 200);
	}
	
	function checkMenu(event) {
		for (var menuName in visible) {
			if (menus[menuName] == null) {
				menu = document.getElementById(menuName);
				if (menu != null) {
					menus[menuName] = menu;
				}
			}
		
			if (visible[menuName]) {
				if (menus[menuName] != null) {
					menus[menuName].style.visibility = "visible";
					if (event) {
						menus[menuName].style.left = (mouseX(event)) + "px";
					}
				}
			}
			else {
				if (menus[menuName] != null) {
					menus[menuName].style.visibility = "hidden";
				}
			}
		}
		tempTr = null;
	}
	
	function mouseX(evt) {
		if (evt.pageX) return evt.pageX;
		else if (evt.clientX)
		   return evt.clientX + (document.documentElement.scrollLeft ?
		   document.documentElement.scrollLeft :
		   document.body.scrollLeft);
		else return null;
	}

	// Ticker for News

	var delay=4000 //set delay between message change (in miliseconds)
	var news = new Array();
	var indexNews=-1;

	//function to change content
	function changecontent(){
		div = getDiv(indexNews);
		if (div) {
			div.style.display = 'none';
		}
		indexNews++;

		div = getDiv(indexNews);
		if (!div) {
			indexNews = 0;
			div = getDiv(indexNews);
		}
		
		div.style.display = 'block';

		setTimeout("changecontent()",delay)
	}
	
	function getDiv(index) {
		var name = 'newsBox' + indexNews;
		var div = $(name);
		return div;
	}

window.onload=changecontent

			