//<![CDATA[
//function mapper(j){
//  var map = new GMap2(document.getElementById("map"));
//  map.setCenter(new GLatLng(36.18984515478542,-114.74584579467773), 5);
//   var point = new GLatLng(36.18984515478542,-114.74584579467773);
//   map.addOverlay(new GMarker(point));
//}
//]]>

//requestVars start

/*
 * @author      Jesse Berman
 * @copyright   2007-07-18
 * @version     1.0
 * @license     http://www.gnu.org/copyleft/lesser.html
*/


/*
 * Portions by Dieter Raber <dieter@dieterraber.net>
 * copyright   2004-12-27
*/


/* pwa.js: a drop-in JavaScript utility that displays galleries from picasaweb.google.com in your website */

/* NOTE: This version hides all the link-backs to Picasa */

/* This JavaScript file, when called from a webpage, will load all the thumbnail images of all the galleries
   in a user's Picasa Web Albums account into an HTML table that's 3 rows wide.  Clicking on any of the
   galleries will display thumbnails of all the photos in that gallery, and clicking on any of those thumbnails
   will display the photo.  

   To call this file from your own webpage, use the following syntax:

       <script type="text/javascript">username='YourPicasawebUsername'; photosize='400'; columns='3';</script>
       <script type="text/javascript" src="http://www.yoursite.com/pwa.js"></script>

   Make sure you change YourPicasawebUsername to your actual Picasaweb username.  For more information about
   Picasa, check out picasaweb.google.com.  Also, www.yoursite.com should point to your actual site name, and
   the location of the pwa.js file.  The script looks for the images back.jpg, next.jpg, and home.jpg, in the
   same directory as pwa.js, to create the navigation arrows.  Please make sure those exist!  I'm providing
   samples in the SourceForce repository, but feel free to substitute your own.

   Note: "Photosize" is the size of the image to be displayed when viewing single images.  I like 400.  :-)
   Note: "columns" is the number of columns of photos to be displayed on your site in the gallery and album views.
   You may omit either of these values; if you do, the default settings are 400 for photosize and 3 for columns.

*/


//############################################
//requestVars end
//############################################
function readGet(){var _GET = new Array();var uriStr  = window.location.href.replace(/&amp;/g, '&');var paraArr, paraSplit;if(uriStr.indexOf('?') > -1){var uriArr  = uriStr.split('?');var paraStr = uriArr[1];}else{return _GET;}if(paraStr.indexOf('&') > -1){paraArr = paraStr.split('&');}else{paraArr = new Array(paraStr);}for(var i = 0; i < paraArr.length; i++){paraArr[i] = paraArr[i].indexOf('=') > -1 ? paraArr[i] : paraArr[i] + '=';paraSplit  = paraArr[i].split('=');_GET[paraSplit[0]] = decodeURI(paraSplit[1].replace(/\+/g, ' '));}return _GET;}var _GET = readGet();

//############################################
// not used anymore! was scaling photos after they were loaded. using browser-native inline scaling instead,
// until google fixes their image size request to work with any imgmax, rather than just 400 :-(
//############################################
function resize(which, max) {
  var elem = document.getElementById(which);
  if (elem == undefined || elem == null) return false;
  if (max == undefined) max = 400;
  if (elem.width > elem.height) {
    if (elem.width > max) elem.width = max;
  } else {
    if (elem.height > max) elem.height = max;
  }
}

//$Update: May 10, 2007$

function $(a){document.write(a);}
var photosize;
if(!photosize){photosize = 400;}

var columns;
if(!columns || isNaN(columns) || columns < 1) {columns = 3;}


//Global variables
var photolist = new Array(); //this is used globally to store the entire list of photos in a given album, rather than pass the list around in a URL (which was getting rediculously long as a result)
var album_name = ""; //this is used globally to store the album name, so we don't have to pass it around in the URL anymore either.
var my_numpics = ""; //this is used globally to store the number of items in a particular album, so we don't have to pass it around in the URL anymore either.
var prev = ""; //used in the navigation arrows when viewing a single item
var next = "";//used in the navigation arrows when viewing a single item


