/* author: cliveb@senet.com.au */
/* Generated by AceHTML Freeware http://freeware.acehtml.com */
/* Creation date: 12/04/05 */

need = new Array(8), needlist = new Array(3), needindex = new Array(3);
var dinverter= new Array(7), dnon = new Array(4), doption = new Array(6);
var cneed, cneed2, ccontact, coptions, ctots, cunit, cmneed, expdate, unitmu=0.06, depositrt=0.2;
hot = new Array("deliciously cool in summer"," so you get a good nights sleep"," so your child(ren) don&#146;t suffer heat stress","so you keep cool for your health"," so you feel comfortable");
cold = new Array("snugly warm in winter"," so you have warm feet"," so your child(ren) don&#146;t get ill due to the cold"," so you can keep warm for your health"," so you feel comfortable");
quiet = new Array("whisper quiet"," so you get a good nights sleep"," so you can watch TV in peace and quiet"," so you listen to the HiFi in peace and quiet"," so you don&#146;t annoy the neighbours"," so you can relax in your garden");
run = new Array("cheap to run"," so you get a smaller summer electricity bill"," so you get a smaller winter electricity bill"," so you produce less Greenhouse Gas"," so you minimise energy use");
reliable = new Array("reliable"," so you get an air conditioner that works when you need it the most"," so you minimise repair costs"," so you don&#146;t waste time waiting for service");
buy = new Array("cheap to buy"," so you get the cheapest price (with no extras)"," so you get value for money"," so you get no extra costs");
attractive = new Array("attractive"," so you get an attractive indoor unit"," so you get an attractive outdoor unit"," so you get an attractive installation"," so you don&#146;t get condensate making a mess");
other = new Array("other reason","please type the other reason");
need2qu = new Array(hot,cold,quiet,run,reliable,buy,attractive,other);

function costdat(item,rate) {
this.item=item;
this.rate=rate;
}

function moddat(model,cool,heat,cost,inst) {
this.model=model;
this.cool=cool;
this.heat=heat;
this.cost=cost;
this.inst=inst;
}

function loadmodels() {
dinverter[0]=new moddat('FTXE25B',2.5,3.4,1017,585);
dinverter[1]=new moddat('FTXE35B',3.6,4.2,1187,585);
dinverter[2]=new moddat('FTXD50BV4',4.8,6.0,1635,585);
dinverter[3]=new moddat('FTXD50B',5.2,6.5,1636,585);
dinverter[4]=new moddat('FTXD60B',6.2,7.2,1833,585);
dinverter[5]=new moddat('FTXD71B',7.1,8.5,2086,630);
dinverter[6]=new moddat('FTXD80B',8.0,9.5,2546,630);

dnon[0]=new moddat('FTY25C',2.5,3.4,921,585);
dnon[1]=new moddat('FTY35C',3.6,4.2,1054,585);
dnon[2]=new moddat('FTY50GA',5.2,6.1,1334,585);
dnon[3]=new moddat('FTY60GA',6.2,7.2,1489,585);

doption[0]=new costdat('refrig',30)
doption[1]=new costdat('elec',10)
doption[2]=new costdat('drain',50)
doption[3]=new costdat('wall',70)
doption[4]=new costdat('paver',40)
doption[5]=new costdat('supports',40)
}

function needquwr(form) {
for (i=0; i<needindex.length; i++) {
//alert("need2qu[needindex[i]][0] " + need2qu[needindex[i]][0]);
if (need2qu[needindex[i]][0]=='other reason') {
//test()
document.write("<tr><td>What is the main other need you have for the air conditioner?<\/td><td><input type='text' name='other' value='type your reason here' size='40' maxlength='256'><\/select><\/td><\/tr>");
//form.elements[i].focus();
//form.elements[i].select();
}
else {
document.write("<tr><td>What is the main reason you want the air conditioner to be " + need2qu[needindex[i]][0] + "\?<\/td>");
document.write("<td><select name=mneed'" + i + " class='sel' size='1' class='bckgrndlt'>");
document.write("<option selected value=''>Choose an option<\/option>");
//alert("need2qu[needindex[i]].length " + need2qu[needindex[i]].length)
for (j=1; j<need2qu[needindex[i]].length; j++) {
needterm=need2qu[needindex[i]][j];
//alert("needterm " + needterm)
document.write("<option value='" + needterm + "'>" + needterm + "<\/option>");
}
document.write("<\/select><\/td><\/tr>");
}
}
}

