var downLayerId;
var dropDegree = 10;
var doDirect;
var DirectTerm = 3500;
var curDropIdx = 0;

function DirectDown()
{
    clearInterval(doDirect);
    clearInterval(downLayerId);
    
    for(i = curDropIdx ;i < document.all["DropHit"].length + curDropIdx;i++)
    {
        document.all["DropHit"][i%document.all["DropHit"].length].style.posTop = document.all["DropHit"][i%document.all["DropHit"].length].style.posHeight * (-1*((i-curDropIdx)%document.all["DropHit"].length));
    }  
    
    var temp = 'setInterval("DownLayer()",13)';                            
    downLayerId = eval(temp);
    direction = "down";
}

function DownLayer()
{
    if(document.all["DropHit"][curDropIdx].style.posTop < document.all["DropHit"][curDropIdx].style.posHeight)
    {
        for(j = curDropIdx ;j < document.all["DropHit"].length + curDropIdx;j++)
        {
            document.all["DropHit"][j%document.all["DropHit"].length].style.posTop += dropDegree;
        }
    }
    else
    {
        clearInterval(downLayerId);
        
        for(j = curDropIdx ;j < document.all["DropHit"].length + curDropIdx;j++)
        {
            document.all["DropHit"][j%document.all["DropHit"].length].style.posTop = document.all["DropHit"][j%document.all["DropHit"].length].style.posHeight *((-1*((j-curDropIdx)%document.all["DropHit"].length))+1);
        }
        curDropIdx = (curDropIdx + 1) ;
        curDropIdx = curDropIdx > document.all["DropHit"].length-1 ? curDropIdx%document.all["DropHit"].length:curDropIdx;
        var temp = 'setInterval("DirectDown()",DirectTerm)';
        doDirect = eval(temp);
    }
}

function rolling(s) {
    clearInterval(doDirect);
    clearInterval(downLayerId);
	if(s==1) {
    	var temp = 'setInterval("DownLayer()",13)';                            
    	downLayerId = eval(temp);
    	direction = "down";	
	}
}

function openflash(width,height,src){ 
    return "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width="+width+" height="+height+"><param name=movie value="+src+"><param name=quality value=high ><param name=wmode value=Transparent><embed src="+src+" quality=high  pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width="+width+" height="+height+"></embed></object>"; 
} 

function writeflash(src){ 
    document.write(src); 
} 
