var tickerTextArray = new Array();
var tickerCount = 0;
var tickerLine = 0;
var IsMac,IE4,NS4,IE5,NS6;
var availableHeight,availableWidth;
var blinkStatus = false;
var blinkChar;
var tickerID;
function checkBrowser() {
//check client browser type
var agt=navigator.userAgent.toLowerCase();
isMac = (agt.indexOf("mac")!=-1);
IE4 = (document.all && !document.getElementById) ? true : false;
NS4 = (document.layers) ? true : false;
IE5 = (document.all && document.getElementById) ? true : false;
NS6 = (document.getElementById && !document.all) ? true : false;
}
checkBrowser();
function setLayerObject(objID,left,top,visibility) {
//set visibilities and position of objects
if (IE5 || NS6) {
this.obj = document.getElementById(objID).style;
this.obj.left = left;
this.obj.top = top;
this.obj.visibility = visibility;
}
else if(IE4) {
this.obj = document.all[objID].style;
this.obj.left = left;
this.obj.top = top;
this.obj.visibility = visibility;
}
else if(NS4) {
this.obj = document.layers[objID];
this.obj.left = left;
this.obj.top = top;
this.obj.visibility = visibility;
}
}
function startTicker() {
//this used for NS to clear the timer on a reload
if (!tickerID) {clearInterval(tickerID);}
tickerID = setInterval("textTicker()",85);
}
function textTicker() {
//blink status used to display flashing cursor
blinkStatus = !blinkStatus;
blinkChar = (blinkStatus) ? "_" : " ";
var displayString = tickerTextArray[tickerLine];
var tempDisp = displayString.substr(0,tickerCount);
//rip out HTML tags and process them...
var addStr = "";
//find first <
if (displayString.charAt(tickerCount) == "<") {
while (displayString.charAt(tickerCount)!= ">") {
addStr=addStr+displayString.charAt(tickerCount);
tickerCount++;
}
addStr+=">";
}
if (IE4 || IE5) {
document.all.tickerLayer.innerHTML = ""+tempDisp+addStr+blinkChar+"";
}
else {
with (document.layers['tickerLayer'].document) {
open();
write(""+tempDisp+blinkChar+"");
close();
}
}
//check to see if come to end of display string.. if so, start again..
if ( tickerCount > displayString.length) {
tickerLine++;
//check to see if come to end of array of strings, if so, start again...
if (tickerLine == tickerTextArray.length) {
tickerCount = 0;
tickerLine = 0;
}
tickerCount = 0;
}
else {
tickerCount++;
}
}
function getScreenDimensions() {
//get screen dimensions (mainly to positioning floating layers
if(NS4 || NS6) {
availableWidth=window.innerWidth;
availableHeight=window.innerHeight;
}
else {
//only works after the BODY tag has been processed
availableWidth=document.body.offsetWidth;
availableHeight=document.body.offsetHeight;
}
}
function positionLayer(objID,x,y) {
//position layer relative to the actual size of the screen
getScreenDimensions();
//this grabs the dimensions of the screen when resizing occurs and calculates
//the correct positioning of the scrolling layer accordingly.
var addX = ((availableWidth - 451)/2);
var tempX = x + addX;
if (tempX
//
//
tickerTextArray[0] = "Honored: 2 Emarat service stations honored with Certificates of Appreciation from RAk ";
tickerTextArray[1] = "Fasttrack: Unique concept in the vehicle servicing ";
tickerTextArray[2] = "Emarat Smart Cards - Em-Cash: The first re-loadable pre-paid card in Dubai... ";
tickerTextArray[3] = "Emarat Smart Cards – Safeer: Credit based smart cards.. the key to better financial control of your company fleet... ";
tickerTextArray[4] = "Emarat Smart Cards – Atheer: A pre-paid smart card for small fleets and individual drivers... ";
//tickerTextArray[1] = "New Tender - Open till 25/01/2004: Redevelopment of 'Gulf' filling station in Ajman. ";
//tickerTextArray[2] = "New Tender - Open till 18/01/2004: Repairs and painting of EGPC/Emarat retail outlets. ";
//tickerTextArray[3] = "To view all open tenders, Select 'Trading with Emarat - Tenders from the menu below... ";
//tickerTextArray[4] = "Emarat Smart Cards - Safeer: Credit based smart cards.. the key to better financial control of your company fleet... ";
//tickerTextArray[5] = "Emarat Smart Cards - Atheer: A pre-paid smart card for small fleets and individual drivers... ";
//tickerTextArray[6] = "Emarat Smart Cards - Em-Cash: The first re-loadable pre-paid card in Dubai... ";