// showpic.js
// Dec 11/05 - Moved all comments to .txt file
// Tips updated: June 1/07
// Added Aerial price structure  Mar 31/08
// Added Commercial Digital Images pricing (not shown for aerial photos)  Aug 3/08
// Display adjustments - Aug 11/08
// Notes & wording Rev Mar 24/09
// Logic Rev Feb 20/09
// Prices Rev Mar 5/09
// Removed "Delivery Options" - people were too stupid to read the note.  Mar 24/09
// Removed 8x12 option - cheaper shipping an 8x10.  Mar 30/09
// Restored 8x12 option.  Jul 28/09
// Updated aerial prices  Aug 28/09
// Sep 9/09 - IE 8 fix. Preview windows were not appearing when run locally, fixed by changing cookie expiration from immediately to .05 day (approx 70 mins.).
// Sep 13/09 - Added check for film images, do not show digital pricing info when ShotOn = Film
// Apr 15/10 - Added 'web use' digital images.
// Oct 9/10  - 4x6 & 5x7 same price, removed 8x12, changed 11x14 to 11x17ff, added 13x19ff.
//           - Price updates.
// Dec 6/10 - Changed wording low, med & hi-res to sml, med & large.
//          - Added 8x12 and 11x14 to 11x17 pull-down - same price - added GallerySizeC
// Dec 21/10 - Short cookie expiry time was not working in Safari browser (time zone problem).
//           - Don't include expiry info.
//           - No expiry info will cause cookie to disappear automatically at end of session.
//           - IE 8 needs some time.  Best solution is set expiry time to 1 day.
// Dec 24/10 - Try setting expiry to .5 days. Should work with Safari.
// Dec 26/10 - Added Wallet size print option.
//           - Added 'GalleryDesc' to handle longer description needed by wallet option.
// Jan 17/11 - Added 3d effects option to printed images (not air).
// Feb 17/11 - Added Digital only, not film pix to 3d effects option.
// Feb 21/11 - Price updates.
// Jun 12/11 - Removed plaque mounting option (set prices to 0). Left code in place in case it's needed later.

var paypalw
var picwin = null;
// These are declared to clear up console warnings - doesn't affect results
var PriceSchedule
var Prints
var Tall
var Wide
var WinTall
var WinWide


// RCP Copyright overlay & pricing @ 600x400
//  Aug 11/08 - display jpgs at 350 x 525 - not as nice to swipe.
//  ForSale indicates if pricing table will appear.
function ShowPicT(PicName,ForSale) {
//  Tall = 600; Wide = 400; PriceSchedule = "reg";
  Tall = 525; Wide = 350; PriceSchedule = "reg";
  if (ForSale == 'p') {Prints = 1;}
    else if (ForSale == 'pa') {Prints=1; PriceSchedule="air";}
      else {Prints = 2;}
  WinTall = Tall + 190;
//  WinWide = Wide + 160;
  WinWide = Wide + 220;
  ShowPic(PicName,Wide,Tall,Prints,WinTall,WinWide,PriceSchedule)
}
function ShowPicW(PicName,ForSale) {
//  Tall = 400; Wide = 600; PriceSchedule = "reg";
  Tall = 350; Wide = 525; PriceSchedule = "reg";
  if (ForSale == 'p') {Prints = 1;}
    else if (ForSale == 'pa') {Prints=1; PriceSchedule="air";}
      else {Prints = 2;}
  WinTall = Tall + 190;
  WinWide = Wide + 90;
  ShowPic(PicName,Wide,Tall,Prints,WinTall,WinWide,PriceSchedule)
}


// RCP Copyright overlay & pricing
function ShowTall(PicName) {
  Tall = 500; Wide = 337; PriceSchedule = "reg";
  Prints = 1;
  WinTall = Tall + 170;
  WinWide = Wide + 220;
  ShowPic(PicName,Wide,Tall,Prints,WinTall,WinWide,PriceSchedule)
}
function ShowWide(PicName) {
  Tall = 337; Wide = 500; PriceSchedule = "reg";
  Prints = 1;
  WinTall = Tall + 190;
  WinWide = Wide + 90;
  ShowPic(PicName,Wide,Tall,Prints,WinTall,WinWide,PriceSchedule)
}


// RCP Copyright overlay only - no pricing
function ShowTallX(PicName) {
  Tall = 500; Wide = 337; PriceSchedule = "reg";
  Prints = 2;
  WinTall = Tall + 170;
  WinWide = Wide + 220;
  ShowPic(PicName,Wide,Tall,Prints,WinTall,WinWide,PriceSchedule)
}
function ShowWideX(PicName) {
  Tall = 337; Wide = 500; PriceSchedule = "reg";
  Prints = 2;
  WinTall = Tall + 190;
  WinWide = Wide + 90;
  ShowPic(PicName,Wide,Tall,Prints,WinTall,WinWide,PriceSchedule)
}


// General Copyright overlay (Cam Club) - no pricing
function ShowTallC(PicName) {
  Tall = 500; Wide = 334; PriceSchedule = "reg";
  Prints = 0;
  WinTall = Tall + 140;
  WinWide = Wide + 105;
  ShowPic(PicName,Wide,Tall,Prints,WinTall,WinWide,PriceSchedule)
}
function ShowWideC(PicName) {
  Tall = 334; Wide = 500; PriceSchedule = "reg";
  Prints = 0;
  WinTall = Tall + 130;
  WinWide = Wide + 90;
  ShowPic(PicName,Wide,Tall,Prints,WinTall,WinWide,PriceSchedule)
}


