var global_nsid = '', global_name ='', global_icon_url ='';

if(!Array.prototype.push) {
   Array.prototype.push = function() {
      var i = 0, b = this.length, a = arguments; 
      for(i; i < a.length; i++) {
         this[b + i] = a[i]; 
         }
      return this.length; 
      }
   ; 
   }
if(!Array.prototype.pop) {
   Array.prototype.pop = function() {
      var b = this[this.length - 1]; 
      this.length--; 
      return b; 
      }
   ; 
   }
if(!Array.prototype.shift) {
   Array.prototype.shift = function() {
      var _3 = this[0]; 
      for(var i = 0; i < this.length - 1; i++) {
         this[i] = this[i + 1]; 
         }
      this.length--; 
      return _3; 
      }
   ; 
   }
var _numeric_sort_func = function(a, b) {
   return (a - b); 
   }
; 
var _alpha_sort_func = function(a, b) {
   var a2 = String(a).toLowerCase(); 
   var b2 = String(b).toLowerCase(); 
   return (a2 > b2) ? 1 : ((a2 < b2) ?- 1 : 0); 
   }
; 
Number.prototype.addZeros = function(p) {
   if(("" + this).length >= p) {
      return this; 
      }
   return (new Array(p).join("0") + this).substr((new Array(p).join("0") + this).length - p); 
   }
; 
Number.prototype.pretty_num = function() {
   var s = this.toString(); 
   sA = s.split("."); 
   s1 = sA[0]; 
   s2 = (sA[1]) ? "." + sA[1] : ""; 
   if(s1.length < 4) {
      return s; 
      }
   var _9 = ""; 
   for(var i = s1.length - 1; i >- 1; i--) {
      if(i < s1.length - 1 && (s1.length - 1 - i) % 3 == 0) {
         _9 = "," + _9; 
         }
      _9 = s1.charAt(i) + _9; 
      }
   return _9 + s2; 
   }
; 
Number.prototype.truncate_geo_value = function() {
   var s = this.toString(); 
   sA = s.split("."); 
   if(sA.length < 2) {
      return this; 
      }
   d = sA[1]; 
   if(d.length < 7) {
      return this; 
      }
   d = d.substring(0, 6); 
   return (sA[0] + "." + d) * 1; 
   }
; 
String.prototype.truncate_geo_value = function() {
   return _pf(this).truncate_geo_value(); 
   }
; 
String.prototype.pretty_num = function() {
   return _pf(this).pretty_num(); 
   }
; 
String.prototype.trim = function() {
   return this.replace(/^\s+|\s+$/g,"");
   }
; 
String.prototype.nl2br = function() {
   return this.split("\n").join("<br />\n"); 
   }
; 
String.prototype.replace = function(_10, _11) {
   return this.split(_10).join(_11); 
   }
; 
String.prototype.escape_for_xml = function() {
   return this.replace("&", "&amp;").replace("\"", "&quot;").replace("<", "&lt;").replace(">", "&gt;"); 
   }
; 
String.prototype.unescape_from_xml = function() {
   return this.replace("&quot;", "\"").replace("&lt;", "<").replace("&gt;", ">").replace("&amp;", "&"); 
   }
; 
String.prototype.escape_for_display = function() {
   return this.replace("<", "&lt;"); 
   }
; 
String.prototype.escape_for_display_and_wrap = function() {
   return this.replace("<", "<wbr>&lt;"); 
   }
; 
String.prototype.truncate_with_ellipses = function(_12) {
   var t = this; 
   if(t.length > _12 - 3) {
      t = t.substr(0, _12 - 3).trim() + "..."; 
      }
   return t; 
   }
; 
String.prototype.truncate = function(_14) {
   var t = this; 
   if(t.length > _14) {
      t = t.substr(0, _14); 
      }
   return t; 
   }
; 
document.getElementsByClass = function(_15, _16, _17) {
   if(!_16) {
      _16 = "*"; 
      }
   var _17 = (_17) ? _17 : document; 
   if(!_17.getElementsByTagName) {
      alert(_17.id + " has no getElementsByTagName method"); 
      }
   var _18 = _17.getElementsByTagName(_16); 
   var _19 = new Array(); 
   var i; 
   var j; 
   for(var i = 0, j = 0; i < _18.length; i++) {
      var c = " " + _18[i].className + " "; 
      if(c.indexOf(" " + _15 + " ") !=- 1) {
         _19[j++] = _18[i]; 
         }
      }
   return _19; 
   }
; 
var F = {
   id : "F", is_windows : (navigator.appVersion.toLowerCase().indexOf("mac") ==- 1 && navigator.appVersion.toLowerCase().indexOf("nix") ==- 1 && navigator.appVersion.toLowerCase().indexOf("nux") ==- 1), changes_count : 0, _ebA : [], _decoratedO : {
      }
   }
; 
F.stop_event_propagation = function(e) {
   if(!e) {
      if(window.event) {
         window.event.cancelBubble = true; 
         }
      }
   else {
      e.stopPropagation(); 
      }
   }
; 
F.fit_text_in_block = function(_23, _24, _25, _26, _27) {
   writeDebug("fit_text_in_block start"); 
   var _28 = new Date(); 
   _26 = (_26) ? _26 : ""; 
   _27 = (_27) ? _27 : ""; 
   var t = _23; 
   var _29 = _24.style.display; 
   var _30 = _24.style.visibility; 
   _24.style.visibility = "hidden"; 
   _24.style.display = "block"; 
   _24.innerHTML = _26 + t + _27; 
   writeDebug("BEFORE: h:" + _24.offsetHeight + " max:" + _25 + " " + t); 
   var c = 0; 
   if(_24.offsetHeight > _25 && t.length > 1) {
      c++; 
      _24.innerHTML = _26 + "m" + _27; 
      var lh = _24.offsetHeight; 
      _24.innerHTML = _26 + t + _27; 
      var lc = (_24.offsetHeight / lh); 
      var alc = Math.floor(_25 / lh); 
      writeDebug("lh " + lh + " lc " + lc + " alc " + alc); 
      var _34 = _24.offsetHeight - _25; 
      var _35 = Math.max(1, lc - 3)/alc;
      writeDebug("DURING: diff:" + _34 + " times:" + _35); 
      t = t.truncate_with_ellipses(_pi(t.length / (_35))); 
      _24.innerHTML = _26 + t + _27; 
      writeDebug("lop a bunch: h:" + _24.offsetHeight + " max:" + _25 + " " + t); 
      }
   if(_24.offsetHeight > _25 && t.length > 1) {
      do {
         c++; 
         t = t.truncate_with_ellipses(t.length - 2); 
         _24.innerHTML = _26 + t + _27; 
         }
      while(_24.offsetHeight > _25 && t.length > 1); 
      }
   writeAPIDebug("AFTER: c:" + c + " h:" + _24.offsetHeight + " max:" + _25 + " " + t); 
   _24.style.visibility = _30; 
   _24.style.display = _29; 
   var _36 = new Date(); 
   writeDebug("fit_text_in_block Step 1 = " + (_36 - _28) + "ms"); 
   }
; 
F.get_tags_from_input_str = function(str) {
   str = str.trim(); 
   if(str == "") {
      return []; 
      }
   var _38 = str.split("\""); 
   var _39 = []; 
   for(var i = 0; i < _38.length; i++) {
      var bit = _38[i].trim(); 
      if(i % 2 == 0) {
         var _41 = bit.split(" "); 
         for(var k = 0; k < _41.length; k++) {
            if(_41[k] != "") {
               _39.push(_41[k]); 
               }
            }
         }
      else {
         if(bit != "") {
            _39.push(bit); 
            }
         }
      }
   return _39; 
   }
; 
F.array_copy = function(A) {
   var c = []; 
   for(var i = 0; i < A.length; i++) {
      c[i] = A[i]; 
      }
   return c; 
   }
; 
F.array_copy_except = function(A, _44) {
   var c = []; 
   for(var i = 0; i < A.length; i++) {
      if(_44 == undefined || A[i] != _44) {
         c.push(A[i]); 
         }
      }
   return c; 
   }
; 
F.array_index_of = function(A, _45) {
   for(var i = 0; i < A.length; i++) {
      if(A[i] == _45) {
         return i; 
         }
      }
   return - 1; 
   }
; 
F.get_dates_from_form = function(_46, _47) {
   var _48; 
   var _49; 
   var _50; 
   var _51 = _ge(_46 + "date_posted_exact"); 
   var _52 = _ge(_46 + "time_posted_exact"); 
   if(_51) {
      var d0A = _51.value.split("/"); 
      _48 = _convert_MYSQLDateTime_into_unix_time_stamp(d0A[2] + "-" + d0A[0] + "-" + d0A[1] + " " + _52.value); 
      if(_47 > 0) {
         _48 = _48 + _47; 
         }
      }
   if(_ge(_46 + "date_taken_exact_div").style.display == "none") {
      var _54 = _ge(_46 + "date_taken_approx_month"); 
      var _55 = _ge(_46 + "date_taken_approx_year"); 
      _49 = _55.options[_55.selectedIndex].value; 
      if(_54.options[_54.selectedIndex].value != 0) {
         _50 = "4"; 
         _49 += "-" + _54.options[_54.selectedIndex].value + "-01"; 
         }
      else {
         _50 = "6"; 
         _49 += "-01-01"; 
         }
      _49 += " 00:00:00"; 
      }
   else {
      var _56 = _ge(_46 + "date_taken_exact"); 
      var _57 = _ge(_46 + "time_taken_exact"); 
      var _58 = _56.value.split("/"); 
      _50 = "0"; 
      _49 = _58[2] + "-" + _58[0] + "-" + _58[1] + " " + _57.value; 
      if(_47 > 0) {
         var _59 = _convert_MYSQLDateTime_into_unix_time_stamp(_49); 
         _59 = _59 + _47; 
         _49 = _convert_unix_time_stamp_into_MYSQLDateTime(_59); 
         }
      }
   return {
      date_posted : _48, date_taken : _49, date_taken_granularity : _50}
   ; 
   }
; 
F.remove_el = function(el, p, _61) {
   if(_61) {
      F.drag_unreg(el); 
      }
   _ge_cache_remove(el); 
   p = (p) ? p : el.parentNode; 
   p.removeChild(el); 
   }
