function Timeline() 
{
	this.ids = new Array();
	this.num = 0;
	this.timecounter = 0;        
    this.Append = function( func, interval ) 
    {
        this.ids[this.num++] = setTimeout( func, this.timecounter );
        this.timecounter = this.timecounter + interval;
    };
    this.Sleep = function( interval ) 
    {
        this.timecounter = this.timecounter + interval;
    };
    this.Stop = function()
    {
		for( var i = 0; i < this.ids.length; i++ )
		{
			clearTimeout( this.ids[i] );
		}
		this.ids = new Array();
    };    
}

function Repeater()
{
	this.id = 0;
	this.Start = function( func, interval ) 
    {
		setTimeout( func, 0 );		
		this.id = setInterval( func, interval );
    };
    this.Stop = function()
    {
		if( this.id != 0 )
		{
			clearInterval( this.id );
		}
    };
}

function show(id)
{
	document.getElementById(id).style.visibility='visible';
}

function hide(id)
{
	document.getElementById(id).style.visibility='hidden';
}

function ov(img)
{
	var i=img.src.lastIndexOf('.');
	var sExt = img.src.substring(i, img.src.length);
	img.src=img.src.substring(0, img.src.length - 2 - sExt.length) + "ov" + sExt;
}

function ot(img)
{	
	var i=img.src.lastIndexOf('.');
	var sExt = img.src.substring(i, img.src.length);
	img.src=img.src.substring(0, img.src.length - 2 - sExt.length) + "ot" + sExt;
}

function opacity(id, opacStart, opacEnd, millisec) 
{
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) 
    {
        for(i = opacStart; i >= opacEnd; i--) 
        {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } 
    else if(opacStart < opacEnd) 
    {
        for(i = opacStart; i <= opacEnd; i++)
        {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) 
{
    var object = document.getElementById(id).style;
	if(opacity == 0)
	{
		object.visibility = 'hidden';
	}
	else
	{
		object.visibility = 'visible';
	}
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function goToPage( url )
{
	document.getElementById( 'frame_content' ).src = url;
}