var AllInfo="";
var qisoi=0;

function cCIt(nUm,fNum){
thisCheckBox=eval("top.frames[1].frames[1].document.forms["+fNum+"]");
if(nUm<6){
  if(eval("thisCheckBox.uI"+nUm).checked>0){
    thisCheckBox.uI6.checked=0;}
   else{
     thisCheckBox.uI6.checked=1;}}
if(nUm > 5){
  if(eval("thisCheckBox.uI"+nUm).checked>0){
    thisCheckBox.uI5.checked=0;}
   else{
    thisCheckBox.uI5.checked=1;}}}

function cTIt(nUm){
thisCheckBox=eval("top.frames[1].frames[1].document.forms[1].uI"+nUm);
if(nUm>9&&11>nUm&&thisCheckBox.checked>0){
    top.frames[1].frames[1].document.forms[1].uI11.checked=0;
    top.frames[1].frames[1].document.forms[1].uI12.checked=0;}
   else{
     thisCheckBox.checked=1;}
if(nUm>10&&12>nUm&&thisCheckBox.checked>0){
    top.frames[1].frames[1].document.forms[1].uI10.checked=0;
    top.frames[1].frames[1].document.forms[1].uI12.checked=0;}
   else{
     thisCheckBox.checked=1;}
if(nUm>11&&13>nUm&&thisCheckBox.checked>0){
    top.frames[1].frames[1].document.forms[1].uI10.checked=0;
    top.frames[1].frames[1].document.forms[1].uI11.checked=0;}
   else{
     thisCheckBox.checked=1;}}

function clearIt(){
for(aw=0;aw<bA.length;aw++){
  for(ab=1;ab<bA[aw].length;ab++){
    for(ac=0;ac<bA[aw][ab].length;ac++){
      if(bA[aw][ab][ac]>=0){
        thisCheckBox=eval("top.frames[1].frames[1].document.forms[0].cB"+aw+""+ab+""+ac);
        if(thisCheckBox.checked=1){
           thisCheckBox.checked=0;}}}}}
for(dF=0;dF<21;dF++){
thisDataBox=eval("top.frames[1].frames[1].document.forms[1].uI"+dF);
thisDataBox.value="";}}

