
function selectTag(tag) {
  if (getFlexApp('timechooser_with_flickr')) {
    getFlexApp('timechooser_with_flickr').selectTag(tag);
  }
  if (getFlexApp('inventory')) {
    getFlexApp('inventory').selectTag(tag);
  }
}

function redirect(url) {
  window.location = url;
}

function snaplickr_redirect(url) {
  window.location = url;
}

function addFriend() {
  getFlexApp('inventory').addFriend();
}

function sendComment() {

  var snapshot_id = document.getElementById('snapshot_id').value;
  var subject = document.getElementById('subject').value;
  var comment = document.getElementById('comment').value;
  
  getFlexApp('inventory').sendCommentForm(snapshot_id, subject, comment);
  
  document.getElementById('snapshot_id').value = '';
  document.getElementById('subject').value = '';
  document.getElementById('comment').value = '';  
  
}

function getFlexApp(appName) {
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[appName];
  } else {
    return document[appName];
  }
}

function changeDate(year, month, day) {  
  //alert("year" + year + "month" + month + "day" + day);
}

function changeTime(time) {  
  //alert(time);  
}

function recvFlickrImages(htmlcode) {
  document.getElementById('streams').innerHTML = htmlcode;
}

function updateMostTags(htmlcode) {
  document.getElementById('mosttags').innerHTML = htmlcode;
}