// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults


function mark_for_destroy(element) {
	$(element).next('.should_destroy').value = 1;
	$(element).up('.textblock').hide();
}


function openScript(url, width, height) {
var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=0,menubar=yes,scrollbars=yes,status=yes' );
}

function order_up(listitem) {
  var aboveitems = listitem.previousSiblings();
  if (aboveitems.length > 1) {
      var itemtext = aboveitems[0].innerHTML;
      aboveitems[0].innerHTML = listitem.innerHTML;
      listitem.innerHTML = itemtext;
    }
}

function order_down(listitem) {
  var aboveitems = listitem.nextSiblings();
  if (aboveitems.length > 0) {
      var itemtext = aboveitems[0].innerHTML;
      aboveitems[0].innerHTML = listitem.innerHTML;
      listitem.innerHTML = itemtext;
    }
}