var newWin = null;
function popUp(strURL, strType, strHeight, strWidth) {
	if (newWin != null && !newWin.closed)
		newWin.close();
		var strOptions="";
	if (strType=="popup")
		strOptions="location=0,menubar=1,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,height="+strHeight+",width="+strWidth;
	newWin = window.open(strURL, 'newWin', strOptions);
	newWin.focus();
}
//Function for expanding or collapsing a chosen tag in the XSL template
 function expand(thistag) {
      if(document.getElementById(thistag)){
      styleObj = document.getElementById(thistag).style;
      if (styleObj.display=='none') {styleObj.display = '';}
      else {styleObj.display = 'none';}
      }
}
function pollValidate(formId) {
  var form = document.getElementById(formId)
  var el = form.elements;
  var checked = false;
  for (var i = 0; i < el.length; i++) {
    if (el[i].checked == true)
      checked = true;
  }
  if (!checked) {
    if (formHasType(form, 'checkbox'))
      alert('You have to select at least one alternative first!');
    else 
      alert('You have to select an alternative first!');
  } else {
    form.submit();
  }
}
function formHasType(form, typeName) {
  var hasType = false;
  for (var i = 0; i < form.elements.length; i++) {
    if (form.elements[i].type == typeName) {
      hasType = true;
      break;
    }
  }
  return hasType;
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}function isInt(str) {
    return /^ *[1-9]+ *$/.test(str);
}
function externalLinks(){
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for(var i=0;i<anchors.length; i++){
		var anchor = anchors[i];
		if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "external"){
			anchor.target = "_blank";
		}
	}
}