maxTop = 700;
maxBottom = 45;
movieHeight = 723;
moveBottom = 0;

function setScroll() {
	if(document.body.scrollHeight > document.body.clientHeight) {
		if(-document.body.scrollTop + document.body.scrollHeight - document.body.clientHeight < maxBottom) {
			varScrollNum = document.body.scrollHeight - maxBottom;
		} else {
			varScrollNum = document.body.scrollTop + document.body.clientHeight;
		}
	} else {
		varScrollNum = document.body.clientHeight - maxBottom;
	}
	if(varScrollNum < maxTop) {
		varScrollNum = maxTop;
	}
	varScrollNum -= moveBottom;
	moving_img_DoFSCommand("setBottom", varScrollNum);
}

var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

function moving_img_DoFSCommand(command, args) {
	var moving_imgObj = isInternetExplorer ? document.all.moving_img : document.moving_img;
	if(command == "setBottom") {
		moving_imgObj.SetVariable("/mc_image:varFromJs",args);
		moving_imgObj.TCallLabel("/mc_hide","callFunction");
	}
	if(command == "init") {
		setScroll();
		window.onresize = setScroll;
		window.onscroll = setScroll;
	}
}


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 moving_img_FSCommand(ByVal command, ByVal args)\n');
	document.write('Call moving_img_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}

function OpenWindow(URL,W,H,S) {
    if (screen.width == W){
      var T = 0;var L = 0;
    }else{
      var L = ((screen.width) - W) / 2;
      var T = ((screen.height) - H) / 2;
    }
    window.open(URL, '', 'width=' + W + ',height=' + H + ',left=' + L + ',top=' + T + ',resizable=no,scrollbars=' + S + '');
}