function outdoorquwr(form,clist) {
//alert("clist[1] " + clist[1])
writeflg=0;//flag to check if any text is written
if (clist[1] == "true") {
document.write("<tr><td><h2>Clearance from obstructions.</h2> The cooler won't work properly if there are substantial obstructions (like a fence, shed or large bush) in front of the outdoor unit. ");
document.write("The air coming out of the cooler will simply bounce off the obstruction and go back into the cooler. This is called recirculation and the cooler will simply not heat or cool properly. <\/td>");
document.write("<td>Can the outdoor unit be mounted on the wall of the house so that the top of the outdoor unit is level with or above the obstruction?<\/td>");
document.write("<td> <select name='wall'  class='sel' size='1'><option selected value='true'>Mount on wall</option><option value='false'>Can't mount on wall</option></select><\/td><\/tr>");
writeflg=1;
}
else {
document.write("<input type='hidden' name='wall' value='false'>");
}
if (clist[3] == "true") {
if (clist[4] == "true") {
document.write("<tr><td><h2>Distance from neighbours.</h2> The cooler shouldn't annoy the neighbours, however if they wanted to they may be able to stop you running the air conditioner at night and early morning. ");
document.write("If there is an alternative acceptable solution (perhaps facing the back fence or even the street), I recomend you use the back button below to review the alternative. <\/td>");
document.write("<td>Can the outdoor unit be relocated?<\/td><td> yes<input type='radio' name='relocate' value='yes'> no<input type='radio' name='relocate' value='no' checked><\/td><\/tr>");
writeflg=1;
}
if (clist[5] == "true") {
document.write("<tr><td><h2>Distance from neighbours.</h2> The cooler might annoy the neighbours, and if they wanted to they may be able to stop you running the air conditioner at night and early morning. ");
document.write("If there is an alternative acceptable solution (perhaps facing the back fence or even the street), I recomend you use the back button below to review the alternative. <\/td>");
document.write("<td>Can the outdoor unit be relocated?<\/td><td> yes<input type='radio' name='relocate' value='yes'> no<input type='radio' name='relocate' value='no' checked><\/td><\/tr>");
writeflg=1;
}
}
else {
document.write("<input type='hidden' name='relocate' value='true'><input type='hidden' name='relocate' value='false'></p>");
}
if (clist[6] == "true") {
document.write("<tr><td><h2>Entertainment area.</h2> If you are likely to want to use the air conditioner when you are using the entertainment area, see if there is an alternative acceptable solution. The outdoor unit will both create noise and blow hot air (cold in winter). I recomend you use the back button below to review the alternatives. ");
document.write("If there is no reasonable alternative can the air conditioner be located so it is blowing down one edge of the area?  <\/td>");
document.write("<td>Have you selected the best compromise?<\/td><td> yes<input type='radio' name='ent' value='yes'> no<input type='radio' name='ent' value='no' checked><\/td><\/tr>");
writeflg=1;
}
else {
document.write("<input type='hidden' name='ent' value='true'><input type='hidden' name='ent' value='false'></p>");
}
}

function optionwr(form,wall) {
if (wall=="false") {
document.write("<input type='hidden' name='wall' value='false'>");
document.write("<tr><td>Is the outdoor unit location on a concrete path (or similar smooth, level, hard surface)?</td><td class='left'>   <select name='paved' class='sel' size='1'><option selected value='true'>Concrete path</option><option value='false'>Garden</option></select><\/td><\/tr>");
}
else {
document.write("<input type='hidden' name='wall' value='true'>");
document.write("<input type='hidden' name='paved' value='false'>");
}
//alert('form.wall.value' + form.wall.value)
}
              
function expireDate(months) {
var expireDate;
expireDate = new Date;
month = expireDate.getMonth();
month = month + eval(months);
expireDate.setMonth(month);
return expireDate;
}
		
