/*!
 * FSI Server Interface
 * http://www.fsi-viewer.com
 *
 * Copyright (C) 2000-2016 NeptuneLabs GmbH - All rights reserved.
 *
 * Version: 3.0.0
 */
;function MainCTL(interfaceControl){var self=this;var ic=interfaceControl;var translationNoSelection;var translator=ic.getTranslator();var $=window.$;var enabledOptions={};this.setParentWindow=function(oWindow){$=oWindow.$};this.resetOptions=function(){enabledOptions={}};this.updateOptions=function(){ic.managePublishOptions()};var mouseOverItem=function(){$(this).addClass("activePublishingRow")};var mouseOutItem=function(){$(this).removeClass("activePublishingRow")};this.enableSection=function(strSection,bEnable){if(enabledOptions[strSection]!=undefined&&enabledOptions[strSection]===bEnable){return}var el=$("#"+strSection).get(0);if(!el){return}enabledOptions[strSection]=bEnable;var tbl=$(el).find("table.publishingOptionTable");if(bEnable){$(el).removeClass("disabled");$(tbl).find("td.publishpresettext").parent("tr").mouseover(mouseOverItem).mouseout(mouseOutItem)}else{$(el).addClass("disabled");$(tbl).find("td.publishpresettext").parent("tr").unbind("mouseover").unbind("mouseout")}};this.onSelectionChanged=function(){};var makeNiceImagePropertyValue=this.makeNiceImagePropertyValue=function(key,value,bTranslateBoolean){var out;if(bTranslateBoolean&&(value=="true"||value=="false")){return(value=="true")?"✓":"✕"}if(typeof(value)=="object"){out=value.length;var tmp="";if(value.length>0){tmp=value.join(", ");if(tmp.length>256){tmp=tmp.substr(0,256)+"[...]"}out=out+"    ("+tmp+")"}return out}switch(key){case"width":case"height":if(value!=undefined){out=ic.makeNiceInt(value)+" px"}else{out=undefined}break;case"size":out=ic.makeNiceFilesSize(value);break;case"lastmodified":case"importtimestamp":if(value!=undefined){var d=new Date();d.setTime(value);out=translator.formatLocaleDate(d)}break;case"sub":case"images":out=ic.makeNiceInt(value);break;case"importstatus":if(value!="1"){switch(value){case"0":out=translator.translateScriptText("unknown status",true);break;case"2":out=translator.translateScriptText("InProgress",true);break;case"3":out=translator.translateTextValue("dialogs","error",true);break;default:out=undefined}}break;default:out=value}return out};var limitHTMLStringWidth=function(str,len){if(len==undefined||str==undefined||str.length<=len||len<2){return str}var ret="";var n=0;var triggerLen=Math.ceil(len/2);var lenTotal=str.length;while(n<lenTotal){var tlen=len;var t=str.substr(n,tlen);var i1=t.lastIndexOf(" ");var i2=t.lastIndexOf("/");var i=Math.max(i1,i2+1);if(i>triggerLen){tlen=i;t=str.substr(n,tlen)}ret+=t+"<wbr/>";n+=tlen}return ret};this.getImageInfoContent=function(listEntry,tdClassName,charSeperator,maxValueLength){var content="";if(listEntry!=undefined){var titles=translateFileDetails("items_"+listEntry.type);if(titles!=undefined){for(var o in titles){var out;out=makeNiceImagePropertyValue(o,listEntry[o]);var fValue;var preValue=ic.htmlEntities(out);if(browser.isFF){fValue=limitHTMLStringWidth(preValue,maxValueLength)}else{fValue=preValue}if(out!=undefined){content+='<tr><td class="'+tdClassName+'_title">'+titles[o]+charSeperator+'</td><td class="'+tdClassName+'_value">'+fValue+"</td></tr>"}}}if(content.length>0){content='<table cellspacing="0" class="imageInfo" border="0" NELASelectable="1">'+content+"</table>"}}else{content=translationNoSelection}return content};var translateFileDetails=this.translateFileDetails=function(key){return translator.translateTextValue("QuickFileDetails",key,true)};this.onResize=function(){};var init=function(){if(translator){translationNoSelection=translateFileDetails("EmptySelection")}else{translationNoSelection="Nothing selected."}};init()};