// JavaScript Document

img01 = new Image(); img01.src = "images/bg.gif"; 
img02 = new Image(); img02.src = "images/left.gif"; 
img03 = new Image(); img03.src = "images/right.gif"; 
img04 = new Image(); img04.src = "images/left_on.gif"; 
img05 = new Image(); img05.src = "images/right_on.gif";
img06 = new Image(); img06.src = "images/background.jpg"; 
img07 = new Image(); img07.src = "images/footer.jpg";

var a; var b; var c;
function contact(a, b, c){
	document.write('<a href="' + 'mailto:' + a + '@' + b + '.' + c + '">' + a + '@' + b + '.' + c + '<' + '/a>');}

function infowrite(a){
	document.write(a);}

<!-- Begin
var max_units = 3000; // quantities in excess of max_units all have the same unit price
var currency = "$"; // currency sign used in 'formatMessage()'
// Edit this function to reflect your discount prices! 

function getPrice(units) {
// Note: It is important to work your way down from max to min amounts!
alert
if (units > max_units) return 3.58 * units;
if (units >= 2501) return 3.63 * units;
if (units >= 2001) return 3.83 * units;
if (units >= 1501) return 3.88 * units;
if (units >= 1001) return 4.08 * units;
if (units >= 751) return 4.23 * units;
if (units >= 501) return 4.43 * units;
else  return 2200;
}

function getCPrice(units) {
// Note: It is important to work your way down from max to min amounts!
alert
if (units >= 1501) return 6.65 * units;
if (units >= 1001) return 7.30 * units;
if (units >= 751) return 7.90 * units;
if (units >= 501) return 8.75 * units;
if (units >= 175) return 9.40 * units;
else  return 1650;
}

function getNumberOfUnits() {
var units = document.calculator.units.value; 
return (units == "") ? 0 : units;
}

function showResult(result) {
// adjust the following line if result must popup somewhere else
document.calculator.respons.value = result;	

}

function formatMessage(price) {
return currency + formatPrice(price); //units + " * " + currency + formatPrice(unit_price) + " = " + currency + formatPrice(units * unit_price);
}
// AltUnits (alternate units): add extra units to reach minimum for next discount price
//function getAltUnits(units) {
//var discount_price = getDiscountPrice(units);
//if (units < max_units) do { units++ } while (discount_price == getDiscountPrice(units));
//return units;
//}

function findPrice() {
var units = getNumberOfUnits();
var price = getPrice(units);
//var alt_units = getAltUnits(units);
//var alt_unit_price = getDiscountPrice(alt_units);
var result;
//if ((units * unit_price) < (alt_units * alt_unit_price))
result = formatMessage(price);
//else
//result = formatMessage(alt_units, alt_unit_price);
showResult(result);

var concreteprice, concreteresult;
concreteprice = getCPrice(units);
concreteresult = formatMessage(concreteprice);
document.calculator.concrete.value = concreteresult;


}

function formatPrice(value) {
var result= Math.floor(value) + ".";
var cents = 100 * (value-Math.floor(value)) + 0.5;
result += Math.floor(cents / 10);
result += Math.floor(cents % 10);
return result;
}

function filterNonNumeric(field) {
var result = new String();
var numbers = "0123456789";
var chars = field.value.split(""); // create array 
for (i = 0; i < chars.length; i++) {
if (numbers.indexOf(chars[i]) != -1) result += chars[i];
}
if (field.value != result) field.value = result;
}
//  End -->


<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function P7_ShowPic(a,b) { //v2.0 by PVII
 var g,gg,d,dd,ic,im;if((g=MM_findObj(b))!=null){
 if(!document.P7ShowPic){document.P7ShowPic=true;}else{
 if((d=MM_findObj(document.P7SPlay))!=null){
  dd=(document.layers)?d:d.style;dd.visibility="hidden";}}
 document.P7SPlay=b;gg=(document.layers)?g:g.style;im=b+"im";
 if((ic=MM_findObj(im))!=null){ic.src=a;gg.visibility="visible";}}
}

function P7_Snap() { //v2.63 by PVII
 var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,tw,q0,xx,yy,w1,pa='px',args=P7_Snap.arguments;a=parseInt(a);
 if(document.layers||window.opera){pa='';}for(k=0;k<(args.length);k+=4){
 if((g=MM_findObj(args[k]))!=null){if((el=MM_findObj(args[k+1]))!=null){
 a=parseInt(args[k+2]);b=parseInt(args[k+3]);x=0;y=0;ox=0;oy=0;p="";tx=1;
 da="document.all['"+args[k]+"']";if(document.getElementById){
 d="document.getElementsByName('"+args[k]+"')[0]";if(!eval(d)){
 d="document.getElementById('"+args[k]+"')";if(!eval(d)){d=da;}}
 }else if(document.all){d=da;}if(document.all||document.getElementById){while(tx==1){
 p+=".offsetParent";if(eval(d+p)){x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
 }else{tx=0;}}ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);tw=x+ox+y+oy;
 if(tw==0||(navigator.appVersion.indexOf("MSIE 4")>-1&&navigator.appVersion.indexOf("Mac")>-1)){
  ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);}else{
  w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
  x=document.body.scrollLeft+event.clientX+bx;y=document.body.scrollTop+event.clientY;}}
 }else if(document.layers){x=g.x;y=g.y;q0=document.layers,dd="";for(var s=0;s<q0.length;s++){
  dd='document.'+q0[s].name;if(eval(dd+'.document.'+args[k])){x+=eval(dd+'.left');y+=eval(dd+'.top');
  break;}}}e=(document.layers)?el:el.style;xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
 if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
  xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);}
 e.left=xx+pa;e.top=yy+pa;}}}
}
