<!-- Hide

                           //

                           // ===========================================================

                           //	You are free to use any or all of this script in any way you wish.

                           //	The only thing we ask is that if you do use it, please do the following:

                           //	1. Browse our web pages at www.projcomplete.com to see if you have

                           //		a need for our services.

                           //	2. Tell your friends to do the same.

                           //	3. Send us mail at larson@projcomplete.com to let us know if you found the script

                           //		helpful and any suggestions you might have for improvement.

                           //	4. If you make improvements, please send us a copy.

                           // ===========================================================

                           //

                           // pricing array

                           //

                           // initialize array with n entries

                           function MakeArray(n) {

                           	this.length = n

                           	for (var i = 1; i <= n; i++) {

                           		this[i] = 0

                           	}

                           	return this

                           }

                           // stuff "rows" of data for a pseudo-two-dimensional array

                           function item(name,time, rate) {

                           	this.name = name

                           	this.time = time

                           	this.rate = rate

                           }

                           // create a pseudo-two-dimensional array

                           itemlist = new MakeArray(8)

                           itemlist[0] = new item("Pages","1",  "90")

                           itemlist[1] = new item("Custom Logo","3",  "35")

                           itemlist[2] = new item("Header Graphic","1",  "55")
				
			   			   itemlist[3] = new item("Flash","1",  "90")

                           itemlist[4] = new item("Custom Graphics","1",  "55")

                           itemlist[5] = new item("Basic email form","1",  "65")

                           itemlist[6] = new item("Dynamic Menu","1",  "75")

                           itemlist[7] = new item("Custom Form","1",  "55")
                           itemlist[8] = new item("Secure Order Form","1",  "150")

                         

                           //

                           // input string validation function (number)

                           //

                           function isValidNumber(inputStr) {

                           var gotItOnce = 0

                           // check the entire string

                           	for (var i=0; i< inputStr.length; i++) {

                           		var oneChar = inputStr.substring(i, i+1)

                           		if (oneChar == ".") {

                           // count the periods

                           			gotItOnce++

                           		}

                           // make sure we have only one period

                           		if (gotItOnce > 1) {

                           			alert("The character '" + oneChar + "' is not a number. Please make sure you enter only numbers.")

                           			return false

                           		}

                           // make sure each character is a number or a period	

                           		if ((oneChar < "0" || oneChar > "9")&&(oneChar != ".")) {

                           			alert("The character '" + oneChar + "' is not a number. Please make sure you enter only numbers.")

                           			return false

                           		}

                           	}

                           	return true

                           }

                           //

                           // positive number decimal formatting function

                           //

                           function format(expr, decplaces) {

                           // raise incoming value by power of 10 times the

                           // number of decimal places; round to an integer; convert to string

                           	var str = "" + Math.round(eval(expr) * Math.pow(10, decplaces))

                           // pad small value strings with zeros to the left of rounded number

                           	while (str.length <= decplaces) {

                           		str = "0" + str

                           	}

                           // establish location of decimal point

                           	var decpoint = str.length - decplaces

                           // assemble final result from: (a) the string up to the position of 

                           // the decimal point; (b) the decimal point; and (c) the balance

                           // of the string. return finished product.

                           	return str.substring(0, decpoint) + "." + str.substring(decpoint, str.length);

                           }

                           //

                           // interger input calculation function

                           //

                           function intcalculate(form,itemnumber) {

                           // calculate the cost for base pages

                           // first make sure that there is an entry in the field

                           	if (form.elements[itemnumber*2].value.length != 0) {

                           // next check to make sure the field contains a valid number

                           		if (isValidNumber(form.elements[itemnumber*2].value)) {

                           // next set up the proper number of decimal places

                           			form.elements[itemnumber*2].value=Math.round(form.elements[itemnumber*2].value,0)

                           // finally calculate the "base pages" line item cost

                           			var cost = format(parseFloat(form.elements[itemnumber*2].value*itemlist[itemnumber].time*itemlist[itemnumber].rate),2)

                           			form.elements[(itemnumber*2)+1].value= cost

                           			return parseFloat(cost)

                           		}

                           	}

                           }

                           //

                           // make new window function

                           //

                           function makeNewWindow(newURL) {

                           	var newwindow=window.open(newURL,"","scrollbars,resizable,height=200,width=400")

                           	newwindow=window.open(newURL,"","scrollbars,resizable,height=200,width=400")

                           }

                           //

                           // calculate function

                           //

                           function calculate(form) {

                           	var totalcost=parseFloat(0)

                           	var cost=parseFloat(0)

                           	for (var i=0; i<= 8; i++) {

                           		intcalculate(form,i)

                           	}8

                           	for (var i=0; i<=8; i++) {

                           		cost = parseFloat(form.elements[(i*2)+1].value)

                           		totalcost=totalcost+cost

                           	}

                           	form.grandtotalcost.value=format(totalcost,2)

                           	return true

                           }

                           // END HIDING -->