function ShowPic(PicName,Wide,Tall,Prints,WinTall,WinWide,PriceSchedule) {
// check screen height, reduce WinTall if req'd
  if (screen.height<=WinTall) {
    WinTall = screen.height-60;
  }
// if window doesn't exist, create it
  if (!picwin || picwin.closed)  {
picwin=window.open("","PictureWindow","menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,hotkeys=no,top=1,left=1,width="+Wide+",height="+Tall+"");
  }
//  picwin.resizeTo(WinWide,WinTall);

// stash parameters in a cookie (picked up by showpic.htm)
  var cookie_stuff = "xxx" + PicName + "xxx" + Wide + "xxx" + Tall + "xxx" + Prints + "xxx" + WinTall + "xxx" + WinWide +"xxx" + PriceSchedule + "xxxeof";
  var cookie_name = "showpic";
  // cookie life in days (if zero, cookie expires when session closed - IE 8 needs some time)
  var cookie_life = .5;   // was .002
  var cookie_exp = "";
  if (cookie_life) {
		var cookie_date = new Date();
		cookie_date.setTime(cookie_date.getTime()+(cookie_life*24*60*60*1000));
		var cookie_exp = "; expires="+cookie_date.toGMTString();
	}
  document.cookie = cookie_name+"="+cookie_stuff+cookie_exp+"; path=/";
// Dec 21/10 - Short expiry time was not working in Safari browser.
// Don't include expiry info. No expiry info will cause cookie to disappear automatically at end of session. A temporary session cookie. Screws up IE.  Best to change expiry time to 1 day.
//  document.cookie = cookie_name+"="+cookie_stuff+"; expires=; path=/";

//  set showpic.htm to display photo
  picwin.location.href="showpic.htm";
  picwin.focus();
}


//   Generate pricing table and e-commerce code
//
// Gallery ID notes:
//   - contains image number when called during image viewing
//   - '-1' when called from index to display pricing info
//   - '-2' when called from special events online ordering. This option allows
//            visitors to enter an image number & Custom Project info.
//   - '-3' when called from showport. Same as -1 except Digital Images pricing section is not shown.

// These are declared to clear up console warnings - doesn't affect results
var GalleryID
var GalleryPrice
var GalleryDMPrice
var GalleryLMPrice
var GalleryPLKPrc
var GallerySize
var GallerySizeB
var GallerySizeC
var GalleryDesc
var DelPrice
var DelDesc

// initial values are required and need to be here
var none = 'None';
var dm = 'DryMounted';
var lm = 'Drymounted and Laminated';
var pk = 'PlakMounted';
var CartDesc = '-';

// form validation - only used when GalleryID = -2
//function validate(theForm) {
//  if (theForm.os0.value == "") {
//      alert("Please add an Image number to your selection");
//      return false;
//    }
//    return true;
//  }


