
function DesInit() {
	ScrollDoc();
	setInterval(DesAnimate,100);
};

function ScrollDoc() {
  var ww;
  var maxw=1680;
  var minw=1000;
  var $i=0;
	if ($browser=='IE' || $browser=='Opera') {
		if (document.body && (document.body.clientWidth)) {
			ww = document.body.clientWidth;
		} else { (document.documentElement && (document.documentElement.clientWidth))
			ww = document.documentElement.clientWidth;
		};
	} else {
		ww = window.innerWidth;
	};
  if (ww < minw) {
	$hshift=0; $hscale=minw;
  };
  if (ww >= minw && ww <= maxw) {
	$hshift=0; $hscale=ww;
  };
  if (ww > maxw) {
	$hshift=0; $hscale=maxw;
	if ($browser!=='IE') {
		$hshift = (window.innerWidth-$hscale)*0.5;
	} else {
		if (document.body && (document.body.clientWidth)) {
			$hshift = (document.body.clientWidth-$hscale)*0.5;
		} else { (document.documentElement && (document.documentElement.clientWidth))
			$hshift = (document.documentElement.clientWidth-$hscale)*0.5;
		};

	};
  };
  document.getElementById('tmain').style.width = $hscale+"px";
  document.getElementById('thead1').style.width = $hscale+"px";
  document.getElementById('thead2').style.width = $hscale+"px";
  document.getElementById('tfoot').style.width = $hscale+"px";
  document.getElementById('mainsitetd').style.width = ($hscale-44-264)+"px";
  document.getElementById('floatcont').style.width = ($hscale-628-12)+"px";
  document.getElementById('headmenu').style.width = ($hscale-318-72)+"px";
  document.getElementById('tsearch').style.left = ($hscale-276)+"px";
  document.getElementById('maincont').style.left = $hshift+"px";
  document.getElementById('dtext1').style.left = ($hscale-345-352-24)+"px";
  document.getElementById('dtext2').style.left = ($hscale-352-19)+"px";
  if ($gal_cnt > 0) {
	$gal_max = Math.round(($hscale-84-264)/220);
	for ($i=1;$i<=$gal_cnt;$i++) {
		if ($i<=$gal_max) {
			document.getElementById("gal"+$i).style.display="";
		} else {
			document.getElementById("gal"+$i).style.display="none";
		};
	};
  };
//FC
   if ($hscale < 1300) {
   	$fsize = 12 - Math.round((1300-$hscale)/70);
     for ($i=1;$i<5;$i++)   {
   	document.getElementById('fclbl'+$i).style.fontSize = $fsize + "pt";
   	document.getElementById('fctel'+$i).style.fontSize = $fsize + "pt";
     };
   };
  document.getElementById('maincont').style.display = "block";
};

function DesAnimate() {
	var $trainClipR=92; $trainClipL=0;
	var $plainClipR=54; var $plainClipL=0;
	var $i=0;
	if ($trainD == 0) {
		$trainX = $trainX + 2;
	} else {
		$trainD--;
	};
	if ($trainX > 288) {$trainX = -92+12; $trainD=100;};
	if ($trainX < 12) $trainClipL = 12-$trainX;
	if ($trainX > 288-92) $trainClipR = 92-($trainX-288+92);
	document.getElementById('train').style.clip = "rect(0px " + $trainClipR + "px 12px " + $trainClipL + "px)";
	document.getElementById('train').style.left = $trainX+"px";

	if ($plainD == 0) {
		$plainX = $plainX - 4;
		if ($plainX < 296-54) {$plainD=150;};

	} else {
		$plainD--;
		if ($plainD == 0) $plainX = $hscale-20;
	};
	if ($plainX > $hscale-12-54) {
		$plainClipR = 54-($plainX-$hscale+66);
		document.getElementById('plain').style.width=$plainClipR + "px";
		document.getElementById('iplain').style.width=$plainClipR + "px";
	} else {
		document.getElementById('plain').style.width="54px";
		document.getElementById('iplain').style.width="54px";
	};
	if ($plainX < 296) $plainClipL = (296-$plainX);
	document.getElementById('plain').style.clip = "rect(0px " + $plainClipR + "px 14px " + $plainClipL + "px)";
	document.getElementById('plain').style.left = $plainX;


	if ($FirstFrame==0) {
		$FirstFrame = 1;
		document.getElementById('train').style.display="block";
		document.getElementById('plain').style.display="block";
	};
}

function hmhl($id) {
	document.getElementById('hmtd'+$id).style.backgroundPosition = "center 10px";
	document.getElementById('hmanch'+$id).style.color = "#ffef84";
	document.getElementById('hmanch'+$id).style.textDecoration = "underline";
}

function hmclear($id) {
	document.getElementById('hmtd'+$id).style.backgroundPosition = "center 30px";
	document.getElementById('hmanch'+$id).style.color = "#ece6be";
	document.getElementById('hmanch'+$id).style.textDecoration = "none";
}
function bthl($id) {
	document.getElementById($id).style.backgroundPosition = "0px 64px";
}

function btclear($id) {
	document.getElementById($id).style.backgroundPosition = "0px 0px";
}