function bookmark(title, url) {
	if (title == undefined) title = document.title;
	if (url == undefined) url = top.location.href;
	if (window.sidebar) window.sidebar.addPanel(title, url, '');
	else if (window.opera && window.print) {
		// Opera
		var t = document.createElement('a');
		t.setAttribute('rel', 'sidebar');
		t.setAttribute('href', url);
		t.setAttribute('title', title);
		t.click();
	} else window.external.AddFavorite(url, title);
	return false;
}

function $(id){
	return document.getElementById(id);
	}
function style(id){
	return $(id).style;
	}
if(navigator.appName == "Microsoft Internet Explorer"){
	var ie = true;
} 
function toggle(id){
  if (style(id).display == 'none') { 
    style(id).display = 'block';
  } else style(id).display = 'none'; 
}

function history(arr) {
  base = new Array();
  doub = new Array();
  doub.length = arr.length
  for (i = 0; i < arr.length; i ++) {
	for (j = 0; j < i; j ++) {
		if (arr[i] == arr[j]) {
			doub[i] = 1;
			doub[j] = 1;
		}
	}
  }
  for (i = 0; i < arr.length; i++)
	if (!doub[i])
		base.push(arr[i]);
  for (i = 0; i < arr.length; i++)
	if (doub[i]) {
	  found = 0;
	  for (j = 0; j < base.length; j++)
	    found = base[j] == arr[i] || found;
	  if (!found)
		base.push(arr[i]);
	}
  return base;
}

function getRadioGroupValue(radioGroupObj){
	if(radioGroupObj.value) return radioGroupObj.value;
	for (var i=0; i < radioGroupObj.length; i++){
		if (radioGroupObj[i].checked) return radioGroupObj[i].value;
	}
	return null;
}

