var showCustomerLogin = true;
function showCustomerLoginBox()
{
	var Element = getElement('id', 'customerLoginBox', 0);
	var ElementData = getElement('id', 'customerDataBox', 0);

	if(showCustomerLogin)
	{
		Element.style.display = 'block';
		ElementData.style.display = 'none';
	}
	else
	{
		Element.style.display = 'none';
		ElementData.style.display = 'block';
	}

	showCustomerLogin = !showCustomerLogin;
}

var showCustomerRegistration = true;
function showCustomerRegistrationBox()
{
	var Element = getElement('id', 'customerRegistrationBox', 0);
	//var ElementButton = getElement('class', 'contentBoxFormButton', 0);

	if(showCustomerRegistration)
	{
		Element.style.display = 'block';
		//Element.style.visibility = 'visible';
		//ElementButton.style.display = 'none';
	}
	else
	{
		Element.style.display = 'none';
		//Element.style.visibility = 'hidden';
		//ElementButton.style.display = 'block';
	}
	showCustomerRegistration = !showCustomerRegistration;
}

//var showBankCollectionDetail = false;
//var showCreditCardDetail = false;
//var showGiroPayDetail = false;

function showBankCollectionDetailBox(visible)
{
	var element = getElement('id', 'bankCollectionDetail', 0);
	if(element)
	{
		if(visible)
		{
			element.style.display = 'block';
			showCreditCardDetailBox(false);
			showGiroPayDetailBox(false);
		}
		else
		{
			element.style.display = 'none';
		}
	}
}


function showCreditCardDetailBox(visible)
{
	var element = getElement('id', 'creditCardDetail', 0);
	if(element)
	{
		if(visible)
		{
			element.style.display = 'block';
			showBankCollectionDetailBox(false);
			showGiroPayDetailBox(false);
		}
		else
		{
			element.style.display = 'none';
		}
	}
}


function showGiroPayDetailBox(visible)
{
	var element = getElement('id', 'giroPayDetail', 0);
	if(element)
	{
		if(visible)
		{
			element.style.display = 'block';
			showBankCollectionDetailBox(false);
			showCreditCardDetailBox(false);
		}
		else
		{
			element.style.display = 'none';
		}
	}
}

function showMoneyCardDetailBox(visible)
{
	showBankCollectionDetailBox(false);
	showGiroPayDetailBox(false);
	showCreditCardDetailBox(false);
}

function processVatID()
{
	var element = getElement('id','inputCompany',0);
	if(element.value.length > 0)
	{
		showVatIDContainer(true);
	}
	else
	{
		showVatIDContainer(false);
	}
}

function showVatIDContainer(visible)
{
	var element = getElement('id','vatIDContainer',0);
	if(visible)
	{
		element.style.display = 'block';
	}
	else
	{
		element.style.display = 'none';
	}
}

function trimString(value)
{
  while (value.substring(0,1) == ' ') {
    value = value.substring(1,value.length);
  }
  while (value.substring(value.length-1,value.length) == ' ') {
    value = value.substring(0,value.length-1);
  }
  return value;
}


function processVatIDCountry(country)
{
	var element = getElement('id','inputCompany',0);
	var element_vat_id = getElement('id','vat_id',0)

	vatId = this.trimString(element.value);

	if((vatId.length > 0))
	{
		showVatIDContainer(true);
	}
	else
	{
		showVatIDContainer(false);
		element_vat_id.value = '';
	}
}

function getCountryValue()
{
	var element = getElement('id','country',0);
	return element.value;
}

function fire(id)
{
	var formElement = getElement('id',id,0);
	formElement.submit();
}

