﻿// JavaScript Document
function insertFlash(Flash,Width,Height){
	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 + "\">");
	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 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 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)}
}


var menuTopMargin = -187;
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 = ((document.body.clientWidth - 1003) /2 + 897)+"px";
}
var menuYloc;
$(document).ready(function(){
	menuYloc = $("#sMenu").offset().top;
}); 
$(window).scroll(function (){ 
	var offsetTop = menuYloc + $(window).scrollTop() +"px"; 
	$("#sMenu").animate({top : offsetTop },{ duration:600 , queue:false }); 
}); 