//############################################
//returns the list of all albums for the user
//############################################
function picasaweb(j){
 //$("<table border=0 bgcolor=#CCCCCC width=100%><tr><td valign=middle align=center><font size=4 face='arial,helvetica' color=#0000CC><b><i>Galleries</i></b></font></td></tr></table>");
 $("<table border=0 cellpadding=5 cellspacing=5><tr>");

 for(i=0;i<j.feed.entry.length;i++){

 // for each of the albums in the feed, grab its album cover thumbnail and the link to that album,
 // then display them in a table with 3 columns (along with the album title)

  //This was the old way of grabbing the photos; since Google updated the feed, the media entry is better. :-)
  //
  //var img_begin = j.feed.entry[i].summary.$t.indexOf('src="')+5;
  //var img_end = j.feed.entry[i].summary.$t.indexOf('?imgmax');
  //var img_base = j.feed.entry[i].summary.$t.slice(img_begin, img_end);

  var img_base = j.feed.entry[i].media$group.media$content[0].url;

  var id_begin = j.feed.entry[i].id.$t.indexOf('albumid/')+8;
  var id_end = j.feed.entry[i].id.$t.indexOf('?');
  var id_base = j.feed.entry[i].id.$t.slice(id_begin, id_end);

  $("<td valign=top bgcolor=#ffffff><a class='standard' href='?albumid="+id_base+"'><img border=0 src='"+img_base+"?imgmax=160&crop=0' class='pwimages' /></a>");
  $("<br><table border=0 bgcolor=#ffffff width=100%><tr><td valign=middle align=center><font size=3 face='arial,helvetica'><a border=0 class='standard' href='?albumid="+id_base+"'>"+ j.feed.entry[i].title.$t +"</a></font></td></tr></table></td>");
  //if (i % columns == columns-1) {
  if (i % 3 == 3-1) {
    $("</tr><tr>");
  }
 }
 $("</tr></table>");
 
}




//############################################
// This function is called just before displaying an item; it returns info about the item's current state within its parent
// album, such as the name of the album it's in, the index of the photo in that album, and the IDs of the previous and next
// photos in that album (so we can link to them using navigation arrows).  This way we don't have to pass state information
// around in the URL, which was resulting in hellishly long URLs (sometimes causing "URI too long" errors on some servers).
//############################################
function getphotolist(j){


// Get the number of pictures in the album.  Added 7/18/2007.
 my_numpics = j.feed.openSearch$totalResults.$t;

// Also get the name of the album, so we don't have to pass that around either.  Added 7/18/2007.
 album_name = j.feed.title.$t;
 
 for(i=0;i<j.feed.entry.length;i++){
  // get the list of all photos referenced in the album and display;
  // also stored in an array (photoids) for navigation in the photo view (passed via the URL)
  var id_begin = j.feed.entry[i].id.$t.indexOf('photoid/')+8;
  var id_end = j.feed.entry[i].id.$t.indexOf('?');
  var id_base = j.feed.entry[i].id.$t.slice(id_begin, id_end);
  photolist[i]=id_base;

  // now get previous and next photos relative to the photo we're currently viewing
  if (i>0)
  {
    var prev_begin = j.feed.entry[i-1].id.$t.indexOf('photoid/')+8;
    var prev_end = j.feed.entry[i-1].id.$t.indexOf('?');
    prev = j.feed.entry[i-1].id.$t.slice(id_begin, id_end);
  }
  if (i<j.feed.entry.length-1)
  {
    var next_begin = j.feed.entry[i+1].id.$t.indexOf('photoid/')+8;
    var next_end = j.feed.entry[i+1].id.$t.indexOf('?');
    next = j.feed.entry[i+1].id.$t.slice(id_begin, id_end);
  }

 }
}

