var scrolltimer;
var timertimer;
var scrolldirection;
var menuheight=1;
var menumaxheight=50;

function setmenu(blnState){
	if(blnState){
		scrolldirection=5;
	}else{
		scrolldirection=-5;
	}
	setmenuheight();
	window.clearTimeout(timertimer);
	window.clearInterval(scrolltimer);
	scrolltimer=window.setInterval('setmenuheight();',10);
}

function settimer(intTimer){
	window.clearTimeout(timertimer);
	timertimer=window.setTimeout('setmenu(false);',intTimer);
}

function setmenuheight(){
	if(menuheight>menumaxheight){
		menuheight=menumaxheight;
		window.clearInterval(scrolltimer);
	}
	if(menuheight<1){
		getmenu('dropdownmenu').style.display='none';
		menuheight=1;
		window.clearInterval(scrolltimer);
	}else{
		getmenu('dropdownmenu').style.display='inline';
	}
	getmenu('dropdownmenu').style.height=menuheight+'px';
	menuheight+=scrolldirection;
}

function getmenu(strID){
	if(document.getElementById!=null){
		return document.getElementById(strID);
	}
	if(document.all){
		return document.all[strID];
	}
}

function image_popup(strURL,intWidth,intHeight){
	intWidth+=20;
	intHeight+=30;
	
	var tempWindow=window.open(strURL,'popupwindow','width='+intWidth+',height='+intHeight);
	tempWindow.focus();
}
