pic1 = new Image(12, 12); 
pic1.src = "http://www.vyrobavideoklipu.cz/graph/doton.gif"; 

objects = new Array();

objects[0] = new Object();
objects[0].text = "Výroba Videoklipů";
objects[0].animIndex = -10;
objects[0].animStep = 0.5;
objects[0].resetValue = -10;
objects[0].hiliteStyle = "letterHilite";
objects[0].htmlId = "mainHeader";

objects[1] = new Object();
objects[1].text = "záznamy koncertů, společenských událostí...";
objects[1].animIndex = -6;
objects[1].animStep = 0.75;
objects[1].resetValue = -6;
objects[1].hiliteStyle = "letterHilite2";
objects[1].htmlId = "hsub1";

objects[2] = new Object();
objects[2].text = "postprodukční práce, digitální triky a efekty, klíčování, 3D animace a více...";
objects[2].animIndex = -15;
objects[2].animStep = 1;
objects[2].resetValue = -15;
objects[2].hiliteStyle = "letterHilite3";
objects[2].htmlId = "hsub2";


function getStringPrefix(str, step)
{
    if (step == 0)
      return "";
    else
      return str.substring(0, step);
}


function getStringSuffix(str, step)
{
    if (step >= str.length-1)
      return "";
    else
      return str.substring(step+1, str.length);
}


function animateText(objIndex)
{
    var stepCounter = objects[objIndex].animIndex;
    var id = objects[objIndex].htmlId;
    var str = objects[objIndex].text;

    if (stepCounter >= 0)
       document.getElementById(id).innerHTML = getStringPrefix(str, stepCounter)+'<span class="'+objects[objIndex].hiliteStyle+'">'+str.charAt(stepCounter)+'<\/span>'+getStringSuffix(str, stepCounter);

    if (stepCounter == objects[objIndex].resetValue)
    {
        document.getElementById(id).innerHTML = str;
    }

    stepCounter+=objects[objIndex].animStep;
    if (stepCounter >= str.length)
    {
        stepCounter = objects[objIndex].resetValue;
    }

    objects[objIndex].animIndex = stepCounter;
}


function startAnim()
{
    animateText(0);
    animateText(1);
    animateText(2);
    ///////////////////////////
    setTimeout("startAnim()", 60);
}


function menuItemOn(id)
{
    document.getElementById(id).src="http://www.vyrobavideoklipu.cz/graph/doton.gif";
}

function menuItemOff(id)
{
    document.getElementById(id).src="http://www.vyrobavideoklipu.cz/graph/dot.gif";
}


function bar(url)
{
    wasOpen  = false;
    win = window.open(url);    
    return (typeof(win)=='object')?true:false;
}


