var active	=	0;

function Rollover_div(expanded_height, expanded_width){

	var divs	=	document.getElementsByTagName("div");
	
	for(var i = 0; i < divs.length; i++){
	
		if(rollover = divs[i].getAttribute("rollover")){
		
			this.add(divs[i], expanded_height, expanded_width);
		
		}
	
	}

}

Rollover_div.prototype.add	=	function(div, expanded_height, expanded_width){

	var rollover_div		=	document.getElementById(div.getAttribute("rollover"));
	
	rollover_div.onmouseout		=	function(){ Rollover_div.prototype.close(rollover_div, expanded_height, expanded_width) }
	div.onmouseover			=	function(){ Rollover_div.prototype.open(rollover_div, expanded_height, expanded_width) }
	
}

Rollover_div.prototype.open	=	function(rollover_div, expanded_height, expanded_width){
	
	if(active == 0){
	
		active	=	1;
		$(rollover_div).animate({height: expanded_height+'px', width: expanded_width+'px'}, {duration: 200, end: setTimeout("active = 0", 10)});
		
	}

}

Rollover_div.prototype.close	=	function(rollover_div, expanded_height, expanded_width){
	
	if(active == 0){
	
		active	=	1;
		$(rollover_div).animate({height: '0px', width: '0px'}, {duration: 200, end: setTimeout("active = 0", 1)});
		
	}

}

