var isNS4 = 0;
var isNS5 = 0;
var isIE4 = 0;
var isNew = 0;

var brow = ((navigator.appName) + (parseInt(navigator.appVersion)));
if (parseInt(navigator.appVersion) >= 5) {
	isNew = 1;
}
else if (brow == "Netscape4") {isNS4 = 1;}
else if (brow == "Netscape5") {isNS5 = 1;}
else if (brow == "Microsoft Internet Explorer4") {isIE4 = 1;}

var docObj 		= (isNS4) ? 'document' : 'document.all';
var styleObj 	= (isNS4) ? '' : '.style';
var visibleObj 	= (isNS4) ? '.visibility' : '.display';

function ShowSub(elementnaam) {
 	var elementid = eval(docObj + '.' + elementnaam + styleObj);
	if (isNS5) {
		if (elementid.display == 'block') {
			elementid.display = 'none'
			}
		else {
			elementid.display = 'block'
			}
	}
	else {
		if (elementid.display == 'block') {
			elementid.display = 'none'
			}
		else {
			elementid.display = 'block'
			}
	}
}

 function MM_changeProp(theObj,theProp,theValue) { //v3.0
   var obj = document.getElementById(theObj);
   if (obj && (theProp.indexOf("style.")==-1 || obj.style)) {
    eval("obj."+theProp+"='"+theValue+"'");
   }
 }

 function stretchSelectbox(obj, breedte) {
  MM_changeProp(obj,'style.width',breedte);
 }

<!-- Validate Month -->
function isPrice(veld, tekst) {
	var waarde
	waarde = veld.value;

	if (isNaN(waarde)) {
		if (tekst != '') alert(tekst);
		veld.focus()
		veld.select()
		return false
	}
	return true;
}

<!-- Validate Month -->
function isMonth(veld, tekst) {
	var waarde
	waarde = veld.value;

	if (isNaN(waarde)) {
		if (tekst != '') alert(tekst);
		veld.focus()
		veld.select()
		return false
	}
	if (waarde < 1 || waarde > 12) {
		if (tekst != '') alert(tekst);
		veld.focus()
		veld.select()
		return false
	}
	return true;
}

<!-- Validate Year -->
function isYear(veld, tekst) {
	var waarde
	waarde = veld.value;

	if (isNaN(waarde)) {
		if (tekst != '') alert(tekst);
		veld.focus()
		veld.select()
		return false
	}
	if (waarde < 1900 || waarde > 2200) {
		if (tekst != '') alert(tekst);
		veld.focus()
		veld.select()
		return false
	}
	return true;
}

<!-- Check for Enter key and start action -->
function keyPressAction(event, actie) { 
	var key = event.keyCode; 
	if (key == 13) { 
		eval(actie);
		return false; 
	} 
}

// Printen van een pagina
function printPagina() {
	window.print();
}

// de volgende functies dienen om een selectbox te sorteren
function compareText (option1, option2) {
  //return option1.text < option2.text ? -1 :
  //  option1.text > option2.text ? 1 : 0;
  return (option1.text).toLowerCase() < (option2.text).toLowerCase() ? -1 :
    (option1.text).toLowerCase() > option2.text.toLowerCase() ? 1 : 0;
}
function compareValue (option1, option2) {
  return option1.value < option2.value ? -1 :
    option1.value > option2.value ? 1 : 0;
}
function compareTextAsFloat (option1, option2) {
  var value1 = parseFloat(option1.text);
  var value2 = parseFloat(option2.text);
  return value1 < value2 ? -1 :
    value1 > value2 ? 1 : 0;
}
function compareValueAsFloat (option1, option2) {
  var value1 = parseFloat(option1.value);
  var value2 = parseFloat(option2.value);
  return value1 < value2 ? -1 :
    value1 > value2 ? 1 : 0;
}
function sortSelect (select, compareFunction) {
  if (!compareFunction)
    compareFunction = compareText;
  var options = new Array (select.options.length);
  for (var i = 0; i < options.length; i++)
    options[i] = 
      new Option (
        select.options[i].text,
        select.options[i].value,
        select.options[i].defaultSelected,
        select.options[i].selected
      );
  options.sort(compareFunction);
  select.options.length = 0;
  for (var i = 0; i < options.length; i++)
    select.options[i] = options[i];
}


function IGPopup(Image_ID, Width, Height, ProductNames, Modalities, BodyParts, Product_ID, Technology) {
	var URL2Open = new String;
	var Features = new String;
	Features = "width="+ String(Width) + ",height="+ String(Height) + ", scrollbars";
	URL2Open = ("/Medical/ImageGallery/PopUp.asp?Image_ID=" + String(Image_ID));
	URL2Open = URL2Open + "&ProductNames=" + String(ProductNames);
	URL2Open = URL2Open + "&Modalities=" + String(Modalities);
	URL2Open = URL2Open + "&BodyParts=" + String(BodyParts);
	URL2Open = URL2Open + "&Product_id=" + String(Product_ID);
	URL2Open = URL2Open + "&Technology=" + String(Technology);
	//alert(Features);
	// window.open(URL2Open,"PoPup", Features); // Popup alsways in the same window
	window.open(URL2Open,"", Features); // Popup always in a new window
}