function csplit(cookie) {
var csplit;
var cookieval;
cookieval = GetCookie (cookie);
if (cookieval != null) {
re = /[,]/
csplit = cookieval.split(re)
//alert("csplit " + csplit)
}
return csplit;
}

function savearray(darray,cookiename) {
//does csplit load the array?
expdate = expireDate(6);
SetCookie (cookiename,darray,expdate,'/');
}
		
function savename(form) {
expdate = expireDate(6);
cindex = form.category1.value + "," + form.category2.value;
SetCookie ('cindex',cindex,expdate,'/');
}

function save(form,cookiename) {
expdate = expireDate(6);
var cookie="";
for (i=0; i<form.length-3; i++) {
if (form.elements[i].type == 'checkbox' || form.elements[i].type == 'radio') {
cookie = cookie + "," + form.elements[i].checked;
}
else {
if (form.elements[i].value=="") form.elements[i].value=" ";
cookie = cookie + "," + form.elements[i].value;
}
}
SetCookie (cookiename,cookie,expdate,'/');
}

function init(form,darray) {
for (i=0; i<darray.length; i++) {
darray[i]=0
}
return darray;
}


function needlistinit(form) {
for (i=0; i<needlist.length; i++) {
needlist[i]=0
needindex[i]=0
}
}

function mainneeds(form) {
needlistinit(form)
i=0;
for (j=0; j<need.length; j++) {
if (needlist[i]<need[j]){
needlist[i]=need[j]
needindex[i]=j
//alert("needindex[i] " + needindex[i])
}
}
i++
for (j=0; j<need.length; j++) {
if (j!=needindex[0]) {
if (needlist[i]<need[j]){
needlist[i]=need[j]
needindex[i]=j
//alert("needindex[i] " + needindex[i])
}
}
}
i++
for (j=0; j<need.length; j++) {
if (j!=needindex[0] && j!=needindex[1]) {
if (needlist[i]<need[j]){
needlist[i]=need[j]
needindex[i]=j
//
}
}
}
//alert("needindex " + needindex)
savearray(needindex,'cneedindex')
}

function quwrtreasons() {
document.write("<h4>9 other reasons to choose the above system</h4>");
document.write("<ol><li>The air conditioner has been correctly sized to ensure comfort when you really need it, without wasting money.</li>");
document.write("<li>We offer Daikin because independent surveys have found Daikin to be the brand with the highest percentage of people who would buy the same make again. This means you can be confident you will be delighted with what you get. </li>");
document.write("<li>Daikin are renowned for their quietness, particularly their wall split units. This means you will be able to watch the television or listen to your Hi-fi without being annoyed by background noise.");
document.write(" It also means you won't disturb the neighbours.</li><li>Daikin are also renowned for their energy efficiency. The inverter wall hung split series won the 2000 Galaxy Energy Award.");
document.write(" The efficiency of the inverter series is far higher than conventional air conditioners when operating at moderate temperature conditions. Because the air conditioner is operating at moderate temperature ");
document.write("conditions for many more hours than it is working at peak conditions, the saving is substantial and normally amounts to hundreds of dollars per year. (Actual saving will depend on actual hours of use.)");
document.write(" These energy savings are likely to be of even more importance this season as electricity costs are continuing to rise. The way to minimise the effect of the price rises is to have an efficient system like the Daikin offered.</li>");
document.write("<li>Daikin are so confident of the reliability of their air conditioners that they offer a 5year parts and labour warranty. This means you can be confident that when you need it, it will be there for you!</li>");
document.write("<li>The inverter units maintain a more even temperature in the room without the wild swings that can occur with conventional units.</li><li>Installation would be by POYNER AIRCONDITIONING (established 1966).");
document.write(" A qualified refrigeration mechanic (not a plumber) will carry out the refrigeration work to give you a reliable installation. The refrigeration work will include complete evacuation of the lines");
document.write(" to ensure you get the rated performance of the air conditioner and leak testing to ensure there is no free moisture, which would cause corrosion in the compressor.");
document.write(" Because of the care taken in the installation, installation work is guaranteed for 5 years for your peace of mind.</li>");
document.write("<li>Installation would be on a completely separate electrical circuit, so that the air conditioner does not cut out when someone turns on another appliance on the same circuit.</li>");
document.write("<li>Components would be METALFLEX, most are guaranteed by the manufacturer for 10 years for further peace of mind.</li></ol>");
}