//  generate gallery pricing table
function WebGalleryPricing(GalleryID,PriceSchedule) {
  // determine if shot on film, images numbers starting with 001 to 299 were on film.
  // 4th character must be '-' or '_' (used in webgalleries). Otherwise when image numbers go beyond 999 the 1000 series will be treated as film.
  // digital pricing & 3d effect will not be shown for film images.
  var ShotOn = 'Digital';
  var FirstChar = GalleryID.charAt(0);
  var HyphenCheck = GalleryID.charAt(3);
  var UnderScoreCheck = GalleryID.charAt(3);
  if ((FirstChar=='0' || FirstChar=='1' || FirstChar=='2') && (HyphenCheck=='-' || UnderScoreCheck=='_')) {
    ShotOn = 'Film';
  }
  //  RootOffset moved to misc.js
  document.write("<scr"+"ipt language='JavaScript' src='"+RootOffset+"bin/dd-tooltip.js' type='text/javascript'>")
  document.write("<\/script>")

  document.write("<table border=1 cellpadding=3 cellspacing=0 align=center width=460 bgcolor='black'>")
  if (GalleryID=='-2') {
    document.write("<tr><td colspan=7><P Class='RegText1'>")
    }
  else {
    document.write("<tr><td colspan=6><P Class='SmlText1'>")
  }
  document.write("All images are licensed for <Strong>non-commercial use only</Strong> unless otherwise specified.")
  document.write("</td></tr>")

  document.write("<tr>")
  if (GalleryID=='-2') {
    document.write("<td rowspan=2><P Class='RegText1'><Strong>Image<br>Number</Strong>")
  }
  document.write("<td rowspan=2><P Class='RegText1'><Strong>Popular<br>Print&nbsp;Sizes</Strong>")
  if (GalleryID!='-1' && GalleryID!='-2' && GalleryID!='-3') {
    document.write("<P Class='SmlText2'>ID# "+GalleryID+"")
  }
  document.write("</td>")
  document.write("<td colspan=4 style='border-bottom-width:0px'><P Class='MidText2'><Strong>Printed Images</Strong></td>")
  if (GalleryID=="-1" || GalleryID=="-3") {
    document.write("<td width=50 rowspan=2><P Class='RegText1'>&nbsp;</td>")
    }
  else {
    document.write("<td rowspan=2><P Class='RegText1'><Strong>Add<br>to<br>Cart</Strong></td>")
  }
  document.write("</tr>")
  document.write("<tr>")
  document.write("<td><P Class='RegText1' Align='Left'>&nbsp;Not&nbsp;&nbsp;&nbsp;<Strong><A class='external' Href='javascript:ShowFaq()' onmouseover='doTooltip(event,3)' onmouseout='hideTip()'>[?]</A></Strong><br>&nbsp;Mounted&nbsp;</td>")
  document.write("<td><P Class='RegText1' Align='Left'>&nbsp;<strong>D</strong>ry&nbsp;&nbsp;&nbsp;<Strong><A class='external' Href='javascript:ShowFaq()' onmouseover='doTooltip(event,4)' onmouseout='hideTip()'>[?]</A></Strong><br>&nbsp;<strong>M</strong>ounted&nbsp;</td>")
  document.write("<td><P Class='RegText1' Align='Left'>&nbsp;<strong>DM+</strong>&nbsp;&nbsp;&nbsp;<Strong><A class='external' Href='javascript:ShowFaq()' onmouseover='doTooltip(event,5)' onmouseout='hideTip()'>[?]</A></Strong><br>&nbsp;Laminated</td>")
//  document.write("<td><P Class='RegText1' Align='Left'>&nbsp;<Strong>Plak</Strong>&nbsp;&nbsp;&nbsp;<Strong><A class='external' Href='javascript:ShowFaq()' onmouseover='doTooltip(event,6)' onmouseout='hideTip()'>[?]</A></Strong><br>&nbsp;Mounted</td>")
  document.write("<td>&nbsp;</td>")
  document.write("</tr>")

// Regular print prices //

  if (PriceSchedule=='reg') {

    GallerySize = '5"x7"'; GallerySizeB = '4"x6" ff'; GallerySizeC = ' ';
    GalleryDesc= ' ';
    GalleryPrice = 15.00; GalleryDMPrice = 21.00; GalleryLMPrice = 0.00; GalleryPLKPrc = 0.00;
    GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc);

    GallerySize = '8"x10"'; GallerySizeB = ' '; GallerySizeC = ' ';
    GalleryDesc= ' ';
    GalleryPrice = 24.00; GalleryDMPrice = 35.00; GalleryLMPrice = 0.00; GalleryPLKPrc = 0.00;
    GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc);

    // Wallet size are same price as 11x17 //
    GallerySize = '12 - 2"x3"'; GallerySizeB = ' '; GallerySizeC = ' ';
    GalleryDesc= 'wallet size<br>single sheet';
    GalleryPrice = 29.00; GalleryDMPrice = 0.00; GalleryLMPrice = 0.00; GalleryPLKPrc = 0.00;
    GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc);


    GallerySize = '11"x17" ff'; GallerySizeB = '11"x14'; GallerySizeC = '8"x12" ff';
    GalleryDesc= ' ';
    GalleryPrice = 29.00; GalleryDMPrice = 46.00; GalleryLMPrice = 58.00; GalleryPLKPrc = 0.00;
    GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc);

    GallerySize = '13"x19" ff'; GallerySizeB = ' '; GallerySizeC = ' ';
    GalleryDesc= ' ';
    GalleryPrice = 38.00; GalleryDMPrice = 57.00; GalleryLMPrice = 74.00; GalleryPLKPrc = 0.00;
    GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc);

    GallerySize = '16"x20"'; GallerySizeB = ' '; GallerySizeC = ' ';
    GalleryDesc= ' ';
    GalleryPrice = 74.00; GalleryDMPrice = 105.00; GalleryLMPrice = 127.00; GalleryPLKPrc = 0.00;
    GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc);

    GallerySize = '16"x24" ff'; GallerySizeB = ' '; GallerySizeC = ' ';
    GalleryDesc= ' ';
    GalleryPrice = 86.00; GalleryDMPrice = 122.00; GalleryLMPrice = 153.00; GalleryPLKPrc = 0.00;
    GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc);
  }

// Aerial print prices //

  if (PriceSchedule=='air') {

    GallerySize = '5"x7"'; GallerySizeB = '4"x6" ff'; GallerySizeC = ' ';
    GalleryDesc= ' ';
    GalleryPrice = 49.00; GalleryDMPrice = 55.00; GalleryLMPrice = 0.00; GalleryPLKPrc = 0.00;
    GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc);

    GallerySize = '8"x10"'; GallerySizeB = ' '; GallerySizeC = ' ';
    GalleryDesc= ' ';
    GalleryPrice = 75.00; GalleryDMPrice = 86.00; GalleryLMPrice = 0.00; GalleryPLKPrc = 0.00;
    GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc);

    GallerySize = '11"x17" ff'; GallerySizeB = '11"x14'; GallerySizeC = '8"x12" ff';
    GalleryDesc= ' ';
    GalleryPrice = 98.00; GalleryDMPrice = 115.00; GalleryLMPrice = 126.00; GalleryPLKPrc = 0.00;
    GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc);

    GallerySize = '13"x19" ff'; GallerySizeB = ' '; GallerySizeC = ' ';
    GalleryDesc= ' ';
    GalleryPrice = 125.00; GalleryDMPrice = 144.00; GalleryLMPrice = 159.00; GalleryPLKPrc = 0.00;
    GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc);

    GallerySize = '16"x20"'; GallerySizeB = ' '; GallerySizeC = ' ';
    GalleryDesc= ' ';
    GalleryPrice = 235.00; GalleryDMPrice = 264.00; GalleryLMPrice = 288.00; GalleryPLKPrc = 0.00;
    GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc);

