var pausebetweenmsg=10 //customize pause in miliseconds between each message showing up (3000=3 seconds)
var glidespeed=2 //customize glide speed in pixels per frame.


function actualstyle(el, cssproperty){
if (el.currentStyle)
return el.currentStyle[cssproperty]
else if (window.getComputedStyle){
var elstyle=window.getComputedStyle(el, "")
return elstyle.getPropertyValue(cssproperty)
}
}


function onebyoneglide(eleid){
glidearray=new Array();
glidearray[0] = document.getElementById(eleid);
//if (curobjindex<glidearray.length)
        glidetimer=setInterval("glideroutine()",50)
}

function glideroutine(){
if (parseInt(actualstyle(glidearray[0], "left"))<0)
glidearray[0].style.left=parseInt(actualstyle(glidearray[0], "left"))+50+"px"
else{
glidearray[0].style.left=0;
//curobjindex++
clearInterval(glidetimer);
//setTimeout("onebyoneglide()", pausebetweenmsg)
}
}

var newslist=new Array();
var cnt=0;			// current news item
var curr = "";
var i=-1;			// current letter being typed


newslist[0]=new Array("&ldquo;We were so thrilled with the results we achieved by advertising the Bath Christmas Market on ChristmasMarkets.com. Nearly 7,000 people clicked through to our page, and the level of interest in or own website increased accordingly. Our advert really helped raise the profile of our market. &rdquo; <p>Bath Tourism</p>");

newslist[1]=new Array("&ldquo;We organise Christmas Markets in Canterbury, London Eye, Glasgow & Hyde Park. The web stats show that nearly 10,000 people clicked on some of our pages, and that meant more clickthroughs to our own site. We love the service provided, are extremely satisfied with the outcome of our advert, and will definitely be advertising again. &rdquo; <p>Event Organiser</p>");

newslist[2]=new Array("&ldquo;Our response rates from christmasmarkets.com showed a significant interest in Birmingham's Frankfurt Christmas Market - no doubt increasing awareness and acting as one of the contributing factors to the amazing footfall of 2.8million.  In addition, many people also clicked through to local hotels and other tourist events and attractions on our website, helping to increase tourism for the city.&rdquo; <p>Head of International and Local Events for Birmingham City Council.</p>");

newslist[3] = new Array("&ldquo;We are proud to be providers of quality festive breaks in association with ChristmasMarkets.com. Last season saw huge increases in the amount of traffic generated through ChristmasMarkets.com. With our increased portfolio and recent developments to the site, we are looking to better these figures in 2009 and in  future years. &rdquo; <p>Newmarket Holidays</p>");

newslist[4] = new Array("&ldquo;We have enjoyed a successful partnership with Christmas Markets over the past few years. They are open to new ideas, always on the ball, and able to implement changes quickly and effectively. In fact, the team at Christmas Markets are a pleasure to work with. &rdquo; <p>Bookings.com</p>");



function newsticker()
{
  //cnt = rand(newslist.length);
  cnt = Math.floor(Math.random()*newslist.length)
  // next text
  document.getElementById("mtxt").style.left = -500 + "px";
  document.getElementById("mtxt").innerHTML = "<span style='color:#13588E; font-weight:bold;'></span>&nbsp;" + newslist[cnt] ;
  
  onebyoneglide("mtxt");

  // new item
  i = -1; curr = "";
  //if (cnt<newslist.length-1)
    //cnt++;
  //else
    //cnt=0;
  setTimeout('newsticker()',10000)
}

//function newsticker()
//{
//  // next character of current item
//  if (i < newslist[cnt][0].length - 1)
//  {
//    i++;
//    temp1 = newslist[cnt][0];
//    temp1 = temp1.split('');
//    curr = curr+temp1[i];
//    temp2 = newslist[cnt][1];
//    //mtxt.innerHTML = "<strong><font color='#ffffff' size='2'>LATEST NEWS ...&nbsp;&nbsp;"+curr+"_</font><strong>";
//    document.getElementById("mtxt").innerHTML = "<span style='color:#13588E; font-weight:bold;'>Latest News ...</span>&nbsp;" + curr+"...";
//	setTimeout('newsticker()',25)
//    return;
//  }
//  // new item
//  i = -1; curr = "";
//  if (cnt<newslist.length-1)
//    cnt++;
//  else
//    cnt=0;
//  setTimeout('newsticker()',5000)
//}
//  End -->



// Generate random number
function rand(n) {
seed = (0x015a4e35*seed) % 0x7fffffff;
return (seed >>6) %n;
}

var now= new Date()
var seed= now.getTime() % 0xffffffff



if (window.addEventListener)
window.addEventListener("load", newsticker, false)
else if (window.attachEvent)
window.attachEvent("onload", newsticker)
else if (document.getElementById)
window.onload=newsticker