function SuffleBlocks(bl)
{
if(bl.length<2) return; 
l=bl.length-1;
m=parseInt(Math.random()*(l+1)); 
if(m>0) for(i=0; i<m; i++){ a=bl[0]; for(j=1; j<=l; j++) bl[j-1]=bl[j]; bl[l]=a;}
}
//Мигание красной строки
var sR=0,sG=8,sB=8; var blR=255,blG=255,blB=255; var b=true;
function makehex(color)
{hn=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F")
if (color<0) return "00"; else if (color>255) return "FF"; 
else { s=""+hn[Math.floor(color/16)]+hn[color%16]; return s;}
}
function toH(red, green, blue){return makehex(red)+makehex(green)+makehex(blue)}
function RGB(red, green, blue){return toH(red, green, blue)}
function setElementColor(r,g,b,ename){ if(document.all) document.all[ename].style.color=RGB(r,g,b);}
function BlinkIt(ename)
{ if(b==true)
{ if((blR>255)||(blG>255)||(blB>255)) b=false; 
blR+=sR; blG+=sG; blB+=sB; 
} else 
{ if((blR<1) || (blG<1) || (blB<1)) b=true;
blR-=sR; blG-=sG; blB-=sB;
}
setElementColor(blR,blG,blB,ename);
setTimeout("BlinkIt('"+ename+"')", 15)
}




massive_length=2;/*устанавливаешь длинну массива, т.е. сколько цветов будет*/ 
colors_= new Array(massive_length); 
colors_[0] = "black";
colors_[1] = "#ed1c24";
var next_ = 0; 
function Changehead() 
{ 
headcolor= colors_[next_];/*headcolor - переменной устанавливаешь новый цвет*/ 

document.getElementById("head1").style.color=headcolor;/*присваеваешь этот цвет элементу в документе*/ 
next_++; 
if(next_>massive_length-1) next_=0; 
window.setTimeout("Changehead()",450); /*спустя 1 секунду, меняешь цвет на новый, если нужно дольше, то ставишь число больше*/ 
} 


