// JavaScript Document
var min=8;
var max=18;
function increaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}

function go() {
	box = document.form.nav;
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}

//for Permit Fee Calculation Sheet

	function calc1()
	{
		var num1;
		var num2;
		var num3;
		var total;
		
		if( (document.form.value1.value * .024).toFixed(2) > 75) {
			document.form.balance1.value = (document.form.value1.value * .024).toFixed(2);
		} else {
			document.form.balance1.value = 75;
		}
		
		document.form.balance2.value = (document.form.value2.value * .018).toFixed(2); 
		num1 = eval(document.form.balance1.value);
		num2 = eval(document.form.balance2.value);
		total = num1 + num2;
		
		document.form.totalPermitFee.value = total;
		
		document.form.fee1.value = total;
		
		if( (document.form.fee1.value * .01).toFixed(2) > 1) {
			document.form.balance3.value = (document.form.fee1.value * .01).toFixed(2);
		} else {
			document.form.balance3.value = 1;
		}
				
		calc2();
	}
	
	function calc2()
	{
		var num1;
		var num2;
		var num3;
		var total;
		num1 = eval(document.form.balance3.value);
		num2 = eval(document.form.balance4.value);
		num3 = eval(document.form.totalPermitFee.value);
		total = num1 + num2 + num3;
		
		document.form.total.value = total.toFixed(2);
	}

	function myAlert()
	{
		alert('Once you have completely filled out the permit application below, you must deliver the application in person along with payment to Construction Services Department; P.0. Box 3366; West Palm Beach, Florida 33402.');
		document.form.submit();
	}
	
	function conVertFee() {
		alert('Once you have completely filled out the permit application below, you must deliver the application in person along with payment to Construction Services Department; P.0. Box 3366; West Palm Beach, Florida 33402.');
		document.form.action = 'fee_pdf.php';
		document.form.submit();
	}
