var active = "AboutSection";
var ratio = 0;
var moviewidth = 1050;
var movieheight = 720;
var wheight = self.window.innerHeight;
var wwidth = self.window.innerWidth;

window.onload=function(){


	if(wwidth > wheight){
		ratio = wwidth / moviewidth;
		control = ratio * movieheight;
		if (control < wheight) {
			ratio = wheight /movieheight;
			movieheight = movieheight * ratio;
			moviewidth = moviewidth * ratio;
		} else {
			moviewidth = moviewidth * ratio;
			movieheight = movieheight * ratio;
		}	
	}
	
	if(wheight > wwidth){
		ratio = wheight / movieheight;
		movieheight = movieheight * ratio;
		moviewidth = moviewidth * ratio;
	}

	MovieContentElement = document.getElementById("MovieContent");
	positiontext = "position: absolute;overflow:hidden;height:"+wheight+"px;width:"+wwidth+"px;";
	MovieContentElement.setAttribute("style", positiontext);
	
	MovieHolderElement = document.getElementById("Movieholder");
	positiontext = "position:absolute;bottom:"+movieheight+"px;";
	MovieHolderElement.setAttribute("style", positiontext);
	
	AddMovie(movieheight, moviewidth);
	
	new Effect.Opacity("Current", 
			{
			to:0.8
			}
		);	
	new Effect.Opacity("Footer", 
			{
			to:0.8
			}
		);	

};

Get = function(Get){
	Effect.Fade(active);
	Effect.Appear(Get);
	active = Get;
};

AddMovie = function(movieheight, moviewidth){
    MovieName = "Flash";
    MovieWhere = "Movieholder";
    movieleft = 0;
    movietop = 0;
    moviestyle = "absolute";
   // movieheight = 480;
   // moviewidth = 700;
    moviesrc = MovieName;
    movieid = MovieName;
    moviename = MovieName;
    moviemovie = MovieName;

    AC_FL_RunContent(
        'topposition', movietop,
        'leftposition', movieleft,
        'positionstyle', moviestyle,
        'moviewhere', MovieWhere,
        'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
        'width', moviewidth,
        'height', movieheight,
        'src', moviesrc,
        'quality', 'high',
        'pluginspage', 'http://www.macromedie.com/go/getflashplayer',
        'align', 'top',
        'play', 'true',
        'loop', 'true',
        'scale', 'showall',
        'wmode', 'window',
        'devicefont', 'false',
        'id', movieid,
        'bgcolor', '#000000',
        'name', moviename,
        'menu', 'false',
        'allowFullScreen', 'false',
        'allowScriptAccess', 'sameDomain',
        'movie', moviemovie,
        'salign', ''
        );
    };
