/* Resize div code */
var smooth_timer = new Array();
 smooth_timer['personalise_news'] ='';

function smoothHeight(id, curH, targetH, stepH, mode) {
	curH=div_height(id);
	diff = targetH - curH;
	
	var diff2;
	
	if(diff<0) 
	{
		diff2=diff*-1;
	} else
	{
		diff2=diff;
	}
	
	
	if (diff != 0 && diff2>=stepH) {

		//set the new height... this will be the current height +/- the number of pixels you pass as "stepH"
		newH = (diff > 0) ? curH + stepH : curH - stepH;

		//add the new height to your current height
		((document.getElementById) ? document.getElementById(id) : eval("document.all['" + id + "']")).style.height = newH + "px";
		if (smooth_timer[id]) window.clearTimeout(smooth_timer[id]);

		//run smoothHeight() again after 5 milliseconds, passing our new height as the current height
		smooth_timer[id] = window.setTimeout( "smoothHeight('" + id + "'," + newH + "," + targetH + "," + stepH + ",'" + mode + "')", 5 );
	}else if(diff!=0)
	{
		stepH=diff2;
		newH = (diff > 0) ? curH + stepH : curH - stepH;

		//add the new height to your current height
		((document.getElementById) ? document.getElementById(id) : eval("document.all['" + id + "']")).style.height = newH + "px";
		if (smooth_timer[id]) window.clearTimeout(smooth_timer[id]);

		//run smoothHeight() again after 5 milliseconds, passing our new height as the current height
		smooth_timer[id] = window.setTimeout( "smoothHeight('" + id + "'," + newH + "," + targetH + "," + stepH + ",'" + mode + "')", 5 );
		
	}
}




function div_height(id)
{
	return document.getElementById(id).offsetHeight;
}




function toggle_advanced()
{
	var object = document.getElementById('advancedvisible');
	if(object.value==0)
	{
		smoothHeight('advanced_search',0,140,5, 'o')
		object.value='1';
	} else
	{
		smoothHeight('advanced_search',140,0,5, 'o')
		object.value='0';
	}
	
}