
function resetCheckbox () {
	pCheck.setAttribute('disabled', false)
}


YAHOO.namespace('example.anim');


// vars
YAHOO.example.anim.init = function() {  

	pFurther = document.getElementById('further');	
	pCheck = document.getElementById('furtherCheckbox');
	
	// collapse fields only if check box isn't yet checked
	if(pCheck.checked == true) {
		pFurther.style.height = '200px';
		}
	else {
		pFurther.style.height = '1px';
		}
		   
		// make it go
	var animate = function(e) {
				
		if(pFurther.style.height && pFurther.style.height == '200px') {
			pHeightFrom = 200;
			pHeightTo = 0;
		}
		else {
			pHeightFrom = 0;
			pHeightTo = 200;
		}
		
		// pass to class
		var anim = new YAHOO.util.Anim('further', {height: {from: pHeightFrom, to: pHeightTo}}, 0.8, YAHOO.util.Easing.easeOut);
	    
		anim.animate(); 
		
	    // double check we have the box ticked correctly
		if(pFurther.style.height != '200px') {
			pCheck.setAttribute('checked', true);
		}
		
	};

	YAHOO.util.Event.addListener(document.getElementById('furtherCheckbox'), 'click', animate);
	}
	
