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 checkCadeauWijzerVelden()
{
      if ( document.getElementById( 'cat' ).value == '0' )
      {
           alert( 'U dient een categorie te selecteren voor u kunt zoeken' );

           return false;
      }
      else if ( document.getElementById( 'budget' ).value == '0' )
      {
           alert( 'U dient een budget te selecteren voordat u kunt zoeken' );

           return false;
      }
      else
           return true;
}

function fill_field( field, input)
{
      var veld = document.getElementById( field );

      if ( veld.value == "" )
          veld.value = input;
}

function update_prijs( we )
{
     getal=5.775993992
getal=Math.round(getal*10)/10;

alert(getal);
}

function bevestig( bericht)
{



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

    return confirm(bericht);
}

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 changeClass( id, to)
 {
      document.getElementById(id).className = to;

 }

 function openPopup(url,AAttr)
 {
	  AWindow=window.open(url,window.name+"X","resizable=no,scrollbars=no,status=0,menubar=no,width=360,height=480");

	  if(parseInt(navigator.appVersion)>=3)
		   AWindow.focus();

	  return false;
}
function sendTofriend(){
	window.open('http://www.dehorlogewebshop.nl/sendtofriend.php', 'SendToFriend', 'width=520,height=280,scrollbars=no,toolbar=no,location=no');
	return false;
}
function inlinePopUp(img)
{
	document.getElementById('inlinePopUp').style.display = 'block';
	document.getElementById('popImg').innerHTML = '<img src="/uploads/'+img+'" alt="" onclick="hideInlinePopUp()" />';
	return false;
}
function hideInlinePopUp()
{
	document.getElementById('inlinePopUp').style.display = 'none';
}