
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - user_management.js - */
function activate_selection(event,principal,type,location){
  var form = document.forms['add-form'];
  if (form.className=='hide-selection') {
      var el = document.createElement("input");
      el.type="hidden";
      el.name=type;
      el.value=principal;
      form.appendChild(el);
      form.className='show-listing-'+location;

      var div = document.getElementById('popupselection');
      div.style["top"]=""+event.pageY+"px";
      if (location=='addboth'){
	var x = window.innerWidth - event.pageX;
	div.style["right"]=""+x+"px";
      } else {
	div.style["left"]=""+event.pageX+"px";
      }
      div.style["position"]="absolute";
  }
};


/* - mymouseover.js - */
/*
 * This is some simple code for "mouseover" effects
 * It uses the following markup:
 *
 * <td class="mouseOverBase" id="uniqueIdForThisMenu">
 *
 * </td>
 *
 * When the menu is toggled, then the whatever with the class mouseOverBase
 * will get an additional class which switches between 
 * 'activated' and 'deactivated'.
 * You can use this to style it accordingly, for example:
 *
 * .mouseOverBase.activated div.mouseOverMore{
 *   display: block;
 * }
 *
 * .mouseOverBase.deactivated div.mouseOverMore{
 *   display: none;
 * }
 *
 *
 * GOTCHA:  It seems like these javascripts share namespace.
 * from now on, prefix functions with their filename
 */

function mymouseover() {
  jq('td.mouseOverBase').mouseover(function() {  
    jq(this).addClass('activated').removeClass('deactivated');  
  }).mouseout(function() {  
      jq(this).removeClass('activated').addClass('deactivated');  
    });

};

jq(mymouseover);

