//Categories Cart Calculator
OneCat = 99;
AddCat = 39;

function calculate(what) {
	what.answer.value = 0;
		for (var i=1,answer=0;i<21;i++)    
		answer += (what.elements['Cat' + i].checked) & (what.elements['Cat' + i].value-0);
		what.answer.value = answer;

	if (answer == 0) {
	document.form.Invoice.value = "0.00";
	}
	
	if (answer == 1) {
	document.form.Invoice.value = OneCat + ".00";
	}
	
	if (answer == 2) {
	document.form.Invoice.value = OneCat + AddCat + ".00";
	}

	if (answer == 3) {
	document.form.Invoice.value = OneCat + AddCat * 2 + ".00";
	}

	if (answer == 4) {
	document.form.Invoice.value = OneCat + AddCat * 3 + ".00";
	}

	if (answer == 5) {
	document.form.Invoice.value = OneCat + AddCat * 4 + ".00";
	}

	if (answer == 6) {
	document.form.Invoice.value = OneCat + AddCat * 5 + ".00";
	}

	if (answer == 7) {
	document.form.Invoice.value = OneCat + AddCat * 6 + ".00";
	}

	if (answer == 8) {
	document.form.Invoice.value = OneCat + AddCat * 7 + ".00";
	}

	if (answer == 9) {
	document.form.Invoice.value = OneCat + AddCat * 8 + ".00";
	}
	
	if (answer == 10) {
	document.form.Invoice.value = OneCat + AddCat * 9 + ".00";
	}

	if (answer == 11) {
	document.form.Invoice.value = OneCat + AddCat * 10 + ".00";
	}

	if (answer == 12) {
	document.form.Invoice.value = OneCat + AddCat * 11 + ".00";
	}

	if (answer == 13) {
	document.form.Invoice.value = OneCat + AddCat * 12 + ".00";
	}

	if (answer == 14) {
	document.form.Invoice.value = OneCat + AddCat * 13 + ".00";
	}

	if (answer == 15) {
	document.form.Invoice.value = OneCat + AddCat * 14 + ".00";
	}

	if (answer == 16) {
	document.form.Invoice.value = OneCat + AddCat * 15 + ".00";
	}

	if (answer == 17) {
	document.form.Invoice.value = OneCat + AddCat * 16 + ".00";
	}

	if (answer == 18) {
	document.form.Invoice.value = OneCat + AddCat * 17 + ".00";
	}

	if (answer == 19) {
	document.form.Invoice.value = OneCat + AddCat * 18 + ".00";
	}

	if (answer == 20) {
	document.form.Invoice.value = OneCat + AddCat * 19 + ".00";
	}
}


//Add Text Area Maximum Counter
 var limit = 7600;
 function check() {
   if(document.form.Ad_Text.value.length > limit) {
     alert('Too much data!');
     document.form.Ad_Text.focus();
     return false; }
   else
     return true; }
 function update() {
   var old = document.form.counter.value;
   document.form.counter.value=document.form.Ad_Text.value.length;
   if(document.form.counter.value > limit && old <= limit) {
     alert('Too much data in the text box!');
     if(document.styleSheets) {
       document.form.counter.style.fontWeight = 'bold';
       document.form.counter.style.color = '#ff0000'; } }
   else if(document.form.counter.value <= limit && old > limit
	   && document.styleSheets ) {
       document.form.counter.style.fontWeight = 'normal';
       document.form.counter.style.color = '#000000'; } 
   }


