var currentTop=0
var clickCheck=0
var timMoveID=0

window.onscroll=scrollcheck

function timescroll(){
	window.clearInterval(timMoveID)
	timMoveID=0

	scrollcheck()
}
function scrollcheck(){

	if(clickCheck==0){
		if (typeof window.pageYOffset=="undefined"){ //must be ie
			currentTop=document.body.scrollTop
		}else{
			currentTop=window.pageYOffset
	
		}
	}else{

		clickCheck=0
		if (typeof window.pageYOffset=="undefined"){ //must be ie
			document.body.scrollTop=currentTop
		}else{
		
			window.scroll(0,currentTop)
		}

	}

}

function itemClicked(){

	if (typeof window.pageYOffset=="undefined"){ //must be ie
		if(document.body.scrollTop==0){
			clickCheck=0
		}else{
			clickCheck=1
		}
	}else{

		if(window.pageYOffset==0){
		
			clickCheck=0
		}else{
			clickCheck=1
			currentTop=window.pageYOffset
		}
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0 with scroll fix

tp=10
	lft=10
	pos=0
	
	if(typeof window.screenX =="undefined"){
	
		if(typeof window.screenTop !="undefined"){
		
			tp=window.screenTop+10
			lf=window.screenLeft+10
			pos=1
		}
	}else{
	
		tp=window.screenY+10
		lf=window.screenX+10
		pos=1
	}
	
	if(pos==1){
		if(features!=""){
			features=features+",top="+tp+",left="+lf
		}else{
			features=features+"top="+tp+",left="+lf
		}
	}
	
	
	 itemClicked()
  x=window.open(theURL,winName,features);
x.focus()
if (typeof window.pageYOffset!="undefined"){
	timMoveID=setInterval("timescroll()",50)
	}
}