function toggle_visibility(id) {
	e = document.getElementById(id);
	var style = e.style.display;
	initShowHideDivs();
	if (style != 'block') {
		$("#" + e.id).slideDown("fast");
		var header = document.getElementById('toolbox_head_' + Right(id, 2));
		header.className += ' selected';
	}
}

function initShowHideDivs() {
	var divs = document.getElementsByTagName('DIV');
	var divCounter = 1;
	for ( var no = 0; no < divs.length; no++) {
		if (divs[no].id.indexOf('toolbox_content_') >= 0) {
			if (divs[no].style.display == 'block') {
				$("#" + divs[no].id).slideUp("fast");
			} else {
				divs[no].style.display = 'none';
			}
			var header = document.getElementById('toolbox_head_' + Right(
					divs[no].id, 2));
			var headerclass = header.className;
			headerclass = headerclass.replace(" selected", "");
			header.className = headerclass;
			divCounter++;
		}
	}
}

function Left(str, n) {
	if (n <= 0)
		return "";
	else if (n > String(str).length)
		return str;
	else
		return String(str).substring(0, n);
}
function Right(str, n) {
	if (n <= 0)
		return "";
	else if (n > String(str).length)
		return str;
	else {
		var iLen = String(str).length;
		return String(str).substring(iLen, iLen - n);
	}
}

function addfav() {
	if (navigator.userAgent.indexOf("MSIE") >= 0) {
		window.external.AddFavorite("http://www.asml.com", "ASML Homepage");
	} else {
		alert('Your browser does not support this function, please add the favorite manually by using.');
	}
}

