
var str=" {--} Sieu Thi Sach Online |  Kinh Chao Qui Khach "
comeback=0
cometo=0
function dis()
{
	window.status=str.substring(0,cometo)
	if(comeback==1)
	{
		cometo--;
		if(cometo==0)
		{
			comeback=0;
		}
	}
	else 
	{
		cometo++;
		if(cometo==str.length)
		{
			comeback=1
		}
	}
	window.status=str.substring(0,cometo)+"|";
	if(cometo==str.length)
	{
		window.setTimeout("dis()",3000);
	} 
	else 
	{
		window.setTimeout("dis()",100);
	}
	
}
dis();
//-----------------------------------------------
function SetBlockAd2(strName)
{
    var arrAdTabSub = new Array('Truyen','Music','Audio','Ebook');
    for(it=0;it<4;it++)
    {
        //document.getElementById("Tab" + arrAdTabSub[it]).style.display = "none";
        try
        {
            document.getElementById("Div" + arrAdTabSub[it]).style.display = "none";
            document.getElementById(arrAdTabSub[it]).className = "tabgrey"; 
        }
        catch(error)
        {
			alert(error);
		}
    }
    //-----------------
   // document.getElementById("Tab" + strName).style.display = "block";
    try
    {
        document.getElementById("Div" + strName).style.display = "block";
        document.getElementById(strName).className = "tabgreen";
    }
    catch(error)
    {}
}
//-----------------------------------------------
var itCurrent = Math.floor(Math.random() * 4);
function SetBlockMasterAdRandom()
{
    SetBlockMasterAd2(itCurrent);
}
//-----------------------------------------------
function SetBlockMasterAd2(ArrayInt)
{
    var arrAdTabSub = new Array('Truyen','Music','Audio','Ebook');
    SetBlockAd2(arrAdTabSub[ArrayInt]);
}
//-----------------------------------------------
function SetBlockMaster(count)
{
    if (itCurrent==3 && count==1)
        itCurrent = -1;
    else if (itCurrent==0 && count==-1)
        itCurrent = 4;
    itCurrent += count;
    SetBlockMasterAd2(itCurrent);
}
//-----------------------------------------------
function setHomePage(siteURL) {
  if (document.all)
  {
    document.body.style.behavior = "url(#default#homepage)";
    document.body.setHomePage(siteURL);
  }
  //else
   // alert("only works in IE 4.0 or higher!");
}
//-----------------------------------------------
function SetViewTableDiv(tableName)
{
    var str = AdFindObjectID(tableName + 'Loc').style.display;
    if (str == 'block')
    {
        AdFindObjectID(tableName + 'Loc').style.display = "none";
        AdFindObjectID(tableName).src = "/images/AdImgDown.gif";
    }
    else
    {
        AdFindObjectID(tableName + 'Loc').style.display = "block";
        AdFindObjectID(tableName).src = "/images/AdImgUp.gif";
    }
    
}
//-----------------------------------------------
function AdFindObjectID(idName)
{
	return document.getElementById(idName);
}
//-----------------------------------------------
