
function setVideo(videofile, autoplay)
{
flowplayer("player", "/js/flowplayer/flowplayer-3.2.5.swf", {
clip: {
    url: videofile,
    autoPlay: autoplay,
    autoBuffering: autoplay
},
canvas: {backgroundColor: "#cceb24"},

plugins: {
   controls: {
      bufferColor: '#cceb24',

      buttonOverColor: '#425e02',
      sliderGradient: 'none',
      backgroundGradient: [0.1,0.2,0.5],
      borderRadius: '0',
      durationColor: '#fdfdfc',
      volumeSliderColor: '#000000',

      buttonColor: '#0e1400',
      volumeSliderGradient: 'none',
      tooltipTextColor: '#ffffff',
      backgroundColor: '#7cad10',
      progressGradient: 'medium',

      sliderColor: '#000000',
      timeBgColor: '#555555',
      tooltipColor: '#5F747C',
      progressColor: '#7ca423',
      bufferGradient: 'none',
      timeColor: '#b9c992',

      height: 24,
      opacity: 1.0
   }
}
});
}
$(document).ready(function(){
    var username='dannyforster'; // set user name
    var format='json'; // set format, you really don't have an option on this one
    var url='http://api.twitter.com/1/statuses/user_timeline/'+username+'.'+format+'?callback=?'; // make the url
	$.getJSON(url,function(tweet){ // get the tweets

		$("#last-tweet").html(tweet[0].text); // get the first tweet in the response and place it inside the div
	});

    $(".tv-dropdown").css({opacity: 0});
    $(".danny-dropdown").css({opacity: 0});

    var topMenuSpeed = 500;

    $("#top-menu-tv").mouseenter(function(){$(".tv-dropdown").stop().css({'display':'block'}).animate({opacity:1},topMenuSpeed)});
    $("#top-menu-tv").mouseleave(function(){$(".tv-dropdown").stop().animate({opacity:0},topMenuSpeed,'linear',function(){$(this).css({'display':'none'});})});
    $(".tv-dropdown").mouseenter(function(){$("#top-menu-tv a").addClass('active'); setTimeout(function(el){return function(){el.stop().animate({opacity:1},topMenuSpeed);};}($(this)),5);});
    $(".tv-dropdown").mouseleave(function(){$("#top-menu-tv a").removeClass('active'); $(this).stop().animate({opacity: 0},topMenuSpeed,'linear',function(){$(this).css({'display':'none'});});});

    $("#top-menu-danny").mouseenter(function(){$(".danny-dropdown").stop().css({'display':'block'}).animate({opacity:1},topMenuSpeed)});
    $("#top-menu-danny").mouseleave(function(){$(".danny-dropdown").stop().animate({opacity:0},topMenuSpeed,'linear',function(){$(this).css({'display':'none'});})});
    $(".danny-dropdown").mouseenter(function(){$("#top-menu-danny a").addClass('active'); setTimeout(function(el){return function(){el.stop().animate({opacity:1},50);};}($(this)),5);});
    $(".danny-dropdown").mouseleave(function(){$("#top-menu-danny a").removeClass('active'); $(this).stop().animate({opacity: 0},topMenuSpeed,'linear',function(){$(this).css({'display':'none'});});});

    /* Top Banner */

var bannerCloudsTime = 20000;

    function firstCloud()
    {
        var cloud = $($("#top-banner .clouds-inner img")[0]);
        cloud.stop();
        cloud.css({left: 0});
        cloud.animate({left: 1100}, bannerCloudsTime, 'linear', function(){setTimeout(function(){firstCloud();},10);});
    }

    function secondCloud()
    {
        var cloud = $($("#top-banner .clouds-inner img")[1]);
        cloud.stop();
        cloud.css({left: -1100});
        cloud.animate({left: 0}, bannerCloudsTime, 'linear', function(){setTimeout(function(){secondCloud();},10);});
    }

    firstCloud();
    secondCloud();

    /* Top Banner Buildings */

    var bannerBuildings = $("#top-banner .buildings img");
    var bannerBuildingsCount = bannerBuildings.size();
    var currentBannerBuilding = -1;
    bannerBuildings.css({display:'block', opacity: 0});

    function setBannerBuilding(id)
    {
        bannerBuildings.stop();
        bannerBuildings.animate({opacity: 0},100);
        $(bannerBuildings[id]).stop();
        $(bannerBuildings[id]).animate({opacity: 1},500);
    }

    function nextBannerBuilding()
    {
        currentBannerBuilding++;
        if(currentBannerBuilding==bannerBuildingsCount) currentBannerBuilding = 0;
        setBannerBuilding(currentBannerBuilding);
        setTimeout(function(){nextBannerBuilding();}, 7000);
    }

    nextBannerBuilding();

 //var param={wmode:"transparent"}
 //swfobject.embedSWF("http://dannyforster.s3.amazonaws.com/content/home_top_banner_netherlands.swf", "flash_swf", "960", "190", "9.0.0", "http://dannyforster.s3.amazonaws.com/js/swfobject/expressInstall.swf", null, param);

});



Shadowbox.init({
language: "en",
players: ["iframe","html","image","swf"]
});

function openShadowbox(content, width, height, player){
Shadowbox.open({
'content': content,
'player': player,
'width': width,
'height': height
});
}