function designstd() {
document.write("<p>Doors and windows closed<br>Blinds or drapes to all windows to be closed when exposed to the sun (when cooling)<br>Indoor blinds or drapes to all windows to be closed when heating<br>");
document.write("Lightweight summer clothes (shorts and T-shirt or equivalent). Medium weight winter clothing (long pants, shirt and lightweight jumper or equivalent).</p>");
document.write("<table border='1' width='450'><tr><td>Summer</td><td>Outside</td><td>38C DB/21C WB</td></tr><tr><td></td><td>Inside</td><td>25C Maximum</td></tr>");
document.write("<tr><td>Winter</td><td>Outside</td><td>4.9C DB</td></tr><tr><td></td><td>Inside</td><td>20C Minimum</td></tr></table>");
document.write("<h4>Work By Others</h4><p>Ceiling insulation (minimum R1.5, recommended R3.5 for maximum comfort and energy savings)<br>");
document.write("Sufficient single-phase electrical power at the switchboard to operate the equipment (no allowance for upgrade of switchboard or service to the switchboard should this be necessary).</p>");
}

function actionplan() {
document.write("<h4>Action Plan</h4><ol><li>Call me on 8354 1062 if you have any questions.</li>");
document.write("<li>Print out a second copy of the quote. Fill out the bottom section of the quote sheet and return all the pages signed and dated with your 20% deposit. Refer to payment options on the last page for methods of payment.</li>");
document.write("<li>I will ring you back to confirm an installation time (installation is usually within 5 working days) (Except in peak season-we will call to confirm).</li>");
document.write("<li>The installer, refrigeration mechanic and electrician will all come on the appointed day to do the installation. They will clean up after they have finished.");
document.write("Balance of payment is due once the system is operating and the method of operation has been explained to you.</li>");
document.write("<li>You sit back and relax in comfort!</li></ol>");
document.write("<p>Sincerely,<br>Clive Blanchard<br>Director<br>COOLMAX PTY LTD</p>");
}

function getunit(ctots,darray) {
//test()
gunit="false"
for (i=darray.length-1; i>0; i--) {
if (ctots[0]<darray[i].cool && ctots[1]<darray[i].heat) {
gunit=i
}
}
return gunit;
}

function dummy(aa,ab) {
dummy = 3
return dummy
}

function displaytest(form){
window.open("wizardquotation[1].txt","child")
var disp=window.document.body.text
alert("disp " + disp)
form.display.value=disp;
}

function unitload2() {
document.write("<tr><td class='left'>Quote Date and time: " + "</td><td class='left'>Quoted Price</td></tr>");
document.write("<tr><td class='left'>Unit</td><td class='left'>Deposit paid</td></tr>");
document.write("<tr><td class='left'>Signature</td><td class='left'>Balance Due</td></tr>");
document.write("<tr><td class='left'>&nbsp;</td><td class='left'>Date</td></tr>");
document.write("<input type='hidden' name='ccontact' value='" + ccontact + "'>");
document.write("<input type='hidden' name='cneed' value='" + cneed + "'>");
document.write("<input type='hidden' name='cneed2' value='" + cneed2 + "'>");
document.write("<input type='hidden' name='coptions' value='" + coptions + "'>");
document.write("<input type='hidden' name='cdata' value='" + cdata + "'>");
document.write("<input type='hidden' name='ctots' value='" + ctots + "'>");
//alert("ccontact " + unit.ccontact.value);
document.write("<input type='hidden' name='coutdoor' value='" + coutdoor + "'>");
document.write("<input type='hidden' name='coutdoor2' value='" + coutdoor2 + "'>");
if (cunit != null) document.write("<input type='hidden' name='cunit' value='" + cunit + "'>");
}