//    GallerySize = '16"x24" ff'; GallerySizeB = ' '; GallerySizeC = ' ';
//    GalleryDesc= ' ';
//    GalleryPrice = 255.00; GalleryDMPrice = 295.00; GalleryLMPrice = 325.00; GalleryPLKPrc = 0.00;
//    GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc);
  }


// 3D effects option  (not for aerial photos or film based pix)
  var ThreeDEffect
  ThreeDEffect = 45;
  if (PriceSchedule=='reg' && ShotOn=='Digital') {
    document.write("<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>")
    document.write("<input type='hidden' name='add' value='1'>")
    document.write("<input type='hidden' name='cmd' value='_cart'>")
    document.write("<input type='hidden' name='business' value='"+WebSales+"'>")
    document.write("<input type='hidden' name='item_name' value='3D Effect'>")
    document.write("<input type='hidden' name='amount' value='"+ThreeDEffect+"'>")
    document.write("<input type='hidden' name='quantity' value='1'>")
    // no shipping charges on photo effects
    document.write("<input type='hidden' name='shipping' value='0'>")
    document.write("<input type='hidden' name='currency_code' value='CAD'>")
    document.write("<input type='hidden' name='lc' value='CA'>")
    document.write("<input type='hidden' name='on0' value='Image'>")
    document.write("<input type='hidden' name='os1' value='..'>")
    document.write("<tr>")
    if (GalleryID=='-2') {
      document.write("<td colspan=4 style='border-right-width:0px' nowrap='nowrap'>")
      }
    else {
      document.write("<td colspan=3 style='border-right-width:0px' nowrap='nowrap'>")
    }
    document.write("<P Class='RegText1'>")
    document.write("<img src='"+RootOffset+"graphics/new.gif' width=28 height=14 border='0'>")
    document.write(" Add <a class='external' href='http://www.rcp.ca/3d.htm' target='_blank'>3d Effect</a> to this image ==></td>")
    if (GalleryID=='-2') {
      document.write("<td style='border-left-width:0px; border-right-width:0px'><input type='text' name='os0' size='8' maxlength='11'></td>")
      }
    else {
      if (GalleryID=='-1' || GalleryID=='-3') {
        document.write("<td style='border-left-width:0px; border-right-width:0px'><br></td>")
        }
      else {
        document.write("<input type='hidden' name='os0' value="+GalleryID+">")
        document.write("<td style='border-left-width:0px; border-right-width:0px'><P Class='RegText1'><strong>"+GalleryID+"</strong></td>")
      }
    }
    document.write("<td style='border-left-width:0px; border-right-width:0px'><P Class='RegText1'>$"+ThreeDEffect+".00</td>")
    document.write("<td style='border-left-width:0px'>")
    if (GalleryID=='-1' || GalleryID=='-3') {
      document.write("<br>")
      }
    else {
      document.write("<input type='image' src='"+RootOffset+"graphics/cart-add.gif' border='0' name='submit' alt='You should place your print order before selecting this option. ** THIS OPTION MAY NOT BE SUITABLE FOR ALL IMAGES - Such as those in our 100- to 299- series - PLEASE ASK IF YOU ARE NOT SURE **' title='You should place your print order before selecting this option. ** THIS OPTION MAY NOT BE SUITABLE FOR ALL IMAGES - Such as those in our 100- to 299- series - PLEASE ASK IF YOU ARE NOT SURE **'>")
    }
    document.write("</td></tr>")
    document.write("</form>")
  }


// Delivery and Print Info

  document.write("<tr>")
  if (GalleryID=='-2') {
    document.write("<td colspan=7 style='border-bottom-width:1px'>")
    }
  else {
    document.write("<td colspan=6 style='border-bottom-width:1px'>")
  }
  document.write("<P Class='SmlText1' align='center'><span>Printed orders can only be delivered to a Canadian or USA address</span> and will be sent via regular lettermail.&nbsp; A small S&amp;H fee will be added during the checkout process.<br><br>")
  document.write("An <strong>ff</strong> print size indicates a full frame (uncropped) print.<br>Check out our <A class='external' Href='"+RootOffset+"cropping.htm' Target='_blank'>cropping</A> page for more information.<br><br>")
  document.write("Have some questions?&nbsp; Please <A class='external' Href='javascript:ShowFeedBack()'>contact us</a> or check out our <A class='external' Href='javascript:ShowFaq()'>FAQ</a> page.")
  document.write("</td></tr>")


