var introSO = false;

function initSWF() {

		var minFlashVersion = 9;
		var flashVersion = deconcept.SWFObjectUtil.getPlayerVersion();

    // Clear container
    $('#background-image').html('');
    $('#claim').hide();

    // Container for background flash
		var contentBox = $('#background-image').get(0);

    // Body-Area
    var bodyBox = $('body').get(0);

    // Calculate video height for full width display
    var footerOffset = 200; 
    var recalc = 480 / 848; // video resolution 
//    var width = contentBox.offsetWidth;
    var width = 956;
    var height = width * recalc;

    var topPositionAdjust = 0;

    // Calculate negative top-value for small browser height
    if(height + footerOffset > bodyBox.offsetHeight) {
      topPositionAdjust = (bodyBox.offsetHeight - height - footerOffset); 
      
      $('#background-image').css('top', topPositionAdjust + 'px');
    }

    var claimheight = 293;
    var claimpadding = 150 + 50; // padding-top + margin-bottom

    if(claimheight + claimpadding - topPositionAdjust < height) {
      $('#claim').fadeIn();
    }


    // Flash
		if (flashVersion.major >= minFlashVersion )
		{ 	// Flash	
			introSO = new SWFObject("/fileadmin/templates/media/bigVideo.swf","bigVideo", width, height, minFlashVersion,"#000000" );
			introSO.useExpressInstall('expressinstall.swf');
			introSO.addParam("allowFullScreen", "false");
//			introSO.addParam("salign", "tc");
      introSO.addParam('quality', 'high');
			introSO.addParam('wmode', 'transparent'); //required
      introSO.addParam('scale', 'exactfit');
      introSO.addParam('loop', 'true');
      introSO.addParam('flashvars','_xmlPath=/fileadmin/templates/media/Intro_800KB.flv');
			
			introSO.write("background-image");

		}
		else
		{	// HTML 
		}  
}

jQuery(initSWF);

