
function chkfields_interestbegagnat() {

	var email = window.document.frmInterestBegagnat.frmEpost;
	
	//If email isn't given or default-text is left
	//then don't submit form
	if (!email.value || email.value == '{ange din epost-adress}') {
	
		window.alert('Du måste fylla i din epost-adress!');
		window.document.frmInterestBegagnat.action = '';
	
	}
	else {
	

		return true;
	
	}
	

}

function chkfields_contact() {

	var typedname = window.document.frmContact.frmNameContact;
	var email = window.document.frmContact.frmMailContact;
	var phone = window.document.frmContact.frmPhoneContact;	
	var mess = window.document.frmContact.frmMessageContact; 

	var titta = 1;
	
	if (titta == 1 && !typedname.value) {

		titta = 0;
		typedname.focus();		

	}

	if (titta == 1 && (!phone.value && !email.value)) {

		titta = 0;
		email.focus();
							
	}

	if (titta == 1 && !mess.value) {

		titta = 0;
		mess.focus();

	}

	
	if (titta == 1) {
		window.document.frmContact.action='Index.aspx?ReturnUrl=mail_contact';
		window.document.frmContact.submit();
	}
	else {
	window.document.frmContact.action=''; //Because of no redirect by "default-submit function
	}


}


function chkfields_newcustomer() {
			
	var country = window.document.newCustomerForm.frmCountry;
	var company = window.document.newCustomerForm.frmCompany;
	var orgnr = window.document.newCustomerForm.frmOrgnr;	
	var street = window.document.newCustomerForm.frmStreet; 
	var postnr = window.document.newCustomerForm.frmPostnr; 
	var ort = window.document.newCustomerForm.frmOrt; 
	var phone = window.document.newCustomerForm.frmPhone; 
	var mail = window.document.newCustomerForm.frmMail; 
	var fax = window.document.newCustomerForm.frmFax; 

	var titta = 1;
	
	if (titta == 1 && !country.value) {
		titta = 0;
		country.focus();		
	}

	if (titta == 1 && !company.value) {
		titta = 0;
		company.focus();		
	}

	if (titta == 1 && !orgnr.value) {
		titta = 0;
		orgnr.focus();		
	}
	
	if (titta == 1 && !street.value) {
		titta = 0;
		street.focus();		
	}

	if (titta == 1 && !postnr.value) {
		titta = 0;
		postnr.focus();		
	}

	if (titta == 1 && !ort.value) {
		titta = 0;
		ort.focus();		
	}

	if (titta == 1 && !orgnr.value) {
		titta = 0;
		orgnr.focus();		
	}

	if (titta == 1 && !phone.value) {
		titta = 0;
		phone.focus();		
	}

	if (titta == 1 && !mail.value) {
		titta = 0;
		mail.focus();		
	}

	if (titta == 1 && !fax.value) {
		titta = 0;
		fax.focus();		
	}





	
	
	if (titta == 1) {
		window.document.newCustomerForm.action='Index.aspx?ReturnUrl=mail_newcustomer';
		window.document.newCustomerForm.submit();
	}
	else {
	window.document.newCustomerForm.action=''; //Because of no redirect by "default-submit function
	}


}


