<!--
	var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	var moviename="Movie1";
	
	// Hook for Internet Explorer 
	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 Movie1_FSCommand(ByVal command, ByVal args)\n');
		document.write('  call Movie1_DoFSCommand(command, args)\n');
		document.write('End Sub\n');
		document.write('</SCRIPT\> \n');
	}

	// Handle all the the FSCommand messages in a Flash movie
	function Movie1_DoFSCommand(command, args) {
		var Movie1Obj = InternetExplorer ? Movie1 : 	window.parent.document.frames["fraTop"].document.all.Movie1;
		//var Movie1Obj = InternetExplorer ? Movie1 : 	document.Movie1;
		alert(args);
	}
	
	function movieobject(moviename) {
		//IE and Netscape refer to the movie object differently.
		//This function returns the appropriate syntax depending on the browser.
	
		if (navigator.appName.indexOf ("Microsoft") !=-1) {
			return window[moviename];
		} else {
			return document[moviename];
		}
	}
	
	function StartMovie(icon) {
		//var movieobj=document.Movie1;
		var movieobj=window.parent.document.frames["fraTop"].document.all.Movie1
		
		eval("movieobj.TPlay('/"+icon+"')")

		/*if (icon=="b2-police") {
			movieobj.TPlay("/target_item/b2-police");
		} else if (icon==2) {
			movieobj.TPlay("/target_item/bus_stop");
		} else if (icon==3) {
			movieobj.TPlay("/target_item/hospital");
		}*/
	}
	
	function StopMovie(icon) {
		//var movieobj=document.Movie1;
		var movieobj=window.parent.document.frames["fraTop"].document.all.Movie1
		
		eval("movieobj.TStopPlay('/"+icon+"');")
		eval("movieobj.TGotoFrame('/"+icon+"', 1);")

		/*if (icon=="b2-police") {
			movieobj.TStopPlay("/target_item/b2-police");
			movieobj.TGotoFrame("/target_item/b2-police", 1);
		} else if (icon==2) {
			movieobj.TStopPlay("/target_item/bus_stop");
			movieobj.TGotoFrame("/target_item/bus_stop", 1);
		} else if (icon==3) {
			movieobj.TStopPlay("/target_item/hospital");
			movieobj.TGotoFrame("/target_item/hospital", 1);
		}*/
	}

	function Demo() {
		alert("This is just a demo!");
	}
	
	function checkStation(flag) {
		var frmStations=document.forms["frmStations"];
		var cboFrom=frmStations.elements["cboFrom"];
		var cboTo=frmStations.elements["cboTo"];
		var ndx1=frmStations.elements["cboFrom"].selectedIndex;
		var ndx2=frmStations.elements["cboTo"].selectedIndex;
		var valFrom=cboFrom.options(ndx1).value;
		var valTo=cboFrom.options(ndx2).value;
		
		if (valFrom==valTo || valTo==valFrom) {
			if (flag) {
				alert("Please select a different arrival station.");
			} else {
				alert("Please select a different departure station.");
			}
		}
	}

	function fncheckStations() {
		var frmStations=document.forms["frmStations"];
		var cboFrom=frmStations.elements["cboFrom"];
		var cboTo=frmStations.elements["cboTo"];
		var ndx1=frmStations.elements["cboFrom"].selectedIndex;
		var ndx2=frmStations.elements["cboTo"].selectedIndex;
		var valFrom=cboFrom.options(ndx1).value;
		var valTo=cboFrom.options(ndx2).value;
		
		if (valFrom==0 || valTo==0) {
			alert("Please select a different departure or arrival station.");
			return false;
		} else if (valFrom==valTo || valTo==valFrom) {
			alert("Please select a different departure or arrival station.");
			return false;
		} else {
			return true;
		}
	}

	function checkStation(rtn) {
		var frmStations=document.forms["frmStations"];
		var cboFrom=frmStations.elements["cboFrom"];
		var cboTo=frmStations.elements["cboTo"];
		var ndx1=frmStations.elements["cboFrom"].selectedIndex;
		var ndx2=frmStations.elements["cboTo"].selectedIndex;
		var valFrom=cboFrom.options(ndx1).value;
		var valTo=cboFrom.options(ndx2).value;
		
		if (rtn==1) {
			if (valFrom==valTo || valTo==valFrom) {
				alert("Please select a different departure or arrival station.");
			} else {
				document.location="planner.asp?from="+valFrom+"&to="+valTo;
			}
		} else {
			if (valFrom==valTo || valTo==valFrom) {
				alert("Please select a different departure or arrival station.");
				return false;
			} else {
				return true;
			}
		}
	}
	
	function goTo(fname) {
		document.forms["frmStations"].action=fname;
		document.forms["frmStations"].submit();
	}

	function revTrans(obj) {
		//eval(obj+'.filters.revealTrans.Apply();');
		//eval(obj+'.style.visibility="visible";');
		//eval(obj+'.filters.revealTrans.Play();');
		obj.filters.revealTrans.Apply();
		obj.style.visibility='visible';
		obj.filters.revealTrans.Play();
	}

	function startTrans(obj,Map1,Map2) {
		var map1=Map1;
		var map2=Map2;
		var TheMap;
		
		if (obj.src==map1) {
			TheMap=map2;
		} else {
			TheMap=map1;
		}
		
		obj.filters.blendTrans.Apply();
		obj.src=TheMap;
		obj.filters.blendTrans.Play();
	}
	
	function popupA() {
		var popup=window.open('','popupWnd','width=330,height=400,top=150,left=100,status=0,location=0,menubar=0');
	}

	function popupB() {
		var popup=window.open('','popupWndFlash','width=590,height=580,top=50,left=80,status=0,location=0,menubar=0,scrollbars=1');
	}
	
	function openWnd(fname) {
		var newwnd=window.open(fname, "newWnd", "status=0,menubar=0,toolbar=0,location=0");
	}

	function showBusRoute(fname) {
		var popup=window.open('showBusRoute.asp?fname='+fname,'busRouteWnd','width=445,height=500,top=10,left=10,status=1,location=0,menubar=0,scrollbars=1');
	}

	function showPlaceOfInterest(ndx) {
		var popup=window.open('viewPicture.asp?ID='+ndx,'popupWnd','width=330,height=400,top=50,left=50,status=0,location=0,menubar=0,scrollbars=1');
	}
	
	function showStationInfo(sID) {
		//var popup=window.open('stationInfo.asp?StnID='+sCode,'popupWndInfo','width=608,height=500,top=10,left=10,status=1,location=0,menubar=0,scrollbars=1');
		var popup=window.open('showFlashMap.asp?StationID='+sID,'popupWndInfo','width=606,height=500,top=10,left=10,status=1,location=0,menubar=0,scrollbars=1,resizable=1');
	}
	
	function selText(elem) {
		elem.focus();
		elem.blur();
		elem.select();
	}
	
	function mustFill(form) {
		var frmPlanner=document.forms["frmStations"];
		var nFlag=frmPlanner.elements["nFlag"];
		
		if (frmStations.elements["from"].value=="" || frmStations.elements["to"].value=="") {
			alert("This following are required:\n- Start location\n- End location");
			return false;
		} else {
			if (nFlag.value==2) {
				var cboID1=frmPlanner.elements["id1"];
				var cboID2=frmPlanner.elements["id2"];
				var ndx1=cboID1.selectedIndex;
				var ndx2=cboID2.selectedIndex;
				
				if (ndx1!=-1 && ndx2!=-1) {
					return true
				} else {
					alert("Fail to search one of the nearest location.\nClick CANCEL to try again.");
					return false;
				}
			} else {
				return true;
			}
		}
	}
	
	function SignUp() {
		var m=window.open("../member/signup.asp","signupWnd","toolbar=0,status=0,location=0,scrollbars=0,width=400,height=500");
	}
	
	function EditProf(nid) {
		var m=window.open("../member/editProfile.asp?MID="+nid,"editProfWnd","toolbar=0,status=0,location=0,scrollbars=1,width=400,height=500");
	}
	
	function Logon(org) {
		var m=window.open("../member/logon.asp?org="+org,"signupWnd","toolbar=0,status=0,location=0,scrollbars=0,width=300,height=200");
	}
	
	function Vote() {
		var m=window.open("","voteWnd","toolbar=0,status=0,location=0,top=100,left=100,scrollbars=1,width=300,height=200");
	}

	function ViewResult() {
		var m=window.open("result.asp","voteWnd","toolbar=0,status=0,top=100,left=100,location=0,scrollbars=0,width=450,height=225");
	}

	function checkOption() {
		var theForm=document.forms["frmPoll"];
		var opt=theForm.elements["Opt"];
		var selectedOpt=0;
		
		for (i=0;i<opt.length;i++) {
			if (opt[i].checked) {
				selectedOpt=1;
				break
			}
		}
		
		if (selectedOpt) {
			var m=window.open("","voteWnd","toolbar=0,status=0,location=0,scrollbars=0,top=100,left=100,width=450,height=250");
			return true;
		} else {
			alert("Please select one of the options before submitting your vote.");
			return false;
		}
	}
	
	function ValidEmail() {
		var theForm=document.forms["frmMailList"];
		var email=theForm.elements["Email"];
		var tmp=email.value;
		
		if (email.value!="") {
			if (tmp.indexOf("@")>0) {
				var m=window.open("","mailWnd","toolbar=0,status=0,location=0,scrollbars=0,width=300,height=150");
				return true;
			} else {
				alert("Please enter a valid e-mail address.");
				return false;
			}
		} else {
			alert("Please enter your e-mail address.");
			return false;
		}
	}
//-->