//  
// highlight words on the first title page
//

var i,wi,ld,cy = 0;
var iv = 1200;
var L = 6;
var S = new Array();

var Tcolor = "#aaabaa";
var Tmed   = "#991010";
var Thigh  = "#CC1212";
var Tbg	   = "#FFF";

// ---

function randomInt(min, max){
 if (min >= max) return;
   return Math.floor(((max+1-min) * Math.random())+min);
}

function getRefToDivNest(divID){
  oDoc = document; 
	if (document.layers){
		if(oDoc.layers[divID]){
		   return oDoc.layers[divID];
		}
		else {
		    for (var x = 0, y; !y && x < oDoc.layers.length;x++)
		       y = getRefToDivNest(divID,oDoc.layers[x].document);
		  return y; 
		}
        }
	if (document.getElementById)
	    return document.getElementById(divID);
	if (document.all)
	    return document.all[divID];
   return document[divID];
}


function setdiv(D,S,C,B){
 var oContent = getRefToDivNest(D); 
    if (!oContent)
       oContent = new Object();
    if(typeof(oContent.innerHTML) != 'undefined'){
       oContent.innerHTML = S; 
         if (oContent.style){
   	  oContent.style.backgroundColor = B; 
	  oContent.style.color = C; 
         }
       return; 
    } 	
}



function runshow(){

  if (cy % 4 == 1){
	i = randomInt(0,L);
	ld = i;
	setdiv("d"+i,S[i],Tmed,Tbg);
	setdiv("d"+i,S[i],Thigh,Tbg);
   } 
   if ((cy % 4 == 0) && (ld > -1)){
	setdiv("d"+ld,S[ld],Tmed,Tbg);
	setdiv("d"+ld,S[ld],Tcolor,Tbg);
     }
 cy++;
}

// main
S[0] = "high grade wood metal cottage barstools timeless leather ";
S[1] = "contemporain chaises pierre naturelle plateaux de scole ";
S[2] = "st&uuml;hle gartenst&uuml;hle sessel korbst&uuml;hle hocker und barhocker ";
S[3] = "st&uuml;hle gartenst&uuml;hle sessel korbst&uuml;hle aus metall ";
S[4] = "tendance design pliants ";
S[5] = "tabourets bois etoiles ";
S[6] = "st&uuml;hle gartenst&uuml;hle sessel korbst&uuml;hle und classique trattoria ";

// -----------------------

ld = -1;
wi = window.setInterval("runshow()",iv);
