function getWindowHeight(){
	var height = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		height = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		height = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		height = document.body.clientHeight;
	}
	return height;
}

function getWindowWidth(){
	var width = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		width = window.innerWidth;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		width = document.documentElement.clientWidth;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		width = document.body.clientWidth;
	}
	return width;
}

function setSWFWidth(objectID, newWidth){
	if (getWindowWidth() < newWidth){
		document.getElementById(objectID).setAttribute('style', 'width:' + newWidth +'px');
	} else {
		document.getElementById(objectID).setAttribute('style', 'width:' + (getWindowWidth()-5) + 'px');
	}
}

function setSWFHeight(objectID, newHeight){
	if (getWindowHeight() < newHeight){
		document.getElementById(objectID).setAttribute('style', 'height:' + newHeight +'px');
	} else {
		document.getElementById(objectID).setAttribute('style', 'height:' + (getWindowHeight()-5) + 'px');
	}	
}

function consoleDebug(message){
	if(window.console && window.console.debug) {
		window.console.debug(message);
	}
};

function consoleInfo(message){
	if(window.console && window.console.info) {
		window.console.info(message);
	}
};

function consoleWarn(message){
	if(window.console && window.console.warn) {
		window.console.warn(message);
	}
};

function consoleError(message){
	if(window.console && window.console.error) {
		window.console.error(message);
	}
};
