
var isDOM=document.getElementById?1:0;
var isIE=document.all?1:0;
var isNS4=navigator.appName=='Netscape'&&!isDOM?1:0;
var isIE4=isIE&&!isDOM?1:0;
var isOp=window.opera?1:0;
var isDyn=isDOM||isIE||isNS4;

function getRef(id, par)
{
 par=!par?document:(par.navigator?par.document:par);
 return isIE ? par.all[id] :
  (isDOM ? (par.getElementById?par:par.ownerDocument).getElementById(id) :
  (isNS4 ? par.layers[id] : null));
}

function getSty(id, par)
{
 var r=getRef(id, par);
 return r?(isNS4?r:r.style):null;
}

if (!window.LayerObj) var LayerObj = new Function('id', 'par',
 'this.ref=getRef(id, par); this.sty=getSty(id, par); return this');
function getLyr(id, par) { return new LayerObj(id, par) }

function LyrFn(fn, fc)
{
 LayerObj.prototype[fn] = new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px"; ' +
  'with (this) { '+fc+' }');
}
LyrFn('x','if (!isNaN(p)) sty.left=p+px; else return parseInt(sty.left)');
LyrFn('y','if (!isNaN(p)) sty.top=p+px; else return parseInt(sty.top)');
LyrFn('w','if (p) (isNS4?sty.clip:sty).width=p+px; ' +
 'else return (isNS4?ref.document.width:ref.offsetWidth)');
LyrFn('vis','sty.visibility=p');
LyrFn('write','if (isNS4) with (ref.document){write(p);close()} else ref.innerHTML=p');


var CSSmode=document.compatMode;
CSSmode=(CSSmode&&CSSmode.indexOf('CSS')!=-1)||isDOM&&!isIE||isOp?1:0;

if (!window.page) var page = { win: window, minW: 0, minH: 0, MS: isIE&&!isOp,
 db: CSSmode?'documentElement':'body' }

page.winW=function()
 { with (this) return Math.max(minW, MS?win.document[db].clientWidth:win.innerWidth) }
page.winH=function()
 { with (this) return Math.max(minH, MS?win.document[db].clientHeight:win.innerHeight) }


function checkDivs()
{
 if (!isDyn) return;
 
 for (var i = 1; i <= visQuotes; i++)
 {
  // Get a layer object if it doesn't exist, and work with it.
  if (!sDivs[i])
  {
   sDivs[i] = getLyr('sDiv' + i);
   if (isIE4) sDivs[i].w(10);
  }

  with (sDivs[i])
  {
   if (x() < (0 - w()))
   {
    var rnd = Math.random();

    speed[i] = minSpeed + rnd*(maxSpeed-minSpeed);
    qPos[i] = page.winW() + 50*Math.random();
 
    var fontSize = parseInt(minSize + rnd*(maxSize-minSize));

    var topMax = page.winH() - (isIE?5:20) - fontSize;
    y(topMax * Math.random());
    sty.zIndex = speed[i];

    var col = colours[Math.floor(rnd*colours.length)];
    var selquote = quotes[Math.floor(Math.random() * quotes.length)];

    var str = isNS4 ? '<font face="'+fontFace+'" point-size="'+fontSize+'" color="#'+col+
     '">'+selquote+'</font>' : '<span style="font-family: '+fontFace+'; font-size: '+fontSize+
     'px; color: '+col+'">'+selquote+'</span>';

    write('<nobr>' + str + '</nobr>');
   }

   qPos[i] -= speed[i];
   x(qPos[i]);
  }
 }

 // Again!
 setTimeout('checkDivs()', 50);
}



// Just cut and paste your quotes into this array:

var quotes = new Array(); c = 0;
quotes[c] = 'Khánh Hà - Vũ Khanh'; c++;
quotes[c] = 'Bread - Carpenters - Paul Davis'; c++;
quotes[c] = 'Dalida - Christophe - Sylvie Vartan'; c++;
quotes[c] = 'Ý Lan - Thanh Hà'; c++;
quotes[c] = 'Beatles - Platters - Lobo - Chicago'; c++;
quotes[c] = 'Leo Sayer - Eagles - America'; c++;
quotes[c] = 'Lan Anh - Tuấn Ngọc'; c++;
quotes[c] = 'Ngọc Lan'; c++;
quotes[c] = 'Billy Joel - Air Supply - Bee Gees'; c++;
quotes[c] = 'Diana Ross - John Lennon'; c++;
quotes[c] = 'Al Stewart - Marry McGregor'; c++;
 

// Maximum onscreen at once, also number of DIVs in body -- change that too!
var visQuotes = 10;

// Set the minimum and maximum quote speeds and font sizes.
// var minSpeed = 3, maxSpeed = 15, minSize = 8, maxSize = 32;
var minSpeed = 3, maxSpeed = 5, minSize = 8, maxSize = 32;

//  Left: Low speed colours (lighter) .... Right: High speed colours (darker).
var colours = new Array('B2C7DE','A4BCD8','96B2D2','88A8CC','7A9EC6','6C94C0','5E89BA');

// Fonts, of course, a comma-separated list is fine.
var fontFace = 'Arial, Helvetica';

// Just leave these, some global arrays are needed to remember quote details.
var sDivs = new Array(visQuotes);
var speed = new Array(visQuotes);
var qPos = new Array(visQuotes);



// Finally trigger quotation scrolling on page load.
// Remember to call all onLoad events here somehow (e.g. popup menus/other scripts)...
window.onload = new Function('checkDivs()');

// End Hide -->