//############################################
//returns all photos in a specific album and
//displays them as a grid of 'polaroid' style images
//############################################
function albums(j){

 //get the number of photos in the album
 var np = j.feed.openSearch$totalResults.$t;
 var item_plural = "s";
 if (np == "1") { item_plural = ""; }

 

 var album_begin = j.feed.entry[0].summary.$t.indexOf('href="')+6;
 var album_end = j.feed.entry[0].summary.$t.indexOf('/photo#');
 var album_link = j.feed.entry[0].summary.$t.slice(album_begin, album_end);
 var photoids = new Array();

 //$("<table border=0 bgcolor=#CCCCCC width=100%><tr><td valign=middle align=center><font size=4 face='arial,helvetica' color=#0000CC><b><i><a border=0 class='standard' href='" + window.location.protocol + "//" + window.location.hostname+window.location.pathname+"'>Galleries</a> &gt; "+ j.feed.title.$t +"&nbsp;&nbsp;["+np+" photo"+item_plural+"]</i></b></font></td></tr></table>");
 //$("<table border=0 bgcolor=#CCCCCC width=600><tr><td valign=middle align=center><font size=4 face='arial,helvetica' color=#0000CC><b><i>Galleries &gt; "+ j.feed.title.$t +"&nbsp;&nbsp;["+np+" photo"+item_plural+"]</i></b></font></td></tr></table>");
 //$("<table border=1 cellpadding=5 cellspacing=5><tr><td rowspan=10 width=20></td>");
 $("<table border=0 cellpadding=5 cellspacing=5><tr>");

 for(i=0;i<j.feed.entry.length;i++){

  var img_base = j.feed.entry[i].media$group.media$content[0].url;

  var id_begin = j.feed.entry[i].id.$t.indexOf('photoid/')+8;
  var id_end = j.feed.entry[i].id.$t.indexOf('?');
  var id_base = j.feed.entry[i].id.$t.slice(id_begin, id_end);
  photoids[i]=id_base;
  

  // display the thumbnail (in a table) and make the link to the photo page, including the gallery name so it can be displayed.
  // (apparently the gallery name isn't in the photo feed from the Picasa API, so we need to pass it as an argument in the URL) - removed the gallery name 7/18/2007
  var link_url = "?albumid="+albumid+"&photoid="+id_base; //+"&photoids="+photoids;

  //ADDED by DGB 23 Nov 2009
  //Parse the image caption into individual elements for creating a standard paypal add-to-cart button
  //Relies on the caption being formated using the following prototype:
  //"Price: $X | Shipping: $X | Description: description | comma-separated options list"
  //TODO: add code that will detect whether the prototype is present and decide whether to display paypal button
  var this_caption = j.feed.entry[i].media$group.media$description.$t;
  var captionArr = this_caption.split('|');
  if (captionArr[0].length != this_caption.length){
	  var priceVerbose = captionArr[0];
	  var priceArr = priceVerbose.split(':');
	  var price = priceArr[1];
	  var descVerbose = captionArr[2];
	  var descArr = descVerbose.split(':');
	  var desc = descArr[1];
  } else {
  	  var desc = this_caption;
  }

  // disable the navigation entirely for really long URLs so we don't hit against the URL length limit.
  // note: this is probably not necessary now that we're no longer passing the photoarray inside the URL. 7/17/2007
  // Not a bad idea to leave it in, though, in case something goes seriously wrong and we need to revert to that method.
  if (link_url.length > 2048) { link_url = link_url.slice(0, link_url.indexOf('&photoids=')+10)+id_base; }
  $("<td valign=top bgcolor=#ffffff align=center><a href='"+link_url+"'><img border=0 src='"+img_base+"?imgmax=160&crop=0' class='pwimages' /></a>");
  $("<table border=0 width=160><tr><td valign=middle align=center><font size=2 face='arial,helvetica'><small><font color='#006600'><b>"+price+"</b></font>"+desc+"</small></font></td></tr></table>"); //j.feed.entry[i].media$group.media$description.$t
  $("</td>");

  if (i % columns == columns-1) {
    $("</tr><tr>");
  }
 }
 $("</tr></table>");
 $('<script type="text/javascript" src="http://picasaweb.google.com/data/feed/base/user/'+username+'/albumid/'+albumid+'?category=photo&alt=json&callback=marker"></script>');//albums
 //marker();
}



