$(this).ready(function() {
	if($('#header_announcement')!= null){
		$('#header_announcement').animate({top:'+='+($('#header_announcement').height()+5)},1000);
		setTimeout('closeBanner()', 20000);
	}
});

function closeBanner()
{
	$('#header_announcement_holder').fadeOut();
}

function indexof(arr, val)
{
    for (var i = 0; i < arr.length; i++) {
      if (arr[i] == val) {
        return i;
      }
    }
    return -1;
}

function swapImage()
{
    if( shown1.length==max ) shown1 = [];
    while( indexof(shown1,cur) != -1 )
        { cur = Math.ceil(max*Math.random()); }
    shown1.push(cur);

    if( shown2.length==maxtext ) shown2 = [];
    while( indexof(shown2,curtext) != -1 ) curtext = Math.ceil(maxtext*Math.random());
    shown2.push(curtext);

    for( var i = 0; i <= max; i++ )
    {
        $('#photo' + i).hide();
        $('#quote' + i).hide();
    }

    for( var i = 0; i <= maxtext; i++ )
    {
        $('#text' + i).hide();
    }

    $('#photo' + cur).fadeIn();
    $('#quote' + cur).fadeIn();
    $('#text' + curtext).fadeIn();
}

function whatsthis(ele)
{
	$('#whatsthis_'+ele).colorbox({open: true, inline:true, title: $('#whatsthis_'+ele).attr('rel'), href:$('#whatsthis_'+ele)});
}