var fsi_width  = 510;
var fsi_height = 419;

	function MakeFSICode(width, height){
		var t = fsi_template;
		var temp;

		do {
			temp = t;
			t = t.replace("[WIDTH]", width);
		} while (t != temp);

		do {
			temp = t;
			t = t.replace("[HEIGHT]", height);
		} while (t != temp);


		return t;
	}

	<!-- End of FSI Viewer code template -->

	// Check which popups are supported by the browser
	function CheckCompatibility(){

		try{
			if (window.createPopup == undefined) {
				document.forms[0].IEPopup.disabled=true;
			}
		}
		catch(e){}

		try{
			if (window.open == undefined) {
				document.forms[0].PopupWindow.disabled=true;
			}
		}
		catch(e){}

		if (GetDragDivObject() == undefined) document.forms[0].DragDiv.disabled = true;
	}



	<!-- Popup Window script -->

	function MakePopupWindow(){
		var margin= (document.all)? 4:0;
		var params = "menubar=0,location=0,resizeable=0,status=0,scrollbars=0,width="+(fsi_width-margin) +",height=" + (fsi_height-margin);

		oNewWindow = window.open( "", '_blank', params);
		if (oNewWindow){
			var content = "<html><body style='overflow:hidden' topmargin=0 leftmargin=0 style='margin:0px;padding:0px;border:0px;'>";
			content += MakeFSICode(fsi_width, fsi_height);
			content +="</body></html>";
			oNewWindow.document.write(content);
			oNewWindow.document.title = "FSI Viewer (Standard Popup Window)";
		}
	}

	<!-- End of Popup Window script -->

	<!-- MSI IE Popup script -->
	var oPopup = false;
	function MakePopup(){

		try{
			if (window.createPopup == undefined) return;
		}
		catch(e){}

		if (!oPopup) {
			oPopup = window.createPopup();
			var oPopBody = oPopup.document.body;
			oPopBody.style.border="2px solid #58A8FF";

			var barstyle='font-family:Arial;font-size:10pt;height:20px;background-color:#58A8FF;color:#FFFFFF;font-weight:bold;cursor:pointer;	filter:progid:DXImageTransform.Microsoft.Gradient(StartColorStr=#FFC9E3FF,EndColorStr=#FF268EFF,GradientType=0);';
			var t = '<div UNSELECTABLE=on align=center style="'+barstyle+'" onClick="document.body.myself.hide();">MS IE Popup - Click to hide FSI Viewer</div>';
			oPopBody.innerHTML = t + MakeFSICode(fsi_width, fsi_height);
			oPopBody.myself = oPopup;
		}

		var pWidth  = fsi_width + 4;
		var pHeight = fsi_height + 24;
		var posx = (screen.width  - pWidth)/2 - screenLeft;
		var posy = (screen.height - pHeight)/2 - screenTop;
		oPopup.show(posx, posy, pWidth, pHeight, document.body);


	}
	<!-- End of MSI IE Popup script -->

<!-- Floating DIV script -->

		dragging = false;

		// Get the floating DIV object
		// depending on browser version
		function GetDragDivObject(){
			try {
				var fsidivobject = document.getElementById('fsidiv');
				if (fsidivobject == undefined) {
					fsidivobject = (document.all)? document.all.fsidiv : document.fsidiv;
					if (fsidivobject == undefined) return undefined;
				}
			}
			catch (e){}

			return fsidivobject;
		}


		// Start dragging the floating DIV
		function StartDrag(){

			var fsidivobject = GetDragDivObject();
			if (fsidivobject == undefined) return;

			dragstartX = fsidivobject.offsetLeft - MouseX;
			dragstartY = fsidivobject.offsetTop  - MouseY;

			dragging = true;

			return true;
		}

		// Stop dragging
		function StopDrag(){
			dragging = false;
		}



		// Show the floating DIV
		function ShowDiv(){
			var fsidivobject = GetDragDivObject();
			if (fsidivobject == undefined) return;

			fsidivobject.style.display = 'block';
			fsidivobject.style.visibility = 'visible';
		}


		<!-- End of floating DIV script -->

		// Track cursor position and move
		// the floating DIV if dragging
		function MouseMove(evt){
			if (!document.all){
				MouseX = Math.max(50, evt.pageX);
				MouseY = evt.pageY;
			}
			else {
				MouseX = Math.max(50,event.x);
				MouseY = event.y;
			}

			if (!dragging) return;

			var fsidivobject = GetDragDivObject();
			if (fsidivobject == undefined)return;

			fsidivobject.style.left = MouseX + dragstartX;
			fsidivobject.style.top  = MouseY + dragstartY;

			return true;
		}

		//Track mouseDown events and hide / close visible popups
		function MouseDown(){

			// Close popup window if present
			try{
				if (oNewWindow != undefined) oNewWindow.close();
			}
			catch(e){}

			// Hide floating DIV if visible
			var fsidivobject = GetDragDivObject();
			if (dragging || fsidivobject == undefined) return;

			if (fsidivobject.style.visibility != 'hidden') fsidivobject.style.visibility = 'hidden';
		}


		// Track mouse clicks and cursor position
		if (!document.all) {
			captureEvents(Event.MOUSEMOVE);
			captureEvents(Event.MOUSEDOWN);
		}
		document.onmousemove = MouseMove;
		document.onmousedown = MouseDown;
	
	
	
	<!--
	
			function fKeyDown() {
			if (!document.all) return;
			if (event.keyCode == 13) {
				event.returnValue= false;
				UpdateMovieUrl();

				//document.selection.createRange().text = String.fromCharCode(9)
				}
			}

			function changequery(){
				top.document.location=document.forms[0].newurl.value;
			}


			//-->

