var scrollDetectEvent;

function StartScrollDetect(page, width, height){
	if(screen.width <= width && screen.height <= height && page == 'app_viewvehicledetails') {
		positionScrollMessage();
		scrollDetectEvent = setInterval('scrollingDetector()', 1000);
	}
}

function positionScrollMessage() {
	var e = document.getElementById('scrollIndicator');
	var browser = browserSize();
	e.style.right = 10;
	e.style.bottom = 20;
	document.getElementById('scrollIndicator').style.visibility = 'visible';
}

function scrollingDetector(){
	var pos = 0;
	if (navigator.appName == "Microsoft Internet Explorer") { pos = document.body.scrollTop; }
	else { pos = window.pageYOffset; }
	if(pos > 0) {
		document.getElementById('scrollIndicator').style.visibility = 'hidden';
		clearInterval(scrollDetectEvent);
	}
}

function browserSize() {
	var myWidth = 0, myHeight = 0, rVar;
	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;
	}
	rVar = new Array(myWidth,myHeight);
	return rVar;
}