; 
F.drag_unreg = function(el) {
   if(el.fumb_target) {
      el.fumb_target.unreg(); 
      }
   if(el.fumb_drag) {
      el.fumb_drag.unreg(); 
      }
   if(el.set_photo_drag) {
      el.set_photo_drag.unreg(); 
      }
   if(el.set_photo_target) {
      el.set_photo_target.unreg(); 
      }
   if(el.set_div_drag) {
      el.set_div_drag.unreg(); 
      }
   if(el.set_div_target) {
      el.set_div_target.unreg(); 
      }
   if(el.dot_drag) {
      el.dot_drag.unreg(); 
      }
   if(el.dot_target) {
      el.dot_target.unreg(); 
      }
   if(el.pinwin_thumb_drag) {
      el.pinwin_thumb_drag.unreg(); 
      }
   if(el.pinwin_thumb_target) {
      el.pinwin_thumb_target.unreg(); 
      }
   if(el.batch_photo_drag) {
      el.batch_photo_drag.unreg(); 
      }
   if(el.batch_photo_target) {
      el.batch_photo_target.unreg(); 
      }
   if(el.group_photo_drag) {
      el.group_photo_drag.unreg(); 
      }
   if(el.group_photo_target) {
      el.group_photo_target.unreg(); 
      }
   for(var i = el.childNodes.length - 1; i >= 0; i--) {
      var ch = el.childNodes[i]; 
      F.drag_unreg(ch); 
      }
   }
; 
F.decorate = function(el, obj) {
   if(!obj) {
      return; 
      }
   if(!el) {
      return; 
      }
   if(!el.id) {
      writeDebug("decorated els must have ids!"); 
      return; 
      }
   if(typeof obj._decotype == "object") {
      F.decorate(el, obj._decotype); 
      }
   for(p in obj) {
      if(p == "_decotype") {
         continue; 
         }
      try {
         el[p] = obj[p]; 
         }
      catch(err) {
         break; 
         }
      }
   if(this._decoratedO[el.id]) {
      }
   else {
      this._decoratedO[el.id] = []; 
      }
   this._decoratedO[el.id].push(el); 
   return el; 
   }
; 
F.changes_were_made = function() {
   this.changes_count = 1; 
   }
; 
F.changes_were_saved = function() {
   this.changes_count = 0; 
   }
; 
F.make_one_photo_edit_pop = function() {
   var div = document.createElement("div"); 
   div.id = "one_photo_edit_pop"; 
   document.body.appendChild(div); 
   F.decorate(div, F._one_photo_edit_pop).pop_go_go_go(); 
   return div; 
   }
; 
F.make_batch_edit_pop = function(_65, _66) {
   var div = document.createElement("div"); 
   div.id = "batch_edit_pop"; 
   document.body.appendChild(div); 
   F.decorate(div, F._batch_edit_pop).pop_go_go_go(_65, _66); 
   return div; 
   }
; 
F.make_shadow = function(_67, _68, _69, _70) {
   var _71 = (_69) ? _69 : document.body; 
   var div = document.createElement("div"); 
   div.id = _67 + "_shadow"; 
   if(_70 && _70.parentNode == _69) {
      _71.insertBefore(div, _70); 
      }
   else {
      _71.appendChild(div); 
      }
   F.decorate(div, F._shadow).shadow_go_go_go(_67, _68, _71); 
   return div; 
   }
; 
F._carrot = new Object(); 
F._carrot.carrot_go_go_go = function(_72, _73, _74, _75) {
   this.carrot_open_img = new Image(); 
   if(_72 == "up") {
      this.carrot_open_img.src = "/images/caret_open_up.gif"; 
      }
   else {
      this.carrot_open_img.src = "/images/caret_open_down.gif"; 
      }
   this.carrot_closed_img = new Image(); 
   this.carrot_closed_img.src = "/images/caret_closed.gif"; 
   this.carrot_is_open = (_73) ? 1 : 0; 
   if(this.carrot_is_open) {
      this.carrot_open_text = (_74) ? _74 : this.childNodes[1].innerHTML; 
      this.carrot_closed_text = (_75) ? _75 : this.carrot_open_text; 
      }
   else {
      this.carrot_closed_text = (_75) ? _75 : this.childNodes[1].innerHTML; 
      this.carrot_open_text = (_74) ? _74 : this.carrot_closed_text; 
      }
   this.style.cursor = (document.all) ? "hand" : "pointer"; 
   this.onclick_default = this.onclick; 
   this.onclick = this.carrot_onclick; 
   }
; 
F._carrot.carrot_onclick = function(e) {
   if(this.carrot_is_open) {
      this.carrot_close(); 
      }
   else {
      this.carrot_open(); 
      }
   }
; 
F._carrot.carrot_open = function() {
   this.onclick_default(); 
   this.carrot_is_open = 1; 
   this.childNodes[0].src = this.carrot_open_img.src; 
   this.childNodes[1].innerHTML = this.carrot_open_text; 
   }
; 
F._carrot.carrot_close = function() {
   this.onclick_default(); 
   this.carrot_is_open = 0; 
   this.childNodes[0].src = this.carrot_closed_img.src; 
   this.childNodes[1].innerHTML = this.carrot_closed_text; 
   }
; 
F._shadow = new Object(); 
F._shadow.shadow_go_go_go = function(_76, _77, _78) {
   this.shadow_use_local_coords = (_78 != document.body); 
   this.shadow_for_id = _76; 
   this.style.zIndex = _77; 
   this.style.display = "none"; 
   this.style.position = "absolute"; 
   this.shadow_height_plus =- 14; 
   this.shadow_width_plus =- 14; 
   this.shadow_x_plus =- 0; 
   this.shadow_y_plus =- 0; 
   var _79 = "" + "<table class=\"shadow_table\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"padding:0px;\">" + "<tr><td width=\"11\"><img class=\"trans_png\" width=\"11\" height=\"11\" src=\"/images/tc_white_shadow_tl.png\"></td><td id=\"" + this.id + "_width_controller\"><img class=\"trans_png\" width=\"100%\" height=\"11\" src=\"/images/tc_white_shadow_t.png\"></td><td width=\"11\"><img class=\"trans_png\" width=\"11\" height=\"11\" src=\"/images/tc_white_shadow_tr.png\"></td></tr>" + "<tr><td height=\"30\" id=\"" + this.id + "_height_controller\"><img class=\"trans_png\" width=\"11\" height=\"100%\" src=\"/images/tc_white_shadow_l.png\"></td><td></td><td><img class=\"trans_png\" width=\"11\" height=\"100%\" src=\"/images/tc_white_shadow_r.png\"></td></tr>" + "<tr><td><img class=\"trans_png\" width=\"11\" height=\"11\" src=\"/images/tc_white_shadow_bl.png\"></td><td><img class=\"trans_png\" width=\"100%\" height=\"11\" src=\"/images/tc_white_shadow_b.png\"></td><td><img class=\"trans_png\" width=\"11\" height=\"11\" src=\"/images/tc_white_shadow_br.png\"></td></tr></table>"; 
   this.innerHTML = _79; 
   }
; 
F._shadow.shadow_size_and_place = function() {
   var el = _ge(this.shadow_for_id); 
   var x = _find_x(el, this.shadow_use_local_coords) + this.shadow_x_plus; 
   var y = _find_y(el, this.shadow_use_local_coords) + this.shadow_y_plus; 
   this.style.left = x + "px"; 
   this.style.top = y + "px"; 
   var w = ((el.offsetWidth) + this.shadow_width_plus); 
   if(w < 0) {
      w = 0; 
      }
   var h = ((el.offsetHeight) + this.shadow_height_plus); 
   if(h < 0) {
      h = 0; 
      }
   _ge(this.id + "_width_controller").style.width = w + "px"; 
   _ge(this.id + "_height_controller").style.height = h + "px"; 
   }
; 
F._shadow.shadow_show = function() {
   this.style.display = "block"; 
   }
; 
F._shadow.shadow_hide = function() {
   this.style.display = "none"; 
   }
; 
_uber_toString = function(ob, d, _86, pre) {
   var ob = (ob) ? ob : window; 
   var d = (d) ? d : 1; 
   var _86 = (_86) ? _86 : 20; 
   var pre = (pre) ? pre : (ob.id) ? ob.id + "." : (ob.api_key) ? "params." : "root."; 
   var _88 = []; 
   var _89 = ""; 
   for(var i = 0; i < d; i++) {
      _89 += "\t"; 
      }
   if(d == 1) {
      _uber_toString._handled_Os_and_As = [ob]; 
      _88.push("{\n"); 
      }
   for(pr in ob) {
      try {
         var _90 = typeof ob[pr]; 
         if(typeof ob[pr] == "object") {
            _90 = "object"; 
            if(ob[pr] == null) {
               _90 = "null"; 
               }
            else {
               if(ob[pr].length != undefined) {
                  _90 = "array (" + ob[pr].length + ")"; 
                  }
               }
            }
         if(ob[pr] == _uber_toString) {
            continue; 
            }
         if(typeof ob == "object" && ob != null && ob.length != undefined && typeof ob[pr] == "function") {
            continue; 
            }
         _88.push(_89 + pre + pr + ":" + _90); 
         if(_90 == "null") {
            _88.push(": null\n"); 
            }
         else {
            if(typeof ob[pr] == "object") {
               if(ob[pr].length != undefined) {
                  _88.push(" : ["); 
                  var end = "]\n"; 
                  }
               else {
                  _88.push(" : {"); 
                  var end = "}\n"; 
                  }
               if(F.array_index_of(_uber_toString._handled_Os_and_As, ob[pr]) >- 1) {
                  _88.push("already been iterated over"); 
                  }
               else {
                  if(d > _86) {
                     _88.push(d + " is too deep (" + _86 + " is max)"); 
                     }
                  else {
                     if(pr == "F") {
                        _88.push("F (Flickr) is not iterated over"); 
                        }
                     else {
                        if(pr == "_decoratedO") {
                           _88.push("_decoratedO is not iterated over"); 
                           }
                        else {
                           if(pr == "_ebA") {
                              _88.push("_ebA is not iterated over"); 
                              }
                           else {
                              if(pr == "_eb_listeners") {
                                 _88.push("_eb_listeners is not iterated over"); 
                                 }
                              else {
                                 if(pr == "childNodes") {
                                    _88.push("childNodes is not iterated over"); 
                                    }
                                 else {
                                    if(pr == "previousSibling") {
                                       _88.push("previousSibling is not iterated over"); 
                                       }
                                    else {
                                       if(pr == "nextSibling") {
                                          _88.push("nextSibling is not iterated over"); 
                                          }
                                       else {
                                          if(pr == "firstChild") {
                                             _88.push("firstChild is not iterated over"); 
                                             }
                                          else {
                                             if(pr == "lastChild") {
                                                _88.push("lastChild is not iterated over"); 
                                                }
                                             else {
                                                if(pr == "parentNode") {
                                                   _88.push("parentNode is not iterated over"); 
                                                   }
                                                else {
                                                   if(pr == "offsetParent") {
                                                      _88.push("offsetParent is not iterated over"); 
                                                      }
                                                   else {
                                                      if(pr == "stvyle") {
                                                         _88.push("style is not iterated over"); 
                                                         }
                                                      else {
                                                         if(pr == "attributes") {
                                                            _88.push("attributes is not iterated over"); 
                                                            }
                                                         else {
                                                            if(pr == "ownerDocument") {
                                                               _88.push("ownerDocument is not iterated over"); 
                                                               }
                                                            else {
                                                               _uber_toString._handled_Os_and_As.push(ob[pr]); 
                                                               _88.push("\n" + _uber_toString(ob[pr], d + 1, _86, pre + pr + ".") + _89); 
                                                               }
                                                            }
                                                         }
                                                      }
                                                   }
                                                }
                                             }
                                          }
                                       }
                                    }
                                 }
                              }
                           }
                        }
                     }
                  }
               _88.push(end); 
               }
            else {
               if(typeof ob[pr] == "function") {
                  _88.push(" " + ob[pr].toString().split("\n")[0].replace("function ", "").replace(" {", "") + "\n"); 
                  }
               else {
                  if(typeof ob[pr] == "string") {
                     if(pr == "innerHTML") {
                        _88.push(": \"" + pr + "\"\n"); 
                        }
                     else {
                        if(pr == "textContent") {
                           _88.push(": \"" + pr + "\"\n"); 
                           }
                        else {
                           _88.push(": \"" + ob[pr].replace("\"", "\\\"") + "\"\n"); 
                           }
                        }
                     }
                  else {
                     _88.push(": " + ob[pr] + "\n"); 
                     }
                  }
               }
            }
         }
      catch(e) {
         writeDebug("OI! " + e.message); 
         _88.push(_89 + pre + pr + ": BARF OUT " + e.message + "\n"); 
         continue; 
         }
      }
   if(d == 1) {
      _88.push("}\n"); 
      }
   return _88.join(""); 
   }
