function getOrderTotal() {
	
	var total 	= 0.00;
	var totalPSD= 0.00;
	var totalw3 = 0.00;
	
	var pages = eval(document.forms['orderForm'].pages.value);
	
	if(document.forms['orderForm'].package.value == "basic" ) {
		baseCost = 149.00
		total = total + baseCost;
		
		totalPSD	= totalPSD	+ 159.00;
		totalw3		= totalw3	+ 229.00;
	}
			var pageHTML = document.getElementById("pageHTML");

	if(pages > 1) {
		var pageCost = ( (pages - 1) * (baseCost / 2) );
		total = total + pageCost;
		

		var pageCost = formatCurrency(baseCost / 2);

		pageHTML.innerHTML = "Total Pages (+" + pageCost  + " per additional page)";
		
		var w3pageCost = (pages - 1) * 172;
		totalw3		=	totalw3	+	w3pageCost;
		
		var PSDpageCost = ( (pages - 1) * (159 / 2) );
		totalPSD	=	totalPSD +	PSDpageCost;


	} else {
	
		if(document.forms['orderForm'].pages.value < 1)
			document.forms['orderForm'].pages.value = 1
		
		/* pageHTML.innerHTML = "Total Pages (Get the first 2 additional pages for free!)"; */

	}

	if(document.forms['orderForm'].wordpress.checked) {
		
		total 			= total 	+ 199.00;
		totalw3			= totalw3	+ 279.00;
		totalPSD		= totalPSD	+ 195.00;
	}
	
	if(document.forms['orderForm'].rush.checked) {
		
		total 			= total 	+ 49.00;
		totalw3			= totalw3	+ 180.00;
		
	}
		

	if(document.forms['orderForm'].strict.checked) {
	
		total 			= total + 9.00;
		totalPSD		= totalPSD + 10.00;
		totalw3			= totalw3 + 9.00;	
			

	}
		
	if(document.forms['orderForm'].flexible.checked) {
		total 			= total + 9.00;
		totalPSD		= totalPSD + 9.00 + 9.00;
		totalw3			= totalw3 + 9.00 + 9.00;
	}
		
	if(document.forms['orderForm'].dropdown_menu.checked) {
		
		total 			= total + 19.00;
		totalPSD		= totalPSD + 19.00
		totalw3			= totalw3 + 9.00
		
	}
		
	/* if(document.forms['orderForm'].ie6compatable.checked)
		total = total + 9.00;
	*/
	
	if(document.forms['orderForm'].comments.checked) {
		total 			= total + 9.00;
		totalPSD		= totalPSD + 9.00;
		totalw3			= totalw3 + 9.00;
	}

	/* add in other costs that we already include for free */
	
	/* company 		|* cost *|			|* Service *|		*/
	
		totalPSD	= totalPSD + 9.00;	// load speed optimization
		totalw3		= totalw3 + 19.00;	// load speed optimization
		
		totalw3		= totalw3 + 27.00;	// opera, ie6 and safari compatability;
		totalPSD	= totalPSD + 9.00;	// ie6 compatability
		
		
	document.forms['orderForm'].total.value = total;	

	total = formatCurrency(total);
	
	var totalHTML = document.getElementById("totalHTML");
	
	totalHTML.innerHTML = total;

//	var totalw3HTML = document.getElementById("totalw3HTML");
//	totalw3 = formatCurrency(totalw3);
//	totalw3HTML.innerHTML = totalw3;
	
//	var totalPSDHTML = document.getElementById("totalPSDHTML");
//	totalPSD = formatCurrency(totalPSD);
//	totalPSDHTML.innerHTML = totalPSD;


	
}

function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
}

function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links=document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popup")) {
      links[i].onclick=function() {
        // Below - to open a full-sized window, just use: window.open(this.href);
        window.open(this.href, "", "top=40,left=40,width=1020,height=650,scrollbars");
        return false;
      }
    }
  }
}
window.onload=doPopups;