// Digital pricing

  if (GalleryID=='-3' || ShotOn=='Film') {
    }
  else {
    document.write("<tr>")
    if (GalleryID=='-2') {
      document.write("<td colspan=7 style='border-top-width: medium; border-bottom-style: hidden'>")
      }
    else {
      document.write("<td colspan=6 nowrap='nowrap' style='border-top-width: medium; border-bottom-style: hidden'>")
    }
    document.write("<P Class='MidText2'><Strong>Digital Images</Strong>")
    document.write("<P Class='SmlText1'>Please review these <A class='external' Href='javascript:ShowFaq()'>notes</a> for delivery &amp; image usage information.")
    document.write("</td>")
    document.write("</tr>")


// Regular digital prices //
    if (PriceSchedule=='reg') {
      GallerySizeW = 'Web Use'; GalleryPriceW = 15.00;
      GallerySizeS = 'Small';   GalleryPriceS = 29.00;
      GallerySizeM = 'Medium';  GalleryPriceM = 45.00;
      GallerySizeL = 'Large';   GalleryPriceL = 56.00;
      GalleryDigItem2(GalleryID, GalleryPriceW, GallerySizeW, GalleryPriceS, GallerySizeS, GalleryPriceM, GallerySizeM, GalleryPriceL, GallerySizeL);


// Regular digital COMMERCIAL prices //
      document.write("<tr>")
      if (GalleryID=='-2') {
        document.write("<td colspan=7 style='border-top-width: medium; border-bottom-style: hidden'>")
        }
      else {
        document.write("<td colspan=6 nowrap='nowrap' style='border-top-width: medium; border-bottom-style: hidden'>")
      }
      document.write("<P Class='MidText2'><Strong>Digital Images - Commercial Use</Strong>")
      document.write("<P Class='SmlText1'><strong>Commercial Use</strong> images do not have a visible copyright mark.<br>Rob Chandler Photography retains full rights and ownership of the images.")
      document.write("</td>")
      document.write("</tr>")
      GallerySizeW = ''; GalleryPriceW = 0;
      GallerySizeS = 'Comm-Sml'; GalleryPriceS = 57.00;
      GallerySizeM = 'Comm-Med'; GalleryPriceM = 85.00;
      GallerySizeL = 'Comm-Lrg'; GalleryPriceL = 105.00;
      GalleryDigItem2(GalleryID, GalleryPriceW, GallerySizeW, GalleryPriceS, GallerySizeS, GalleryPriceM, GallerySizeM, GalleryPriceL, GallerySizeL);
    }


// Aerial digital prices //
    if (PriceSchedule=='air') {
      GallerySizeW = 'Web Use'; GalleryPriceW = 45.00;
      GallerySizeS = 'Small';  GalleryPriceS = 95.00;
      GallerySizeM = 'Medium'; GalleryPriceM = 159.00;
      GallerySizeL = 'Large';  GalleryPriceL = 195.00;
      GalleryDigItem2(GalleryID, GalleryPriceW, GallerySizeW, GalleryPriceS, GallerySizeS, GalleryPriceM, GallerySizeM, GalleryPriceL, GallerySizeL);

// Aerial digital COMMERCIAL prices //
      document.write("<tr>")
      if (GalleryID=='-2') {
        document.write("<td colspan=7 style='border-top-width: medium; border-bottom-style: hidden'>")
        }
      else {
        document.write("<td colspan=6 nowrap='nowrap' style='border-top-width: medium; border-bottom-style: hidden'>")
      }
      document.write("<P Class='MidText2'><Strong>Digital Images - Commercial Use</Strong>")
      document.write("<P Class='SmlText1'><strong>Commercial Use</strong> images do not have a visible copyright mark.<br>Rob Chandler Photography retains full rights and ownership of the images.")
      document.write("</td>")
      document.write("</tr>")
      GallerySizeW = ''; GalleryPriceW = 0;
      GallerySizeS = 'Comm-Sml'; GalleryPriceS = 175.00;
      GallerySizeM = 'Comm-Med'; GalleryPriceM = 295.00;
      GallerySizeL = 'Comm-Lrg'; GalleryPriceL = 365.00;
      GalleryDigItem2(GalleryID, GalleryPriceW, GallerySizeW, GalleryPriceS, GallerySizeS, GalleryPriceM, GallerySizeM, GalleryPriceL, GallerySizeL);
     }
  }