function checkIt(){
var userItems="";
var checItems="<BODY BGCOLOR=#FFFFFF><TABLE BORDER=1 cellspacing=0><TR><TD><TABLE><TR><TD><CENTER><H4>To process this order <BR>send it via e-mail by clicking the 'Order' button below <BR>or print this frame and fax it to:</H4></TD></TR><TR><TD><FONT SIZE=4><HR size=1 noshade>Coral Sea Imagery on: +61 7 4721 1477</FONT><BR><HR size=1 noshade><FONT SIZE=4><B><CENTER><STRONG>ORDER</STRONG></CENTER></B></FONT><P><CENTER>Please send me the following title(s):</CENTER></TD></TR></TABLE></TD></TR><TR><TD><TABLE BORDER=1>";
var userInfo="";
var totalVal=0;
var iC=0;
for(aw=0;aw<bA.length;aw++){
  for(ab=1;ab<bA[aw].length;ab++){
    for(ac=0;ac<bA[aw][ab].length;ac++){
      if(bA[aw][ab][ac]>=0){
        if(eval("top.frames[1].frames[1].document.forms[0].cB"+aw+""+ab+""+ac+".checked")==1){
          tmp1=new String(bA[aw][ab][ac]);
          if(tmp1.indexOf(".")==-1)tmp1+=".00";
          checItems+="<TR><TD>"+bA[aw][ab][ac-2]+"</TD><TD>"+bA[aw][ab][ac-1]+"</TD><TD align=right>$"+tmp1+"</TD></TR>";
          totalVal+=bA[aw][ab][ac];
          userItems+=bA[aw][ab][ac-2]+" | "+bA[aw][ab][ac-1]+" | $"+tmp1+"\n";
          if(iC>0){iC+=1;}else{var iC=1;}}}}}}
tmp1=new String(totalVal);
if(tmp1.indexOf(".")>0&&2==(tmp1.length-tmp1.indexOf(".")))tmp1+="0";
if(tmp1.indexOf(".")==-1)tmp1+=".00";
tmp2=tmp1.indexOf(".")+3;
tmp3=tmp1.substring(0, tmp2);
totalVal=new String(tmp3);
iC-=1;var sC=Math.round((iC-(iC%3))/3);sCost=sC*7.5;sCost+=7.5;
shippingCost=new String(sCost);
toVal=parseFloat(tmp3);
aisatcpf=sCost+toVal;
totalValpF=new String(aisatcpf);
if(totalValpF.indexOf(".")>0&&2==(totalValpF.length-totalValpF.indexOf(".")))totalValpF+="0";
if(totalValpF.indexOf(".")==-1)totalValpF+=".00";
if(top.frames[1].frames[1].document.forms[1].uI5.checked>0){
  if(shippingCost.indexOf(".")>0&&2==(shippingCost.length-shippingCost.indexOf(".")))shippingCost+="0";
  if(shippingCost.indexOf(".")==-1)shippingCost+=".00";
  checItems+="<TR><TD></TD><TD><FORM>Shipping</FORM></TD><TD align=right>$"+shippingCost+"</TD></TR><TR><TD></TD><TD>TOTAL</TD><TD align=right>$"+totalValpF+"</TD></TR></TABLE></TD></TR><TR><TD><TABLE BORDER=0>";
  userInfo+="Shipping: "+shippingCost+"\n";
  userInfo+="Total: "+totalValpF+"\n";
}else{
  if(totalVal.indexOf(".")>0&&2==(totalVal.length-totalVal.indexOf(".")))totalVal+="0";
  if(totalVal.indexOf(".")==-1)totalVal+=".00";
  checItems+="<TR><TD></TD><TD><FONT SIZE=3>Quote for International Shipping Costs before processing order?</FONT></TD><TD><FORM><INPUT NAME='uI5' TYPE='checkbox' VALUE='Yes' onClick='top.frames[1].cCIt(5,0)'>&nbsp;&nbsp;Yes, please quote freight<P><INPUT NAME='uI6' TYPE='checkbox' VALUE='No' onClick='top.frames[1].cCIt(6,0)' checked>&nbsp;&nbsp;No, please process order</FORM></TD></TR><TR><TD></TD><TD>TOTAL</TD><TD align=right>$"+totalVal+"</TD></TR></TABLE></TD></TR><TR><TD><TABLE BORDER=0>";
  userInfo+="Total: "+totalVal+"\n";}
checItems+="<FORM NAME='mailForm' ACTION='mailto:info@coral-sea.com.au?subject=Bookshop Purchase' METHOD='post' ENCTYPE='multipart/form-data' onSubmit='return top.frames[1].mailIt(this)'>";
checItems+="<TR><TD>Name:</TD><TD>"+top.frames[1].frames[1].document.forms[1].uI0.value+"</TD><TD></TD></TR>";
userInfo+="Name: "+top.frames[1].frames[1].document.forms[1].uI0.value+"\n";
checItems+="<TR><TD>Street:</TD><TD>"+top.frames[1].frames[1].document.forms[1].uI1.value+"</TD></TD><TD></TR>";
userInfo+="Street: "+top.frames[1].frames[1].document.forms[1].uI1.value+"\n";
checItems+="<TR><TD>City:</TD><TD>"+top.frames[1].frames[1].document.forms[1].uI2.value+"</TD></TD><TD></TR>";
userInfo+="City: "+top.frames[1].frames[1].document.forms[1].uI2.value+"\n";
checItems+="<TR><TD>State:</TD><TD>"+top.frames[1].frames[1].document.forms[1].uI3.value+"</TD></TD><TD></TR>";
userInfo+="State: "+top.frames[1].frames[1].document.forms[1].uI3.value+"\n";
checItems+="<TR><TD>Postcode:</TD><TD>"+top.frames[1].frames[1].document.forms[1].uI4.value+"</TD></TD><TD></TR>";
userInfo+="Postcode: "+top.frames[1].frames[1].document.forms[1].uI4.value+"\n";
if(top.frames[1].frames[1].document.forms[1].uI6.checked>0){
  var qisoi=1;
  checItems+="<TR><TD>Country:</TD><TD>"+top.frames[1].frames[1].document.forms[1].uI20.value+"</TD></TD><TD></TR>";
  userInfo+="Country: "+top.frames[1].frames[1].document.forms[1].uI20.value+"\n";
}else{
   var qisoi=0;
   checItems+="<TR><TD>Country:</TD><TD>Australia</TD></TD><TD></TR>";
   userInfo+="Country: Australia/n";}
checItems+="<TR><TD>Tel #:</TD><TD>"+top.frames[1].frames[1].document.forms[1].uI7.value+"</TD></TD><TD></TR>";
userInfo+="Tel #: "+top.frames[1].frames[1].document.forms[1].uI7.value+"\n";
checItems+="<TR><TD>Fax #:</TD><TD>"+top.frames[1].frames[1].document.forms[1].uI8.value+"</TD></TD><TD></TR>";
userInfo+="Fax #: "+top.frames[1].frames[1].document.forms[1].uI8.value+"\n";
checItems+="<TR><TD>E-Mail:</TD><TD>"+top.frames[1].frames[1].document.forms[1].uI9.value+"</TD></TD><TD></TR>";
userInfo+="E-Mail: "+top.frames[1].frames[1].document.forms[1].uI9.value+"\n";
for(cCT=10;cCT<13;cCT++){
  if(eval("top.frames[1].frames[1].document.forms[1].uI"+cCT+".checked")==1){
    checItems+="<TR><TD>Credit card type:</TD><TD>"+eval("top.frames[1].frames[1].document.forms[1].uI"+cCT+".value")+"</TD></TD><TD></TR>";
    userInfo+="Credit card type: "+eval("top.frames[1].frames[1].document.forms[1].uI"+cCT+".value")+"\n";}}
checItems+="<TR><TD>Name on Card:</TD><TD>"+top.frames[1].frames[1].document.forms[1].uI13.value+"</TD></TD><TD></TR>";
userInfo+="Name on Card: "+top.frames[1].frames[1].document.forms[1].uI13.value+"\n";
checItems+="<TR><TD>Credit Card #:</TD><TD>"+top.frames[1].frames[1].document.forms[1].uI14.value+"-"+top.frames[1].frames[1].document.forms[1].uI15.value+"-"+top.frames[1].frames[1].document.forms[1].uI16.value+"-"+top.frames[1].frames[1].document.forms[1].uI17.value+"</TD></TD><TD></TR>";
userInfo+="Credit Card #: "+top.frames[1].frames[1].document.forms[1].uI14.value+"-"+top.frames[1].frames[1].document.forms[1].uI15.value+"-"+top.frames[1].frames[1].document.forms[1].uI16.value+"-"+top.frames[1].frames[1].document.forms[1].uI17.value+"\n";
checItems+="<TR><TD>Expiry Date:</TD><TD>"+top.frames[1].frames[1].document.forms[1].uI18.value+"-"+top.frames[1].frames[1].document.forms[1].uI19.value+"</TD><TD></TD></TR></TABLE></TD></TR>";
userInfo+="Expiry Date: "+top.frames[1].frames[1].document.forms[1].uI18.value+"-"+top.frames[1].frames[1].document.forms[1].uI19.value+"\n";
checItems+="<TR><TD align=center><TABLE BORDER=0><TR><TD><INPUT TYPE='hidden' NAME='mailBody'><INPUT TYPE='submit' VALUE='Order (send email)'></TD><TD><INPUT TYPE='BUTTON' VALUE='Back (change list)' onClick='window.history.go(-1);'></TD></TR></TABLE></FORM></TD></TR></TABLE></BODY>";
AllInfo = userItems+=userInfo;
top.frames[1].frames[1].document.write(checItems);
top.frames[1].frames[1].document.close(); }

function mailIt(form){
if(qisoi>0){
  if(top.frames[1].frames[1].document.forms[0].uI5.checked > 0){
    AllInfo+="Quote International Shipping Cost: "+top.frames[1].frames[1].document.forms[0].uI5.value+"\n";
    }else{
      AllInfo+="Quote International Shipping Cost: "+top.frames[1].frames[1].document.forms[0].uI6.value+"\n";}}
top.frames[1].frames[1].document.forms[1].mailBody.value = AllInfo;
return true;}