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[1] = "فاست تراك: سلسلة من الخدمات السريعة ذات الجودة العالية والأسعار المناسبة لصيانة وإصلاح السيارات ";
tickerTextArray[2] = "بطاقات امارات الذكية - أثير: بطاقات مدفوعة القيمة للشركات الصغيرة و الأفراد... ";
tickerTextArray[3] = "بطاقات امارات الذكية - إم-كاش: أول بطاقات مدفوعة القيمة يمكن إعادة تعبئتها في دبي ... ";
tickerTextArray[4] = "بطاقات امارات الذكية - سفير: بطاقات ائتمانية ذكية -- مفتاحك لإدارة مالية أفضل لإسطول شركتك... ";
//tickerTextArray[0] = "The Green Drive - Emarat leads the way as the UAE goes green and switches to unleaded gasoline. ";
//tickerTextArray[1] = "The Green Drive - Emarat leads the way as the UAE goes green and switches to unleaded gasoline. ";
//tickerTextArray[0] = "New Tender - Open till 9/11/2003: Supply of Tractor Units (6x4)... ";
//tickerTextArray[0] = "New Tender - Open till 2/11/2003: Supply of Jet A1 & Diesel Back Loading Pump... ";
//tickerTextArray[1] = "New Tender - Open till 2/11/2003: Construction of LPG Storage Facilities at Commercial Sites... ";
//tickerTextArray[2] = "New Tender - Open till 2/11/2003: Transpostration of Packed Lubricants... ";
//tickerTextArray[3] = "New Tender - Open till 19/10/2003: Cleaning services at Emarat retail outlets... ";
//tickerTextArray[2] = "Emarat Smart Cards - Safeer: Credit based smart cards.. the key to better financial control of your company fleet...";
//tickerTextArray[3] = "Emarat Smart Cards - Atheer: A pre-paid smart card for small fleets and individual drivers... ";
//tickerTextArray[4] = "Emarat Smart Cards - Em-Cash: The first re-loadable pre-paid card in Dubai... ";