// custom project

  if (GalleryID=='-2') {
    document.write("<tr>")
    document.write("<td colspan=7 style='background-color:#4f4f4f; border-bottom:1px; border-top-width: medium'>")
    document.write("<P Class='MidText2'><strong>Custom Projects</strong>")
    document.write("<P Class='RegText1'>This area is to be used only for payment of <strong>pre-authorized</strong> Custom Projects!")
    document.write("</td></tr>")
    document.write("<tr><td style='background-color:#4f4f4f; border-bottom:1px; border-top:1px; border-right:1px;'>")
    document.write("<P Class='RegText1'><strong>Ref #</strong></td>")
    document.write("<td colspan=4 style='background-color:#4f4f4f; border-bottom:1px; border-top:1px; border-right:1px;'>")
    document.write("<P Class='RegText1'><strong>Project Summary</strong> (max 160 characters)</td>")
    document.write("<td style='background-color:#4f4f4f; border-bottom:1px; border-top:1px; border-right:1px;'>")
    document.write("<P Class='RegText1'><strong>Fee&nbsp;&nbsp;<A class='external' Href='javascript:ShowFaq()' onmouseover='doTooltip(event,2)' onmouseout='hideTip()'>[?]</A></strong></td>")
    document.write("<td style='background-color:#4f4f4f; border-bottom:1px; border-top:1px;'>")
    document.write("&nbsp;</td>")
    document.write("</tr>")
    document.write("<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>")
    document.write("<input type='hidden' name='add' value='1'>")
    document.write("<input type='hidden' name='cmd' value='_cart'>")
    document.write("<input type='hidden' name='business' value='"+WebSales+"'>")
    document.write("<input type='hidden' name='item_name' value='Custom Project'>")
    document.write("<input type='hidden' name='quantity' value='1'>")
// no extra shipping charges or taxes on custom projects
    document.write("<input type='hidden' name='shipping' value='0'>")
    document.write("<input type='hidden' name='tax' value='0'>")
    document.write("<input type='hidden' name='return' value='http://www.rcp.ca/custom.htm'>")
    document.write("<input type='hidden' name='cancel_return' value='http://www.rcp.ca/custom.htm'>")
    document.write("<input type='hidden' name='currency_code' value='CAD'>")
    document.write("<input type='hidden' name='lc' value='CA'>")
    document.write("<input type='hidden' name='on0' value='Ref #'>")
    document.write("<input type='hidden' name='on1' value='Project Description'>")
    document.write("<tr>")
    document.write("<td style='background-color:#4f4f4f; border-top:1px; border-right:1px;'><input type='text' name='os0' size='8' maxlength='11'></td>")
    document.write("<td colspan=4 style='background-color:#4f4f4f; border-top:1px; border-right:1px;'><input type='text' name='os1' size='40' maxlength='165'></td>")
    document.write("<td style='background-color:#4f4f4f; border-top:1px; border-right:1px;'><input type='text' name='amount' size='7' maxlength='7'></td>")
    document.write("</td><td style='background-color:#4f4f4f; border-top:1px;'>")
    document.write("<input type='image' src='"+RootOffset+"graphics/cart-add.gif' border='0' name='submit' alt='Add to shopping cart.' title='Add to shopping cart.'>")
    document.write("</td></tr>")
    document.write("</form>")
  }

// end of custom project

// extra info

  document.write("<tr>")
  document.write("<td style='padding-left:0px; padding-right:0px'>")
  document.write("<img src='"+RootOffset+"graphics/paypal_verified.gif' border=0 width=88 height=33>")
  document.write("</td>")
  if (GalleryID=='-2') {
    document.write("<td colspan=4 style='padding-left:5px; padding-right:5px'>")
    }
  else {
    document.write("<td colspan=3 style='padding-left:5px; padding-right:5px'>")
  }
  document.write("<P Class='SmlText1'>All images and files are <Strong><A class='external' Target='_blank' Href='http://www.cb-cda.gc.ca/info/act-e.html'>copyright</A> ")
  document.write("Rob&nbsp;Chandler</Strong> and are licensed for <Strong>non-commercial use only</Strong> unless otherwise specified.")
  document.write("</td>")
  document.write("<td colspan=2 style='padding-left:0px; padding-right:0px'>")
  if (GalleryID=='-1' || GalleryID=='-3') {
    document.write("<img src='"+RootOffset+"graphics/verisign.gif' Border=0 alt='Purchases made via PayPal are secured by VeriSign.' title='Purchases made via PayPal are secured by VeriSign.'>")
    }
  else {
    document.write("<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>")
    document.write("<input type='hidden' name='cmd' value='_cart'>")
    document.write("<input type='hidden' name='business' value='"+WebSales+"'>")
    document.write("<input type='image' src='"+RootOffset+"graphics/viewcart.gif' border='0' name='submit' alt='Payments are processed via PayPal. You DO NOT need a PayPal account when paying with a credit card.' title='Payments are processed via PayPal. You DO NOT need a PayPal account when paying with a credit card.'>")
    document.write("<input type='hidden' name='display' value='1'>")
    document.write("</form>")
  }
  document.write("</td></tr>")
  document.write("</table>")
}

// create print purchase line

