﻿// JavaScript Document

function InsertFlash(Flash,Width,Height,ID){
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ");
	document.write("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" ");
	document.write("width=\"" + Width + "\" height=\"" + Height + "\" id=\"" + ID + "\">");
	document.write("<param name=\"movie\" value=\"" + Flash + "\">");
	document.write("<param name=\"quality\" value=\"high\">");
	document.write("<param name=\"wmode\" value=\"transparent\">");
	document.write("<embed src=\"" + Flash + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ");
	document.write("type=\"application/x-shockwave-flash\" width=\"" + Width + "\" height=\"" + Height + "\"></embed>");
	document.write("</object>");
}

function openNewWin(winUrl,winName,winWidth,winHeight){
window.open(winUrl,winName,"width="+winWidth+",height="+winHeight+",scrollbars=yes,toolbar=no, status=no, menubar=no, resizable=yes")	
	}
	

function bcastr(xmlFile,width,height){
document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" id=scriptmain name=scriptmain codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/");
document.writeln("flash\/swflash.cab#version=6,0,29,0\" width=\""+width+"\" height=\""+height+"\">");
document.writeln("    <param name=\"movie\" value=\"bcastr.swf?bcastr_xml_url=xml\/bcastr.xml\">");
document.writeln("    <param name=\"quality\" value=\"high\">");
document.writeln("    <param name=scale value=noscale>");
document.writeln("    <param name=\"LOOP\" value=\"false\">");
document.writeln("    <param name=\"menu\" value=\"false\">");
document.writeln("    <param name=\"wmode\" value=\"transparent\">");
document.writeln("    <embed src=\"bcastr.swf?bcastr_xml_url=xml\/"+xmlFile+".xml\" width=\""+width+"\" height=\""+height+"\" loop=\"false\" quality=\"high\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" type=\"application\/x-shockwave-flash\" salign=\"T\" name=\"scriptmain\" menu=\"false\" wmode=\"transparent\"><\/embed>");
document.writeln("  <\/object>");
}

function scoll(){
	var speed=30
	demo2.innerHTML=demo1.innerHTML
	function Marquee(){
	if(demo2.offsetWidth-demo.scrollLeft<=0)
	demo.scrollLeft-=demo1.offsetWidth
	else{
	demo.scrollLeft++
	}
	}
	var MyMar=setInterval(Marquee,speed)
	demo.onmouseover=function() {clearInterval(MyMar)}
	demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
}

function scrollexm(){
	var speed=40;
var exm2=document.getElementById("exm2");
var exm1=document.getElementById("exm1");
var exm=document.getElementById("exm");
exm2.innerHTML=exm1.innerHTML
function Marquee(){
if(exm2.offsetTop-exm.scrollTop<=0)
exm.scrollTop-=exm1.offsetHeight;
else{
exm.scrollTop++;
}
}
var MyMar=setInterval(Marquee,speed);
exm.onmouseover=function() {clearInterval(MyMar)}
exm.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
	}
	
var menuTopMargin = -160;
var menuSpeed = 15;
var timerSpeed = 200;
var timer;
var heightLimit = 0;

function checkMenu() {
if(document.body.offsetHeight > heightLimit) {
var reTimer = timerSpeed;
var startPoint = parseInt(document.all.sMenu.style.top,10);
var endPoint = document.body.scrollTop;
endPoint = (menuTopMargin <= endPoint ) ? endPoint - menuTopMargin : 0;
if(startPoint != endPoint) {
moveAmount = Math.ceil(Math.abs(endPoint - startPoint) / 15);
document.all.sMenu.style.top = parseInt(document.all.sMenu.style.top,10) + ((endPoint<startPoint) ? -moveAmount : moveAmount);
reTimer = menuSpeed;
}
} else document.all.sMenu.style.top = 0;
timer = setTimeout("checkMenu();",reTimer);
}

function initMenu() {
if(document.body.offsetHeight > heightLimit) document.all.sMenu.style.top = document.body.scrollTop;
checkMenu();
document.all.sMenu.style.left = (897)+"px";
}

