<!--
/* Copyright (c) 1998- University of Washington, MyUW */

document.write('<script type="text\/javascript" src="/js/incUwAlert.js"><\/script>');

function toggleDiv (id, hideLabel, showLabel){ 
  if (document.getElementById) { 
    var showhideDiv = document.getElementById('toggle_div_' + id); 
    var showhideLink = document.getElementById('toggle_link_' + id); 

    if (showhideDiv.style.display == "none"){ 
      showhideDiv.style.display = ""; 
      showhideLink.innerHTML = hideLabel;

    } else { 
      showhideDiv.style.display = "none"; 
      showhideLink.innerHTML = showLabel;
    }
  }
}

function toggleEdit (id) {
  toggleDiv (id, "Hide Edit...", "Edit");
}

function toggleAdd (id){ 
  toggleDiv (id, "Hide Add...", "Add Custom Box");
}

function reloadW(chanid) {
  var urlprefix = window.location.href.match
    (/^(https?:\/\/myuw[^\.]*\.u?\.?washington\.edu\/)/i);
  var newurl = urlprefix[1] + 'servlet/main/?rfch='+ chanid;
  if (newurl == window.location.href) {
    window.location.reload(true);
  } else {
    window.location.assign(newurl);
  }
  window.location.hash=window.location.href.match(/#(\w.+)/)[1];
}

function reloadAjx(chanid) {
  var urlprefix = window.location.href.match
    (/^(https?:\/\/myuw[^\.]*\.u?\.?washington\.edu\/)/i);
  var newurl = urlprefix[1] + 'servlet/pschancontent?';

  var connObj = myuwYAHOO.util.Connect.asyncRequest('POST', newurl, {
      success: function(o) {
      // insert result to the channel itself.
      if (o.responseText !== undefined && o.responseText !== ""){ 
        document.getElementById("psn_" + chanid).innerHTML = o.responseText;
        }
      },
      failure: function() {
        // doing nothing,
        // showing un-available message on the same channel.
      }},
      "h=" + chanid);
}

function reloadChan(chanid) {
  if (chanid == 11) {
    reloadW (chanid);
  } else {
    reloadAjx (chanid);
  }
}

document.domain = 'washington.edu';

document.write('<script type="text\/javascript" src="/js/dnd.js"><\/script>');

//-->