//############################################
// Returns exactly one photo
//############################################

function photo(j){


 var album_begin = j.entry.summary.$t.indexOf('href="')+6;
 var album_end = j.entry.summary.$t.indexOf('/photo#');
 var album_link = j.entry.summary.$t.slice(album_begin, album_end);

 var img_title = j.entry.title.$t;

 //get the dimensions of the photo we're grabbing; if it's smaller than our max width, there's no need to scale it up.
 var img_width = j.entry.media$group.media$content[0].width;
 var img_height = j.entry.media$group.media$content[0].height;


 var img_base = j.entry.media$group.media$content[0].url;


 // is this a video? If so, we will display that in the breadcrumbs below.
 var is_video = 0;
 if (j.entry.media$group.media$content.length > 1)
 {
   //$('This is a '+j.entry.media$group.media$content[1].medium+'.<br>');
   if (j.entry.media$group.media$content[1].medium == "video")
   {
	   is_video = 1;
   }
 }

 
 var photo_begin = j.entry.summary.$t.indexOf('href="')+6;
 var photo_end = j.entry.summary.$t.indexOf('"><img');
 var photo_link = j.entry.summary.$t.slice(photo_begin, photo_end);
 var photo_id = _GET['photoid'];

 //album name is now taken from the global variable instead. 7/18/2007
 //
 //var album_name_begin = j.entry.summary.$t.indexOf(username)+username.length+1;
 //var album_name_end = j.entry.summary.$t.indexOf('/photo#');
 //var album_name = j.entry.summary.$t.slice(album_name_begin, album_name_end);

 var album_id = _GET['albumid'];
 var my_next = next;
 var my_prev = prev;
 var photo_array = photolist;
 //var my_numpics = _GET['np'];
 //instead, we now get this through the global variable my_numpics. 7/18/2007

 //$("photo ids: "+_GET['photoids']+".<br><br>");
 //$("photolist: "+photo_array+".<br><br>");

 //var my_galleryname = _GET['galleryname'];
 //var my_fixed_galleryname = my_galleryname.slice(1, my_galleryname.length-1);
 var my_galleryname = album_name;
 var my_fixed_galleryname = album_name;
 var album_base_path = window.location.protocol + "//" + window.location.hostname+window.location.pathname +"?albumid="+albumid;

 // Get the filename for display in the breadcrumbs
 var LastSlash = 0;
 var img_filename = img_title;
 for(i=0;i<img_base.length-1;i++){
  if (img_base.charAt(i)=="/")
  {
	  LastSlash = i;
  }
 }
 if (LastSlash != 0)
 {
	 img_filename = img_base.slice(LastSlash+1, img_base.length);
 }
 // replace some commonly-used URL characters like %20
 img_filename = img_filename.replace("%20"," ");
 img_filename = img_filename.replace("%22","\"");
 img_filename = img_filename.replace("%27","\'");


//find preceding two and following two pictures in the array; used for the navigation arrows.
//the arrows are already linked to the previous and next pics, which were passed in with the URL.
//however, we need the ones that are two behind and two ahead so that we can pass that info along when we link to another photo.
//
//NOTE: as of 7/16/2007, the photo array is taken from global photolist (loaded in the getphotolist function) rather than from the URL.
//This has eliminated the need for really long URLs, which were hitting up against the URL length limit in some extreme cases.
for(i=0;i<photo_array.length;i++){
 if (photo_array[i]==photo_id)
 {
	 var p1 = photo_array[i-1]; //ID of the picture one behind this one; if null, we're at the beginning of the album
	 var current_index = i + 1; //this is the count of the current photo
	 var n1 = photo_array[i+1]; //ID of the picture one ahead of this one; if null, we're at the end of the album
 }
}
//these will be passed along if we move to the next or previous photo - removed the gallery name 7/18/2007
//var prev = album_base_path + "&photoid=" + p1 + "&np=" + my_numpics + "&galleryname=" + my_galleryname.replace("'","%27") + "&prev="+p2+ "&next="+photo_id; //+"&photoids="+photo_array;
//var next = album_base_path + "&photoid=" + n1 + "&np=" + my_numpics + "&galleryname=" + my_galleryname.replace("'","%27") + "&prev="+photo_id+ "&next="+n2; //+"&photoids="+photo_array;
var prev = album_base_path + "&photoid=" + p1; //+"&photoids="+photo_array;
var next = album_base_path + "&photoid=" + n1; //+"&photoids="+photo_array;


//Display the breadcrumbs
var my_item_plural = "";
if (my_numpics != 1)
{
	my_item_plural = "s";
}
var item_label = "photo";
var item_label_caps = "Photo";
if (is_video == 1) //if it's a video, don't say it's a picture, say it's an "item" instead
{
	item_label = "item";
	item_label_caps = "Item";
}
var current_index_text = item_label_caps + " " + current_index + " of " + my_numpics;
if (is_video == 1) { current_index_text = current_index_text + "&nbsp;&nbsp;[VIDEO]"; }  //show in the breadcrumbs that the item is a video
//$("<center><table border=0 bgcolor=#CCCCCC width=804><tr><td valign=middle align=left><font size=4 face='arial,helvetica' color=#0000CC><b><i><a border=0 class='standard' href='"+ window.location.protocol + "//" + window.location.hostname+window.location.pathname+"'>Galleries</a> &gt; <a border=0 class='standard' href='" + album_base_path + "'>" + my_fixed_galleryname + "</a> &gt; <!--" + img_filename + "-->" + current_index_text + "</i></b></font></td>");
$("<center><table border=0 cellpadding=2 cellspacing=0 width=605><tr><td valign=middle align=left width=405><font size=2 face='arial,helvetica'><big><big><b>&nbsp; " + current_index_text + "</b></big></big></font></td>");


if (p1 == null) //we're at the first picture in the album; going back takes us to the album index
  { var prev = album_base_path }

if (n1 == null) //we're at the last picture in the album; going forward takes us to the album index
  { var next = album_base_path }

 //the navigation panel: back, home, and next.
 $("<td valign=middle align=center width=200><img border=0 src='images/1.gif' width=1 height=4><br>");
 if (photo_array.length > 1) { $("<a border=0 class='standard' href='"+prev+"'><img border=0 alt='Previous item' src='http://www.dbeckett.com/assets/images/prev.gif'></a> "); }
 if (photo_array.length > 1) { $("<a border=0 class='standard' href='"+next+"'><img border=0 alt='Next item' src='http://www.dbeckett.com/assets/images/next.gif'></a>"); }
 $("</td></tr>");
 
 var max_width = 400; //max width for our photos
 var display_width = max_width;
 if (img_width < display_width)
   { display_width = img_width; } //don't scale up photos that are narrower than our max width; disable this to set all photos to max width

 //at long last, display the image and its description. photos larger than max_width are scaled down; smaller ones are left alone
 $("<tr><td valign=top align=right><img border=4 id='picture' src='"+img_base+"?imgmax=400&crop=0' class='pwimages' /></td>");
 $("<td valign=top align=right>");
  
 //ADDED by DGB 23 Nov 2009
 //Parse the image caption into individual elements for creating a standard paypal add-to-cart button
 //Relies on the caption being formated using the following prototype:
 //"Price: $X | Shipping: $X | Description: description | Photo: X of N | comma-separated options list"
 //TODO: add code that will detect whether the prototype is present and decide whether to display paypal button
 var this_caption = j.entry.media$group.media$description.$t;
 var captionArr = this_caption.split('|');

 if (captionArr[0].length != this_caption.length){
	var priceVerbose = captionArr[0];
	var priceArr = priceVerbose.split(':');
	var price = priceArr[1];
	var shipVerbose = captionArr[1];
	var shipArr = shipVerbose.split(':');
	var ship = shipArr[1];
	var descVerbose = captionArr[2];
	var descArr = descVerbose.split(':');
	var desc = descArr[1];

	$("<font face='Arial,Helvetica' size='2'><font color='#003300'>"+desc+"</font><br>");
	$("<font color='#006600' size=4><b>"+priceVerbose+"</b></font><br>");
	$("<font color='#000000' size=1>"+shipVerbose+"</font><br>");
	$("<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>");
	$("<input name='add' value='1' type='hidden'>");
	$("<input name='cmd' value='_cart' type='hidden'>");
	$("<input name='business' value='dan.beckett@ideola.com' type='hidden'>");
	$("<input name='item_name' value='"+desc+"' type='hidden'>");
	$("<input name='item_number' value='used part "+photo_id+"' type='hidden'>"); // "+album_id+"#"+photo_id+"
	$("<input name='amount' value='"+price+"' type='hidden'>");
	$("<input name='shipping' value='"+ship+"' type='hidden'>");
	$("<input name='no_note' value='1' type='hidden'>");
	$("<input name='currency_code' value='USD' type='hidden'>");
	$("<input name='lc' value='US' type='hidden'>");
	$("<input name='bn' value='PP-ShopCartBF' type='hidden'>");
	// if there's an option list, fetch it and build a picklist
	if (captionArr.length > 4){
	   var optVerbose = captionArr[4];
	   var optArr = optVerbose.split(',');
	   $("<input name='on0' value='OPTION(S)' type='hidden'><select name='os0'>");
	   for(i=0;i<optArr.length;i++){
	       $("<option value='"+optArr[i]+"'>"+optArr[i]+"</option>");
	   }
	   $("</select>");
	}
	// if there are multiple photos for a single item, only display the add-to-cart button if we're on the first photo
	// and direct the user to go back to the first photo to purchase
	if (captionArr.length > 3){
	   var countVerbose = captionArr[3];
	   var countArr = countVerbose.split(' ');
	   var count = countArr[2];
	   if (count > 1){
	       $("<br>This is "+countVerbose+" for this item. Navigate to the first photo of this item to add to your shopping cart.</form>");
	   } else {
	       $("<br><input src='images/add-to-cart.gif' name='submit' alt='Add to Cart' border='0' height='20' type='image' width='98'></form>");
		// Make an offer section
		$("<hr><form name='offer' action='http://garage.ideola.com/cgi-bin/offer.cgi' method='post' onsubmit='return validate_form(this);'>");
		$("<font face='Helvetica, Arial, sans-serif' color='#CC6600'><big><big><b>Make an Offer</b></big></big></font><br>");
		$("<font face='Helvetica, Arial, sans-serif'><small>Asking price too high?<br>Make us an offer!</small></font><br>");
		$("<font face='Helvetica, Arial, sans-serif' color='#CC6600'><big><big><b>USD$</b></big></big><input maxlength='8' size='10' name='offer'></font><br>");
		$("<font face='Helvetica, Arial, sans-serif'><small>email: <input maxlength='100' size='20' name='email'></small></font><br>");
		$("<font face='Helvetica, Arial, sans-serif'><small>verify: <input maxlength='100' size='20' name='emailVerify'></small></font><br>");
		$("<input name='mapsitna' id='mapsitna' value='mapsitna' type='hidden'>");
		$("<input name='item_name' value='"+desc+"' type='hidden'>");
		$("<input name='item_number' value='"+photo_id+"' type='hidden'>"); // "+album_id+"#"+photo_id+"
		$("<input name='amount' value='"+price+"' type='hidden'>");
		$("<input name='shipping' value='"+ship+"' type='hidden'>");
		$("<input src='images/make-offer.gif' name='submit' alt='Make Offer' border='0' height='20' type='image' width='98'></font></form>");
	   }
	}
 } else {
 	//WE HAVE NON-CONFORMING CAPTION, just display the caption as is...
	$("<font face='Arial,Helvetica' size='2' font color='#0000CC'>"+this_caption+"</font><hr>");
	$("<font face='Arial,Helvetica' size='2'><b>Please <a href='contact.html?non-paypal'>contact us</a> to arrange for purchase & shipment of this item.</b></font>");
 }
$("<hr><font face='Helvetica, Arial, sans-serif' color='#003366' size='2'><big><big><b>Parts Request</b></big></big></font><br>");
$("<font face='Helvetica, Arial, sans-serif' color='#336699' size='2'><small>Need a part you can't find?<br>We'll help you find it!</small></font><br>");
$("<a href='contact.html?partsrequest'><img src='images/parts-help.gif' alt='Parts Help!' border='0' height='20' width='98'></a>");
$("</td></tr>");
 //$("<tr><td valign=middle align=center><font size=2 face='arial,helvetica' color=#0000CC>"+j.entry.media$group.media$description.$t+"</font></td><td></td></tr>");
 $("</table><br><img border=0 src='images/1.gif' width=1 height=4><br>");

 //now we will trap left and right arrow keys so we can scroll through the photos with a single keypress ;-) JMB 7/5/2007
 $('<script language="Javascript"> function testKeyCode( evt, intKeyCode ) { if ( window.createPopup ) return evt.keyCode == intKeyCode; else return evt.which == intKeyCode; } document.onkeydown = function ( evt ) { if ( evt == null ) evt = event; if ( testKeyCode( evt, 37 ) ) { window.location = "' + prev + '"; return false; } if ( testKeyCode( evt, 39 ) ) { window.location = "' + next + '"; return false; } } </script>');

}

