function showConditions(conditions){
	
	if(conditions == false){
		document.getElementById('condition-holder').innerHTML = '<div id="conditions"><h1>Försäljningsvillkor</h1><h3>För privatpersoner:</h3><ul><li>Samtliga priser är inklusive 25 % Moms.</li><li>Leverans sker normalt inom tre arbetsdagar från erhållen beställning.</li><li>Beställningen levereras mot postförskott. Frakt och p.f. avgift tillkommer.<br/><b>Vid order över 2000 kr inkl. moms tillkommer inga avgifter.</b></li><li>Det är helt riskfritt för dig att beställa från Dianova AB eftersom du har full returrätt inom 10 dagar från mottagande av varan.<br/>Priset av varan som inte har använts återbetalas till dig.</li><li>Vid returnerat outlöst paket debiteras en avgift på 150kr.</li></ul><h3>För butiker, klubbar, föreningar, kommuner, företag:</h3><ul><li>Kontakta oss för prisuppgifter och försäljningsvillkor.</li></ul><p>Tag kontakt med Dianova för mer information.</p><p>Telefon: 070 - 56 940 80<br/>E-post: dianova (at) dianova-ab (dot) se</p><a href="" onClick="javascript:conditions=showConditions(conditions);return false;">Stäng</a></div>';
		conditions = true;
	}else{
		document.getElementById('condition-holder').innerHTML = '';
		conditions = false;
	}
	
	return conditions;
}

function showConditionsEng(conditions){
	
	if(conditions == false){
		document.getElementById('condition-holder').innerHTML = '<div id="conditions"><h1>Sales Conditions (abroad)</h1><h3>For private persons:</h3><ul><li>All prices includes swedish tax at 25% (for the EU Union). Outside of the EU Union tax will be excluded.</li><li>Payment before delivery. Freight cost will be added to the proforma invoice.</li><li>We send your order as soon as we have received your payment.</li></ul><h3>For stores, clubs, associations, companies etc.:</h3><ul><li>All prices ex. swedish tax. For the EU Union we need your VAT I.D number.</li><li>Payment before delivery. Freight and insuranse cost will be added to the proforma invoice.</li><li>We send your order as soon as we have received your payment.</li><li>For bigger quantity  ask for offer. Contact dianova@dianova-ab.se for more information.</li></ul><a href="" onClick="javascript:conditions=showConditions(conditions);return false;">Close</a></div>';
		conditions = true;
	}else{
		document.getElementById('condition-holder').innerHTML = '';
		conditions = false;
	}
	
	return conditions;
}

function hideConditions(){
	document.getElementById('condition-holder').innerHTML = '';
}

function setPaymentInfo(isChecked)
{
	with (window.document.frmCheckout) {
		if (isChecked) {
			txtPaymentFirstName.value  = txtShippingFirstName.value;
			txtPaymentLastName.value   = txtShippingLastName.value;
			txtPaymentAddress1.value   = txtShippingAddress1.value;
			txtPaymentPhone.value      = txtShippingPhone.value;
			txtPaymentState.value      = txtShippingState.value;			
			txtPaymentCity.value       = txtShippingCity.value;
			txtPaymentPostalCode.value = txtShippingPostalCode.value;
			
			txtPaymentFirstName.readOnly  = true;
			txtPaymentLastName.readOnly   = true;
			txtPaymentAddress1.readOnly   = true;
			txtPaymentAddress2.readOnly   = true;
			txtPaymentPhone.readOnly      = true;
			txtPaymentState.readOnly      = true;			
			txtPaymentCity.readOnly       = true;
			txtPaymentPostalCode.readOnly = true;			
		} else {
			txtPaymentFirstName.readOnly  = false;
			txtPaymentLastName.readOnly   = false;
			txtPaymentAddress1.readOnly   = false;
			txtPaymentAddress2.readOnly   = false;
			txtPaymentPhone.readOnly      = false;
			txtPaymentState.readOnly      = false;			
			txtPaymentCity.readOnly       = false;
			txtPaymentPostalCode.readOnly = false;			
		}
	}
}


function checkShippingAndPaymentInfo()
{
	with (window.document.frmCheckout) {
		if (isEmpty(txtShippingFirstName, 'Enter first name')) {
			return false;
		} else if (isEmpty(txtShippingLastName, 'Enter last name')) {
			return false;
		} else if (isEmpty(txtShippingAddress1, 'Enter shipping address')) {
			return false;
		} else if (isEmpty(txtShippingPhone, 'Enter phone number')) {
			return false;
		} else if (isEmpty(txtShippingState, 'Enter shipping address state')) {
			return false;
		} else if (isEmpty(txtShippingCity, 'Enter shipping address city')) {
			return false;
		} else if (isEmpty(txtShippingPostalCode, 'Enter the shipping address postal/zip code')) {
			return false;
		} else if (isEmpty(txtPaymentFirstName, 'Enter first name')) {
			return false;
		} else if (isEmpty(txtPaymentLastName, 'Enter last name')) {
			return false;
		} else if (isEmpty(txtPaymentAddress1, 'Enter Payment address')) {
			return false;
		} else if (isEmpty(txtPaymentPhone, 'Enter phone number')) {
			return false;
		} else if (isEmpty(txtPaymentState, 'Enter Payment address state')) {
			return false;
		} else if (isEmpty(txtPaymentCity, 'Enter Payment address city')) {
			return false;
		} else if (isEmpty(txtPaymentPostalCode, 'Enter the Payment address postal/zip code')) {
			return false;
		} else {
			return true;
		}
	}
}

