 var occ = {
	MesseHaandbog: {
		addQuantity: function(id,kategori){
		  var antal = document.getElementById("antal"+id).value;
		  window.location = "?category="+kategori+"&addProduct="+id+"&antal="+antal;
	    	},

		thousandSeperator: function(price){
		  price += '';

		  if (price.length == 4){
		      price = price.substring(0,1) + '.' + price.substring(1,4);
		  }
		  else if(price.length == 5){
		      price= price.substring(0,2) + '.' + price.substring(2,5);
		  }
		  else if(price.length == 6){
		      price= price.substring(0,3) + '.' + price.substring(3,6);
		  }
		  document.write(price);
		}
	}
  }


function submitSucces(field){
	$('#'+field).html($('#updated').val());
	$('#verifier').val($('#verifier').val() + field + ',');

	isValid = true;
	confirmThing = $('#verifier').val();

	if(confirmThing.indexOf('companyDataBtn') == -1){ isValid = false;}
	if(confirmThing.indexOf('companyProfileBtn') == -1){ isValid = false;}

	if(isValid == true){
		$('#continueBtn').removeAttr("disabled");
	}
}

function updateCompanyData(){
var isValid = true;

if($('#cid').val().length == 0){isValid = false; alert("Der er sket en fejl, luk venligst vinduet ned og logind påny.");}
if($('#companyAddress').val().length == 0){isValid = false; alert($('#addressName').html());}
if($('#companyCity').val().length == 0){isValid = false; alert($('#cityName').html());}
if($('#companyZip').val().length == 0){isValid = false; alert($('#zipcodeName').html());}
if($('#companyCountry').val().length == 0){isValid = false; alert($('#countryName').html());}
if($('#companyTlf').val().length == 0){isValid = false; alert($('#tlfName').html());}
if($('#companyEmail').val().length == 0){isValid = false; alert($('#emailName').html());}


if(isValid != false){
	companyId = $('#cid').val();
	$('#companyDataBtn').html('Loading...');
	$('#submitVirksomhedsData').attr('src', '/system/formularer/reminder---company.aspx?'+ $.param({
		cid: companyId,
		companyCity: $('#companyCity').val(),
		companyZip: $('#companyZip').val(),
		companyAddress: $('#companyAddress').val(),
		companyCountry: $('#companyCountry').val(),
		companyTlf: $('#companyTlf').val(),
		companyFax: $('#companyFax').val(),
		companyEmail: $('#companyEmail').val(),
		companyWebsite: $('#companyWebsite').val(),
		companyEanNumber: $('#companyEanNumber').val()
	}))
}
}

function updateCompanyProfile(){
isValid = true;

if(isValid != false){
	$('#companyPofileBtn').html('Loading...');
	$('#submitVirksomhedsProfil').attr('src', '/system/formularer/reminder---profile.aspx?' + $.param({
	        CompanyMId: $('#CompanyMId').val(),
		messeCompanyProfileDK: $('#messeCompanyProfileDK').val(),
		messeCompanyProfileUK: $('#messeCompanyProfileUK').val(),
		messeDeltagStandnr: $('#messeDeltagStandnr').val(),
		company: $('#company').val()
	}))
}
	
}

