// menu ------------------------------------------------------------------------
var currentObj;

function swapMenuImage(obj, state) {

  var regexp = /\.gif$/gi;
  var regexp2 = /_o\.gif$/gi;

  if (state != "") {
    if (state == 2) {
      var loc = obj.src;
      var newloc = loc.replace(regexp, "_o.gif");
      obj.src = newloc;
    }
    else if (state == 1) {
      var loc = obj.src;
      var newloc = loc.replace(regexp2, ".gif");
      obj.src = newloc;
    }
    if (currentObj != null) {
      var loc = currentObj.src;
      var newloc = loc.replace(regexp2, ".gif");
      currentObj.src = newloc;
    }
  }
}

function CreateControl(DivID, objectCode)
{
  var d = document.getElementById(DivID);
  d.innerHTML = objectCode;    
}

function openHelpPopup(helpTekst_id,w,h)
{

    var width = (w==null) ? 200 : w;
    var height = (h==null) ? 250 : h;
    var scrollbars = (height>550) ? "yes" : "no";
    
    openWin('popup.aspx?id='+helpTekst_id,width,height,scrollbars,"no");
}


function openWin(url, w, h, scrollbars, resizable)
{
	var x = 0;
	var y = 0;

	//breedte en plaats bepalen
	if (  screen.width <=  w )
		//breedte past niet op scherm
		w =  screen.width - 100;
	else
		//breedte past wel
		x = ( screen.width - w ) / 2;
	
	//hoogte bepalen
	if (  screen.height <=  h )
		//breedte past niet op scherm
		h =  screen.height - 100;
	else
		//preview breedte past wel
		y = ( screen.height - h ) / 2;
	
	var opties = "width=" + w + ", height=" + h + ",scrollbars=" + scrollbars + ",resizable=| + resizable + |, left="+x+",top="+y+"";
	var popup = window.open(url , "popup", opties);
	popup.focus();
}
 

