var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
function setCookie(name, value) {
	var expires = 60*60*24;
	var path = "/";
	var todaydate = new Date();
    var domain = "";

	var expdate=new Date(todaydate.getTime()+expires*1000);	
    var curCookie = name + "=" + escape(value) +
	"; expires=" + expdate.toGMTString()  +
	"; domain=" + domain + ((path) ? "; path=" + path : "");
	return curCookie;
}
function getCookie(name) {
	var prefix = name + "="
    var cookieStartIndex = document.cookie.indexOf(prefix)
    if (cookieStartIndex == -1) return "";
    var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
    if (cookieEndIndex == -1)
    cookieEndIndex = document.cookie.length
    return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
}
function manage_movies(command, args) {
	if (command == "alert") {
		//alert(args);
		//document.all['deb'].value = document.all['deb'].value + ' ' + args;
	}
	if (command == "loaded") {
		//onLoadMovie();
	}
	if (command == "updatecity") {
		//alert(args);
		document.cookie = "lastcity="+args;
	}
	if (command == "startall") {
		window.document.clock3.SetVariable("mouseflag", 1);
		window.document.banner2.SetVariable("mouseflag", 1);
		window.document.banner1.SetVariable("mouseflag", 1);
	}
	if (command == "stopall") {
		//window.document.clock3.SetVariable("mouseflag", 0);
		//window.document.banner2.SetVariable("mouseflag", 0);
		//window.document.banner1.SetVariable("mouseflag", 0);
	}
}
function clock3_DoFSCommand(command, args) {
  var clock3Obj = InternetExplorer ? document.all['clock3'] : document.clock3;
  manage_movies(command, args);
}
function banner1_DoFSCommand(command, args) {
  var banner1Obj = InternetExplorer ? document.all['banner1'] : document.banner1;
  manage_movies(command, args);
}
function banner2_DoFSCommand(command, args) {
  var banner2Obj = InternetExplorer ? document.all['banner2'] : document.banner2;
  manage_movies(command, args);
}
function onLoadMovie() {
	if (getCookie('lastcity') != '') {
		window.document.clock3.SetVariable('lastcity', getCookie('lastcity'));
	}
}
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('Sub clock3_FSCommand(ByVal command, ByVal args)\n');
  document.write('  call clock3_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('Sub banner2_FSCommand(ByVal command, ByVal args)\n');
  document.write('  call banner2_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('Sub banner1_FSCommand(ByVal command, ByVal args)\n');
  document.write('  call banner1_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('</SCRIPT\> \n');
}