; 
var global_photos = {
   }
; 
var global_sets = {
   }
; 
var global_groups = {
   }
; 
var global_users = {
   }
; 
if(global_nsid) {
   global_users[global_nsid] = {
      id : global_nsid, name : global_name, icon_url : global_icon_url}
   ; 
   }
var _get_photo_src = function(p, s) {
   var str = ""; 
   if(!p ||!p.src) {
      return str; 
      }
   if(!s) {
      s = "s"; 
      }
   var src = p.src; 
   if(s != "s") {
      src = src.replace("_s", "_" + s); 
      }
   str = _img_root + src; 
   if(p.src_cb) {
      str += "?" + p.src_cb; 
      }
   return str; 
   }
; 
var _upsert_user = function(_93) {
   var id = _93.getAttribute("nsid"); 
   var _95 = _93.getAttribute("username"); 
   var _96 = _93.getAttribute("iconserver"); 
   if(_96) {
      var _97 = _img_root + _96 + "/buddyicons/" + id + ".jpg"; 
      }
   else {
      var _97 = "http://www.flickr.com/images/buddyicon.jpg"; 
      }
   var u = global_users[id]; 
   if(!u) {
      u = global_users[id] = {
         id : id, name : _95, icon_url : _97}
      ; 
      }
   else {
      u.id = id; 
      u.name = _95; 
      u.icon_url = _97; 
      }
   return u; 
   }
; 
var _upsert_group = function(_99) {
   var id = _99.getAttribute("nsid"); 
   var name = _99.getAttribute("name"); 
   var _101 = _99.getAttribute("iconserver"); 
   if(_101) {
      var _102 = _img_root + _101 + "/buddyicons/" + id + ".jpg"; 
      }
   else {
      var _102 = "http://www.flickr.com/images/buddyicon.jpg"; 
      }
   var g = global_groups[id]; 
   if(!g) {
      g = global_groups[id] = {
         id : id, name : name, icon_url : _102}
      ; 
      }
   else {
      g.id = id; 
      g.name = name; 
      g.icon_url = _102; 
      }
   return g; 
   }
; 
var _upsert_photo = function(node) {
   var id = node.getAttribute("id"); 
   var _105 = node.getAttribute("server"); 
   var src = _105 + "/" + id + "_" + node.getAttribute("secret") + "_s.jpg"; 
   var _106 = node.getElementsByTagName("title"); 
   if(_106 && _106[0]) {
      var _107 = _106[0]; 
      var _108 = (_107.firstChild) ? _107.firstChild.nodeValue : ""; 
      var _109 = node.getElementsByTagName("description")[0]; 
      var _110 = (_109.firstChild) ? _109.firstChild.nodeValue : ""; 
      var _111 = node.getAttribute("license"); 
      var _112 = node.getAttribute("isfavorite"); 
      var _113 = node.getElementsByTagName("visibility")[0]; 
      var _114 = _113.getAttribute("ispublic"); 
      var _115 = _113.getAttribute("isfriend"); 
      var _116 = _113.getAttribute("isfamily"); 
      var _117 = node.getElementsByTagName("geoperms"); 
      if(_117 && _117[0]) {
         var _118 = _117[0].getAttribute("ispublic"); 
         var _119 = _117[0].getAttribute("isfriend"); 
         var _120 = _117[0].getAttribute("isfamily"); 
         var _121 = _117[0].getAttribute("iscontact"); 
         }
      var _122 = node.getElementsByTagName("dates")[0]; 
      var _123 = _122.getAttribute("taken"); 
      var _124 = _122.getAttribute("takengranularity"); 
      var _125 = _122.getAttribute("posted"); 
      var _126 = _122.getAttribute("lastupdate"); 
      var _127 = node.getElementsByTagName("owner")[0]; 
      var _128 = _127.getAttribute("nsid"); 
      var _129 = _127.getAttribute("username"); 
      var _130 = null; 
      var _131 = node.getElementsByTagName("location"); 
      if(_131 && _131[0]) {
         var _132 = _131[0].getAttribute("latitude"); 
         var _133 = _131[0].getAttribute("longitude"); 
         var _134 = _131[0].getAttribute("accuracy"); 
         }
      var _135 = node.getElementsByTagName("permissions"); 
      if(_135 && _135[0]) {
         var _136 = _135[0].getAttribute("permcomment"); 
         var _137 = _135[0].getAttribute("permaddmeta"); 
         }
      var _135 = node.getElementsByTagName("permissions"); 
      if(_135 && _135[0]) {
         var _136 = _135[0].getAttribute("permcomment"); 
         var _137 = _135[0].getAttribute("permaddmeta"); 
         }
      var tags = node.getElementsByTagName("tag"); 
      _rebuild_tags_for_photos(id, tags); 
      var sets = node.getElementsByTagName("set"); 
      var _140 = node.getElementsByTagName("pool"); 
      }
   else {
      var _108 = node.getAttribute("title"); 
      var _123 = node.getAttribute("datetaken"); 
      var _125 = node.getAttribute("dateupload"); 
      var _132 = node.getAttribute("latitude"); 
      var _133 = node.getAttribute("longitude"); 
      var _134 = node.getAttribute("accuracy"); 
      var _128 = node.getAttribute("owner"); 
      var _129 = node.getAttribute("ownername"); 
      var _130 = node.getAttribute("iconserver"); 
      }
   var p = global_photos[id]; 
   if(!p) {
      p = global_photos[id] = {
         id : id, title : _108, src : src}
      ; 
      }
   else {
      p.id = id; 
      p.title = _108; 
      p.src = src; 
      }
   p.server = _105; 
   p.toString = function(ob, d) {
      var ob = (ob) ? ob : this; 
      var d = (d) ? d : 1; 
      var str = ""; 
      var tabs = ""; 
      for(var i = 0; i < d; i++) {
         tabs += "\t"; 
         }
      if(d == 1) {
         str += "global_photos[" + p.id + "] = {\n"; 
         }
      for(pr in ob) {
         if(typeof ob[pr] == "function") {
            continue; 
            }
         str += tabs + pr; 
         if(typeof ob[pr] == "object") {
            if(ob[pr].length != undefined) {
               str += " = [\n"; 
               str += p.toString(ob[pr], d + 1); 
               str += tabs + "]\n"; 
               }
            else {
               str += " = {\n"; 
               str += p.toString(ob[pr], d + 1); 
               str += tabs + "}\n"; 
               }
            }
         else {
            if(typeof ob[pr] == "function") {
               str += ": function\n"; 
               }
            else {
               if(typeof ob[pr] == "string") {
                  str += ": \"" + ob[pr] + "\"\n"; 
                  }
               else {
                  str += ": " + ob[pr] + "\n"; 
                  }
               }
            }
         }
      if(d == 1) {
         str += "}\n"; 
         }
      return str; 
      }
   ; 
   if(_111 && _111 != "") {
      p.license_id = _111; 
      }
   if(_111 && _111 != "") {
      p.is_favorite = _112; 
      }
   if(_123 && _123 != "") {
      p.date_taken = _123; 
      }
   if(_124 != undefined && _124 != "") {
      p.date_taken_granularity = _124; 
      }
   if(_125 && _125 != "") {
      p.date_upload = _125; 
      }
   if(_126 && _126 != "") {
      p.date_update = _126; 
      }
   if(_132 != undefined && _132 != "") {
      p.latitude = _132; 
      }
   if(_133 != undefined && _133 != "") {
      p.longitude = _133; 
      }
   if(_134 != undefined && _134 != "") {
      p.accuracy = _134; 
      }
   if(_110 != undefined) {
      p.description = _110; 
      }
   if(_114 != undefined) {
      p.is_public = _114; 
      }
   if(_115 != undefined) {
      p.is_friend = _115; 
      }
   if(_116 != undefined) {
      p.is_family = _116; 
      }
   if(_118 != undefined) {
      p.geo_is_public = _118; 
      }
   if(_119 != undefined) {
      p.geo_is_friend = _119; 
      }
   if(_120 != undefined) {
      p.geo_is_family = _120; 
      }
   if(_121 != undefined) {
      p.geo_is_contact = _121; 
      }
   if(_136 != undefined) {
      p.perm_comment = _136; 
      }
   if(_137 != undefined) {
      p.perm_addmeta = _137; 
      }
   if(_128 != undefined) {
      p.owner_nsid = _128; 
      }
   if(_129 != undefined) {
      p.owner_name = _129; 
      }
   if(_130 != undefined) {
      p.owner_iconserver = _130; 
      }
   if(sets && sets.length) {
      p.sets = []; 
      for(var i = 0; i < sets.length; i++) {
         p.sets.push(sets[i].getAttribute("id")); 
         }
      }
   if(_140 && _140.length) {
      p.pools = []; 
      for(var i = 0; i < _140.length; i++) {
         p.pools.push(_140[i].getAttribute("id")); 
         }
      }
   return p; 
   }