function unitload() {
cneed=csplit('cneed');
cneed2=csplit('cneed2');
ccontact=csplit('ccontact');
coptions=csplit('coptions');
ctots=csplit('ctots');
coutdoor=csplit('coutdoor');
coutdoor2=csplit('coutdoor2');
cdata=csplit('cdata');
cost=0
loadmodels();
needindex=csplit('cneedindex');
type=dnon
for (i=0; i<needindex.length; i++) {
if (needindex[i]==3) {
type=dinverter;
}
}
mindex=getunit(ctots,type);
if (mindex=="false" && type==dnon) {
type=dinverter;
mindex=getunit(ctots,type);
}
if (mindex=="false") {
document.write("The heating and cooling load exceeds that of the largest wall split in this range. Please step back to the calculator and review your loads or call us on 8354 1062");
}
else {
cost=cost+(1+unitmu)*type[mindex].cost+type[mindex].inst;
datestamp();
document.write("<p>" + ccontact[0] + " " + ccontact[1] + "<br>" + ccontact[3] + "<br>");
if (ccontact[4] != " ") document.write(ccontact[4] + "<br>");
document.write(ccontact[5] + " " + ccontact[6] + " " + ccontact[7] + "<\/p>");
document.write("<h4>RE: PLAN OF ACTION TO AIRCONDITION THE ABOVE PREMISES</h4>")
document.write("<p>Dear " + ccontact[0] + " </p>")
document.write("<p>Imagine you are sitting in your lounge all snug and warm while the wind howls outside, or all cool and comfortable while the sun blazes down outside. To achieve this I recommend:</p>")
document.write("<input type='hidden' name='model' value='" + type[mindex].model + "'>");
//alert("type[mindex].model " + type[mindex].model);
document.write("<p> A top quality Daikin " + type[mindex].model + " reverse cycle ");
if (type == dinverter) document.write("Inverter ");
document.write("wall split air conditioner with a rated capacity of " + type[mindex].cool + "kW cooling and " + type[mindex].heat + "kW heating.");
comfort='good';
if (cdata[2]=='2') comfort='excellent';
document.write(" This air conditioner has been sized to give " + comfort + " conditions.<\/p>");
//alert("cneed2 " + cneed2);
//alert("needindex " + needindex)
document.write("<h4>Why buy Daikin?</h4>")
document.write("<p><strong>Daikin Synchronised Power (DSP)</strong> isn't just hype. It consists of a package of features working in unison to achieve that rare thing, a product that just seems to read your mind! DSP ensures the air conditioner is:</p>")
document.write("<ul>")
for (i=0; i<needindex.length; i++) {
if (need2qu[needindex[i]][0] != "other reason") document.write("<li>" + need2qu[needindex[i]][0] + cneed2[i] + "</li>")
}
document.write("</ul>")
quwrtreasons()
document.write("<h4>Design basis</h4><ul><li>Room name " + cdata[44]);
document.write("</li><li>This is a single story house.</li><li>The outdoor unit is to be located: " + coutdoor[8] + "</li><li>The indoor unit is to be located: " + coptions[6] + "</li>");
if (coutdoor[2]=="true") {
document.write("<li>The boundary fence is more than 3 metres from the outdoor unit.</li>");
}
else {
document.write("<li>The boundary fence is less than 3 metres from the outdoor unit and you understand that if the outdoor unit noise annoys your neighbours, they may restrict your use at night.</li>");
}
if (coutdoor[4]=="true") {
document.write("<li>The neighbours nearest bedroom window or outdoor entertaining area is more than 3 metres from the outdoor unit.</li>");
}
else {
document.write("<li>The neighbours nearest bedroom window or outdoor entertaining area is less than 3 metres from the outdoor unit and you understand that if the outdoor unit noise annoys your neighbours, they may restrict your use at night.</li>");
}
document.write("<li>The outdoor unit is " + coptions[0] + " metres from the indoor unit (ignoring ups and downs.");
cost=cost+coptions[0]*doption[0].rate;
document.write("</li><li>The outdoor unit is " + coptions[1] + " metres from the electrical switchboard.</li>");
exelec=coptions[1]-10+3;
if (exelec<0); exelec=0;
cost=cost+exelec*doption[1].rate;
if (coptions[2]=="true") {//drain required
document.write("<li>You want the drain from the outdoor unit taken to a specific location.</li>");
cost=cost+doption[2].rate;
if (coptions[4]=="false") {//if no wall brackets
cost=cost+doption[5].rate;//supports
}
}
if (coutdoor[0]=="true") {
position="more";
}
else {
position="less";
}
document.write("<li>The nearest obstruction in front of the outdoor unit is " + position + " than 1 metre away</li>");
if (coptions[4]=="true") {//if wall brackets
document.write("<li>The outdoor unit can be wall mounted so that the top of the outdoor unit is level with or above the obstruction.</li>");
cost=cost+doption[3].rate;//wall brackets
}
else {
if (position=="less") document.write("<li>The outdoor unit can't be wall mounted so that the top of the outdoor unit is level with or above the obstruction.</li>");
if (coptions[5]=="false") {//if not paved
document.write("<li>The outdoor unit is to be installed in an unpaved (garden) area.</li>");
cost=cost+doption[4].rate;//paver
}
else {
document.write("<li>The outdoor unit is to be installed on a concrete path (or similar smooth, level, hard surface).</li>");
}
}
designstd();
cost=parseInt(cost);
document.write("<input type='hidden' name='cost' value='" + cost + "'>");
//alert("cost " + cost)
document.write("<h4>Investment</h4><p>The cash price inclusive of GST is: $" + cost +"<br>Price remains valid for 30 days.</p>");
actionplan()
deposit=parseInt(cost*depositrt);
document.write("<input type='hidden' name='deposit' value='" + deposit + "'>");
document.write("PS The deposit required is $" + deposit);
}
}

