function moveFooter() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
 // window.alert( 'Width = ' + myWidth );
 // window.alert( 'Height = ' + myHeight );

	var header_H = document.getElementById('header').clientHeight;
	var footer_H = 33; //document.getElementById('footer').clientHeight;
	var main_H = myHeight-(header_H+footer_H);
	var containerH = document.getElementById('mainContent').clientHeight;
	var ddH = containerH+header_H+footer_H+268;//+33;
	
	if(myHeight > ddH){
		//document.getElementById('container').style.height = main_H + "px";  
	}
	//alert("body="+header_H+", "+footer_H+", "+main_H+", "+myHeight+", "+ddH+", "+containerH);
	document.getElementById('header').style.width = myWidth + "px"; 
}

function createFlash(thePlaceholder, thePlayerId, swfFile, w, h, xmlfile) {
		var flashvars = {
			xml:xmlfile
		}
		var params = {
				allowfullscreen:"false", 
				allowscriptaccess:"always",
				bgcolor:"#e7f9f6",
				wmode:"transparent"
		}
		var attributes = {
				id:thePlayerId,  
				name:thePlayerId
		}
		swfobject.embedSWF(swfFile, thePlaceholder, w, h, "9.0.115", false, flashvars, params, attributes);
}

function putTitle(thePlaceholder, thePlayerId, w, h, msg) {
		var flashvars = {
			t:msg
		}
		var params = {
				allowfullscreen:"false", 
				allowscriptaccess:"always",
				wmode:"transparent"
		}
		var attributes = {
				id:thePlayerId,  
				name:thePlayerId
		}
		swfobject.embedSWF('swf/title.swf', thePlaceholder, w, h, "9.0.115", false, flashvars, params, attributes);
}

function topFixed(ele,dist) {
	ele.style.top = dist+'px';
	var ieMatch = navigator.appVersion.match(/MSIE (\d+)\./);
	if(!ieMatch || +ieMatch[1]>=7) {
		ele.style.position = 'fixed';
	} else {
		ele.style.position = 'absolute';
		setInterval(function(ele) {
			ele.style.display = 'none';
			ele.style.top = dist+'px';
			ele.style.display = 'block';
		},10,ele);
	}
} 

function fixHeader(){
	topFixed(document.getElementById('header'),0); 
}

/*
if( window.addEventListener ){
	window.addEventListener( "scroll", positionFooter, false );
	window.addEventListener( "resize", positionFooter, false );
} else {
	window.attachEvent( "onscroll", positionFooter );
	window.attachEvent( "onresize", positionFooter );
}

function positionFooter(){
	var html = document.getElementsByTagName( "html" )[ 0 ];
	var winY = html.scrollTop;
	var winH = html.offsetHeight;
	var element = document.getElementById( "footer" );
	
	winH -= element.offsetHeight;
	element.style.top = ( winY + winH ) + "px";
}
*/