; 
var _upsert_set = function(node) {
   var id = node.getAttribute("id"); 
   var _142 = node.getAttribute("primary"); 
   var _143 = node.getAttribute("server"); 
   var _144 = node.getAttribute("secret"); 
   var _145 = node.getAttribute("id"); 
   var _146 = node.getAttribute("photos"); 
   var _147 = node.getElementsByTagName("photo"); 
   if(_142 && _142 != "") {
      var p = global_photos[_142]; 
      if(!p) {
         p = global_photos[_142] = {
            }
         ; 
         p.id = _142; 
         }
      if(_143 && _143 != "" && _144 && _144 != "") {
         p.src = _143 + "/" + p.id + "_" + _144 + "_s.jpg"; 
         }
      }
   var _148 = node.getElementsByTagName("title"); 
   if(_148 && _148[0] && _148[0].firstChild) {
      var _149 = _148[0].firstChild.nodeValue; 
      }
   else {
      var _149 = node.getAttribute("title"); 
      }
   var _150 = node.getElementsByTagName("description"); 
   if(_150 && _150[0]) {
      if(_150[0].firstChild) {
         var _151 = _150[0].firstChild.nodeValue; 
         }
      else {
         var _151 = ""; 
         }
      }
   var s = global_sets[id]; 
   if(!s) {
      s = global_sets[id] = {
         id : id, primary_photo_id : _142, photo_idsA : []}
      ; 
      }
   else {
      s.id = id; 
      s.primary_photo_id = _142; 
      }
   if(_145 && _145 != "") {
      s.owner = _145; 
      }
   if(_149 && _149 != "") {
      s.title = _149; 
      }
   if(_151 != undefined) {
      s.description = _151; 
      }
   var _147 = node.getElementsByTagName("photo"); 
   if(_147 && _147.length) {
      s.count = _147.length; 
      s.photo_idsA = []; 
      for(var i = 0; i < _147.length; i++) {
         var p = _upsert_photo(_147[i]); 
         s.photo_idsA.push(p.id); 
         }
      }
   else {
      if(_146 != "") {
         s.count = _146; 
         }
      }
   return s; 
   }
; 
var global_reg_photo_print_ids = [1, 2, 3]; 
var global_dig_photo_print_ids = [29, 30, 31]; 
var global_huge_photo_print_ids = [18]; 
var global_square_photo_print_ids = [23]; 
var global_wallet_photo_print_ids = [32]; 
var writeDebug = function() {
   }
; 
var writeAPIDebug = function() {
   }
; 
var writeTimerDebug = function() {
   }
; 
var timer = function() {
   }
; 
timer.prototype.add = function() {
   }
; 
timer.prototype.add_child = function() {
   }
; 
timer.prototype.clear = function() {
   }
; 
timer.prototype.get_text = function() {
   }
; 
timer.prototype.dump = function() {
   }
; 
var _page_timer = new timer("page", "start"); 
var _pi = function(str) {
   return parseInt(str, 10); 
   }
; 
var _pf = function(str) {
   return parseFloat(str); 
   }
; 
_ge_cache_obj = {
   }
; 
_ge_cache_retrieve = function(id) {
   return _ge_cache_obj[id]; 
   }
; 
_ge_cache_add = function(el) {
   _ge_cache_obj[el.id] = el; 
   }
; 
_ge_cache_remove = function(el) {
   if(!el) {
      return; 
      }
   if(el.id && _ge_cache_obj[el.id]) {
      _ge_cache_obj[el.id] = null; 
      delete _ge_cache_obj[el.id]; 
      }
   for(var i = el.childNodes.length - 1; i >- 1; i--) {
      _ge_cache_remove(el.childNodes[i]); 
      }
   }
; 
var _ge = function(id) {
   el = document.getElementById(id); 
   return el; 
   }
; 
var _ok_for_swf = function() {
   if(actualVersion < 6) {
      return false; 
      }
   return true; 
   var ua = navigator.userAgent; 
   if(navigator.appVersion.toLowerCase().indexOf("mac") > 0) {
      if(ua.indexOf("Gecko") ==- 1) {
         return false; 
         }
      }
   else {
      if(ua.indexOf("MSIE 5.6") > 0 || ua.indexOf("MSIE 5.5") > 0 || ua.indexOf("MSIE 6") > 0 || ua.indexOf("MSIE 7") > 0) {
         }
      else {
         if(ua.indexOf("Gecko") ==- 1) {
            return false; 
            }
         }
      }
   return true; 
   }
; 
var _ok_for_scrumjax_xml = function() {
   if(global_fakeOperaXMLHttpRequestSupport) {
      return false; 
      }
   return _ok_for_scrumjax(); 
   }
; 
var _ok_for_scrumjax = function() {
   if(!window.XMLHttpRequest) {
      return false; 
      }
   if(navigator.appVersion.toLowerCase().indexOf("mac") > 0 && navigator.userAgent.indexOf("MSIE") > 0 && navigator.userAgent.indexOf("Opera") ==- 1) {
      return false; 
      }
   return true; 
   }