function quoteanal(form) {
save(form,'ccontact')
}

function nunitanal() {
clist=csplit('coutdoor')
return clist
}

function needanal(form) {
cneed = GetCookie ('cneed');
if (cneed != null) {
re = /[,]/
clist = cneed.split(re)
for (i=0; i<clist.length; i++) {
j=i%8;
if (clist[i]=="true"){
need[j]++;
}
}
}
}

function needprocess(form) {
need=init(form,need);
//cookiename="cneed"
save(form,"cneed");
//needsaveanal(form);
}

function emailsend(form) {
alert("referrer " + document.referrer);
form.submit();
}

function load(form,cookiename) {
cookie = GetCookie (cookiename);
//alert("cookie " + cookie)
if (cookie != null) {
re = /[,]/
clist = cookie.split(re)
for (i=0; i<clist.length; i++) {
if (form.elements[i].type == 'checkbox' || form.elements[i].type == 'radio') {
if (clist[i]=="true") {
form.elements[i].checked=clist[i];
}
}
else {
if (form.elements[i].type != "button" && form.elements[i].type != "submit") {
form.elements[i].value=clist[i];
}
}
}
}
}

function need2process(form) {
//need2init(form);
save(form,'cneed2');
//needsaveanal(form);
}

function quotenanal(form) {
save(form,'ccontact');
//test()
}

function optionsanal(form) {
save(form,'coptions');
}

function optionload(form) {
//nunitanal();
clist=csplit('coutdoor2')
if (clist[0]=="true") {
wall="true"
}
else {
wall="false"
}
optionwr(form,wall)
//save(form,'coptions');
}

function nunit2load(form) {
nunitanal();
outdoorquwr(form,clist);
if (writeflg==0) {
window.location.replace('options.htm')
}
//needsave(form);
}

function need2load(form) {
//test()
need=init(form,need);
needanal(form);
mainneeds(form);
needquwr(form)
}

function ncalcprocess(form) {

}

function checkoutdoor(form) {
if (form.clear.value == "no") {
showpopup('clearance');
}
}

function outdooranal2(form) {
save(form,'coutdoor2');
//alert('coutdoor2 ' + coutdoor2);
//action = "options.htm"
}

function outdooranal(form) {
save(form,'coutdoor');
//checkoutdoor(form);
// action = "options.htm"
}

function loginanal(form) {
savename(form);
}