function disable_element( inputid, checkbx )
{
       var textfld = document.getElementById(inputid);

       if (checkbx.checked)
                textfld.disabled = false;
       if (!checkbx.checked)
                textfld.disabled = true;
}

function add_focus( inputid )
{
     var textfld = document.getElementById(inputid);

     if ( !textfld.disabled )
     {
           document.getElementById( inputid ).focus();
     }
}

function empty_field( field, standaard )
{
      var inhoud = document.getElementById( field );


      if ( inhoud.value == standaard )
      {
             inhoud.value = "";
      }

}

function bevestig( bericht)
{



    if (bericht == '' || typeof(window.opera) != 'undefined')
    {
        return true;
    }

    return confirm(bericht);
}

function bevestig_link(bericht, naar)
{
    if (bericht == '' || typeof(window.opera) != 'undefined')
    {
        return true;
    }

    if( confirm(bericht) )
    {
         document.location = naar;
         return true;
    }
    else
         return false;
}

function b_alert( plaatje, titel, prijs )
{
  alertwidth = 400;


  screenwidth = window.screen.availWidth;
  screenheight = window.screen.availHeight;

  screenwidth = (screenwidth/2);
  screenheight = (screenheight/2)-50;

  x_start = (screenwidth-(alertwidth/2));
  y_start = (screenheight-200);

  document.getElementById('b_alert').style.width = alertwidth;
  document.getElementById('b_alert').style.top = y_start;
  document.getElementById('b_alert').style.left = x_start;

  document.getElementById('b_alert_text').innerHTML = '<table width="100%"><td width="30%"><img src="' + plaatje + '" alt="" border=0></td><td width="70%" bgcolor="#f6f6f6" valign="top"><b> ' + titel + ' </b><p> <span class="prijs">&euro; ' + prijs + '</span></td><tr><td colspan="2" bgcolor="#EAEAEA"></td></table>';
}

 function hide_b_alert()
 {
  document.getElementById('b_alert').style.width = 0;
  document.getElementById('b_alert').style.top = -5000;
  document.getElementById('b_alert').style.left = -5000;
  document.getElementById('b_alert_text').innerHTML = "";
 }


 function verander_class( id, naar )
 {
       document.getElementById( id ).className = naar;
 }


 function check_clicked( id )
 {
       document.getElementById( id ).checked = true;
 }
  function add_file(id, i) {
	if (document.getElementById(id + '_' + i).innerHTML.search('uploadinputbutton') == -1) {
		document.getElementById(id + '_' + i).innerHTML = '&nbsp;Vanaf: <input type="text"  name="vanaf_' + i + '" onchange="return add_file(\'' + id + '\', ' + (i+1) + ');" />&nbsp;&nbsp;Prijs: <input type="text" name="prijs_'+ i + '" /><br /><span id="' + id + '_' + (i+1) + '"><\/span>\n';
	}
}
