// JavaScript Document
var selectedLeftAccordian = 0;
var selectedRightAccordian = 0;
var accordianPrefix = 'accord';

function accordian(id,height) {
	var attributes = {   
		height: { to: height } 
		};   
	var anim = new YAHOO.util.Anim(id, attributes, 0.2); 
	anim.animate();  
	} 
	
function accordianGo(position,id) {	
	if (position == 1) {
		
		// If left side according
		if (id != selectedLeftAccordian) {
			
			// Close the open accordian
			if (selectedLeftAccordian != 0 && selectedLeftAccordian != id) {
				accordian(accordianPrefix + '_' + position + '_' + selectedLeftAccordian,0);
				} // End if selectedAccordian
				
			// Open the selected accordian
			if (id != selectedLeftAccordian) {
				// Determine height to open
				openHeight = document.getElementById(accordianPrefix + '_inner_' + position + '_' + id).offsetHeight;
				
				// Go
				accordian(accordianPrefix + '_' + position + '_' + id, openHeight);
				} // End if id
				
				selectedLeftAccordian = id;
			
			} // End if 
		} else {
		// If right side according
			if (id != selectedRightAccordian) {
			
			// Close the open accordian
			if (selectedRightAccordian != 0 && selectedRightAccordian != id) {
				accordian(accordianPrefix + '_' + position + '_' + selectedRightAccordian,0);
				} // End if selectedAccordian
				
			// Open the selected accordian
			if (id != selectedRightAccordian) {
				// Determine height to open
				openHeight = document.getElementById(accordianPrefix + '_inner_' + position + '_' + id).offsetHeight;
				
				// Go
				accordian(accordianPrefix + '_' + position + '_' + id, openHeight);
				} // End if id
				
				selectedRightAccordian = id;
			
			} // End if
		} // End if position
	}