var blingblings = [];

function add_blingbling(object_id)
{
  blingblings[blingblings.length] = object_id;
}

function blingbling()
{
  for (var x = 0; x < blingblings.length; x++)
	{
	  if (document.getElementById(blingblings[x]))
	  {
	    if (document.getElementById(blingblings[x]).style.color == 'black')
	      document.getElementById(blingblings[x]).style.color = 'white';
	    else document.getElementById(blingblings[x]).style.color = 'black';
	  }
	}
  if (blingblings.length > 0) setTimeout('blingbling()', 1000);					
}

function show_login_div()
{
  document.getElementById('div_login').style.display = 'block';
  document.getElementById('div_lost_password').style.display = 'block';		
  document.getElementById('username').focus();
}

function hide_login_div()
{
  document.getElementById('div_login').style.display = 'none';
  document.getElementById('div_lost_password').style.display = 'none';	
}

function login()
{
	if (document.getElementById('new_user').checked)
	{
	  window.location = '?section=finalize&action=register';
	}
	else
	{
	  document.getElementById('login_form').submit();
	}	
	return false;
}

function send_finalize_registration()
{
	document.getElementById('registration_form').submit();
}

function send_customer_data()
{
	document.getElementById('customer_data_form').submit();
	return false;
}	

function show_address()
{
  document.getElementById('div_address').style.display = 'block';
	document.getElementById('address').focus();
}

function hide_address()
{
  document.getElementById('div_address').style.display = 'none';
}

function send_address()
{
	document.getElementById('address_form').submit();
	return false;
}

function show_cust_data()
{
  window.location = '?section=finalize';
}

function show_lost_password()
{
  window.location = '?section=lostpass';
}

function check_agree()
{
  if (!document.getElementById('agree1').checked)
	{
	  alert('U dient te verklaren alle gegevens naar waarheid\nte hebben ingevuld, alvorens uw bestelling\nkan worden geplaatst.');
	  return false;
	}
  if (!document.getElementById('agree2').checked)
	{
	  alert('U dient te verklaren akkoord te zijn gegaan met de\nAlgemene Voorwaarden, alvorens uw bestelling \nkan worden geplaatst.');
	  return false;
	}
	return true;			
}

function send_contact()
{
  document.getElementById('contact_form').submit();
}

function send_login()
{
  document.getElementById('login_form').submit();
}

function change_reaction_productline()
{
  window.location = '?section=reactions&productline=' + document.getElementById('productline').value;
}

function change_reaction_product()
{
  window.location = '?section=reactions&productline=' + document.getElementById('productline').value + '&product=' + document.getElementById('product').value;
}

function show_reaction(product_id)
{
  window.location = '?section=reactions&action=new&product=' + product_id;
}

function send_reaction()
{
  document.getElementById('reaction_form').submit(); 
}

function show_reaction_section(product_id)
{
  window.location = '?section=reactions&productline=0&product=' + product_id;
}

function show_home()
{
  window.location = '?section=home';
}

function show_login()
{
  window.location = '?section=login';
}

function show_customer_data()
{
  window.location = '?section=login&action=edit';
}

function send_logout()
{
  window.location = '?section=login&action=logout';
}

function show_registration()
{
	window.location = '?section=login&action=registration';
}

function send_registration()
{
  document.getElementById('registration_form').submit();  
}

function send_edit_customer_data()
{
	document.getElementById('edit_customer_data_form').submit();
}

function lost_password()
{
	window.location = '?section=login&action=lostpass';  
}

function send_lost_password()
{
	document.getElementById('lostpass_form').submit();  
}		

