function toggleNews(obj) {
	//toggleAll();
	obj = obj.parentNode;//.className;
	newsBlock = obj.getElementsByTagName('span');
	for (i=0; i<newsBlock.length; i++) {
		if (newsBlock[i].className == 'newsText') {
			newsBlock[i].style.display = (newsBlock[i].style.display=='none') ? '' : 'none';
		}
	}
	return;


}

function toggleAll() {
	container = document.getElementById('newsContainer');
	newsItems = container.getElementsByTagName('div');
	for (i=0; i<newsItems.length; i++) {
		text = newsItems[i].getElementsByTagName('span');
		for (i=0; i<text.length; i++) {
			if (text[i].className == 'newsText') {
				text[i].style.display = 'none';
			}
		}
	}
}

function showDetails(itemId, holder) {
	items = document.getElementById(holder).getElementsByTagName('div');
	for (i=0; i<items.length; i++) {
		if (itemId!='none') {
			items[i].style.display = (items[i].id == itemId) ? '' : 'none';
		} else {
			items[i].style.display = 'none';
		}

	}
	return false;
}

/**
 *
 * @access public
 * @return void
 **/
function highlight(obj){
	objects = document.getElementById('zones').getElementsByTagName('a');
	for (i=0; i<objects.length; i++) {
		objects[i].style.fontWeight = 'normal';
	}
	if (obj=='') {
		objects[0].style.fontWeight = 'bold';
	} else {
		obj.style.fontWeight = 'bold';
	}
}
/**
 *
 * @access public
 * @return void
 **/
function sendForm(action, request){
	placeholder = $("form .container");
	if (action == 'submit') {
		placeholder.load('ade-651-contact.html', {'name':$('[name=name]').val(), 'email':$('[name=email]').val(), 'fax':$('[name=fax]').val(), 'phone':$('[name=phone]').val(), 'code':$('[name=code]').val(), 'message':$('[name=message]').val()});
	}
	if (action == 'load') {
		placeholder.load('ade-651-contact.html?get=form&file='+request);
	}

	return false;
}

/**
 *
 * @access public
 * @return void
 **/
function search(term){
	window.location = 'http://www.google.com/#q=' + term + '+site%3Awww.ade651.co.uk&hl=en';
	return false;
}
