function TopMenuHover() {

var obj = document.getElementById("TopMenu");   
var objs = obj.getElementsByTagName("a");   

	for (var i = 0; i < objs.length; i++) {   
   objs[i].onmouseover=function() {
   		$('#'+this.id).clearQueue();
			$('#'+this.id).animate({backgroundColor: "#333333"}, 500);
			$('#'+this.id).animate({color: "#FFFFFF"}, 500);    	
    }
   objs[i].onmouseout=function() {
   		$('#'+this.id).clearQueue();
			$('#'+this.id).animate({backgroundColor: "#828282"}, 500);
			$('#'+this.id).animate({color: "#FFFFFF"}, 500);    	
    }    
   }  

}


function HomepageThumbnails() {

var obj = document.getElementById("HomepageArticles");   
var objs = obj.getElementsByTagName("a");   

	for (var i = 0; i < objs.length; i++) {   
   objs[i].onmouseover=function() {
   		$('#'+this.id).clearQueue();
			$('#'+this.id).animate({backgroundColor: "#801717", color: "#FFFFFF"}, 500);
    }
   objs[i].onmouseout=function() {
   		$('#'+this.id).clearQueue();
			$('#'+this.id).animate({backgroundColor: "#FFFFFF", color: "#000000"}, 500);
    }    
   }  

}


function AccordionHomepage() {
	var obj = document.getElementById("Accordions");   
	var objs = obj.getElementsByTagName("div");   
	
	for (var i = 0; i < objs.length; i++) {   
				
		var sobj = document.getElementById(objs[i].id);   
		var sobjs = sobj.getElementsByTagName("h4");   
		
		for (var j = 0; j < sobjs.length; j++) {   
			
				//alert(sobjs[j].id);
			
				sobjs[j].onclick=function() {
			
					animateAccordion(this.id, this.parentNode.id);
			
				}
			
		}
	}
}

function animateAccordion(obj, container) {
	
	var sobj = document.getElementById(container);   
	var sobjs = sobj.getElementsByTagName("h4");   
		
	for (var j = 0; j < sobjs.length; j++) {  	
		
		if (sobjs[j].id == obj) {
			$('#'+sobjs[j].id+'-o').animate({height:'200', opacity:'1'}, {duration: 600, height: 'easeOutBounce'});
			$('#'+sobjs[j].id).animate({backgroundColor:'#FFFFFF', color:'#000000'}, {duration: 600});
			$('#'+sobjs[j].id+'-p').animate({height:'150', padding:'6px 6px 0px 6px', opacity:'1'}, {duration: 600, height: 'easeOutBounce'});
		}
		else {
			$('#'+sobjs[j].id+'-o').animate({height:'0', opacity:'0'}, {duration: 600, height: 'easeOutBounce'}).hide(0);
			$('#'+sobjs[j].id).animate({backgroundColor:'#000000', color:'#FFFFFF'}, {duration: 600});
			$('#'+sobjs[j].id+'-p').animate({height:'0', padding:'0', opacity:'0'}, {duration: 600, height: 'easeOutBounce'}).hide(0);
		}
		
	}
	
}
