	var wait_window;
	
	function openpop()
	{
		wait_window= window.open ("","waitwindow","width=350,height=100");
		wait_window.document.write('<center><H3>Please wait while we process your request ...</H3><img src="images/wait.gif"></center>');
		return true;
	}
	
	function exitpop()
	{
		wait_window.close ();
	}


	function makeInteger(val)
	{
		if (isBlank(val)){return "0";}
		for(var i=0;i<val.length;i++)
		{
			if(!isDigit(val.charAt(i))){return "0";}
		}
		return val;
	}

	function isBlank(val)
	{
		if(val==null){return true;}
		for(var i=0;i<val.length;i++)
		{
			if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){return false;}
		}
		return true;
	}

	function isDigit(num)
	{
		if (num.length>1){return false;}
		var string="1234567890";
		if (string.indexOf(num)!=-1){return true;}
		return false;
	}

	function networkQuote()
	{
		networkcost = 0;

		if (quoteform.network[0].checked) { networkcost = 500; }  // basic flat fee for wired
		if (quoteform.network[1].checked) { networkcost = 300; }  // basic flat fee for wireless
		if (quoteform.network[2].checked) { networkcost = 700; }  // basic flat fee for hybrid

		if (quoteform.floors[0].checked)  { networkcost = networkcost; }  // 1 floor
		if (quoteform.floors[1].checked)  { networkcost *= 2; }  // 2 floors
		if (quoteform.floors[2].checked)  { networkcost *= 3; }  // 3 floors
		if (quoteform.floors[3].checked)  { networkcost *= 5; }  // 4 floors

		wallfeet = parseInt(makeInteger(quoteform.cablewall.value));
		if (wallfeet > 0) networkcost += 300; 																// flat fee wall installation
		networkcost += wallfeet * 10; // per foot in wall
		
		networkcost += parseInt(makeInteger(quoteform.cablefree.value)) * 3; 	// per foot free running

		stations = parseInt(makeInteger(quoteform.networkstations.value));
		if (stations > 15)
		{
			networkcost += stations * 80 + 1000; 		// per station cost, plus bridge
		}
		else
		{
			networkcost += stations * 70; 	
		}

		if (quoteform.cubicles[0].checked) { networkcost += 500; networkcost *= 1.2;}  // cubicles installation

		networkcost += parseInt(makeInteger(quoteform.wirelessdistance.value))/30 * 100; 	// additional access points


		if (quoteform.wan[0].checked) { networkcost += 500; }  				// basic flat fee for router
		if (quoteform.firewall[0].checked) { networkcost += 1500; }		// basic flat fee for firewall and configuration

		networkcost = networkcost * 1.2;		// 20% labor

		networkcost = Math.floor(networkcost);

		quoteform.hiddennetworkquote.value = "$" + networkcost.toString();
		quoteform.networkquote.value = "$" + networkcost.toString();
	}


	function appQuote()
	{
		appcost = 0;

		if (quoteform.apptype[0].checked) { appcost += 1000; }  // Simple
		if (quoteform.apptype[1].checked) { appcost += 1300; }  // Web Services
		if (quoteform.apptype[2].checked) { appcost += 800; }   // Client/Server
		if (quoteform.apptype[3].checked) { appcost += 1000; }  // Other

		appcost += parseInt(makeInteger(quoteform.entities.value)) * 500; 	// per entity
		appcost += parseInt(makeInteger(quoteform.screens.value)) * 300; 	  // per screen
		appcost += parseInt(makeInteger(quoteform.reports.value)) * 600; 	  // per report
		appcost += parseInt(makeInteger(quoteform.feeds.value)) * 200; 	  	// per feed
		appcost += parseInt(makeInteger(quoteform.services.value)) * 500; 	// per service
		
		if (quoteform.graphics[0].checked) appcost += 1200; 	  						// graphics
		if (quoteform.migration[0].checked) appcost += 1500; 	  						// migration

		if (quoteform.platform[0].checked) { appcost *= 1.7; }  // Windows .net
		if (quoteform.platform[1].checked) { appcost *= 1.5; }  // Windows visual studio
		if (quoteform.platform[2].checked) { appcost *= 1.9; }  // Java/unix
		if (quoteform.platform[3].checked) { appcost *= 1.4; }  // Other

		if (quoteform.database[0].checked) { appcost *= 1.2; }  // SQL Server
		if (quoteform.database[1].checked) { appcost *= 1.3; }  // Oracle
		if (quoteform.database[2].checked) { appcost *= 1.3; }  // Db2
		if (quoteform.database[3].checked) { appcost *= 1.3; }  // Sybase
		if (quoteform.database[4].checked) { appcost *= 1.2; }  // Mysql
		if (quoteform.database[5].checked) { appcost *= 1.2; }  // Access
		if (quoteform.database[6].checked) { appcost *= 1.0; }  // none

		if (quoteform.complexity[0].checked) { appcost *= 1.0; }  // low
		if (quoteform.complexity[1].checked) { appcost *= 1.2; }  // medium
		if (quoteform.complexity[2].checked) { appcost *= 1.4; }  // high

		if (quoteform.appsecurity[0].checked) { appcost *= 1.1; }  // low
		if (quoteform.appsecurity[1].checked) { appcost *= 1.2; }  // medium
		if (quoteform.appsecurity[2].checked) { appcost *= 1.3; }  // high

		appcost = appcost  * 1.2;		// 20% Overhead

		appcost = Math.floor(appcost);

		quoteform.hiddenappquote.value = "$" + appcost.toString();
		quoteform.appquote.value = "$" + appcost.toString();
}