// JavaScript Document

var vmsDelay='8000'; //how long the script will wait before scrolling next message in millisecond (1 second = 1,000 millisecond).
var vmsWidth='560px'; //the width of the scroll box.
var vmsHeight='80px'; //the height of the scroll box.
var vmsBGColor='none'; //the background color of the scroll box.
var vmsBGImage=''; //the background image of the scroll box. For example, your_image.gif.

//specifies scrolling messages here.
var vmsMsgList=new Array();
vmsMsgList[0]="&#8220;We have been extremely impressed with the overall service given by Allied Lifts, especially in terms of call out response and level of preventative maintenance to our lift portfolio.&#8221;<br /><strong>NHS Client</strong>";
vmsMsgList[1]="&#8220;To date we have been very happy with the service provided by Allied Lifts in terms of their consultancy expertise and delivery of their contract.&#8221;<br /><strong>Private building contractor</strong>";
vmsMsgList[2]="&#8220;Working with Allied Lifts is so simple and straight forward, the account management has allowed us to develop a relationship based on trust over the years.&#8221;<br /><strong>Nursing Home client</strong>";
vmsMsgList[3]="&#8220;What can I say, our lift has not broken down for almost two years!&#8221;<br /><strong>Residential Management Agent</strong>";
vmsMsgList[4]="&#8220;Allied Lifts have been very helpful in making sure we got up to date with our DDA requirements in a cost effective and efficient manner.&#8221;<br /><strong>Local Authority Client</strong>";
vmsMsgList[5]="&#8220;We have recently had a major refurbishment on one of the lifts and the Project Management of this was carried out in a professional and efficient manner meaning our lift was completed ahead of works programme and to the highest standard. We will definitely be working together again in the near future.&#8221;<br /><strong>NHS Client</strong>";


//DO NOT CHANGE ANYTHING BELOW.

var vmsIE4=document.all;
var vmsDOM=document.getElementById;
i=(vmsMsgList.length>2)?2:0;

function vmsscroll(vmspDIV){
	vmsoDIV=eval(vmspDIV);
	if (parseInt(vmsoDIV.style.top)>0&&parseInt(vmsoDIV.style.top)<=5){
		vmsoDIV.style.top=0+"px";
		setTimeout("vmsscroll(vmsoDIV)",vmsDelay);
		setTimeout("vmsscroll2(vmsoDIV2)",vmsDelay);
		return;
	}
	if (parseInt(vmsoDIV.style.top)>=vmsoDIV.offsetHeight*-1){
		vmsoDIV.style.top=parseInt(vmsoDIV.style.top)-5+"px";
		setTimeout("vmsscroll(vmsoDIV)",50);
	}
	else{
		vmsoDIV.style.top=parseInt(vmsHeight)+"px";
		vmsoDIV.innerHTML=vmsMsgList[i];
		if(i==vmsMsgList.length-1){
			i=0;
		}
		else{
			i++;
		}
	}
};

function vmsscroll2(vmspDIV){
	vmsoDIV2=eval(vmspDIV);
	if (parseInt(vmsoDIV2.style.top)>0&&parseInt(vmsoDIV2.style.top)<=5){
		vmsoDIV2.style.top=0+"px";
		setTimeout("vmsscroll2(vmsoDIV2)",vmsDelay);
		setTimeout("vmsscroll(vmsoDIV1)",vmsDelay);
		return;
	};
	if (parseInt(vmsoDIV2.style.top)>=vmsoDIV2.offsetHeight*-1){
		vmsoDIV2.style.top=parseInt(vmsoDIV2.style.top)-5+"px";
		setTimeout("vmsscroll2(vmsoDIV2)",50);
	}
	else{
		vmsoDIV2.style.top=parseInt(vmsHeight)+"px";
		vmsoDIV2.innerHTML=vmsMsgList[i];
		if(i==vmsMsgList.length-1){
			i=0;
		}
		else{
			i++;	
		}
	}
};

function vmsstart(){
	vmsoDIV1=vmsIE4?VMSDIV1:document.getElementById("VMSDIV1");
	vmsoDIV2=vmsIE4?VMSDIV2:document.getElementById("VMSDIV2");
	vmsscroll(vmsoDIV1);
	vmsoDIV2.style.top=vmsHeight;
	vmsoDIV2.style.visibility='visible';
};

if (vmsIE4||vmsDOM){
	document.writeln('<div id="VMS" style="position:relative;width:'+vmsWidth+';height:'+vmsHeight+';overflow:hidden;background-color:'+vmsBGColor+' ;background-image:url('+vmsBGImage+')">');
	document.writeln('<div style="position:absolute;width:'+vmsWidth+';height:'+vmsHeight+';clip:rect(0 '+vmsWidth+' '+vmsHeight+' 0);left:0px;top:0px">');
	document.writeln('<div id="VMSDIV1" style="position:absolute;width:'+vmsWidth+';left:0px;top:1px;">');
	document.write(vmsMsgList[0]);
	document.writeln('</div>');
	document.writeln('<div id="VMSDIV2" style="position:absolute;width:'+vmsWidth+';left:0px;top:0px;visibility:hidden">');
	document.write(vmsMsgList[(vmsMsgList.length==1)?0:1]);
	document.writeln('</div></div></div>');
};

if (window.addEventListener){
	window.addEventListener("load", vmsstart, false);
}else if (window.attachEvent){
	window.attachEvent("onload", vmsstart);
}else if (vmsIE4||vmsDOM){
	window.onload=vmsstart;
};
