function quickChangeState(prefix,themodule,buttonclass,thefield,blabel,theid){$('#controlbarextra'+theid+' a.'+buttonclass).css('opacity',0.25);$('#controlbarextra'+theid+' a.'+buttonclass).load('/common/multi/changestate.php',{'prefix':prefix,'module':themodule,'thefield':thefield,'blabel':blabel,'theid':theid},function(v){$(this).css('opacity',1);var valarr=v.split(':');var nextvalue=valarr[0];$(this).html(valarr[1]);if(nextvalue===0){$('#entry'+theid).removeClass('draft');}
if(nextvalue==9){$('#entry'+theid).addClass('draft');}
if(blabel=='undelete'){$(window).reload();}});}
function quickChangeOrder(prefix,themodule,family,category,numval,theid){$('#displayorderselect'+theid).css('opacity',0.25);$.get('/common/multi/changeorder.php',{'prefix':prefix,'module':themodule,'family':family,'category':category,'numval':numval,'theid':theid});}
function reorderEntries(prefix,entryid){var headhi=$('header').innerHeight();if(headhi>300){headhi=32;}
if($('#reorderwindow').length){$('#reorderwindow').remove();}
var display_order=0;$('#main').append('<div id="reorderwindow"></div>');$('#reorderwindow').load('/common/multi/reorder_entries.php',{'prefix':prefix,'id':entryid,'reorder':0,'display_order':0},function(){$('#reorderwindow .reorder_wrap').prepend('<a class="closex"></a>');$('#reorderwindow .reorder_wrap .closex').click(function(){$('#reorderwindow').remove();location.reload();});$('#reorderwindow').not('.reorder_wrap').click(function(){$('#reorderwindow').remove();location.reload();});$('#reorder_entries').sortable({update:function(event,ui){display_order=0;$('.reorder_entry').each(function(){display_order++;entryid=$(this).attr('data-id');$('#reorderwindow .feedback').load('/common/multi/reorder_entries.php',{'prefix':prefix,'id':entryid,'reorder':1,'display_order':display_order});});}});});}
function quickAssignCategory(prefix,entryid){var thisid;var headhi=$('header').innerHeight();if(headhi>300){headhi=32;}
if($('#reorderwindow').length){$('#reorderwindow').remove();}
$('#main').append('<div id="reorderwindow"></div>');$('#reorderwindow').css('top',headhi+'px');$('#reorderwindow').load('/common/multi/assign_category.php',{'prefix':prefix,'id':entryid},function(){$('#reorderwindow .reorder_wrap').prepend('<a class="closex"></a>');$('#reorderwindow .reorder_wrap .closex').click(function(){$('#reorderwindow').remove();location.reload();});$('#reorderwindow').not('.reorder_wrap,.reorder_wrap button').click(function(){$('#reorderwindow').remove();location.reload();});$('.assign_category').click(function(){thiscat=$(this).attr('data-category');$('#reorderwindow').load('/common/multi/assign_category.php',{'prefix':prefix,'id':entryid,'category':thiscat,'assign':1},function(q){if(q.search('success')>-1){$('#reorderwindow').remove();location.reload();}});});});}