var curItem;var entryIds="";function newMenu(a,b){if(showNormalContextMenu(a)){return true}else{if(itemMenu==null){itemMenu=new Traction.ItemMenu()}itemMenu.showMenu(a);return false}}function setItem(a){curItem=a}function showNormalContextMenu(c){var b;if(document.elementFromPoint){b=document.elementFromPoint(c.clientX,c.clientY)}else{if(c&&c.srcElement){b=c.srcElement}}for(var a=0;a<3;a++){if(!b||b==null){return false}else{if(b.tagName=="img"||b.tagName=="IMG"||b.tagName=="a"||b.tagName=="A"){return true}else{b=b.parentNode}}}return false}function processTracking(a){document.tracking.type.value="tracking";document.tracking.curitem.value=decode_url_parameter(curItem);document.tracking.fb_submit.value=a;document.tracking.submit()}function processCustomAction(c,b){if(b){var a="";if(document.fm.type&&document.fm.type.value){a="&origtype="+document.fm.type.value}openDialog("reclassifydialog","modern_insertlabel_window","","&customaction="+c+"&curitem="+decode_url_parameter(curItem)+a,DIALOG_FLAG_MULTIPLE_WINDOWS)}else{document.tracking.type.value="customaction";document.tracking.curitem.value=decode_url_parameter(curItem);document.tracking.fb_submit.value=c;document.tracking.submit()}}function processCustomActionInline(d,a,c){var b=curItem;if(a){processCustomActionInline_wakeup(b,d,a,c)}else{setTimeout(function(){processCustomActionInline_wakeup(b,d,a,c)},1)}}function processCustomActionInline_wakeup(e,g,b,f){setWaitCursor(false);if(b){var a="";if(document.fm.type&&document.fm.type.value){a="&origtype="+document.fm.type.value}openDialog("reclassifydialog","modern_insertlabel_window","","&customaction="+g+"&curitem="+decode_url_parameter(e)+a,DIALOG_FLAG_MULTIPLE_WINDOWS)}else{document.tracking.type.value="customaction";document.tracking.curitem.value=decode_url_parameter(e);document.tracking.fb_submit.value=g;var d=fm_submit(document.tracking);d=fm_append(d,"returnitemlabels=true");d=fm_append(d,"tractionid="+document.tracking.curitem.value);d=fm_append(d,"proj="+_get_url_param("proj","*"));var c=[encode_url_parameter(document.tracking.curitem.value),f];xmlpost_async(FORM_ACTION_READ_WRITE,d,null,true,labels_refresh,c)}}function processAction(opttype,action,formtarget,opentargetjs,windowUrl,windowName,windowFeatures,javascriptToEval){if(javascriptToEval&&eval(javascriptToEval)){}else{if(windowUrl){executeNewActionUrl(action,opttype,windowUrl,windowName,windowFeatures)}else{var curform;curform=document.fm;eval(opentargetjs);curform.target=formtarget;if(action!=""){var entryIdVal;if(!entryIds&&curform.entryid){entryIds=curform.entryid.value}if(opttype=="view"){curform.curentry.value="";curform.curitem.value="";entryIdVal=entryIds}else{if(opttype=="entry"){curform.curentry.value=decode_url_parameter(curItem);curform.curitem.value="";entryIdVal=""}else{curform.curitem.value=decode_url_parameter(curItem);curform.curentry.value="";entryIdVal=""}}if(curform.entryid){curform.entryid.value=entryIdVal}curform.action.value=action;curform.submit()}}}}function executeNewActionUrl(f,e,d,b,a){if(f!=""){if(d.indexOf("?")!=-1){if(e=="view"){if(!entryIds&&document.fm.entryid){entryIds=document.fm.entryid.value}d+="&curentry=&curitem=&entryid="+encode_url_parameter(entryIds)}else{if(e=="entry"){var c=curItem;var g=c.indexOf(".");if(g!=-1){c=c.substring(0,g)}d+="&curentry="+c+"&curitem="}else{d+="&curentry=&curitem="+curItem}}date=new Date();id=""+date.getTime();d=removeURLParameter(d,"cacheid");d+="&cacheid="+id}if(b!=null){do_window_open(d,b,a)}else{window.location.href=d}}}function addToEntryId(a){var b=document.fm.entryid.value;if(b.indexOf(a)==-1){if(b!=""){b+=","}document.fm.entryid.value=b+a}}if(navigator.product=="Gecko"&&navigator.userAgent.toLowerCase().indexOf("safari")==-1){Document.prototype.elementFromPoint=function(a,e){this.addEventListener("mousemove",this.elementFromPoint__handler,false);var d=this.createEvent("MouseEvents");var c=this.getBoxObjectFor(this.documentElement);var b={x:c.screenX,y:c.screenY};d.initMouseEvent("mousemove",true,false,this.defaultView,0,a+b.x,e+b.y,a,e,false,false,false,false,0,null);this.dispatchEvent(d);this.removeEventListener("mousemove",this.elementFromPoint__handler,false);return this.elementFromPoint__target};Document.prototype.elementFromPoint__handler=function(a){this.elementFromPoint__target=a.explicitOriginalTarget;if(this.elementFromPoint__target.nodeType==Node.TEXT_NODE){this.elementFromPoint__target=this.elementFromPoint__target.parentNode}if(this.elementFromPoint__target.nodeName.toUpperCase()=="HTML"&&this.documentElement.nodeName.toUpperCase()=="HTML"){this.elementFromPoint__target=this.getElementsByTagName("BODY").item(0)}a.preventDefault();a.stopPropagation()};Document.prototype.elementFromPoint__target=null}function item_checkbox_onclick(c,b,d,a){setItem(b);if(c.checked){processCustomActionInline(a,false,item_checkbox_action_failed)}else{processCustomActionInline(d,false,item_checkbox_action_failed)}return false}function item_checkbox_action_failed(b){var a=document.getElementById(b.toLowerCase()+"icbox");if(a!=null&&a.tagName.toLowerCase()=="input"){a.checked=!a.checked}};