            $(document).ready(function(){
                $("#newslink").toggle( function(){
                        $("#newslink").animate({"top": "121px"}, "slow");
                        $("#newses").animate({"height": "290px", "top": "-281px"}, "slow");
                        //$("#newses").animate({"height": "310px"}, "slow");
                        $("#newcontain").animate({"height": "270px", 'top': '-280px'}, "slow");
                }, function(){
                        $("#newslink").animate({"top": "411px"}, 'slow');
                        $("#newses").animate({"height": "0px", "top": "8px"}, 'slow');
                        $("#newcontain").animate({"height": "0px", "top": "0px"}, 'slow');
                });
            });

window.onload = function(){
    setTimeout(function(){showGame(file)}, 500);
}



function changeGame(type){
    $.ajax({
        url: "/changegame/"+type,
        type: "POST",
        data: 'sort='+currentSort,
        success: function(data){
            if (data != ''){
                var res = data.split('|');
                var file = res[7];
                currentSort = res[12];
                var h = parseInt($('#maindescription').css('height'));
                $('#descinner').animate({"top":"-=200"}, 'slow', function() {
                    showGame(file);
                    $('#descinner').html('<h1><a href="/games/'+res[13]+'">'+res[1]+'</a></h1>'+res[4]);
                    $('#descinner').animate({"top":"+=200"}, 'slow');
                });
            }
        },
        async: false
    });
}

function getFlashMovieObject(movieName)
{


  if (window.document[movieName])
  {
    return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName];
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }


}

function showGame (img)
{
	var f = getFlashMovieObject("myFlashMovie");
	//alert(f.width);
	f.changeGame("http://www.alcomi.com/content/images/"+img+".jpg");
	//f.nativeProperty.changeGame();

}