; 
var global_today = new Date(); 
var global_tm = global_today.getMonth() + 1; 
var global_td = global_today.getDate(); 
var global_ty = global_today.getFullYear(); 
var global_days_in_months = [31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; 
var global_mn = ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"]; 
var global_mn_name = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; 
var _get_month_index = function(m) {
   var cm = m.substr(0, 3).toUpperCase(); 
   for(var i = 0; i < global_mn.length; i++) {
      if(cm == global_mn[i]) {
         return i; 
         }
      }
   return - 1; 
   }
; 
_make_unix_time_stamp = function(_155, _156, _157, inHr, _159, _160) {
   var _161 = new Date(_155, _156 - 1, _157, inHr, _159, _160); 
   return _161.getTime()/1000;
   }
; 
_convert_unix_time_stamp = function(_162) {
   return new Date(_162 * 1000); 
   }
; 
_convert_unix_time_stamp_into_MYSQLDateTime = function(_163) {
   var ld = new Date((_163 * 1000)); 
   return _make_MYSQLDateTime_stamp(ld.getFullYear(), (ld.getMonth() + 1).addZeros(2), ld.getDate().addZeros(2), ld.getHours().addZeros(2), ld.getMinutes().addZeros(2), ld.getSeconds().addZeros(2)); 
   }
; 
_make_MYSQLDateTime_stamp = function(_165, _166, _167, inHr, _168, _169) {
   var txt = ""; 
   if(_165 != undefined) {
      txt += _165; 
      }
   else {
      return txt; 
      }
   if(_166 != undefined) {
      txt += "-" + _166; 
      }
   else {
      return txt; 
      }
   if(_167 != undefined) {
      txt += "-" + _167; 
      }
   else {
      return txt; 
      }
   if(inHr != undefined) {
      txt += " " + inHr; 
      }
   else {
      return txt; 
      }
   if(_168 != undefined) {
      txt += ":" + _168; 
      }
   else {
      return txt; 
      }
   if(_169 != undefined) {
      txt += ":" + _169; 
      }
   else {
      return txt; 
      }
   return txt; 
   }
; 
_convert_MYSQLDateTime_into_unix_time_stamp = function(_171) {
   var _172 = _convert_MYSQLDateTime(_171); 
   return Math.floor(_172.getTime()/1000);
   }
; 
_convert_MYSQLDateTime = function(_173) {
   var both = _173.split(" "); 
   var cal = both[0].split("-"); 
   var tim = both[1].split(":"); 
   return new Date(cal[0], (cal[1] * 1) - 1, cal[2], tim[0], tim[1], tim[2]); 
   }
; 
var _in_array = function(_177, _178) {
   for(var i = _178.length - 1; i >- 1; i--) {
      if(_178[i] == _177) {
         return true; 
         }
      }
   return false; 
   }
; 
var _disable_select = function() {
   document.onselectstart = new Function("return false"); 
   }
; 
var _enable_select = function() {
   document.onselectstart = new Function("return true"); 
   }
; 
var _limit_textarea = function(_179, max) {
   if(_179.value.length > max) {
      _179.value = _179.value.substring(0, max); 
      }
   }
; 
var _el_is_in_a_link = function(el) {
   var p = el; 
   while(p) {
      if(p.href) {
         return 1; 
         }
      p = p.parentNode; 
      }
   return 0; 
   }
; 
var _get_event_src = function(e) {
   if(e && e.target) {
      return e.target; 
      }
   if(e && e.srcElement) {
      return e.srcElement; 
      }
   if(window.event) {
      return window.event.srcElement; 
      }
   return null; 
   }
; 
var _get_event_keycode = function(e) {
   if(e) {
      return e.keyCode; 
      }
   if(window.event) {
      return window.event.keyCode; 
      }
   return null; 
   }
; 
var _keys = {
   TAB : 9, ENTER : 13, RIGHTARROW : 39, DOWNARROW : 40, UPARROW : 38, BACKSPACE : 8, CTRL : 17, ESCAPE : 27}
; 
var _hitch = function(obj, meth) {
   return function() {
      return obj[meth].apply(obj, arguments); 
      }
   ; 
   }
; 
var _find_x = function(el, _182) {
   if(_182) {
      if(el.style.left) {
         return _pi(el.style.left); 
         }
      return el.offsetLeft; 
      }
   var _183 = 0; 
   if(el.offsetParent) {
      while(el.offsetParent) {
         _183 += el.offsetLeft; 
         el = el.offsetParent; 
         }
      }
   else {
      if(el.x) {
         _183 += el.x; 
         }
      }
   return _183; 
   }
; 
var _find_y = function(el, _184) {
   if(_184) {
      if(el.style.top) {
         return _pi(el.style.top); 
         }
      return el.offsetTop; 
      }
   var _185 = 0; 
   if(el.offsetParent) {
      while(el.offsetParent) {
         _185 += el.offsetTop; 
         el = el.offsetParent; 
         }
      }
   else {
      if(el.y) {
         _185 += el.y; 
         }
      }
   return _185; 
   }
; 
myPos = {
   getPos : function(el) {
      return [this.getX(el), this.getY(el)]; 
      return [_find_x(el, 1), _find_y(el, 1)]; 
      }
   , getY : function(el) {
      return _find_y(el); 
      return _find_y(el, 1); 
      }
   , getX : function(el) {
      return _find_x(el); 
      return _find_x(el, 1); 
      }
   }
; 
var _find_screen_height = function() {
   if(window.innerHeight) {
      return window.innerHeight; 
      }
   else {
      if(document.documentElement.clientHeight) {
         return document.documentElement.clientHeight; 
         }
      else {
         if(document.body.clientHeight) {
            return document.body.clientHeight; 
            }
         }
      }
   }
; 
var _find_screen_width = function() {
   if(window.innerWidth) {
      return window.innerWidth; 
      }
   else {
      if(document.documentElement.clientWidth) {
         return document.documentElement.clientWidth; 
         }
      else {
         if(document.body.clientWidth) {
            return document.body.clientWidth; 
            }
         }
      }
   }
; 
var _decorate = function() {
   var el = arguments[0]; 
   if(!el) {
      return; 
      }
   arguments[0] = el; 
   var _186 = "decorate_" + el.className; 
   if(window[_186]) {
      return window[_186](arguments); 
      }
   writeDebug(_186 + " is not a function"); 
   }
; 
var _pretty_list = function(list) {
   if(list.length == 1) {
      return list[0]; 
      }
   else {
      if(list.length == 2) {
         return list.join(" and "); 
         }
      else {
         var last = list.pop(); 
         return list.join(", ") + " and " + last; 
         }
      }
   }
; 
var _hyperlink = function(txt) {
   if(txt.indexOf("http://") >- 1) {
      var txtA = txt.split("\n"); 
      for(var y = 0; y < txtA.length; y++) {
         var _190 = txtA[y].split(" "); 
         for(var t = 0; t < _190.length; t++) {
            var _191 = ""; 
            if(_190[t].substr(0, 1) == "(") {
               _190[t] = _190[t].replace("(", ""); 
               _191 = "("; 
               }
            if(_190[t].substr(0, 7) == "http://") {
               var url = _190[t]; 
               var _193 = ""; 
               if(url.substr(url.length - 1, 1) == ")") {
                  url = url.substr(0, url.length - 1); 
                  _193 = ")"; 
                  }
               var _194 = ""; 
               if(url.substr(url.length - 1, 1) == ".") {
                  url = url.substr(0, url.length - 1); 
                  _194 = "."; 
                  }
               _190[t] = "<a href=\"" + url + "\" onclick=\"\">" + url + "</a>" + _193 + _194; 
               }
            _190[t] = _191 + _190[t]; 
            }
         txtA[y] = _190.join(" "); 
         }
      txt = txtA.join("<br />"); 
      }
   return txt; 
   }
; 
var global_js_tip_count = 0; 
var _get_tip_html = function(txt, _195) {
   if(txt.length == 0) {
      return ""; 
      }
   global_js_tip_count++; 
   _195 = (_195 == undefined) ? "Tip" : _195; 
   var _196 = "<span style=\"display: none;\" id=\"js_tooltip_" + global_js_tip_count + "\">" + txt + "</span>" + "<span class=\"" + _195 + "\">[<a href=\"#\" onclick=\"this.blur(); show_tooltip(this, 'js_tooltip_" + global_js_tip_count + "', " + txt.length + "); return false;\">?</a>]</span>"; 
   return _196; 
   }
; 
var _set_cookie = function(name, _197, days) {
   var _199 = ""; 
   if(days) {
      var date = new Date(); 
      date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 
      _199 = "; expires=" + date.toGMTString(); 
      }
   var str = name + "=" + _197 + _199 + "; path=/"; 
   document.cookie = str; 
   }
; 
var _get_cookie = function(name) {
   var _201 = name + "="; 
   var ca = document.cookie.split(";"); 
   for(var i = 0; i < ca.length; i++) {
      var c = ca[i]; 
      while(c.charAt(0) == " ") {
         c = c.substring(1, c.length); 
         }
      if(c.indexOf(_201) == 0) {
         return c.substring(_201.length, c.length); 
         }
      }
   return null; 
   }
; 
var _delete_cookie = function(name) {
   _set_cookie(name, "", - 1); 
   }
; 
var _rebuild_tags_for_photos = function(_203, tags) {
   if(global_photos[_203] == undefined) {
      return; 
      }
   global_photos[_203].tagsA = []; 
   global_photos[_203].tags_rawA = []; 
   global_photos[_203].tags_idA = []; 
   global_photos[_203].tags_canDeleteA = []; 
   for(var t = 0; t < tags.length; t++) {
      var node = tags[t]; 
      var tag = node.firstChild.nodeValue; 
      var _205 = node.getAttribute("raw"); 
      var _206 = node.getAttribute("id"); 
      var _207 = node.getAttribute("author"); 
      var _208 = (global_photos[_203].isOwner || global_nsid == _207) ? true : false; 
      global_photos[_203].tagsA.push(tag); 
      global_photos[_203].tags_rawA.push(_205); 
      global_photos[_203].tags_idA.push(_206); 
      global_photos[_203].tags_canDeleteA.push(_208); 
      }
   }
; 
var global_single_shadow_div; 
var _make_single_shadow = function(div, _209, _210, _211, _212) {
   if(div == undefined) {
      div = document.createElement("div"); 
      div.style.position = "absolute"; 
      div.style.top = "0px"; 
      div.style.left = "0px"; 
      document.body.appendChild(div); 
      }
   window.global_single_shadow_height_plus = (_209 == undefined) ? (12 - 24) : _209; 
   window.global_single_shadow_width_plus = (_210 == undefined) ? (12 - 24) : _210; 
   window.global_single_shadow_x_plus = (_211 == undefined) ? ( - 3) : _211; 
   window.global_single_shadow_y_plus = (_212 == undefined) ? ( - 3) : _212; 
   var html = ""; 
   html += "<table class=\"shadow_table\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"padding:0px;\">"; 
   html += "<tr><td width=\"11\"><img class=\"trans_png\" width=\"11\" height=\"11\" src=\"/images/tc_white_shadow_tl.png\"></td><td id=\"shadow_width_controller\"><img class=\"trans_png\" width=\"100%\" height=\"11\" src=\"/images/tc_white_shadow_t.png\"></td><td width=\"11\"><img class=\"trans_png\" width=\"11\" height=\"11\" src=\"/images/tc_white_shadow_tr.png\"></td></tr>"; 
   html += "<tr><td height=\"30\" id=\"shadow_height_controller\"><img class=\"trans_png\" width=\"11\" height=\"100%\" src=\"/images/tc_white_shadow_l.png\"></td><td></td><td><img class=\"trans_png\" width=\"11\" height=\"100%\" src=\"/images/tc_white_shadow_r.png\"></td></tr>"; 
   html += "<tr><td><img class=\"trans_png\" width=\"11\" height=\"11\" src=\"/images/tc_white_shadow_bl.png\"></td><td><img class=\"trans_png\" width=\"100%\" height=\"11\" src=\"/images/tc_white_shadow_b.png\"></td><td><img class=\"trans_png\" width=\"11\" height=\"11\" src=\"/images/tc_white_shadow_br.png\"></td></tr></table>"; 
   div.innerHTML = html; 
   div.style.zIndex = "999"; 
   div.style.display = "none"; 
   div.id = "shadow_div"; 
   window._set_single_shadow_x = function(_214) {
      div.style.marginLeft = (_214 + global_single_shadow_x_plus) + "px"; 
      }
   ; 
   window._set_single_shadow_y = function(_215) {
      div.style.marginTop = (_215 + global_single_shadow_y_plus) + "px"; 
      }
   ; 
   window._set_single_shadow_height = function(_216) {
      var el = _ge("shadow_height_controller"); 
      if(!el) {
         return; 
         }
      var d = ((_216.offsetHeight) + global_single_shadow_height_plus); 
      if(d < 0) {
         d = 0; 
         }
      el.style.height = d + "px"; 
      }
   ; 
   window._set_single_shadow_width = function(_217) {
      var el = _ge("shadow_width_controller"); 
      if(!el) {
         return; 
         }
      var d = ((_217.offsetWidth) + global_single_shadow_width_plus); 
      if(d < 0) {
         d = 0; 
         }
      el.style.width = d + "px"; 
      }
   ; 
   window.global_single_shadow_div = div; 
   }
; 
var global_comm_div; 
var _make_comm_div = function(_218) {
   var div = _ge("comm_div"); 
   if(!div) {
      div = document.createElement("DIV"); 
      div.id = "comm_div"; 
      div.style.left = 0; 
      div.style.top = 0; 
      document.body.appendChild(div); 
      div.modal_blocker = document.createElement("DIV"); 
      div.modal_blocker.id = "modal_blocker"; 
      div.modal_blocker.style.position = "absolute"; 
      div.modal_blocker.style.top = 0; 
      div.modal_blocker.default_style = {
         }
      ; 
      div.modal_blocker.style.backgroundColor = div.modal_blocker.default_style.backgroundColor = "#999"; 
      div.modal_blocker.style.opacity = div.modal_blocker.default_style.opacity = ".5"; 
      div.modal_blocker.style.filter = div.modal_blocker.default_style.filter = "alpha(opacity=50)"; 
      document.body.appendChild(div.modal_blocker); 
      }
   var html = "" + "<table id=\"comm_table\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width:200px; padding:0px;\">" + "<tr>" + "<td width=\"3\"><img width=\"3\" height=\"3\" src=\"/images/tc_white_tl.gif\"></td>" + "<td class=\"td_white\"></td>" + "<td class=\"td_white\"></td>" + "<td width=\"3\"><img width=\"3\" height=\"3\" src=\"/images/tc_white_tr.gif\"></td>" + "</tr>" + "<tr>" + "<td class=\"td_white\"></td>" + "<td class=\"td_white\" style=\"padding:3px 0px 0px 0px\" width=\"1\" valign=\"top\"><img id=\"comm_pulser_img\" src=\"/images/pulser2.gif\" width=\"32\" height=\"15\" border=\"0\"></td>" + "<td class=\"td_white\" style=\"padding:3px; font-family:arial; font-size:12px;\" id=\"comm_td\">" + "<div id=\"comm_msg_div\"></div>" + "<div id=\"comm_form_div\" style=\"display:none;\"></div>" + "<div id=\"comm_progress_bar_div_wrapper\" style=\"display:none; border:1px solid black; margin-top:10px;\">" + "<div id=\"comm_progress_bar_div_inner\" style=\"width:300px; height:15px\">" + "<div id=\"comm_progress_bar_div\" style=\"height:100%; width:0%; background-color:#FF0084\"></div>" + "</div>" + "</div>" + "</td>" + "<td class=\"td_white\"></td>" + "</tr>" + "<tr id=\"comm_button_tr\">" + "<td class=\"td_white\"></td>" + "<td class=\"td_white\"></td>" + "<td class=\"td_white\" style=\"padding:3px\">" + "<form>" + "<nobr><input id=\"comm_button_ok\" type=\"button\" class=\"Butt\" value=\"OK\" onclick=\"this.onclick_func();\" style=\"margin:5px 5px 0 0;\">" + "<input id=\"comm_button_cancel\" type=\"button\" class=\"CancelButt\" value=\"CANCEL\" onclick=\"this.onclick_func();\" style=\"margin:5px 5px 0 0;\"></nobr>" + "</form>" + "</td>" + "<td class=\"td_white\"></td>" + "</tr>" + "<tr>" + "<td><img width=\"3\" height=\"3\" src=\"/images/tc_white_bl.gif\"></td>" + "<td class=\"td_white\"></td>" + "<td class=\"td_white\"></td>" + "<td><img width=\"3\" height=\"3\" src=\"/images/tc_white_br.gif\"></td>" + "</tr>" + "</table>"; 
   div.innerHTML = html; 
   div.button_tr = _ge("comm_button_tr"); 
   div.pulser_img = _ge("comm_pulser_img"); 
   div.button_ok = _ge("comm_button_ok"); 
   div.button_cancel = _ge("comm_button_cancel"); 
   div.button_ok.onclick_func = function() {
      div.stop_comming(); 
      this.blur(); 
      if(typeof this.onclick_plus == "function") {
         this.onclick_plus(); 
         }
      if(typeof this.onclick_do == "function") {
         this.onclick_do(); 
         }
      }
   ; 
   div.button_cancel.onclick_func = function() {
      div.stop_comming(); 
      this.blur(); 
      if(typeof this.onclick_plus == "function") {
         this.onclick_plus(); 
         }
      if(typeof this.onclick_do == "function") {
         this.onclick_do(); 
         }
      }
   ; 
   div.table = _ge("comm_table"); 
   div.comm_msg_div = _ge("comm_msg_div"); 
   div.comm_form_div = _ge("comm_form_div"); 
   div.comm_progress_bar_div_wrapper = _ge("comm_progress_bar_div_wrapper"); 
   div.style.zIndex = _218; 
   div.style.display = "none"; 
   if(div.modal_blocker) {
      div.modal_blocker.style.zIndex = 998; 
      div.modal_blocker.style.display = "none"; 
      }
   div.stop_comming = function() {
      if(this.modal_blocker) {
         div.modal_blocker.style.zIndex = 998; 
         this.modal_blocker.style.display = "none"; 
         }
      this.style.display = "none"; 
      global_single_shadow_div.style.display = "none"; 
      div.comm_form_div.style.display = "none"; 
      div.comm_progress_bar_div_wrapper.style.display = "none"; 
      _ge("comm_progress_bar_div").style.width = 0; 
      this.comming = 0; 
      }
   ; 
   div.change_comming_msg = function(msg, perc, _221, _222) {
      if(!msg) {
         return; 
         }
      this.comm_msg_div.innerHTML = msg; 
      var w = Math.ceil(perc * _ge("comm_progress_bar_div_inner").offsetWidth); 
      anim_do_width_to(_ge("comm_progress_bar_div"), 8, 30, w, "linearTween", _221, _222); 
      _set_single_shadow_height(this.table); 
      _set_single_shadow_width(this.table); 
      }
   ; 
   div.get_rid_of_form = function() {
      if(!div.comm_form_div.childNodes[0]) {
         return; 
         }
      var _223 = div.comm_form_div.childNodes[0]; 
      _223.style.display = "none"; 
      if(_223.old_parentNode) {
         _223.old_parentNode.appendChild(_223); 
         }
      else {
         F.remove_el(_223, div.comm_form_div); 
         }
      div.comm_form_div.style.display = "none"; 
      }
   ; 
   div.start_comming = function(msg, _224, _225, _226, _227, _228, _229, _230, _231, _232, _233, _234, _235) {
      var txt = (!msg) ? "working..." : msg; 
      this.comm_msg_div.innerHTML = txt; 
      div.comm_form_div.style.display = "none"; 
      if(_233) {
         div.get_rid_of_form(); 
         div.comm_form_div.style.display = "block"; 
         _233.style.display = "block"; 
         if(_233.old_parentNode != div.comm_form_div) {
            _233.old_parentNode = _233.parentNode; 
            }
         div.comm_form_div.appendChild(_233); 
         }
      div.comm_progress_bar_div_wrapper.style.display = "none"; 
      if(_235) {
         div.comm_progress_bar_div_wrapper.style.display = "block"; 
         }
      this.pulser_img.style.display = (_226) ? "none" : "inline"; 
      if(_227 || _230) {
         this.button_tr.style.display = (document.all &&!window.opera) ? "block" : "table-row"; 
         this.button_ok.value = (_228) ? _228.toUpperCase() : "OK"; 
         this.button_tr.style.display = (document.all &&!window.opera) ? "block" : "table-row"; 
         this.button_ok.onclick_do = (typeof _229 == "function") ? _229 : null; 
         this.button_ok.style.visibility = (_227) ? "visible" : "hidden"; 
         this.button_ok.style.display = (_227) ? "inline" : "none"; 
         this.button_cancel.value = (_231) ? _231.toUpperCase() : "CANCEL"; 
         this.button_cancel.onclick_do = (typeof _232 == "function") ? _232 : null; 
         this.button_cancel.style.visibility = (_230) ? "visible" : "hidden"; 
         this.button_tr.style.display = (document.all &&!window.opera) ? "block" : "table-row"; 
         _ge("comm_table").style.width = "312px"; 
         }
      else {
         this.button_tr.style.display = "none"; 
         _ge("comm_table").style.width = "200px"; 
         }
      this.style.display = "block"; 
      if(_234 && this.modal_blocker) {
         this.modal_blocker.style.display = "block"; 
         this.modal_blocker.style.backgroundColor = (_234.backgroundColor) ? _234.backgroundColor : div.modal_blocker.default_style.backgroundColor; 
         this.modal_blocker.style.opacity = (_234.opacity) ? _234.opacity : div.modal_blocker.default_style.opacity; 
         this.modal_blocker.style.filter = (_234.filter) ? _234.filter : div.modal_blocker.default_style.filter; 
         }
      if(window.innerWidth) {
         var ww = window.innerWidth; 
         var wh = window.innerHeight; 
         var bgX = window.pageXOffset; 
         var bgY = window.pageYOffset; 
         }
      else {
         var ww = document.body.clientWidth; 
         var wh = document.body.clientHeight; 
         var bgX = document.body.scrollLeft; 
         var bgY = document.body.scrollTop; 
         }
      var _240 = function() {
         var x = bgX + _pi((ww - _pi(global_comm_div.table.offsetWidth))/2);
         return x; 
         }
      ; 
      var _241 = function() {
         var y = bgY + _pi((wh - global_comm_div.table.offsetHeight)/2);
         return y; 
         }
      ; 
      var x = (typeof _224 == "function") ? _224() : (typeof _224 == "number") ? _224 : _240(); 
      var y = (typeof _225 == "function") ? _225() : (typeof _225 == "number") ? _225 : _241(); 
      this.style.marginLeft = x + "px"; 
      this.style.marginTop = y + "px"; 
      if(_234 && this.modal_blocker) {
         if(_234.loc_style) {
            this.modal_blocker.style.top = _234.loc_style.top + "px"; 
            this.modal_blocker.style.left = _234.loc_style.left + "px"; 
            this.modal_blocker.style.width = _234.loc_style.width + "px"; 
            this.modal_blocker.style.height = _234.loc_style.height + "px"; 
            }
         else {
            this.modal_blocker.style.top = bgY + "px"; 
            this.modal_blocker.style.left = bgX + "px"; 
            this.modal_blocker.style.width = ww + "px"; 
            this.modal_blocker.style.height = wh + "px"; 
            }
         }
      _set_single_shadow_x(x); 
      _set_single_shadow_y(y); 
      _set_single_shadow_height(this.table); 
      _set_single_shadow_width(this.table); 
      global_single_shadow_div.style.display = "block"; 
      if(_227 && navigator.userAgent.indexOf("KHTML") ==- 1) {
         this.button_ok.focus(); 
         }
      this.comming = 1; 
      }
   ; 
   window.global_comm_div = div; 
   if(!global_single_shadow_div) {
      _make_single_shadow(_ge("shadow_div")); 
      }
   return global_comm_div; 
   }
; 
F._eb = new Object(); 
F._eb.eb_go_go_go = function() {
   this._eb_listeners = []; 
   F._ebA.push(this); 
   }
; 
JS_is_wonderful_as_AS = false; 
F._eb.eb_broadcast = function() {
   if(JS_is_wonderful_as_AS) {
      var _242 = arguments.shift(); 
      }
   else {
      var _243 = []; 
      for(var i = 0; i < arguments.length; i++) {
         _243[i] = arguments[i]; 
         }
      var _242 = _243.shift(); 
      }
   var list = F.array_copy(this._eb_listeners); 
   var max = list.length; 
   for(var i = 0; i < max; ++i) {
      if(list[i][_242]) {
         list[i][_242].apply(list[i], _243); 
         }
      else {
         }
      }
   }
; 
F._eb.eb_add = function(obj) {
   this.eb_remove(obj); 
   this._eb_listeners.push(obj); 
   return (true); 
   }
; 
F._eb.eb_remove = function(obj) {
   var list = this._eb_listeners; 
   var i = list.length; 
   while(i--) {
      if(list[i] == obj) {
         list.splice(i, 1); 
         return (true); 
         }
      }
   return (false); 
   }
; 
F._eb.eb_remove_all = function() {
   this._eb_listeners = []; 
   }
; 
F.decorate(F, F._eb).eb_go_go_go(); 
window.onresize = function() {
   F.eb_broadcast("window_onresize"); 
   }
; 
window.onbeforeunload = function() {
   F.eb_broadcast("window_onbeforeunload", F.changes_count); 
   if(F.changes_count) {
      return "You have unsaved changes."; 
      }
   }
; 
window.onblur = function() {
   window.blurred = 1; 
   }
; 
window.onfocus = function() {
   window.blurred = 0; 
   }
; 
window.onunload = function() {
   F.eb_broadcast("window_unload"); 
   _ge_cache_obj = {
      }
   ; 
   for(var i = F._ebA.length - 1; i >= 0; i--) {
      var eb = F._ebA[i]; 
      eb.eb_remove_all(); 
      }
   F._ebA = []; 
   F._decoratedO = {
      }
   ; 
   }
; 
function _change_privacy(id) {
   var _245 = _ge("is_private_" + id).checked; 
   _ge("is_friend_" + id).disabled =!_245; 
   _ge("is_family_" + id).disabled =!_245; 
   }
function _get_qs_args() {
   var args = {
      }
   ; 
   var _247 = location.search.substring(1).split("&"); 
   for(var i = 0; i < _247.length; i++) {
      var p = _247[i].indexOf("="); 
      if(p !=- 1) {
         var name = _247[i].substring(0, p); 
         var _248 = _247[i].substring(p + 1); 
         args[name] = unescape(_248); 
         }
      }
   return args; 
   }
var _qs_args = _get_qs_args(); 
var promos_show = function(_249) {
   var _250 = _ge(_249); 
   var _251 = _ge(_249 + "_promo_div"); 
   var _252 = _ge(_249 + "_removed_div"); 
   if(!_251) {
      return; 
      }
   var _253 = {
      }
   ; 
   if(_249 == "promo_do_more") {
      _253["promos_hide_do_more"] = 0; 
      }
   else {
      if(_249 == "promo_reupgrade") {
         _253["promos_hide_reupgrade"] = 0; 
         }
      else {
         if(_249 == "promo_proexpire") {
            _253["promos_hide_proexpire"] = 0; 
            }
         else {
            if(_249 == "promo_intro") {
               _253["promos_hide_intro"] = 0; 
               }
            else {
               return false; 
               }
            }
         }
      }
   _251.flickr_prefs_setPrefs_onLoad = function() {
      }
   ; 
   F.API.callMethod("flickr.prefs.setPrefs", _253, _251); 
   _251.style.visibility = "visible"; 
   _252.style.display = "none"; 
   }
; 
var promos_remove = function(_254) {
   var _255 = _ge(_254); 
   var _256 = _ge(_254 + "_promo_div"); 
   var _257 = _ge(_254 + "_removed_div"); 
   if(!_256) {
      return; 
      }
   var _258 = {
      }
   ; 
   if(_254 == "promo_do_more") {
      _258["promos_hide_do_more"] = 1; 
      }
   else {
      if(_254 == "promo_reupgrade") {
         _258["promos_hide_reupgrade"] = 1; 
         }
      else {
         if(_254 == "promo_proexpire") {
            _258["promos_hide_proexpire"] = 1; 
            }
         else {
            if(_254 == "promo_intro") {
               _258["promos_hide_intro"] = 1; 
               }
            else {
               return false; 
               }
            }
         }
      }
   _256.flickr_prefs_setPrefs_onLoad = function() {
      }
   ; 
   F.API.callMethod("flickr.prefs.setPrefs", _258, _256); 
   _256.style.visibility = "hidden"; 
   _257.style.display = "block"; 
   _255.style.backgroundColor = "#FFFFFF"; 
   setTimeout("anim_do_pink_fade(_ge(\"" + _255.id + "\"))", 300); 
   }
; 
function _privacy_specific_change(_259, _260) {
   _259 = (_259) ? _259 : ""; 
   var _261 = _ge(_259 + "is_private").checked; 
   var _262 = _ge(_259 + "is_friend").checked; 
   var _263 = _ge(_259 + "is_family").checked; 
   var _264 =!_261; 
   _ge(_259 + "is_friend").disabled =!_261; 
   _ge(_259 + "is_family").disabled =!_261; 
   _ge(_259 + "is_friend_label").style.color = _261 ? "black" : "silver"; 
   _ge(_259 + "is_family_label").style.color = _261 ? "black" : "silver"; 
   if(_261) {
      if(_262 || _263) {
         _privacy_check_boxes(_259 + "perm_comment", false, false, true, true); 
         _privacy_check_boxes(_259 + "perm_addmeta", false, false, true, true); 
         }
      else {
         _privacy_check_boxes(_259 + "perm_comment", false, true, true, true); 
         _privacy_check_boxes(_259 + "perm_addmeta", false, true, true, true); 
         }
      }
   else {
      _privacy_check_boxes(_259 + "perm_comment", false, false, false, false); 
      _privacy_check_boxes(_259 + "perm_addmeta", false, false, false, false); 
      }
   if(!_260 && (previous_public != _264 || previous_friend != _262 || previous_family != _263)) {
      _privacy_try_and_check(_259 + "perm_comment", 1); 
      _privacy_try_and_check(_259 + "perm_addmeta", 2); 
      previous_public = _264; 
      previous_friend = _262; 
      previous_family = _263; 
      }
   }
function _privacy_default_change() {
   var _265 = _ge("is_private").checked; 
   var _266 = _ge("is_friend").checked; 
   var _267 = _ge("is_family").checked; 
   var _268 =!_265; 
   _ge("is_friend").disabled =!_265; 
   _ge("is_family").disabled =!_265; 
   _ge("is_friend_label").style.color = _265 ? "black" : "silver"; 
   _ge("is_family_label").style.color = _265 ? "black" : "silver"; 
   _ge("perm_addmeta_disclaim").style.display = _265 ? "block" : "none"; 
   _ge("perm_comment_disclaim").style.display = _265 ? "block" : "none"; 
   if(_265) {
      if(_266 || _267) {
         _privacy_check_boxes("perm_comment", false, false, false, false); 
         _privacy_check_boxes("perm_addmeta", false, false, false, false); 
         }
      else {
         _privacy_check_boxes("perm_comment", false, false, false, false); 
         _privacy_check_boxes("perm_addmeta", false, false, false, false); 
         }
      }
   else {
      _privacy_check_boxes("perm_comment", false, false, false, false); 
      _privacy_check_boxes("perm_addmeta", false, false, false, false); 
      }
   }
function _privacy_check_boxes(name, a, b, c, d) {
   _ge(name + "_4").disabled = a; 
   _ge(name + "_3").disabled = b; 
   _ge(name + "_2").disabled = c; 
   _ge(name + "_1").disabled = d; 
   _ge(name + "_4_label").style.color = a ? "silver" : "black"; 
   _ge(name + "_3_label").style.color = b ? "silver" : "black"; 
   _ge(name + "_2_label").style.color = c ? "silver" : "black"; 
   _ge(name + "_1_label").style.color = d ? "silver" : "black"; 
   var _269 = false; 
   for(var i = 4; i >= 1; i--) {
      if(_ge(name + "_" + i).checked &&!_ge(name + "_" + i).disabled) {
         return; 
         }
      }
   for(var i = 1; i <= 4; i++) {
      if(!_ge(name + "_" + i).disabled) {
         _ge(name + "_" + i).checked = true; 
         return; 
         }
      }
   }
function _privacy_try_and_check(name, min) {
   for(var i = min; i <= 4; i++) {
      if(!_ge(name + "_" + i).disabled) {
         _ge(name + "_" + i).checked = true; 
         return; 
         }
      }
   }
function _privacy_show_more() {
   _ge("morerow").style.display = "none"; 
   _ge("lessrow").style.display = (document.all) ? "block" : "table-row"; 
   _ge("detailrow").style.display = (document.all) ? "block" : "table-row"; 
   }
function _privacy_show_less() {
   _ge("morerow").style.display = (document.all) ? "block" : "table-row"; 
   _ge("lessrow").style.display = "none"; 
   _ge("detailrow").style.display = "none"; 
   }
function woe_location_obj(ID, _272, _273, _274, bbox, _276, lat, lon) {
   this.id = ID; 
   this.title = _272; 
   this.sub_title = _273; 
   this.relevance = _274; 
   this.bbox = bbox; 
   this.precision = _276; 
   this.lat = lat; 
   this.lon = lon; 
   }
F._loc_search_div = {
   }
; 
F._loc_search_div.div_go_go_go = function(_279) {
   this.page_type = _279; 
   this.input_id = (this.page_type == "org") ? "loc_search_input" : "header_search_q"; 
   this.last_source_id = null; 
   this.last_search_term = null; 
   this.setLocation_geo_point = null; 
   this.setLocation_source_id = null; 
   this.setLocation_search_term = null; 
   var _280 = _ge(this.input_id); 
   _280.onkeydown = _280.onkeypress = _280.onkeyup = function(e) {
      F.stop_event_propagation(e); 
      }
   ; 
   this.style.display = "none"; 
   F.eb_add(this); 
   this.locations = []; 
   this.div_show_all = 0; 
   this.current_location_index =- 1; 
   var _281 = document.createElement("div"); 
   _281.id = "loc_search_inner_div"; 
   _281.style.width = "300px"; 
   _281.style.border = "0px solid black"; 
   this.appendChild(_281); 
   var div = document.createElement("div"); 
   div.id = "loc_search_header_div"; 
   div.className = "Pulser"; 
   div.style.position = "absolute"; 
   div.style.top = "10px"; 
   div.style.left = "10px"; 
   div.style.height = "20px"; 
   div.style.width = "30px"; 
   _281.appendChild(div); 
   var div = document.createElement("div"); 
   div.id = "loc_search_header_msg_div"; 
   div.style.margin = "12px 15px 10px 38px"; 
   div.style.fontWeight = "normal"; 
   div.style.fontFamily = "arial"; 
   div.style.fontSize = "12px"; 
   div.style.color = "#434343"; 
   _281.appendChild(div); 
   var div = document.createElement("div"); 
   div.id = "loc_search_results_div"; 
   div.style.margin = "0 0 15px 38px"; 
   _281.appendChild(div); 
   var div = document.createElement("div"); 
   div.id = "loc_search_msg_div"; 
   div.style.margin = "0px 0 10px 30px"; 
   div.style.display = "none"; 
   _281.appendChild(div); 
   var img = document.createElement("img"); 
   img.id = "loc_search_close"; 
   img.style.border = "0px"; 
   img.style.position = "absolute"; 
   img.style.left = "281px"; 
   img.style.top = "4px"; 
   img.src = "/images/simple_close_default.gif"; 
   img.width = img.height = "15"; 
   img.onclick = function() {
      _ge("loc_search_div").div_fade(); 
      }
   ; 
   this.appendChild(img); 
   F.decorate(_ge("loc_search_close"), F._simple_button).button_go_go_go(); 
   }
; 
F._loc_search_div.window_onresize = function() {
   if(this.style.display != "none") {
      this.div_show(); 
      }
   }
; 
F._loc_search_div.div_show = function() {
   if(this.style.display == "none") {
      this.style.visibility = "hidden"; 
      }
   this.style.display = "block"; 
   var _283 = _ge("loc_search_results_div"); 
   var y = _find_y(_ge(this.input_id)); 
   if(this.page_type == "org") {
      var x = (_find_screen_width() - this.offsetWidth - 3); 
      y += 25; 
      }
   else {
      if(this.page_type == "else") {
         var x = (_find_screen_width() - this.offsetWidth - 60); 
         if(x > _find_x(_ge(this.input_id))) {
            x = _find_x(_ge(this.input_id)); 
            }
         y += 23; 
         }
      else {
         var x = _find_x(_ge("Main")) + _ge("Main").offsetWidth - this.offsetWidth; 
         y += 24; 
         }
      }
   _283.style.height = ""; 
   _283.style.overflow = ""; 
   if(this.offsetHeight + y > _find_screen_height()) {
      _283.style.height = (_find_screen_height() - y - 52) + "px"; 
      _283.style.overflow = "auto"; 
      if(this.reset_scrollTop) {
         this.reset_scrollTop = 0; 
         _283.scrollTop = 0; 
         }
      }
   var val = 100; 
   this.style.opacity = val / 100; 
   this.style.filter = "alpha(opacity=" + val + ")"; 
   this.style.left = x + "px"; 
   this.style.top = y + "px"; 
   this.style.visibility = "visible"; 
   }
; 
F._loc_search_div.div_hide = function() {
   this.style.display = "none"; 
   }
; 
F._loc_search_div.div_loading = function() {
   _ge("loc_search_results_div").style.display = "none"; 
   _ge("loc_search_close").style.display = "none"; 
   _ge("loc_search_header_div").className = "Pulser"; 
   _ge("loc_search_header_msg_div").innerHTML = "&nbsp;&nbsp;&nbsp;Searching"; 
   this.reset_scrollTop = 1; 
   this.div_show_all = 0; 
   this.div_show(); 
   }
; 
F._loc_search_div.div_fade_if_open = function() {
   if(this.style.display == "block") {
      this.div_fade(); 
      }
   }
; 
F._loc_search_div.div_fade = function() {
   var div = this; 
   var _285 = function() {
      div.div_hide(); 
      }
   ; 
   anim_do_opacity_to(div, 7, 35, 0, "easeInQuad", _285); 
   }
; 
F._loc_search_div.div_update_results = function(_286) {
   if(_286) {
      this.div_show_all = 1; 
      }
   var num = this.locations.length; 
   _ge("loc_search_close").style.display = "block"; 
   if(this.locations.length == 0) {
      _ge("loc_search_header_div").className = "Problem"; 
      _ge("loc_search_header_msg_div").innerHTML = "No results found"; 
      _ge("loc_search_results_div").style.display = "none"; 
      }
   else {
      if(this.locations.length == 1) {
         if(this.page_type == "site") {
            }
         else {
            setTimeout("_ge('loc_search_div').div_fade()", 2000); 
            }
         }
      _ge("loc_search_header_div").className = "Confirm"; 
      var msg = "We found <b>" + num + "</b> match"; 
      if(num == 1) {
         msg += ":"; 
         }
      else {
         msg += "es for \"" + this.last_search_term.escape_for_display() + "\""; 
         }
      _ge("loc_search_header_msg_div").innerHTML = msg; 
      _ge("loc_search_results_div").style.display = "block"; 
      var _288 = []; 
      max_abs = 20; 
      max_to_show = 8; 
      max_to_show_if_more_than_that = 5; 
      var _289 = (this.current_location_index > max_to_show_if_more_than_that || this.div_show_all) ? this.locations.length : (this.locations.length > max_to_show) ? max_to_show_if_more_than_that : this.locations.length; 
      for(i = 0; i < _289; i++) {
         var _290 = "margin-top:3px;"; 
         if(this.page_type == "site") {
            var url = "/map?woe_id=" + this.locations[i].id; 
            var _291 = "_ge('loc_search_div').div_hide();"; 
            }
         else {
            _290 += (i == this.current_location_index) ? "font-weight:bold; text-decoration:none" : ""; 
            var _291 = "_ge('loc_search_div').div_on_result_click(" + i + "); return false;"; 
            if(this.page_type == "else") {
               var url = "/map?woe_id=" + this.locations[i].id; 
               }
            else {
               var url = "/photo/organize/?start_tab=map&woe_id=" + this.locations[i].id; 
               }
            }
         var html = "<div style=\"margin-bottom:7px; font-size:12px; font-family:arial\">"; 
         if(this.locations[i].title) {
            html += "<span class=\"loc_search_found_term\">" + this.locations[i].title + "</span>, "; 
            }
         html += "<a href=\"" + url + "\" style=\"" + _290 + "\" onclick=\"" + _291 + "\">"; 
         html += " " + this.locations[i].sub_title + "</a>"; 
         html += "</div>"; 
         _288.push(html); 
         }
      if(this.locations.length > _289) {
         _288.push("<br><b><a href=\"#\" onclick=\"_ge('loc_search_div').div_update_results(1); return false;\">More results...</a></b>"); 
         }
      _ge("loc_search_results_div").innerHTML = _288.join(""); 
      }
   this.div_show(); 
   }
; 
F._loc_search_div.div_go_to_map = function(i, ms) {
   if(!ms || ms < 1) {
      var _293 = this.locations[i].id; 
      var url = "/map?woe_id=" + _293; 
      document.location = url; 
      var msg = "(We'll take you there now...)"; 
      }
   else {
      setTimeout("_ge('loc_search_div').div_go_to_map(" + i + ", " + (ms - 1000) + ")", ms); 
      var msg = "(We'll take you there in " + _pi(ms / 1000) + " second" + ((_pi(ms / 1000) == 1) ? "" : "s") + "...)"; 
      }
   writeDebug(msg); 
   if(_ge("loc_search_msg_div")) {
      _ge("loc_search_msg_div").style.display = "block"; 
      _ge("loc_search_msg_div").innerHTML = msg; 
      }
   }
; 
F._loc_search_div.div_on_result_click = function(i) {
   if(this.page_type == "site") {
      }
   else {
      this.current_location_index = i; 
      this.focus_on_location(); 
      this.div_update_results(); 
      this.div_fade(); 
      }
   }
; 
F._loc_search_div.div_do_loc_search = function() {
   var _294 = _ge(this.input_id).value.trim(); 
   if(_294) {
      if(this.last_search_term != _294) {
         this.last_search_term = _294; 
         this.div_loading(); 
         F.API.callMethod("flickr.geocode.translate", {
            location : this.last_search_term.replace("-", ""), provider_name : "woe"}
         , this, null, null, null, 0); 
         }
      else {
         this.div_show(); 
         }
      }
   }
; 
F._loc_search_div.div_add_source_params = function(_295) {
   if(this.setLocation_geo_point != null && _ge("map_controller").is_this_point_on_the_map(this.setLocation_geo_point)) {
      writeDebug("adding source!"); 
      _295.source = this.setLocation_source_id; 
      _295.query = this.setLocation_search_term; 
      }
   return _295; 
   }
; 
F._loc_search_div.flickr_geocode_translate_onLoad = function(_296, _297, _298, _299) {
   if(_296) {
      var _300 = _297.documentElement.getElementsByTagName("ResultSet")[0]; 
      var _301 = _297.documentElement.getElementsByTagName("Result"); 
      this.last_source_id = _300.getAttribute("fl:source_id"); 
      this.locations = []; 
      if(_301.length == 0) {
         this.div_update_results(); 
         return; 
         }
      for(i = 0; i < _301.length; i++) {
         var _302 = _301[i].getAttribute("precision"); 
         var _303 = _pf(_301[i].getElementsByTagName("woe_specificprobability")[0].firstChild.nodeValue); 
         var _304 = _pf(_301[i].getElementsByTagName("woe_woeid")[0].firstChild.nodeValue); 
         var lat = String(_301[i].getElementsByTagName("Latitude")[0].firstChild.nodeValue); 
         var lon = String(_301[i].getElementsByTagName("Longitude")[0].firstChild.nodeValue); 
         var bbox = String(_301[i].getElementsByTagName("woe_bbox")[0].firstChild.nodeValue); 
         try {
            var _305 = String(_301[i].getElementsByTagName("Address")[0].firstChild.nodeValue); 
            }
         catch(er) {
            var _305 = ""; 
            }
         try {
            var city = String(_301[i].getElementsByTagName("City")[0].firstChild.nodeValue); 
            }
         catch(er) {
            var city = ""; 
            }
         try {
            var _307 = String(_301[i].getElementsByTagName("State")[0].firstChild.nodeValue); 
            }
         catch(er) {
            var _307 = ""; 
            }
         try {
            var zip = String(_301[i].getElementsByTagName("Zip")[0].firstChild.nodeValue); 
            }
         catch(er) {
            var zip = ""; 
            }
         try {
            var _309 = String(_301[i].getElementsByTagName("Country")[0].firstChild.nodeValue); 
            }
         catch(er) {
            var _309 = ""; 
            }
         _309 = (_309 == "United States") ? "US" : _309; 
         _309 = (_309 == "United Kingdom") ? "UK" : _309; 
         var _310 = ""; 
         var _311 = ""; 
         var _312 = this.last_search_term.trim().split(" ")[0].split(",")[0].replace("-", ""); 
         var _313 = _312.toLowerCase(); 
         if(_302 == "GeocodedBuilding") {
            if(_305) {
               _311 = _311 + ", " + _305; 
               }
            }
         if(city) {
            _311 = _311 + ", " + city; 
            }
         if(_307) {
            _311 = _311 + ", " + _307; 
            }
         if(_309) {
            _311 = _311 + ", " + _309; 
            }
         if(_311.length > 2) {
            _311 = _311.substring(2, _311.length); 
            }
         if(_302 == "County") {
            _310 = _312.substring(0, 1).toUpperCase() + _312.substring(1, _312.length) + " County"; 
            }
         else {
            if(_302 == "GeocodedBuilding") {
               _311 = _312 + " " + _311; 
               }
            else {
               sub_titleA = _311.split(", "); 
               if(_313 == sub_titleA[0].toLowerCase()) {
                  if(sub_titleA[0] != _311) {
                     _310 = sub_titleA[0]; 
                     _311 = _311.replace(sub_titleA[0] + ", ", ""); 
                     }
                  }
               }
            }
         var _314 = new woe_location_obj(_304, _310, _311, _303, bbox, _302, lat, lon); 
         this.locations.push(_314); 
         }
      this.current_location_index =- 1; 
      if(this.locations.length == 1) {
         this.current_location_index = 0; 
         if(this.page_type == "site") {
            this.div_go_to_map(0, 3000); 
            }
         else {
            setTimeout(function() {
               _ge("loc_search_div").focus_on_location(); }
            , 200); 
            }
         }
      this.div_update_results(); 
      }
   else {
      writeDebug("Something sucked"); 
      return; 
      }
   }
; 
F._loc_search_div.focus_on_location = function() {
   if(window.YGeoPoint == undefined || this.page_type == "site") {
      return; 
      }
   var _315 = this.locations[this.current_location_index]; 
   var _316 = map.getCenterLatLon(); 
   if(this.locations.length == 1 && _315.precision == "GeocodedBuilding") {
      var _317 = 2; 
      if(_316.Lon != _315.lon || _316.Lat != _315.lat || map.getZoomLevel() != _317) {
         map.drawZoomAndCenter(new YGeoPoint(_315.lat, _315.lon), _317); 
         _ge("map_controller").end_pan(); 
         }
      }
   else {
      this.best_fit_points = []; 
      this.best_fit_points.push(new YGeoPoint(_315.bbox.split(",")[1], _315.bbox.split(",")[0])); 
      this.best_fit_points.push(new YGeoPoint(_315.bbox.split(",")[3], _315.bbox.split(",")[2])); 
      var _318 = []; 
      for(i = 0; i < this.best_fit_points.length; i++) {
         _318.push(this.best_fit_points[i]); 
         }
      var _317 = map.getZoomLevel(_318); 
      if(_315.precision != "GeocodedStreet") {
         _317 = Math.max(5, _317); 
         }
      var _319 = map.getGeoBox(_318); 
      var _320 = map.getBoxGeoCenter(_319.min, _319.max); 
      if(_316.Lon != _320.Lon || _316.Lat != _320.Lat || map.getZoomLevel() != _317) {
         map.drawZoomAndCenter(_320, _317); 
         _ge("map_controller").end_pan(); 
         }
      }
   this.setLocation_geo_point = new YGeoPoint(_315.lat, _315.lon); 
   this.setLocation_source_id = this.last_source_id; 
   this.setLocation_search_term = this.last_search_term; 
   }
; 


