function decision(message, url) {
  if (confirm(message)) location.href = url;
}
function selectImage(img) {
  document.getElementById('previewImage').src = '../../images/uploads/' + img;
  activeImg = img
}
function useImage() {
  window.opener.setImage(activeImg);
  window.close();
}
function setImage(img) {
  document.getElementById('image').value = img
}
function selectSong(song) {
  document.getElementById('song').innerHTML = song;
  activeSong = song;
}
function useSong() {
  window.opener.setSong(activeSong);
  window.close();
}
function setSong(song) {
  document.getElementById('song').value = song
}
function openPopUp(url, windowName, w, h, scrollbar) {
		if(windowName = "") {
				var day = getDate();
				var id = day.getTime();
				windowName = id;
		}
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',scrollbars=' + scrollbar;
  win = window.open(url, windowName, winprops);
  if (parseInt(navigator.appVersion) >= 4) {
    win.window.focus();
  }
}
function toggleCategory(id) {
  var browserName = navigator.appName;
  if (navigator.appVersion.indexOf("MSIE") != -1) {
    // bah, IE again
    var browserVer = parseFloat(navigator.appVersion.split("MSIE")[1]);
  } else {
    var browserVer = parseInt(navigator.appVersion);
  }
  if (browserName == "Microsoft Internet Explorer" && browserVer < 8) {
    if (document.getElementById('toggleLink_' + id).innerHTML == 'Hide') {
      document.getElementById('category_' + id).firstChild.style.display = 'none';
      document.getElementById('toggleLink_' + id).innerHTML = "Show";
    } else {
      document.getElementById('category_' + id).firstChild.style.display = 'block';
      document.getElementById('toggleLink_' + id).innerHTML = "Hide";
    }
  } else {
    if (document.getElementById('toggleLink_' + id).innerHTML == 'Hide') {
      document.getElementById('category_' + id).firstChild.setAttribute('style', 'display:none');
      document.getElementById('toggleLink_' + id).innerHTML = "Show";
    } else {
      document.getElementById('category_' + id).firstChild.setAttribute('style', 'display:block');
      document.getElementById('toggleLink_' + id).innerHTML = "Hide";
    }
  }
}
function hideElement(id) {
 document.getElementById(id).style.display = 'none';
}
function showElement(id) {
 document.getElementById(id).style.display = 'block';
}