//
// Expand and collapse divs
//
function expandCollapse() {
	for (var i=0; i<expandCollapse.arguments.length; i++) {
		var element = document.getElementById(expandCollapse.arguments[i]);
		element.style.display = (element.style.display == "none") ? "block" : "none";
	}
}

//
// Clear search field onfocus
//
function clearField(field){
	var s = field.value;
	var instr = s.substring(0,9);
	if(instr == 'Search...'){
		field.value = '';
	}
}


//
// Mootools Ajax function (used in Star Ratings module)
//
function mootoolsAjax(url, div)    {
    var mootoolsAjax = new Ajax(url, { update: $(div) }).request();
}


//
// Add to favourites
//

function addToFavourites(){

	var BookmarkURL = location.href;
	var BookmarkTitle = document.title;
	
	if (document.all){
		// Internet Exploder
		window.external.AddFavorite(BookmarkURL,BookmarkTitle)
	}
	else{
		// Mozilla et al.
		window.sidebar.addPanel(BookmarkTitle, BookmarkURL, '');
	}

}