﻿var speedProtect=25;
var recordIndexProtect = 0;
var demoProtect=document.getElementById("DivDemoProtect");
var demo2Protect=document.getElementById("DivDemo2Protect");
var demo1Protect=document.getElementById("DivDemo1Protect");
var MyMarProtect;
demo2Protect.innerHTML=demo1Protect.innerHTML
function MarqueeProtect(totalProtect)
{
	if(recordIndexProtect >= demo1Protect.offsetHeight / totalProtect -1)
	{
		recordIndexProtect = 0;
	}
	else
		recordIndexProtect ++;
	if(demo2Protect.offsetTop-demoProtect.offsetTop-demoProtect.scrollTop<=0)
	{
		demoProtect.scrollTop-=demo1Protect.offsetHeight;
		demoProtect.scrollTop++;
	}
	else
		demoProtect.scrollTop++;
}
function startRollProtect(totalProtect)
{
	MyMarProtect=setInterval("MarqueeProtect("+totalProtect+")",speedProtect);
}

function stopRollProtect(totalProtect)
{
	clearInterval(MyMarProtect);
	setTimeout("startRollProtect("+totalProtect+")",0);
}

function pauseRollProtect(totalProtect)
{
	clearInterval(MyMarProtect);
}

function continueRollProtect(totalProtect)
{
	startRollProtect(totalProtect);
}

var speedPay=25;
var recordIndexPay = 0;
var demoPay=document.getElementById("DivDemoPay");
var demo2Pay=document.getElementById("DivDemo2Pay");
var demo1Pay=document.getElementById("DivDemo1Pay");
var MyMarPay;
demo2Pay.innerHTML=demo1Pay.innerHTML
var countPayMar = 0;
function MarqueePay(totalPay)
{
	if(recordIndexPay >= demo1Pay.offsetHeight / totalPay -1)
	{
		recordIndexPay = 0;
	}
	else
		recordIndexPay ++;
	if(demo2Pay.offsetTop-demoPay.offsetTop-demoPay.scrollTop<=0)
	{
		demoPay.scrollTop-=demo1Pay.offsetHeight;
		demoPay.scrollTop++;
	}
	else
		demoPay.scrollTop++;
}
function startRollPay(totalPay)
{
	MyMarPay=setInterval("MarqueePay("+totalPay+")",speedPay);
	countPayMar ++;
}

function stopRollPay(totalPay)
{
	clearInterval(MyMarPay);
	setTimeout("startRollPay("+totalPay+")",0);
}

function pauseRollPay(totalPay)
{
	clearInterval(MyMarPay);
	countPayMar --;
}

function continueRollPay(totalPay)
{
	startRollPay(totalPay);
}