function GalleryPicItem(GalleryID, GalleryPrice, GalleryDMPrice, GalleryLMPrice, GalleryPLKPrc, GallerySize, GallerySizeB, GallerySizeC, GalleryDesc) {
  document.write("<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post' onsubmit='this.os1.value=(this.amount[0].checked)?none:(this.amount[1].checked)?dm:(this.amount[2].checked)?lm:pk'>")
  document.write("<input type='hidden' name='add' value='1'>")
  document.write("<input type='hidden' name='cmd' value='_cart'>")
  document.write("<input type='hidden' name='business' value='"+WebSales+"'>")
  document.write("<input type='hidden' name='currency_code' value='CAD'>")
  document.write("<input type='hidden' name='lc' value='CA'>")
  document.write("<input type='hidden' name='on0' value='Image'>")
  document.write("<input type='hidden' name='on1' value='Options'>")
  document.write("<input type='hidden' name='os1' value='..'>")
  document.write("<input type='hidden' name='quantity' value='1'>")
//  document.write("<input type='hidden' name='tax' value='0'>")
  document.write("<tr>")
  if (GalleryID=='-2') {
    document.write("<td><input type='text' name='os0' size='9' maxlength='11'></td>")
    }
  else {
    document.write("<input type='hidden' name='os0' value="+GalleryID+">")
  }
  if (GallerySizeB==' ') {
    CartDesc = GallerySize;
    document.write("<td><P Class='RegText1'>")
    document.write("<input type='hidden' name='item_name' value='"+GallerySize+" Print'>"+GallerySize+"")
    }
  else {
    CartDesc = GallerySize +' or ' + GallerySizeB;
    document.write("<td><select name='item_name' size=GallerySize style='width:75px;'>")
    document.write("<option value='"+GallerySize+" Print'>"+GallerySize+"</option>")
    document.write("<option value='"+GallerySizeB+" Print'>"+GallerySizeB+"</option>")
    if (GallerySizeC!=' ') {
      document.write("<option value='"+GallerySizeC+" Print'>"+GallerySizeC+"</option>")
      CartDesc = GallerySize+', '+GallerySizeB+' or '+GallerySizeC;
      }
    document.write("</select>")
  }
  if (GalleryDesc!=' ') {
    document.write("<br><P Class='SmlText1'>"+GalleryDesc+"")
    CartDesc = CartDesc + " " + GalleryDesc;
  }
  document.write("</td><td nowrap='nowrap' style='padding-left:1px'>")
  document.write("<P Class='RegText1' Align='Left'><input checked type='radio' name='amount' value="+GalleryPrice+">&nbsp;$"+GalleryPrice+".00")
  document.write("</td><td nowrap='nowrap' style='padding-left:1px'>")

  if (GalleryDMPrice==0) {
    document.write("<br>")
    }
  else {
    document.write("<P Class='RegText1' Align='Left'><input type='radio' name='amount' value="+GalleryDMPrice+">&nbsp;$"+GalleryDMPrice+".00")
  }
  document.write("</td><td nowrap='nowrap' style='padding-left:1px'>")
  if (GalleryLMPrice==0) {
    document.write("<br>")
    }
  else {
    document.write("<P Class='RegText1' Align='Left'><input type='radio' name='amount' value="+GalleryLMPrice+">&nbsp;$"+GalleryLMPrice+".00")
  }
  document.write("</td><td nowrap='nowrap' style='padding-left:1px'>")
  if (GalleryPLKPrc==0) {
    document.write("<br>")
    }
  else {
    document.write("<P Class='RegText1' Align='Left'><input type='radio' name='amount' value="+GalleryPLKPrc+">&nbsp;$"+GalleryPLKPrc+".00")
  }
  document.write("</td><td>")
  if (GalleryID=='-1' || GalleryID=='-3') {
    document.write("<br>")
    }
  else {
    document.write("<input type='image' src='"+RootOffset+"graphics/cart-add.gif' border='0' name='submit' alt='Add to shopping cart.' title='Add *"+CartDesc+"* to shopping cart.'>")
  }
  document.write("</td></tr>")
  document.write("</form>")
}


// create digital file purchase line - NEW VERSION - All on one line - Feb 20/09