if(_GET['photoid']&&albumid>0){
 $('<script type="text/javascript" src="http://picasaweb.google.com/data/feed/base/user/'+username+'/albumid/'+albumid+'?category=photo&alt=json&callback=getphotolist"></script>');//get the list of photos in the album and put it in the global "photolist" array so we can properly display the navigation arrows; this eliminates the need for really long URLs :-) 7/16/2007
 $('<script type="text/javascript" src="http://picasaweb.google.com/data/entry/base/user/'+username+'/albumid/'+albumid+'/photoid/'+_GET['photoid']+'?alt=json&callback=photo&np='+_GET['np']+'&galleryname='+_GET['galleryname']+'"></script>');//photo
//}else if(_GET['albumid']&&!_GET['photoid']){
// $('<script type="text/javascript" src="http://picasaweb.google.com/data/feed/base/user/'+username+'/albumid/'+_GET['albumid']+'?category=photo&alt=json&callback=albums"></script>');//albums
// $('<script type="text/javascript" src="http://picasaweb.google.com/data/feed/base/user/'+username+'/albumid/'+_GET['albumid']+'?category=photo&alt=json&callback=mapper"></script>');//albums
}else if(albumid>0&&!_GET['photoid']){
 $('<script type="text/javascript" src="http://picasaweb.google.com/data/feed/base/user/'+username+'/albumid/'+albumid+'?category=photo&alt=json&callback=albums"></script>');//albums
 $('<script type="text/javascript" src="http://picasaweb.google.com/data/feed/base/user/'+username+'/albumid/'+albumid+'?category=photo&alt=json&callback=mapper"></script>');//albums
}else{
 $('<script type="text/javascript" src="http://picasaweb.google.com/data/feed/base/user/'+username+'?category=album&alt=json&callback=picasaweb&access=public"></script>');//picasaweb
}


//$Update: July 18, 2007$
