var direction = null;
var scrolling = null;
var browser = navigator.appName;

function getHeight(myId){
	return (document.getElementById(myId).scrollHeight);
}

function hideMenus(){
	if (browser == "Microsoft Internet Explorer"){
	document.getElementById('propertiesContainer').style.display = 'none';
	}else{
		stopScroll();
		var menus = new Array('properties');
	
		var b = getHeight('propertiesContainer');	
		document.getElementById('propertiesContainer').style.marginTop = (b+20) *-1+'px;'; 
		clearing = null;
	}
}

function showMenu(myId){
	hideMenus();
	menu = myId+'Container';
	document.getElementById(menu).style.display = 'block';
	stopScroll();
	scrolling = this.setInterval(scrollUp, 10);
//  slideOut = -1* getHeight('specialtiesContainer');	
	slideOut = -1* getHeight(menu);
	increment = getHeight(menu) /10;
}
/*
function clearMenu(){
	clearing = setTimeout(hideMenus,1000);
}
function resetTimer(){
	clearing = null;
}
function startScroll(functionName){
	scrolling = this.setInterval(functionName, 50);
}
*/

function stopScroll(){
	if (scrolling != null){
		this.clearInterval(scrolling);
		scrolling = null;
	}
}
		
function scrollDown(){
	slideOut -= 10;
	if (slideOut > 0){
		document.getElementById('introcopy').style.marginTop = scrPos+'px';            
	}else{
		stopScroll();    
	}    
}

function scrollUp(){
	slideOut += increment;
	if (slideOut < 0){
		document.getElementById(menu).style.marginTop = slideOut+'px'; 
	}else{
		document.getElementById(menu).style.marginTop = '1px'; 
		stopScroll();
	}           
}

if (browser == "Microsoft Internet Explorer") {
document.write("<link REL='stylesheet' HREF='style-ie.css' TYPE='text/css'>");
}