function GalleryDigItem2(GalleryID, GalleryPriceW, GallerySizeW, GalleryPriceS, GallerySizeS, GalleryPriceM, GallerySizeM, GalleryPriceL, GallerySizeL) {
  document.write("<tr>")
  if (GalleryID=='-2') {
    document.write("<td style='border-top-width: 0px'><input type='text' name='os0' size='9' maxlength='11'></td>")
  }
  if (GalleryID=='-2b') {
    document.write("<td style='border-top-width: 0px'><br></td>")
  }
  document.write("<td colspan=6 nowrap='nowrap' style='border-top-width: 0px; border-top-style: hidden'>")
  document.write("<table border=0 cellpadding=0 cellspacing=0 width='100%' align=center>")
  document.write("<tr>")

// web-res
  if(GalleryPriceW>0) {
    document.write("<td nowrap='nowrap'>")
    document.write("<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>")
    document.write("<input type='hidden' name='add' value='1'>")
    document.write("<input type='hidden' name='cmd' value='_cart'>")
    document.write("<input type='hidden' name='business' value='"+WebSales+"'>")
    document.write("<input type='hidden' name='amount' value="+GalleryPriceW+">")
    if (GalleryID!='-2') {
      document.write("<input type='hidden' name='os0' value="+GalleryID+">")
    }
    document.write("<input type='hidden' name='quantity' value='1'>")
    // no shipping charges on electronic delivery
    document.write("<input type='hidden' name='shipping' value='0'>")
    //  document.write("<input type='hidden' name='tax' value='0'>")
    document.write("<input type='hidden' name='currency_code' value='CAD'>")
    document.write("<input type='hidden' name='lc' value='CA'>")
    document.write("<input type='hidden' name='on0' value='Image'>")
    document.write("<P Class='RegText1' Align='center'>")
    document.write("<input type='hidden' name='item_name' value='"+GallerySizeW+"'>"+GallerySizeW+"&nbsp;<br>$"+GalleryPriceW+".00")
    if (GalleryID=='-1' || GalleryID=='-3') {
      document.write("&nbsp;")
      }
    else {
      CartDesc = GallerySizeW;
      document.write("&nbsp;&nbsp;<input type='image' src='"+RootOffset+"graphics/cart-add.gif' border='0' name='submit' alt='Add to shopping cart.' title='Add *"+CartDesc+"* to shopping cart.'>")
    }
    document.write("</form>")
    document.write("</td>")
  }

// low-res (small)
  document.write("<td nowrap='nowrap'>")
  document.write("<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>")
  document.write("<input type='hidden' name='add' value='1'>")
  document.write("<input type='hidden' name='cmd' value='_cart'>")
  document.write("<input type='hidden' name='business' value='"+WebSales+"'>")
  document.write("<input type='hidden' name='amount' value="+GalleryPriceS+">")
  if (GalleryID!='-2') {
    document.write("<input type='hidden' name='os0' value="+GalleryID+">")
  }
  document.write("<input type='hidden' name='quantity' value='1'>")
// no shipping charges on electronic delivery
  document.write("<input type='hidden' name='shipping' value='0'>")
//  document.write("<input type='hidden' name='tax' value='0'>")
  document.write("<input type='hidden' name='currency_code' value='CAD'>")
  document.write("<input type='hidden' name='lc' value='CA'>")
  document.write("<input type='hidden' name='on0' value='Image'>")
  document.write("<P Class='RegText1' Align='center'>")
  document.write("<input type='hidden' name='item_name' value='"+GallerySizeS+"'>"+GallerySizeS+"&nbsp;<br>$"+GalleryPriceS+".00")
  if (GalleryID=='-1' || GalleryID=='-3') {
    document.write("&nbsp;")
    }
  else {
    CartDesc = GallerySizeS;
    document.write("&nbsp;&nbsp;<input type='image' src='"+RootOffset+"graphics/cart-add.gif' border='0' name='submit' alt='Add to shopping cart.' title='Add *"+CartDesc+"* to shopping cart.'>")
  }
  document.write("</form>")
  document.write("</td>")

// med-res (medium)
  document.write("<td nowrap='nowrap'>")
  document.write("<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>")
  document.write("<input type='hidden' name='add' value='1'>")
  document.write("<input type='hidden' name='cmd' value='_cart'>")
  document.write("<input type='hidden' name='business' value='"+WebSales+"'>")
  document.write("<input type='hidden' name='amount' value="+GalleryPriceM+">")
  if (GalleryID!='-2') {
    document.write("<input type='hidden' name='os0' value="+GalleryID+">")
  }
  document.write("<input type='hidden' name='quantity' value='1'>")
// no shipping charges on electronic delivery
  document.write("<input type='hidden' name='shipping' value='0'>")
//  document.write("<input type='hidden' name='tax' value='0'>")
  document.write("<input type='hidden' name='currency_code' value='CAD'>")
  document.write("<input type='hidden' name='lc' value='CA'>")
  document.write("<input type='hidden' name='on0' value='Image'>")
  document.write("<P Class='RegText1' Align='center'>")
  document.write("<input type='hidden' name='item_name' value='"+GallerySizeM+"'>"+GallerySizeM+"&nbsp;<br>$"+GalleryPriceM+".00")
  if (GalleryID=='-1' || GalleryID=='-3') {
    document.write("&nbsp;")
    }
  else {
    CartDesc = GallerySizeM;
    document.write("&nbsp;&nbsp;<input type='image' src='"+RootOffset+"graphics/cart-add.gif' border='0' name='submit' alt='Add to shopping cart.' title='Add *"+CartDesc+"* to shopping cart.'>")
  }
  document.write("</form>")
  document.write("</td>")

// hi-res (large)
  document.write("<td nowrap='nowrap'>")
  document.write("<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>")
  document.write("<input type='hidden' name='add' value='1'>")
  document.write("<input type='hidden' name='cmd' value='_cart'>")
  document.write("<input type='hidden' name='business' value='"+WebSales+"'>")
  document.write("<input type='hidden' name='amount' value="+GalleryPriceL+">")
  if (GalleryID!='-2') {
    document.write("<input type='hidden' name='os0' value="+GalleryID+">")
  }
  document.write("<input type='hidden' name='quantity' value='1'>")
// no shipping charges on electronic delivery
  document.write("<input type='hidden' name='shipping' value='0'>")
//  document.write("<input type='hidden' name='tax' value='0'>")
  document.write("<input type='hidden' name='currency_code' value='CAD'>")
  document.write("<input type='hidden' name='lc' value='CA'>")
  document.write("<input type='hidden' name='on0' value='Image'>")
  document.write("<P Class='RegText1' Align='center'>")
  document.write("<input type='hidden' name='item_name' value='"+GallerySizeL+"'>"+GallerySizeL+"&nbsp;<br>$"+GalleryPriceL+".00")
  if (GalleryID=='-1' || GalleryID=='-3') {
    document.write("&nbsp;")
    }
  else {
    CartDesc = GallerySizeL;
    document.write("&nbsp;&nbsp;<input type='image' src='"+RootOffset+"graphics/cart-add.gif' border='0' name='submit' alt='Add to shopping cart.' title='Add *"+CartDesc+"* to shopping cart.'>")
  }
  document.write("</form>")
  document.write("</td>")
  document.write("</tr></table>")
}

