/* 
Methods for resizing the flash stage at runtime.

setFlashWidth(divid, newW)
divid: id of the div containing the flash movie.
newW: new width for flash movie

setFlashWidth(divid, newH)
divid: id of the div containing the flash movie.
newH: new height for flash movie

setFlashSize(divid, newW, newH)
divid: id of the div containing the flash movie.
newW: new width for flash movie
newH: new height for flash movie

canResizeFlash()
returns true if browser supports resizing flash, false if not. 
*/
function setFlashWidth(divid, newW){
	document.getElementById(divid).style.width = newW+"px";
}
function setFlashHeight(divid, newH){
	document.getElementById(divid).style.height = newH+"px";		
}
function setFlashSize(divid, newW, newH){
	setFlashWidth(divid, newW);
	setFlashHeight(divid, newH);
}
function canResizeFlash(){
	var ua = navigator.userAgent.toLowerCase();
	var opera = ua.indexOf("opera");
	if( document.getElementById ){
		if(opera == -1) return true;
		else if(parseInt(ua.substr(opera+6, 1)) >= 7) return true;
	}
	return false;
}

function wylaczPreloader(){
	//alert(document.getElementById("loaderId").style.display);
document.getElementById("loaderId").style.display = "none";
	//alert(document.getElementById("loaderId").style.display);

//setFlashWidth("flashid", 525);
document.getElementById("flashid").style.height = "525px";
}


function getAltimaApp(appName) {
	if (navigator.appName.indexOf ("Microsoft") !=-1) {
		return window[appName];
	} else {
		return document[appName];
	}
}

window.onscroll = scrollEvent;
function scrollEvent() {
	var scrollTop = window.pageYOffset || document.documentElement.scrollTop || 0; var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft || 0;
	/*if (navigator.appName == "Microsoft Internet Explorer"){
		var position = document.body.scrollTop; 
		alert('a' + position);
		var position = window.pageYOffset;
		alert('aa ' + position);
	}
	else {
		var position = window.pageYOffset;
		alert('b' + position);
		}
	*/

	//alert('all '+scrollTop);
	if(getAltimaApp("mpl"))
	getAltimaApp("mpl").myFlexFunction(scrollTop);
}
