function onButtonEnterClick(n,t){window.event.keyCode==13&&(document.getElementById(t).focus(),document.getElementById(t).click())}function onPrintScreen(n){var t=n.keyCode||n.charCode;t==44&&$("#storageFilesViewerPnl").dialog("isOpen")==!0&&(typeof clipboardData!="undefined"&&window.clipboardData.setData("text",""),alert("Использование оцифрованных материалов архива запрещено без согласования с руководством архива."))}function alertAsync(n){setTimeout(function(){alert(n)},1)}function clickButton(n,t){var i=n?n:window.event;return i.keyCode==13?($(t).click(),!1):!0}function showUpdateProgress(n){if(n){var t=$("#UpdateProgress").find("#UpdateProgressText")[0];t&&$(t).html(n)}$get("UpdateProgress").style.display="block"}function hideUpdateProgress(){$get("UpdateProgress").style.display="none"}function searchClick(n,t){$("#"+n).toggleClass("hidden");$("#"+t).toggleClass("hidden")}function beginSearch(n,t){$("#"+n).hide();$("#"+t).show()}function endSearch(n,t){$("#"+t).hide();$("#"+n).show()}function stopSearch(n){return $("#ctl00_UpdateProgress").hide(),window.stop===undefined?document.execCommand("Stop"):window.stop(),$.ajax({url:"/Pages/SearchHandler.axd?action=stop",cache:!1}),n!==undefined&&(n.processOnServer=!1),!1}function showCheckboxList(n,t){$(n).slideToggle(500,function(){$(t).text($(this).css("display")=="block"?"Скрыть":"Выбрать")})}function checkedAllCheckboxListItems(n,t){var i=$("input[type='checkbox'][name*='"+n+"']");$(i).each(function(n,i){i.checked=t.checked})}function tripleConfirm(n,t){return $("<div><\/div>").html(n).dialog({title:"Подтвердите действие",resizable:!1,buttons:{"Да":function(){$(this).dialog("close");t(!0)},"Нет":function(){$(this).dialog("close");t(!1)},"Отмена":function(){$(this).dialog("close")}}}),!1}function enableDesktopNotifications(n){return window.webkitNotifications&&window.webkitNotifications.checkPermission()==1?(window.webkitNotifications.requestPermission(n),!1):!0}function downloadFile(n){n&&$("body").append("<iframe src='"+n+"' style='display:none'><\/iframe>")}function disableOnUpdate(n,t){Page_ClientValidate(n);Page_IsValid&&$(t).attr("onclick","return false")}function enter(n,t){return n.keyCode==13?($("#"+t).click(),!1):!0}function setValueToValidate(n,t,i,r){var u=n.GetValue();r&&$.inArray(u,r)?$("#"+i).val(u):$("#"+i).val("")}function validateAspxCombobox(obj,args){var comboboxId=$("#"+obj.controltovalidate).attr("binding-combobox");try{args.IsValid=args.Value!=""&&args.Value!=undefined&&args.Value!=null;args.IsValid?eval("$("+comboboxId+'.GetInputElement()).removeClass("input-error")'):eval("$("+comboboxId+'.GetInputElement()).addClass("input-error")')}catch(ex){args.IsValid=!0}return args.IsValid}function copy(n,t,i){$("#"+t).val().trim()==""&&i&&($("#"+t).val($("#"+n).val()),$("#"+t).trigger("change"))}function $id(n){return document.getElementById(n)}function disableLink(n){var t=$(n.target).parent();t.attr("disabled")=="disabled"?n.preventDefault():t.attr("disabled","disabled")}function sleep(n){for(var t=(new Date).getTime();t+n>=(new Date).getTime(););}function hideTabsHeader(n){$("#"+n).find(".dxtcTabsCell").css("display","none")}function updateText(){var n=checkListBox.GetSelectedItems();checkComboBox.SetText(getSelectedItemsText(n))}function synchronizeListBoxValues(n){checkListBox.UnselectAll();var t=n.GetText().split(textSeparator),i=getValuesByTexts(t);checkListBox.SelectValues(i);updateText()}function getSelectedItemsText(n){for(var i=[],t=0;t<n.length;t++)i.push(n[t].text);return i.join(textSeparator)}function getValuesByTexts(n){for(var r=[],t,i=0;i<n.length;i++)t=checkListBox.FindItemByText(n[i]),t!=null&&r.push(t.value);return r}function makeControlNEXT(){controlNEXT=document.createElement("a");controlNEXT.href="#";controlNEXT.id="controlNEXT";controlNEXT.className="slider__next";var n=document.createElement("i");return controlNEXT.appendChild(n),Seadragon.Utils.addEvent(controlNEXT,"click",function(){forwardNavigate();manageVisiblityImagePaging()}),controlNEXT}function makeControlPREV(){controlPREV=document.createElement("a");controlPREV.href="#";controlPREV.id="controlPREV";controlPREV.className="slider__prev";var n=document.createElement("i");return controlPREV.appendChild(n),Seadragon.Utils.addEvent(controlPREV,"click",function(){backNavigate()}),controlPREV}function makeControlImageNEXT(){controlImageNEXT=document.createElement("a");controlImageNEXT.href="#";controlImageNEXT.id="controlImageNEXT";controlImageNEXT.className="slider__image__next";var n=document.createElement("i");return controlImageNEXT.appendChild(n),Seadragon.Utils.addEvent(controlImageNEXT,"click",function(){forwardPaging()}),controlImageNEXT}function makeControlImagePREV(){controlImagePREV=document.createElement("a");controlImagePREV.href="#";controlImagePREV.id="controlImagePREV";controlImagePREV.className="slider__image__prev";var n=document.createElement("i");return controlImagePREV.appendChild(n),Seadragon.Utils.addEvent(controlImagePREV,"click",function(){backPaging()}),controlImagePREV}function storageViewerNavigate(n,t,i,r,u){var f='{"fid": '+JSON.stringify(n.value)+', "searchText": '+JSON.stringify(t.length>0?t.val():"")+', "showCensorship": "'+i+'", "rotation": "'+r+'", "pageNumber": "'+u+'"}';$.ajax({type:"POST",url:"/Pages/NavigateImageHandler.ashx?cmd=navigate",data:f,dataType:"json",contentType:"application/json; charset=utf-8",success:function(n){var s=n.Width,h=n.Height,i=n.TileSize,r=n.TileOverlap,c=n.DisableTiles,l=n.ImageUrl,f=n.SearchText,e=n.FileId,a=n.FileName,v=n.IsBookmarked,y=n.IsViewerDisabled,o=n.Rotation,p=n.FileFormat,t;totalPages=n.TotalPages;setDeepZoomVisible(!0);t=new Seadragon.TileSource(s,h,i,r);t.getTileUrl=function(n,t,s){return c?"/Pages/ImageFile.ashx?id="+e+"&simple=true&rotation="+o+"&searchtext="+f:"/Pages/ImageFile.ashx?level="+n+"&x="+t+"&y="+s+"&tileSize="+i+"&tileOverlap="+r+"&id="+e+"&page="+u+"&rotation="+o+"&searchtext="+f};manageVisiblityImagePaging();seadragonviewer.openTileSource(t)},error:function(){customError("Не удалось перелистнуть файл/страницу.")}})}function stopPropagationMouseDown(n){$(n).on("mousedown",function(t){var i=t.target,r=n;if(i!==r)return t.preventDefault(),t.stopPropagation(),!1})}function manageVisiblityImagePaging(){totalPages>1?(seadragonviewer.addControl(nextImageControl,Seadragon.ControlAnchor.BOTTOM_RIGHT),seadragonviewer.addControl(prevImageControl,Seadragon.ControlAnchor.BOTTOM_RIGHT)):(seadragonviewer.removeControl(nextImageControl),seadragonviewer.removeControl(prevImageControl))}function PrintPreview(){var n,u,t,i,r=this;this.loadPrintPreview=function(n,u,f){var o,e,h,s,c,l;for(t=$('<div id="print-modal"><\/div>'),i=$('<div id="print-modal-controls"><a href="#" class="print" title="'+u+'">'+u+'<\/a><a href="#" class="close" title="'+f+'">'+u+"<\/a>").hide(),o=$('<iframe id="print-modal-content" scrolling="no" border="0" frameborder="0" name="print-frame" />'),t.hide().append(i).append(o).appendTo("body"),e=null,h=null,s=0;s<window.frames.length;s++)if(window.frames[s].name=="print-frame"){e=window.frames[s].document;h=window.frames[s];break}e.open();e.write('<!DOCTYPE html<html xmlns="http://www.w3.org/1999/xhtml"><head><title>'+document.title+'<\/title><\/head><body style="margin: 0px;"><img width="777" src="'+n+'"><\/img><\/body><\/html>');e.close();$("a",e).bind("click.this",function(n){n.preventDefault()});$("head").append('<style type="text/css">@media print {/* -- Print Preview --*/#print-modal-mask,#print-modal {display: none !important;}}<\/style>');this.loadMask();$("body").css({overflowY:"hidden",height:"100%"});$("img",e).load(function(){o.height($("body",o.contents())[0].scrollHeight)});c=$(window).height()+$(window).scrollTop();l={top:c,height:"100%",overflowY:"auto",zIndex:1e4,display:"block"};t.css(l).animate({top:$(window).scrollTop()},400,"linear",function(){i.fadeIn("slow").focus()});o.height($("body",o.contents())[0].scrollHeight);$("a",i).bind("click",function(n){n.preventDefault();$(this).hasClass("print")?(h.window.focus(),h.window.print()):r.distroyPrintPreview()})};this.loadMask=function(){u=this.sizeUpMask();n=$('<div id="print-modal-mask" />').appendTo($("body"));n.css({position:"absolute",top:0,left:0,width:u[0],height:u[1],display:"none",opacity:0,zIndex:9999,backgroundColor:"#000"});n.css({display:"block"}).fadeTo("400",.75);$(window).bind("resize..this.mask",function(){r.updateMaskSize()});n.bind("click.this.mask",function(){r.distroyPrintPreview()});$(document).bind("keydown.this.mask",function(n){n.keyCode==27&&r.distroyPrintPreview()})};this.sizeUpMask=function(){if($.browser.msie){var n=$(document).height(),t=$(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n-t<20?t:n]}return[$(document).width(),$(document).height()]};this.updateMaskSize=function(){var t=this.sizeUpMask();n.css({width:t[0],height:t[1]})};this.distroyPrintPreview=function(){i.fadeOut(100);t.animate({top:$(window).scrollTop()-$(window).height(),opacity:1},400,"linear",function(){t.remove();$("body").css({overflowY:"auto",height:"auto"})});n.fadeOut("slow",function(){n.remove()});$(document).unbind("keydown.this.mask");n.unbind("click.this.mask");$(window).unbind("resize.this.mask")}}function showEmployeeDetails(){$("#employeeDetailsPnl").dialog("open")}function closeEmployeeDetails(){return $("#employeeDetailsPnl").dialog("close"),!1}function showLoginStatisticsPnl(){$("#LoginStatisticsPnl").dialog("open")}function closLoginStatisticsPnl(){return $("#LoginStatisticsPnl").dialog("close"),!1}function ToggleCheckBox(n){var i=GetNodeIndex(n,LINK),r=TREEVIEW_ID+"n"+i+"CheckBox",t=$id(r);t.checked=!t.checked;ToggleChildCheckBoxes(t);ToggleParentCheckBox(t)}function checkBox_Click(n){ToggleChildCheckBoxes(n.target);ToggleParentCheckBox(n.target);$(n.target).trigger("change")}function GetNodeIndex(n,t){var i;return t===LINK?i=n.substring((TREEVIEW_ID+"t").length):t===CHECKBOX&&(i=n.substring((TREEVIEW_ID+"n").length,n.indexOf("CheckBox"))),i}function ToggleChildCheckBoxes(n){var u=n.id.substring(0,n.id.search("CheckBox"))+"Nodes",r=$id(u),i,t;if(r)for(i=r.getElementsByTagName("input"),t=0;t<i.length;t++)i[t].disabled||(i[t].checked=n.checked)}function ToggleParentCheckBox(n){var i=GetParentNodeById(n,TREEVIEW_ID),t,f,r,u;if(i&&(t=i.id.substring(0,i.id.search("Nodes"))+"CheckBox",$get(t)&&$get(t).type==="checkbox"))if(n.checked===!1)$get(t).checked=!1;else{for(f=0,r=i.getElementsByTagName("input"),u=0;u<r.length;u++)r[u].checked===!0&&f++;$get(t).checked=f===r.length}}function GetParentNodeById(n,t){var i=n.parentNode;return i===null?!1:i.id.search(t)===-1?GetParentNodeById(i,t):i}function showPrintFormsPnl(){$("#printFormsPnl").dialog("open")}function closePrintFormsPnl(){return $("#printFormsPnl").dialog("close"),!1}function showUserLoginStatisticsPnl(){$("#userLoginStatisticsPnl").dialog("open")}function closUserLoginStatisticsPnl(){return $("#userLoginStatisticsPnl").dialog("close"),!1}function ProtocolQuestionEdit(n,t,i,r,u){var e=n,f=t,c=!1,o=!1,s,a=i,v=$(e).dialog({width:812,autoOpen:!1,resizable:!1,draggable:!0,modal:!0}),l,h;v.parent().appendTo($("form:first"));this.disableSelectFromOrganizations=function(n){c=n};this.disable=function(){o=!0};this.enable=function(){o=!1};this.setOrganization=function(n){s=n};this.show=function(n){typeof n=="undefined"||n===null||$(e).dialog({title:"Редактирование вопроса "+$(e).data("epktypetitle")+" (протокол "+n+")"});$(e).dialog("open");$(".submitbutton",e).attr("disabled","disabled")};this.showTemplate=function(n){typeof n=="undefined"||n===null||$(e).dialog({title:"Шаблон вопроса: "+n+""});$(e).dialog("open");$(".submitbutton",e).attr("disabled","disabled")};this.close=function(){$(e).dialog("close")};l=function(n){var t,e,i;$(f).find('[selector="Organizations"]').each(function(){var t=selectFromEpkOrganizations.getPanel().clone(!0),n,i;c||o?(t.find(".organization-panel-select").hide(),t.find(".organization-panel-clear").hide()):(t.find(".organization-panel-select").show(),t.find(".organization-panel-clear").show());n=t.find("select");n.attr("field",$(this).attr("field"));n.attr("class",$(this).attr("class"));n.attr("style",$(this).attr("style"));n.attr("printname",$(this).attr("printname"));n.attr("gridname",$(this).attr("gridname"));n.attr("selector",$(this).attr("selector"));n.attr("meaning",$(this).attr("meaning"));i=n.width()-55;n.width(i);$(this).replaceWith(t);t.show()});$(f).find('[selector="InventoryInProcess"]').each(function(){var n=inventoriesInProcessControl.clonePanelAndCopyAttributesFromSelect(this,o,r,u);$(this).replaceWith(n);n.show()});t=$(f).find("select");e=$(a).val();t.each(function(t,r){var u=$(r).attr("selector");typeof u!="undefined"&&u!==!1&&$.ajax({type:"POST",url:"/Pages/EPK/epk.axd?action=getSelectorData&dbHelper="+u+"&archiveId="+e,dataType:"json",error:messageError,success:function(t){$(r).append($("<option/>",{value:"",text:"- не имеет значения -"}));$(t).each(function(t,u){var f=$("<option/>",{value:u.Value,text:u.Text});u.HasFiles&&$(f).attr("HasFiles","1");$(r).append(f);--i||h(n)});u==="Organizations"&&typeof s!="undefined"&&$(r).val(s)}})});i=t.length;i===0&&h(n)};h=function(n){$.ajax({type:"POST",url:"/Pages/EPK/epk.axd?action=getValues&questionId="+n,dataType:"json",error:messageError,success:function(n){$(n).each(function(n,t){var i,e;$(f).find("input[field="+t.name+"]").val(t.value);$(f).find("textarea[field="+t.name+"]").val(t.value);$(f).find("select[field="+t.name+"]").val(t.value);i=$(f).find("select[field="+t.name+"]");i&&$(i).attr("selector")==="InventoryInProcess"&&(e=t.value.split(","),inventoriesInProcessControl.fillTable(i,e,r,u))});$(".submitbutton",e).removeAttr("disabled")}})};this.showHtml=function(n,t,i){$(f).html("<div>Загрузка...<\/div>");$.ajax({type:"POST",url:"/Pages/EPK/epk.axd?action=getHtml&templateId="+t,dataType:"html",error:messageError,success:function(t){$(f).html(t);o?$(f).find("input").each(function(){$(this).attr("readonly","readonly")}):$(f).find("input").each(function(){$(this).removeAttr("readonly")});l(n);FillSedInventoryTable(n,f,r,u);$(e).dialog("option","position","center");i&&i()}})};this.saveValues=function(n,t){var i=[];$(f).find("input, select, textarea").each(function(n,t){var r,u;$(t).attr("selector")!=="InventoryInProcess"?i.push({ValueUniqueName:$(t).attr("field"),DataDumpValue:$(t).val(),SelectedHistoryId:$(t).attr("selectedhistoryid")}):(r=inventoriesInProcessControl.getValues(t),r.length>0&&(u=r.join(","),i.push({ValueUniqueName:$(t).attr("field"),DataDumpValue:u,SelectedHistoryId:$(t).attr("selectedhistoryid")})))});$.ajax({type:"POST",url:"/Pages/EPK/epk.axd?action=setValues&questionId="+n,data:JSON.stringify(i),dataType:"json",error:messageError,success:function(result){typeof t=="undefined"||t===null||eval(t);typeof result.message!="undefined"&&alertAsync(result.message)}})};$(".protocol-question-edit-tab").click(function(n){var t=n.target,i;$(t).hasClass("dxtc")&&(t=$(t).closest(".dxtcTab"));i=$(t).attr("class").replace("dxtcTab ","").replace("dxtcTabHover","").replace("protocol-question-edit-tab ","");showProtocolQuestionEditTab(i.trim())})}function resetProtocolQuestionEditTabControl(){$(".protocol-question-edit-tab.tab-Main").click()}function showProtocolQuestionEditTab(n){var t=$('.protocol-question-edit-tab-page[name="'+n+'"]');t!==null&&t.length>0&&($(".protocol-question-edit-tab-page").hide(),$('.protocol-question-edit-tab-page[name="'+n+'"]').show())}function pageLoad(){$(".preagree-comment-view.editable-comment").unbind("click");$(".preagree-comment-view.editable-comment").click(function(n){var t=$(n.target);openCommentEditor(t)});$(".preagree-comment-button.button-close").unbind("click");$(".preagree-comment-button.button-close").click(function(n){var t=$(n.target);closeCommentEditor(t)});$(".preagree-comment-button.button-save").unbind("click");$(".preagree-result").unbind("change");$(".preagree-comment-editor").unbind("click");$(".preagree-comment-button.button-save").click(function(n){var t=$(n.target).closest(".preagree-row");savePreAgree(t,null);closeCommentEditor(n.target)});$(".preagree-result").change(function(n){var t=$(n.target).closest(".preagree-row");savePreAgree(t,null)});$(".preagree-comment-editor").click(function(n){var t=$(n.target).closest(".preagree-row");showPreAgreeCommentEditor(t)})}function openCommentEditor(n){$(n).closest(".preagree-comment-field").find('*[name="edit"]').each(function(n,t){$(t).show()});$(n).closest(".preagree-comment-field").find('*[name="view"]').each(function(n,t){$(t).hide()})}function closeCommentEditor(n){$(n).closest(".preagree-comment-field").find('*[name="edit"]').each(function(n,t){$(t).hide()});$(n).closest(".preagree-comment-field").find('*[name="view"]').each(function(n,t){$(t).show()})}function savePreAgree(n,t){var r=$(n).find(".preagree-user-info"),e=$(r).data("id"),o=$(r).data("questionid"),u,f,i;(t===null||t.length<0)&&(t=$(n).find(".preagree-comment-edit").val().replace('"','"'));u=$(n).find(".preagree-result option:selected").val();f=sendPreAgreeData(t,u,e,o);f?(t.length<1&&(t=defaultComment),$(n).find(".preagree-comment-view").text(t),$(n).find(".preagree-comment-edit").val(t),$(n).find(".preagree-comment-text-block").attr("title",t)):(i=$(n).find(".preagree-comment-view").text(),i===defaultComment&&(i=""),$(n).find(".preagree-comment-edit").val(i),$(n).find(".preagree-comment-text-block").attr("title",i))}function sendPreAgreeData(n,t,i,r){var u=!1;return $.ajax({type:"POST",url:"/Pages/EPK/epk.axd?action=savePreAgreeResult",dataType:"json",async:!1,data:JSON.stringify({Comment:n,UserIdEncrypted:i,QuestionId:r,ResultId:t}),error:function(){u=!1;messageError()},success:function(){u=!0}}),u}function showPreAgreeCommentEditor(n){var r=$(n).find(".preagree-comment-edit"),i=$(n).find(".preagree-comment-view").hasClass("editable-comment")?null:"readonly",t=$('<div><textarea cols="40" rows="20"'+(i==="readonly"?'readonly="readonly"':"")+">"+r.val()+"<\/textarea><\/div>").dialog({autoOpen:!0,modal:!0,title:"Комментарий",width:"auto",buttons:i==="readonly"?{"Отмена":function(){$(this).dialog("close");t.remove()}}:{"Сохранить":function(){savePreAgree(n,$(this).find("textarea").val().replace('"','"'));$(this).dialog("close");t.remove()},"Отмена":function(){$(this).dialog("close");t.remove()}}})}function ProtocolQuestionSelect(n,t,i,r,u){var e=n,f=t,c=!1,o=!1,s,a=i,v=$(e).dialog({width:800,autoOpen:!1,resizable:!1,draggable:!0,modal:!0}),l,h;v.parent().appendTo($("form:first"));this.disableSelectFromOrganizations=function(n){c=n};this.disable=function(){o=!0};this.enable=function(){o=!1};this.setOrganization=function(n){s=n};this.show=function(){$(e).dialog("open");$(".submitbutton",e).attr("disabled","disabled")};this.showTemplate=function(n){typeof n=="undefined"||n===null||$(e).dialog({title:"Шаблон вопроса: "+n+""});$(e).dialog("open");$(".submitbutton",e).attr("disabled","disabled")};this.close=function(){$(e).dialog("close")};l=function(n){var t,e,i;$(f).find('[selector="Organizations"]').each(function(){var t=selectFromEpkOrganizations.getPanel().clone(!0),n,i;c||o?(t.find(".organization-panel-select").hide(),t.find(".organization-panel-clear").hide()):(t.find(".organization-panel-select").show(),t.find(".organization-panel-clear").show());n=t.find("select");n.attr("field",$(this).attr("field"));n.attr("class",$(this).attr("class"));n.attr("style",$(this).attr("style"));n.attr("printname",$(this).attr("printname"));n.attr("gridname",$(this).attr("gridname"));n.attr("selector",$(this).attr("selector"));n.attr("meaning",$(this).attr("meaning"));i=n.width()-55;n.width(i);$(this).replaceWith(t);t.show()});$(f).find('[selector="InventoryInProcess"]').each(function(){var n=inventoriesInProcessControl.clonePanelAndCopyAttributesFromSelect(this,o,r,u);$(this).replaceWith(n);n.show()});t=$(f).find("select");e=$(a).val();t.each(function(t,r){var u=$(r).attr("selector");typeof u!="undefined"&&u!==!1&&$.ajax({type:"POST",url:"/Pages/EPK/epk.axd?action=getSelectorData&dbHelper="+u+"&archiveId="+e,dataType:"json",error:messageError,success:function(t){$(r).append($("<option/>",{value:"",text:"- не имеет значения -"}));$(t).each(function(t,u){var f=$("<option/>",{value:u.Value,text:u.Text});u.HasFiles&&$(f).attr("HasFiles","1");$(r).append(f);--i||h(n)});u==="Organizations"&&typeof s!="undefined"&&$(r).val(s)}})});i=t.length;i===0&&h(n)};h=function(n){$.ajax({type:"POST",url:"/Pages/EPK/epk.axd?action=getValues&questionId="+n,dataType:"json",error:messageError,success:function(n){$(n).each(function(n,t){var i,e;$(f).find("input[field="+t.name+"]").val(t.value);$(f).find("textarea[field="+t.name+"]").val(t.value);$(f).find("select[field="+t.name+"]").val(t.value);i=$(f).find("select[field="+t.name+"]");i&&$(i).attr("selector")==="InventoryInProcess"&&(e=t.value.split(","),inventoriesInProcessControl.fillTable(i,e,r,u))});$(".submitbutton",e).removeAttr("disabled")}})};this.showHtml=function(n,t,i){$(f).html("<div>Загрузка...<\/div>");$.ajax({type:"POST",url:"/Pages/EPK/epk.axd?action=getHtml&templateId="+t,dataType:"html",error:messageError,success:function(t){$(f).html(t);o?$(f).find("input").each(function(){$(this).attr("readonly","readonly")}):$(f).find("input").each(function(){$(this).removeAttr("readonly")});l(n);FillSedInventoryTable(n,f,r,u);$(e).dialog("option","position","center");i&&i()}})};this.clearHtml=function(){$(f).html("")};this.saveValues=function(n,t){var i=[];$(f).find("input, select, textarea").each(function(n,t){var r,u;$(t).attr("selector")!=="InventoryInProcess"?i.push({ValueUniqueName:$(t).attr("field"),DataDumpValue:$(t).val(),SelectedHistoryId:$(t).attr("selectedhistoryid")}):(r=inventoriesInProcessControl.getValues(t),r.length>0&&(u=r.join(","),i.push({ValueUniqueName:$(t).attr("field"),DataDumpValue:u,SelectedHistoryId:$(t).attr("selectedhistoryid")})))});$.ajax({type:"POST",url:"/Pages/EPK/epk.axd?action=setValues&questionId="+n,data:JSON.stringify(i),dataType:"json",error:messageError,success:function(result){typeof t=="undefined"||t===null||eval(t);typeof result.message!="undefined"&&alertAsync(result.message)}})};$(".protocol-question-edit-tab").click(function(n){var t=n.target,i;$(t).hasClass("dxtc")&&(t=$(t).closest(".dxtcTab"));i=$(t).attr("class").replace("dxtcTab ","").replace("dxtcTabHover","").replace("protocol-question-edit-tab ","");showProtocolQuestionEditTab(i.trim())})}function FillSedInventoryTable(n,t,i,r){var u=$(t).find("table.sed-inventory-table");u.length>0&&$.ajax({type:"POST",url:"/Pages/EPK/epk.axd?action=getSedInventoryData&questionId="+n,dataType:"json",error:messageError,success:function(n){var t=function(n){return $("<img class='inv-card' />").click(function(){$(r).val(n+"|ShowSedInventoryCard");$(i).click()})},f=function(n){return $("<img class='inv-show-files' />").click(function(){$(r).val(n+"|ShowSedInventoryFiles");$(i).click()})};u.find("tr:not(.sed-inventory-table-header,.sed-inventory-table-template)").remove();$(n).each(function(n,i){var r=u.find("tr.sed-inventory-table-template").clone().removeClass("sed-inventory-table-template");r.find("td[data-field=number]").text(i.number);r.find("td[data-field=title]").text(i.title);var e=i.id,o=t(e),s=f(e);r.find("td.action001").append(o,i.fileCount>0?s:"");u.append(r.show())})}})}function showHistory(){$("#historyPnl").dialog("open")}function closeHistory(){return $("#historyPnl").dialog("close"),!1}function showQueryPlanExecutionDatePnl(){$("#queryPlanExecutionDatePnl").dialog("open")}function closeQueryPlanExecutionDatePnl(){return $("#queryPlanExecutionDatePnl").dialog("close"),!1}function showQueryCreationDatePnl(){$("#queryCreationDatePnl").dialog("open")}function closeQueryCreationDatePnl(){return $("#queryCreationDatePnl").dialog("close"),!1}function showQueryExecutionFinishDateChangePnl(){$("#queryExecutionFinishDateChangePnl").dialog("open")}function closeQueryExecutionFinishDateChangePnl(){return $("#queryExecutionFinishDateChangePnl").dialog("close"),!1}function setQueryEditActiveTab(n){$(".query-edit-tab."+n).click()}function showQueryEditTab(n){var t=$('.query-edit-tab-page[name="'+n+'"]');t!=null&&t.length>0&&($(".query-edit-tab-page").hide(),$('.query-edit-tab-page[name="'+n+'"]').show())}function absolute(n,t){var r=n.split("/"),u=t.split("/"),i;for(r.pop(),i=0;i<u.length;i++)u[i]!="."&&(u[i]==".."?r.pop():r.push(u[i]));return r.join("/")}function testPageRequest(n){var t=links[n];$.ajax({url:t,success:function(t){testPageSuccess(t,n)},error:function(t){testPageError(t,n)},complete:function(){testStart(n+1)}})}function testPageSuccess(n,t){var i=links[t];testLinks[i].state=2;parseResponse(i,n)}function testPageError(n,t){var i=links[t];testLinks[i].state=3;$("#missing").append('<li><span style="width:200px;display:block">Текст ссылки: <b>'+testLinks[i].text+'<\/b><\/span> <span class="link-name">'+testLinks[i].link+'<\/span> <a target="_blank" href='+testLinks[i].parent+">источник<\/a><\/li>")}function parseResponse(n,t){$("a",t).each(function(){var t=$(this).attr("href"),i;t!=undefined&&t!=""&&t[0]!="#"&&(i=absolute(n,t),testLinks[i]||addLink(i,t,$(this).text(),n))})}function testStart(n){var i,t,r;for(n||(n=0),$("#loading").show(),t=n;t<links.length;t++)if(r=links[t],testLinks[r].state==1){i=t;break}i!=undefined?testPageRequest(i):($("#loading").hide(),$("#missing").append("<li>Битых ссылок не обнаружено<\/li>"))}function addLink(n,t,i,r){links[links.length]=n;testLinks[n]={};testLinks[n].state=1;testLinks[n].link=t;testLinks[n].text=i;testLinks[n].parent=r}function showDictionaryDetails(n){$("#dictionaryDetailsPnl").dialog("option","title",n);$("#dictionaryDetailsPnl").dialog("open")}function closeDictionaryDetails(){return $("#dictionaryDetailsPnl").dialog("close"),!1}function showUploadLicensePnl(){$("#uploadLicensePnl").dialog({autoOpen:!1,width:"auto",height:"auto",resizable:!1,draggable:!0,modal:!0});$("#uploadLicensePnl").dialog("open")}function closeUploadLicensePnl(){return $("#uploadLicensePnl").dialog("close"),!1}function uploader_OnUploadStart(){licenseUploadBtn.SetEnabled(!1)}function uploader_OnFilesUploadComplete(){updateUploadButton()}function updateUploadButton(){licenseUploadBtn.SetEnabled(licenseUploader.GetText(0)!="")}function showOrganizationDetails(){$("#organizationDetailsPnl").dialog("open")}function closeOrganizationDetails(){return $("#organizationDetailsPnl").dialog("close"),!1}function colorChanged(n){n.get_element().style.color="#"+n.get_selectedColor()}function showPlanWorkDetails(){$("#planWorkDetailsPnl").dialog("open")}function closePlanWorkDetails(){return $("#planWorkDetailsPnl").dialog("close"),!1}function showHistory(){$("#historyPnl").dialog("open")}function closeHistory(){return $("#historyPnl").dialog("close"),!1}function showDeclinePlanWorkPnl(){$("#declinePlanWorkPnl").dialog("open")}function closeDeclinePlanWorkPnl(){return $("#declinePlanWorkPnl").dialog("close"),!1}function showSendPlanWorkToExecutionPnl(){$("#sendPlanWorkToExecutionPnl").dialog("open")}function closeSendPlanWorkToExecutionPnl(){return $("#sendPlanWorkToExecutionPnl").dialog("close"),!1}function showReturnPlanWorkToTransferToExecutionPnl(){$("#returnPlanWorkToTransferToExecutionPnl").dialog("open")}function closeReturnPlanWorkToTransferToExecutionPnl(){return $("#returnPlanWorkToTransferToExecutionPnl").dialog("close"),!1}function showPlanWorkPlanExecutionDatePnl(){$("#planWorkPlanExecutionDatePnl").dialog("open")}function closePlanWorkPlanExecutionDatePnl(){return $("#planWorkPlanExecutionDatePnl").dialog("close"),!1}function showPlanWorkExecutionPnl(){$("#planWorkExecutionPnl").dialog("open")}function closePlanWorkExecutionPnl(){return $("#planWorkExecutionPnl").dialog("close"),!1}function setReportInfo(n,t,i){$('.formTemplate span[calculated="%year%"]').text(n);$('.formTemplate span[calculated="%quarter%"]').text(t);$('.formTemplate span[calculated="%mounth%"]').text(i)}function initCalculatedFields(){$(".formTemplate input[calculated]").each(function(){var n=$(this);$.each($(this).attr("calculated").split(/\+|-|\*|\//),function(){if(!$.isNumeric(this)){var t='input[field="'+this+'"]';$(".formTemplate").delegate(t,"keyup",function(){calculateField(n)})}})})}function calculateField(field){var expression=field.attr("calculated"),result;return $.each(field.attr("calculated").split(/\+|-|\*|\//),function(){var n=$('.formTemplate input[field="'+this+'"]');n.length==1?(n.val($.trim(n.val().replace(",","."))),expression=$.isNumeric(n.val())?expression.replace(this,n.val()):expression.replace(this,"0")):$.isNumeric(this)||(expression=expression.replace(this,"0"))}),result=eval(expression),$.isNumeric(result)?result.toString().indexOf(".")>=0&&(result=result.toFixed(2)):result="",field.val(result),field.trigger("keyup"),field.stop(!0,!0).animate({backgroundColor:"#ffdc87"}).animate({backgroundColor:"white"}),result}function showHideParametersOfMainDirectionsAndResultsReportQuarter(n,t){$(n).find("input")[0].checked?$("#"+t).show():$("#"+t).hide()}function showAndCloseDetailsPnl(n,t,i){return $("#"+n).dialog("option","title",t),$("#"+n).dialog(i),i=="close"?!1:void 0}function showAndCloseDetailsAndSumForm(n,t){return $("#"+n).dialog(t),t=="close"?!1:void 0}function showStorageStateInformationReportDetailsForm(){$("#storageStateInformationReportDetailsFormPnl").dialog("open")}function closeStorageStateInformationReportDetailsForm(){return $("#storageStateInformationReportDetailsFormPnl").dialog("close"),!1}function showStatFormNumber1ReportDetailsForm(){$("#statFormNumber1ReportDetailsFormPnl").dialog("open")}function closeStatFormNumber1ReportDetailsForm(){return $("#statFormNumber1ReportDetailsFormPnl").dialog("close"),!1}function showApplicationFormsNumber1And3ReportDetailsForm(){$("#applicationFormsNumber1And3ReportDetailsFormPnl").dialog("open")}function closeApplicationFormsNumber1And3ReportDetailsForm(){return $("#applicationFormsNumber1And3ReportDetailsFormPnl").dialog("close"),!1}function showStatFormNumber1ReportSumReportForm(){$("#statFormNumber1ReportSumReportFormPnl").dialog("open")}function closeStatFormNumber1ReportSumReportForm(){return $("#statFormNumber1ReportSumReportFormPnl").dialog("close"),!1}function showApplicationFormsNumber1And3ReportSumReportForm(){$("#applicationFormsNumber1And3ReportSumReportFormPnl").dialog("open")}function closeApplicationFormsNumber1And3ReportSumReportForm(){return $("#applicationFormsNumber1And3ReportSumReportFormPnl").dialog("close"),!1}function showParametersOfMainDirectionsOfArchivesDevelopmentReportDetailsForm(){$("#parametersOfMainDirectionsOfArchivesDevelopmentReportDetailsFormPnl").dialog("open")}function closeParametersOfMainDirectionsOfArchivesDevelopmentReportDetailsForm(){return $("#parametersOfMainDirectionsOfArchivesDevelopmentReportDetailsFormPnl").dialog("close"),!1}function showParametersOfMainDirectionsOfArchivesDevelopmentReportSumReportForm(){$("#parametersOfMainDirectionsOfArchivesDevelopmentReportSumReportFormPnl").dialog("open")}function closeParametersOfMainDirectionsOfArchivesDevelopmentReportSumReportForm(){return $("#parametersOfMainDirectionsOfArchivesDevelopmentReportSumReportFormPnl").dialog("close"),!1}function closeEvalIndicatorsDetailFormPnl(){return $("#evalIndicatorsDetailsFormPnl").dialog("close"),!1}function showEvalIndicatorsDetailsFormPnl(){$("#evalIndicatorsDetailsFormPnl").dialog("open")}function showIndicatorFinalResultFormPnl(){$("#indicatorFinalResultFormPnl").dialog("open")}function closeIndicatorFinalResultFormPnl(){$("#indicatorFinalResultFormPnl").dialog("close")}function showDevelopmentRateIndicatorFormPnl(){$("#developmentRateIndicatorFormPnl").dialog("open")}function closeDevelopmentRateIndicatorFormPnl(){$("#developmentRateIndicatorFormPnl").dialog("close")}function showParametersOfMainDirectionsAndResultsReportDetailsForm(){$("#parametersOfMainDirectionsAndResultsReportDetailsFormPnl").dialog("open")}function closeParametersOfMainDirectionsAndResultsReportDetailsForm(){return $("#parametersOfMainDirectionsAndResultsReportDetailsFormPnl").dialog("close"),!1}function showParametersOfMainDirectionsAndResultsReportSumReportForm(){$("#parametersOfMainDirectionsAndResultsReportSumReportFormPnl").dialog("open")}function closeParametersOfMainDirectionsAndResultsReportSumReportForm(){return $("#parametersOfMainDirectionsAndResultsReportSumReportFormPnl").dialog("close"),!1}function showDataAboutChangesInCompositionAndVolumeOfFundsReportDetailsForm(){$("#dataAboutChangesInCompositionAndVolumeOfFundsReportDetailsFormPnl").dialog("open")}function closeDataAboutChangesInCompositionAndVolumeOfFundsReportDetailsForm(){return $("#dataAboutChangesInCompositionAndVolumeOfFundsReportDetailsFormPnl").dialog("close"),!1}function showDataAboutChangesInCompositionAndVolumeOfFundsSumReportForm(){$("#dataAboutChangesInCompositionAndVolumeOfFundsSumReportFormPnl").dialog("open")}function closeDataAboutChangesInCompositionAndVolumeOfFundsSumReportForm(){return $("#dataAboutChangesInCompositionAndVolumeOfFundsSumReportFormPnl").dialog("close"),!1}function showNumbersCompositionAndMovementOfWorkersOfArchivalBodiesAndInstitutionsReportDetailsForm(){$("#NumbersCompositionAndMovementOfWorkersOfArchivalBodiesAndInstitutionsReportDetailsFormPnl").dialog("open")}function closeNumbersCompositionAndMovementOfWorkersOfArchivalBodiesAndInstitutionsReportDetailsForm(){return $("#NumbersCompositionAndMovementOfWorkersOfArchivalBodiesAndInstitutionsReportDetailsFormPnl").dialog("close"),!1}function showNumbersCompositionAndMovementOfWorkersOfArchivalBodiesAndInstitutionsReportSumReportForm(){$("#NumbersCompositionAndMovementOfWorkersOfArchivalBodiesAndInstitutionsReportDetailsSumFormPnl").dialog("open")}function closeNumbersCompositionAndMovementOfWorkersOfArchivalBodiesAndInstitutionsReportSumReportForm(){return $("#NumbersCompositionAndMovementOfWorkersOfArchivalBodiesAndInstitutionsReportDetailsSumFormPnl").dialog("close"),!1}function showParametersOfMainDirectionsAndResultsYanaoDetailsForm(){$("#parametersOfMainDirectionsAndResultsYanaoDetailsFormPnl").dialog("open")}function closeParametersOfMainDirectionsAndResultsYanaoDetailsForm(){return $("#parametersOfMainDirectionsAndResultsYanaoDetailsFormPnl").dialog("close"),!1}function showParametersOfMainDirectionsAndResultsYanaoSumReportForm(){$("#parametersOfMainDirectionsAndResultsYanaoSumFormPnl").dialog("open")}function closeParametersOfMainDirectionsAndResultsYanaoSumReportForm(){return $("#parametersOfMainDirectionsAndResultsYanaoSumFormPnl").dialog("close"),!1}function showParametersOfMainDirectionsAndResultsForm1YanaoDetailsForm(){$("#parametersOfMainDirectionsAndResultsForm1YanaoDetailsFormPnl").dialog("open")}function closeParametersOfMainDirectionsAndResultsForm1YanaoDetailsForm(){return $("#parametersOfMainDirectionsAndResultsForm1YanaoDetailsFormPnl").dialog("close"),!1}function showParametersOfMainDirectionsAndResultsForm1YanaoSumReportForm(){$("#parametersOfMainDirectionsAndResultsForm1YanaoSumFormPnl").dialog("open")}function closeParametersOfMainDirectionsAndResultsForm1YanaoSumReportForm(){return $("#parametersOfMainDirectionsAndResultsForm1YanaoSumFormPnl").dialog("close"),!1}function showMainDirectionsAndPerformanceIndicatorsArhivalIndustryOfKurskDetailsForm(){$("#mainDirectionsAndPerformanceIndicatorsArhivalIndustryOfKurskDetailsFormPnl").dialog("open")}function closeMainDirectionsAndPerformanceIndicatorsArhivalIndustryOfKurskDetailsForm(){return $("#mainDirectionsAndPerformanceIndicatorsArhivalIndustryOfKurskDetailsFormPnl").dialog("close"),!1}function showParametersOfMainDirectionsAndResultsLipeskDetailsForm(){$("#parametersOfMainDirectionsAndResultsLipeskDetailsFormPnl").dialog("open")}function closeParametersOfMainDirectionsAndResultsLipeskDetailsForm(){return $("#parametersOfMainDirectionsAndResultsLipeskDetailsFormPnl").dialog("close"),!1}function showParametersOfMainDirectionsAndResultsLipeskSumReportForm(){$("#parametersOfMainDirectionsAndResultsLipeskSumFormPnl").dialog("open")}function closeParametersOfMainDirectionsAndResultsLipeskSumReportForm(){return $("#parametersOfMainDirectionsAndResultsLipeskSumFormPnl").dialog("close"),!1}function printConfirm(n,t){return $("#printConfirmationDialog .records-count").text(n),$("#printConfirmationDialog").dialog({title:"Выберите действие",resizable:!1,buttons:{"Печать":function(){$(this).dialog("close");t($("#PrintCurrent").prop("checked"))},"Отмена":function(){$(this).dialog("close")}},open:function(){$(this).parent().focus()}}),!1}function showPrintConfirm(){return $("#ShowPrintConfirmHf").val()=="True"?printConfirm($("#RecordsCountHf").val(),confirmPrintCallback):!0}function confirmPrintCallback(n){$("#PrintOnlyCurrentPageHf").val(n);var t=$("#SearchResultPrintBtn"),i=t.attr("onclick");t.removeAttr("onclick");t.click();t.attr("onclick",i)}function showWarnBeforeSorting(){return $("#ShowWarnBeforeSortingHf").val()=="True"?confirm("Найдено "+$("#RecordsCountHf").val()+" записей. Сортировка по архивному шифру может занять длительное время. Продолжить?"):!0}function showProgressBarPnl(){$("#progressBarPnl").dialog("open");$("#progressBarPnl").dialog("widget").find(".ui-dialog-titlebar-close").hide()}function closeProgressBarPnl(){return $("#progressBarPnl").dialog("close"),!1}function showIllegibleImagePnl(){$("#IllegibleImagePnl").dialog("open")}function closeIllegibleImagePnl(){$("#IllegibleImagePnl").dialog("close")}function showStorageFilesViewer(){$("#storageFilesViewerPnl").dialog({autoOpen:!1,width:(document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth)-15,height:(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-15,resizable:!1,draggable:!1,modal:!0});$("#storageFilesViewerPnl").dialog("open")}function replaceStorageFilesTitle(n){$("#storageFilesViewerPnl").dialog({title:n})}function closeStorageFilesViewer(){return $("#storageFilesViewerPnl").dialog("close"),!1}function showCropPnl(){$("#imageCropPnl").dialog({autoOpen:!1,width:(document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth)-15,height:(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-15,resizable:!1,draggable:!1,modal:!0});$("#imageCropPnl").dialog("open");updateCropControl()}function closeCropPnl(){return $("#imageCropPnl").dialog("close"),!1}function storageFileNotExists(n){return alert("Файл не найден: "+n),!1}function print1(n,t){var r=$id("frame-print-content"),i;return r.onload=function(){callPrint("frame-print-content")},i=n.getAttribute("data-url"),t!=null&&t.length&&(i=i+"&censorships="+encodeURIComponent(t)),r.src=i,$get("UpdateProgress").style.display="block",!1}function callPrint(n){var t=document.getElementById(n);t.focus();$.browser.msie||!!navigator.userAgent.match(/Trident.*rv\:11\./)?t.contentWindow.document.execCommand("print",!1,null):t.contentWindow.print();$get("UpdateProgress").style.display="none"}function clearForm(){}function DefaultEdit(n,t){var i=n,f=typeof t=="undefined"||t===null?800:t,r={width:f,autoOpen:!1,resizable:!1,draggable:!0,modal:!0,open:function(){window.setTimeout(function(){var n=$(i);n!==null&&n.dialog("option","position",{my:"center",at:"center",of:window,collision:"fit"})},50)}},u;$(i).dialog(r).dialog("destroy");u=$(i).dialog(r);u.parent().appendTo($("form:first"));this.title=function(n){r.title=n};this.onbeforeclose=function(n){$(i).dialog(r).dialog({beforeClose:n})};this.onafterclose=function(n){$(i).on("dialogclose",n)};this.show=function(n,t){$(i).attr("controlName",n);$(i).find("input[type=hidden][name$=_hfAdditionalData]").val(t);var u=$(i).dialog(r);u!==null&&u.dialog("open")};this.showAndFit=function(){var n=r;n.width=(document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth)-15;n.height=(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-15;$(i).dialog(n)};this.incHeight=function(n){var t=typeof n=="undefined"||n===null?30:n,u=$(i).parent().height()+t;$(i).dialog(r).dialog("option","height",u)};this.fit=function(){var t=(document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth)-15,n;$(i).dialog(r).dialog("option","width",t);n=(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-15;$(i).dialog(r).dialog("option","height",n)};this.close=function(){var n=$(i).dialog(r);n!==null&&n.dialog("close")};this.clear=function(){$(":input",i).each(function(){var n=this.type;n==="text"&&(this.value="")})}}function DefaultEditForCustomMessage(n,t){var i=n,u=typeof t=="undefined"||t===null?800:t,r={width:u,autoOpen:!1,resizable:!1,draggable:!0,modal:!0};$(i).dialog(r).dialog("destroy").remove();this.title=function(n){r.title=n};this.onbeforeclose=function(n){$(i).dialog(r).dialog({beforeClose:n})};this.show=function(){var n=$(i).dialog(r);n!==null&&n.dialog("open")};this.fit=function(){var t=(document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth)-15,n;$(i).dialog(r).dialog("option","width",t);n=(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-15;$(i).dialog(r).dialog("option","height",n)};this.close=function(){$(i).dialog("close")};this.clear=function(){$(":input",i).each(function(){var n=this.type;n==="text"&&(this.value="")})}}function tabClick(n){var t=$(n),i,r,u,f;return t.hasClass("tabControl-tab-active")||(i=t.data("name"),r=t.parent().attr("data-activetabcontainer"),$("#"+r).val(i),u=t.parent(),f=u.attr("data-event"),t.parent().children(".tabControl-tab").each(function(n,t){$(t).removeClass("tabControl-tab-active")}),t.addClass("tabControl-tab-active"),showActiveTabContent()),!1}function showActiveTabContent(){$(".tabControl-tab").each(function(n,t){$($(t).data("nestedcontrol")).hide()});$($(".tabControl-tab-active").data("nestedcontrol")).show()}function switchOnCustomSpellCheck(){$("input[type='text']/*[custspellcheck='true']*/, textarea[custspellcheck='true']").focus(function(){var n=$(this),r=-(parseInt($(n).css("padding-bottom"))+parseInt($(n).css("margin-bottom"))+3)+"px",t=$("<div />",{id:"chk-area-div",text:$(n).val()}).addClass("chk-area-div").css("width",$(n).width()+4+"px").css("font-size",$(n).css("font-size")).css("font-family",$(n).css("font-family")).css("padding-left",parseInt($(n).css("padding-left"))+1+"px").css("top",r),i=$("<div />",{id:"parent-area-div"}).addClass("parent-area-div").css("width",$(n).width());$(i).append(t);$(n).off("blur").blur(function(){$(i).remove()}).off("keydown").keydown(function(i){(i.keyCode===32||i.keyCode===46||i.keyCode===8||i.keyCode===37||i.keyCode===39)&&spellCheckInput(n,t)}).off("click").click(function(){spellCheckInput(n,t)}).after(i);spellCheckInput(n,t)})}function spellCheckInput(n,t){var r=$.trim($(n).val()),i;r.length!==0&&(i=r.split(/(\s+)/).filter(function(n){return n.trim().length>0}),i=$.map(i,function(n){return n.trim()}),i=i.join("&text="),srvUrl="http://speller.yandex.net/services/spellservice.json/checkTexts?lang=ru&options=0&text="+i,$.support.CORS=!0,$.ajax({contentType:"application/json; charset=utf-8",crossDomain:!0,dataType:"json",success:function(i){getResultSpellCheck(n,t,i)},error:function(n,t,i){console.log(n.responseText);console.log(t);console.log(i)},type:"POST",url:srvUrl}))}function getResultSpellCheck(n,t,i){if(i&&i.length>0&&i[0]){var u=$(n).val(),r=u.split(/(\s+)/);r=replaceSpacesInWordArray(r);$.each(i,function(n,t){t&&t[0]&&(r=replaceInWordArray(r,t[0].word))});$(t).html(r.join(""))}}function replaceInWordArray(n,t){for(i=0;i<n.length;i++)n[i]===t&&(n[i]='<span class="wavyline">'+t+"<\/span>");return n}function replaceSpacesInWordArray(n){for(i=0;i<n.length;i++)n[i]&&n[i].indexOf(" ")!==-1&&(n[i]=n[i].replace(/ /g,"&nbsp;"));return n}function showGmpPreloader(n,t,i){var r=$("<div />",{id:"gmp-preloader-div"}).addClass("hidden"),u;$(r).empty().append("Ваш заказ "+t+" оформлен. <br />После завершения обработки данных системой Вы будете перенаправлены на РПГУ для для оплаты.").append("<img alt='Загрузка...' src='/images/loader.gif' />");$(r).dialog({autoOpen:!1,width:"900",height:"auto",resizable:!1,draggable:!0,modal:!0,title:"Заказ "+t,close:function(){$(r).remove()}});$(r).dialog("open");checkGmpAccrualStatus(n,r,i);u=setInterval(function(){$("#gmp-preloader-div").length>0?checkGmpAccrualStatus(n,r,i):clearInterval(u)},5e3);setTimeout(function(){clearInterval(u);$("#gmp-preloader-div").length>0&&setGmpPreloaderWithButton(r)},6e4)}function setGmpPreloaderWithButton(n){$(n).length>0&&$(n).empty().append("Долгое ожидание подтверждения от ГИС ГМП.").append('<br />После получения подтверждения Вы сможете перейти к оплате со страницы "Мои заказы" ').append(" <input type='button' value='Перейти' onclick='redirectToOrderListTab();' />")}function redirectToOrderListTab(){window.open("/Pages/Personal/PersonalSettings.aspx#&&tabName=OrderList","_self");$("#gmp-preloader-div").remove()}function checkGmpAccrualStatus(n,t,i){$.ajax({contentType:"application/json; charset=utf-8",type:"POST",dataType:"json",url:"/webservices/PaidGmpService.asmx/GetStatusGmpAccrual",data:JSON.stringify({gmpAccrualId:n}),success:function(r){analiseGmpStatus(n,r.d,t,i)},error:function(n,t,i){console.log(n.responseText);console.log(t);console.log(i)}})}function setGmpAccrualStatus(n,t){$.ajax({contentType:"application/json; charset=utf-8",type:"POST",dataType:"json",url:"/webservices/PaidGmpService.asmx/SetStatusIdInGmpAccrual",data:JSON.stringify({gmpAccrualId:n,statusId:t}),success:function(){},error:function(n,t,i){console.log(n.responseText);console.log(t);console.log(i)}})}function analiseGmpStatus(n,t,i,r){i&&t&&t>1&&t!==6&&($("#gmp-preloader-div").remove(),setGmpAccrualStatus(n,3),window.open(r,"_blank"))}function initReportBuilderData(){createTemplatesTable();setDroppable();setReportBuilderHeaderAndFooterEditors()}function createTemplatesTable(){var t,n;$("#report-templates-tbl").remove();t=$("<table />",{id:"report-templates-tbl",cellspacing:"0",style:"border-collapse:collapse;"}).addClass("grid-view new-grid-view").append('<tr><th class="align-center" align="center" scope="col" style="width:5%;">№<\/th><th scope="col">Название шаблона<\/th> <th scope="col" style="width:15%;">Действие<\/th> <\/tr>');refreshJsonEntities();n=getJsonEntities();n&&n.templates&&n.templates.length>0&&$.each(n.templates,function(n,i){$(t).append('<tr class="'+oddOrEven(n)+'" templateId="'+i.Id+'" ><td align="center">'+(n+1)+"<\/td><td>"+i.Name+'<\/td><td><div class="btns-div"> <div class="img-div edit-tmpl" title="Редактировать" onclick="editReportTemplate('+i.Id+');"/><div class="img-div delete-tmpl" title="Удалить" onclick="deleteReportTemplate('+i.Id+');"/> <\/div><\/td><\/tr>')});$("div.report-builder-templates-page div#tmpls-grid-content").append(t)}function oddOrEven(n){return n&1?"odd":"even"}function showReportBuilderPage(){clearReportBuilderArea();$("div#report-templates-page-div").hide();$("div#report-builder-page-div").show();$("div#report-builder-page-div div#rpt-bldr-cnt").removeAttr("selectedTeplateId")}function closeReportBuilderPage(){confirm("Все несохраненные изменения будут потеряны. Покинуть шаблон?")&&($("div#report-templates-page-div").show(),$("div#report-builder-page-div").hide(),$("div#report-builder-page-div div#rpt-bldr-cnt").removeAttr("selectedTeplateId"),clearReportBuilderArea())}function createReportBuilderDialog(){var n,t;$("#addingEntitiesDialog").length>0?$("#addingEntitiesDialog").dialog("open"):(n=getJsonEntities(),n&&(t=createReportBuilderDialogContent(n),$("<div />",{id:"addingEntitiesDialog"}).addClass("hidden").empty().append(t).dialog({autoOpen:!1,width:"350",height:"auto",resizable:!1,draggable:!0,modal:!0,title:"Выбор сущностей"}),$("#addingEntitiesDialog").dialog("open")))}function createReportBuilderDialogContent(n){var t="";return n&&$.each(n.entities,function(n,i){i.display!=="False"&&(t+='<div class="entity-chk-div"><input type="checkbox" id="chk'+i.entityId+'" entityId="'+i.entityId+'" display="'+i.display+'" onclick="checkEtitiesByRelations();" class="entity-chk-dlg"/><label for="chk'+i.entityId+'">'+i.entityShowName+"<\/label><\/div>")}),t+='<div class="add-entyties-btn-div"><input type= "button" value = "Выбрать" onclick="createSelectedEntities();" /> &nbsp;<input type= "button" value = "Отмена" onclick="$(\'#addingEntitiesDialog\').dialog(\'close\');" /><\/div>'}function checkEtitiesByRelations(){var i=[],n=[],r=[],u=getJsonEntities(),t;$("div#addingEntitiesDialog input.entity-chk-dlg:checkbox:checked").each(function(){t=$(this).attr("entityId");i.push(t);r=getRelationEntities(u.relations,t);n=union(n,r)});i.length===1&&n.length===0&&n.push(i[0]);n&&n.length>0?(n=addExceptionEntityForEnable(n),$("div#addingEntitiesDialog input.entity-chk-dlg:checkbox").each(function(){t=$(this).attr("entityId");$.inArray(t,n)<0?$(this).attr("disabled","disabled"):$(this).removeAttr("disabled")})):$("div#addingEntitiesDialog input.entity-chk-dlg:checkbox").removeAttr("disabled")}function getRelationEntities(n,t){var i=[],f=t,r,u;return $.each(n,function(n,t){r=t.primaryKeyEntity;u=t.foreignKeyEntity;(r===f||u===f)&&($.inArray(r,i)<0&&i.push(r),$.inArray(u,i)<0&&i.push(u))}),i}function union(n,t){var r,i,u,f;if(n==null||t==null)return void 0;for(r={},i=n.length-1;i>=0;--i)r[n[i]]=n[i];for(i=t.length-1;i>=0;--i)r[t[i]]=t[i];u=[];for(f in r)r.hasOwnProperty(f)&&u.push(r[f]);return u}function createGroupingConfigDialog(n){var t="configure-grouping-dlg",i;$("#"+t).length>0?$("#"+t).dialog("open"):(i=createGroupingConfigDialogContent(t),$(i).addClass("hidden").dialog({autoOpen:!1,width:"350",height:"auto",resizable:!1,draggable:!0,modal:!0,title:"Настройка группировки"}),$(i).dialog("open"));$("#"+t).attr("selectedFieldId",n);setGropinValuesInDialog()}function setGropinValuesInDialog(){var n=$("#configure-grouping-dlg"),t=$("#"+$(n).attr("selectedFieldId"));$(t).attr("grouping")?$(n).find("#cfg-grouping-chk").prop("checked","checked"):$(n).find("#cfg-grouping-chk").removeProp("checked");$(t).attr("group-fun")?$(n).find("#gr-fun").val($(t).attr("group-fun")):$(n).find("#gr-fun").val("Empty");$(t).attr("group-cmp-operator")?$(n).find("#gr-cmp-op").val($(t).attr("group-cmp-operator")):$(n).find("#gr-cmp-op").val("Empty");$(t).attr("group-cmp-val")?$(n).find("#cmp-value-input").val($(t).attr("group-cmp-val")):$(n).find("#cmp-value-input").val("");$(t).attr("fieldtype").toLowerCase()==="system.int32"?$("select#gr-fun.gr-funct-slct").find('option[value="Max"], option[value="Min"], option[value="Avg"]').removeAttr("disabled","disabled"):$("select#gr-fun.gr-funct-slct").find('option[value="Max"], option[value="Min"], option[value="Avg"]').attr("disabled","disabled")}function chkRadioOriented(n){$(n).attr("id")==="oriented-book"?($('div.report-builder-page div.orient-div input#oriented-book:radio[name="oriented"]')[0].checked=!0,$('div.report-builder-page div.orient-div input#oriented-album:radio[name="oriented"]')[0].checked=!1,$("#rpt-bldr-cnt").attr("oriented","book")):($('div.report-builder-page div.orient-div input#oriented-book:radio[name="oriented"]')[0].checked=!1,$('div.report-builder-page div.orient-div input#oriented-album:radio[name="oriented"]')[0].checked=!0,$("#rpt-bldr-cnt").attr("oriented","album"))}function createGroupingConfigDialogContent(n){var t=$("<input />",{id:"cfg-grouping-chk",type:"checkbox"}),r=$('<label for="configure-grouping-chk">Группировать по полю<\/label> <br/>'),u=$('<div class="cnf-vals-div">Выводить значение: <br/><br/><select id="gr-fun" class="gr-funct-slct"><option value="Empty"><\/option><option value="Count">Количество<\/option><option value="Max">Максимум<\/option><option value="Min">Минимум<\/option><option value="Avg">Среднее<\/option><\/select><select id="gr-cmp-op" class="gr-cmp-op-slct"><option value="Empty"><\/option><option value="0">=<\/option><option value="1">><\/option><option value="2">>=<\/option><option value="3"><<\/option><option value="4"><=<\/option><\/select><input id="cmp-value-input" class="gr-value-input" type="text" onkeypress="return pressOnlyDigitKey(this);"><\/div>'),i=$('<div class="gr-cfg-btns-div"><\/div>'),f=$("<input />",{id:"cfg-apply-input",type:"button",value:"Применить"}).click(function(){var f=$("#"+n).attr("selectedFieldId"),i=$("#"+f),r,u;$(t).prop("checked")?$(i).attr("grouping","on"):$(i).removeAttr("grouping");r=$("#gr-fun option:selected").val();u=$("#gr-cmp-op option:selected").val();r!=="Empty"?($(i).attr("group-fun",r).attr("group-cmp-val",$("#cmp-value-input").val()),u==="Empty"?$(i).removeAttr("group-cmp-operator"):$(i).attr("group-cmp-operator",u)):$(i).removeAttr("group-fun").removeAttr("group-cmp-operator").removeAttr("group-cmp-val");setCssButtonForGrouping(f);$("#"+n).dialog("close")});return i.append(f,"&nbsp;&nbsp;&nbsp;",$('<input type= "button" value = "Отмена" onclick="$(\'#'+n+"').dialog('close');\" />")),$('<div id="'+n+'" class="gr-config-dlg" />').append(t,r,u,i)}function setCssButtonForGrouping(n){var t=$("#"+n),i=$(t).attr("group-fun");$(t).attr("grouping")==="on"||i&&i!=="Empty"?$(t).find("#btn-grouping-"+n).removeClass("field-grouping-off").addClass("field-grouping-on"):$(t).find("#btn-grouping-"+n).addClass("field-grouping-off").removeClass("field-grouping-on")}function pressOnlyDigitKey(n){if(isNaN(n.value+String.fromCharCode(event.keyCode)))return!1}function createSelectedEntityDiv(n,t){n&&t&&$.each(n.entities,function(n,i){i.entityId.toLowerCase()===t.toLowerCase()&&i.display==="True"&&createEntityHtml(i)})}function setDraggableConfigs(n){$("#report-builder-page-div #entities-content #"+n+" label").draggable({revert:"invalid",helper:"clone"})}function setDroppable(){var n=$("#rpt-bldr-cnt");$(n).droppable({activate:function(){$(n).addClass("activate-droppable-content")},deactivate:function(){$(n).removeClass("activate-droppable-content")},drop:function(t,i){if(i.draggable.context.localName==="label"){var r=$(i.draggable).attr("id"),u=createFieldCartDiv(r);$(u).appendTo(n);$("label#"+r).hide()}}}).sortable()}function getAttributesFromElement(n){var i=$("#"+n).prop("attributes"),t=[];return $.each(i,function(){t.push({name:this.name,value:this.value})}),t}function getAttrValFromArr(n,t){var i=null;return $.each(n,function(n,r){r.name.toLowerCase()===t.toLowerCase()&&(i=r.value)}),i}function createFieldCartDiv(n){var t=$("#"+n),e=$(t).attr("entityShowName")+"."+$(t).attr("fieldShowName"),r=$(t).attr("entityId")+"-"+$(t).attr("fieldName"),u=r+"-input",f=r+"-lbl",i=r+"-div",o=$("<div/>",{id:r+"-txt-div"}).addClass("text-div"),l=$("<label/>",{id:f,text:e,onclick:"setEditable('"+u+"', '"+f+"', true,'"+i+"');"}),a=$("<input/>",{id:u,type:"text",text:e,onblur:"setEditable('"+u+"', '"+f+"', false,'"+i+"');"}).addClass("hidden"),c;$(o).append(l,a);var s=$("<div/>",{id:r+"-btns-div"}).addClass("btns-div"),v=$('<div class="img-box field-filter" title="фильтровать по данному полю" />').click(function(){var n=$("#"+i);$(n).attr("filter")?($(n).removeAttr("filter"),$(this).removeClass("field-filter-on").addClass("field-filter-off")):($(n).attr("filter","on"),$(this).removeClass("field-filter-off").addClass("field-filter-on"));setReportBuilderHeaderAndFooterEditors()}),y=$('<div id="'+r+'-sort-btn" class="img-box sorting-default" title="сортировать по данному полю"/>').click(function(){var n=$("#"+i);$(n).attr("sort")?$(n).attr("sort")==="up"?($(n).attr("sort","down"),$(this).removeClass("field-sorting-up").addClass("field-sorting-down")):$(n).attr("sort")==="down"&&($(n).removeAttr("sort"),$(this).removeClass("field-sorting-down").addClass("sorting-default")):($(n).attr("sort","up"),$(this).removeClass("sorting-default").addClass("field-sorting-up"))}),p=$('<div class="field-sorting-num" title="порядковый номер поля при сортировке"><input type="text" maxlength="2" class="sorting-num" onkeypress="return pressOnlyDigitKey(this);"><\/div>'),w=$('<div class="img-box show-in-report" title="отображать поле в отчете"/>').click(function(){var n=$("#"+i);$(n).attr("showInReport")==="on"?($(n).attr("showInReport","off"),$(this).removeClass("show-in-report-on").addClass("show-in-report-off")):($(n).attr("showInReport","on"),$(this).removeClass("show-in-report-off").addClass("show-in-report-on"))}),b=$("<div/>",{id:"btn-grouping-"+i,title:"группировать по данному полю"}).addClass("img-box field-grouping").click(function(){createGroupingConfigDialog(i)}),h=$("<div />",{id:"btn-summary-results-"+i,title:"Для данного столбца должны отображаться сводные итоги"}).addClass("img-box summary-results").click(function(){var n=$("#"+i);n.attr("fieldtype")==="System.Int32"&&($(n).attr("summary-results")?($(n).removeAttr("summary-results"),$(this).removeClass("summary-results-on").addClass("summary-results-off")):($(n).attr("summary-results","on"),$(this).addClass("summary-results-on").removeClass("summary-results-off")))});return $(t).attr("fieldtype")!=="System.Int32"&&$(h).addClass("img-box-nohover"),c=$('<div class="img-box field-delete" title="удалить карточку поля из рабочей области конструктора отчетов"/>').click(function(){$("#"+i).remove();$("label#"+$(t).attr("id")).show()}),$(s).append(v,b,y,p,w,h,c),$("<div/>",{id:i,entityId:$(t).attr("entityId"),fieldName:$(t).attr("fieldName"),entityName:$(t).attr("entityName"),entityShowName:$(t).attr("entityShowName"),fieldShowName:$(t).attr("fieldShowName"),fieldTitle:$(t).attr("entityShowName")+"."+$(t).attr("fieldShowName"),fieldType:$(t).attr("fieldType"),dictionary:$(t).attr("dictionary"),customDictionaryId:$(t).attr("customDictionaryId"),additionalField:$(t).attr("additionalField"),showInReport:"on"}).addClass("field-card ui-state-default ui-sortable-handle").append(o,s)}function getSelectedTeplateId(){var n=0;return $("div#report-builder-page-div div#rpt-bldr-cnt").attr("selectedTeplateId")&&(n=$("div#report-builder-page-div div#rpt-bldr-cnt").attr("selectedTeplateId")*1),n}function isBadTemplateName(){var n=$("#template-name").val(),i=getSelectedTeplateId(),t=n==="",r=getJsonEntities();return $.each(r.templates,function(r,u){i*1!==u.Id&&n===u.Name&&(t=!0)}),t}function getNotRelationEntities(){var n=[],i=[],e=[],t,o,u,r,f;return($("div.builder-content div.field-card").each(function(){t=$(this).attr("entityid");$.inArray(t,n)<0&&n.push(t)}),n=addExceptionEntityForRelation(n),n&&n.length>1&&(o=getJsonEntities(),u=0,$.each(n,function(t,r){e=getRelationEntities(o.relations,r);u=getCountRelations(r,e,n);u===0&&i.push(r)}),i&&i.length>0))?(r=[],$("div.builder-content div.field-card").each(function(){t=$(this).attr("entityid");f=$(this).attr("entityshowname");$.inArray(t,i)>-1&&$.inArray(f,r)<0&&r.push(f)}),r):null}function addExceptionEntityForRelation(n){return n&&n.length>1&&($.inArray("vwRequests",n)>-1&&$.inArray("vwArchiveFiles",n)>-1&&n.push("vwRequestFiles"),$.inArray("vwPlanWorks",n)>-1&&$.inArray("vwArchiveFiles",n)>-1&&n.push("vwPlanWorkToArchiveFiles")),n}function addExceptionEntityForEnable(n){return n&&n.length>0&&($.inArray("vwRequests",n)>-1&&$.inArray("vwArchiveFiles",n)<0?n.push("vwArchiveFiles"):$.inArray("vwRequests",n)<0&&$.inArray("vwArchiveFiles",n)>-1&&n.push("vwRequests"),$.inArray("vwPlanWorks",n)>-1&&$.inArray("vwArchiveFiles",n)<0?n.push("vwArchiveFiles"):$.inArray("vwPlanWorks",n)<0&&$.inArray("vwArchiveFiles",n)>-1&&n.push("vwPlanWorks")),n}function getCountRelations(n,t,i){var r=0;return $.each(i,function(i,u){u!==n&&$.inArray(u,t)>-1&&(r=r+1)}),r}function checkAgregationAndSave(){var n,i;if($("div.builder-content div.field-card").length!==0){if(isBadTemplateName()){alertText("Некорректное название шаблона отчета!");return}if(n=getNotRelationEntities(),n&&n.length>0){i="Сохраняемые поля относятся к несвязанным сущностям :\n\r"+n.join(",");alertText(i);return}var r=[],t=[],u=$("div.builder-content div.field-card[group-fun]").length;u>0&&$("div.builder-content div.field-card").each(function(){$(this).attr("group-fun")?($(this).removeAttr("grouping"),r.push($(this).attr("fieldtitle"))):$(this).attr("showinreport")!=="on"||$(this).attr("grouping")||t.push($(this).attr("fieldtitle"))});u>0&&t.length>0?createAgregationCheckDialog(r,t):saveReportTemplateAndRefreshData()}}function createAgregationCheckDialog(n,t){$("#agregation-check-dlg").length>0&&$("#agregation-check-dlg").remove();var r="Установлены агрегирующие функции по следующим полям:<br/>"+n.join(","),u="<br/><br/>Необходимо установить группировку по следующим полям:<br/>"+t.join(","),f=$('<div class="gr-cfg-btns-div"><\/div>').append($('<input type="button" value="Группировать" onclick="$(\'#agregation-check-dlg\').remove(); setCorrectGroupingForAgregation();" />'),"&nbsp;&nbsp;&nbsp;",$('<input type="button" value="Отмена" onclick="$(\'#agregation-check-dlg\').remove();" />')),i=$('<div id="agregation-check-dlg" />').append(r,u,f);$(i).addClass("hidden").dialog({autoOpen:!1,width:"550",height:"auto",resizable:!1,draggable:!0,modal:!0,title:"Настройки группировки для агрегации"});$(i).dialog("open")}function setCorrectGroupingForAgregation(){$("div.builder-content div.field-card").each(function(){$(this).attr("group-fun")?$(this).removeAttr("grouping"):$(this).attr("grouping","on");setCssButtonForGrouping($(this).attr("id"))});checkAgregationAndSave()}function getReportTemplate(n){var t=null;return $.ajax({url:"/api/ReportBuilder/"+n,method:"GET",contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){t=JSON.parse(n)},error:function(n,t,i){console.log(n.responseText);console.log(t);console.log(i)},async:!1}),t}function deleteReportTemplateSrv(n){$.ajax({url:"/api/ReportBuilder/"+n,method:"DELETE",contentType:"application/json; charset=utf-8",dataType:"json",error:function(n,t,i){console.log(n.responseText);console.log(t);console.log(i)},async:!1})}function editReportTemplate(n){showReportBuilderPage();$("div#report-builder-page-div div#rpt-bldr-cnt").attr("selectedTeplateId",n);createTemplate(n)}function deleteReportTemplate(n){confirm("Все отчеты для удаляемого шаблона будут удалены. Вы действительно хотите удалить данный шаблон?")&&(deleteReportTemplateSrv(n),$('div#tmpls-grid-content table#report-templates-tbl tr[templateId="'+n+'"]').remove(),refreshJsonEntities())}function clearReportBuilderArea(){$("#template-name").val("");$("div#entities-content div.entity-div").remove();$("div.builder-content div.field-card").remove();CKEDITOR.instances["ck-editor-hdr"].setData("");CKEDITOR.instances["ck-editor-ftr"].setData("");$("div#rpt-bldr-cnt").removeAttr("order-num");setCssOrderNumOn(!1)}function createTemplate(n){var t=getReportTemplate(n),i;t&&($("#template-name").val(t.Name),setTimeout(function(){t.ReportTemplate.Header&&CKEDITOR.instances["ck-editor-hdr"].setData(t.ReportTemplate.Header);t.ReportTemplate.Footer&&CKEDITOR.instances["ck-editor-ftr"].setData(t.ReportTemplate.Footer)},1e3),t.Landscape?chkRadioOriented($('div.report-builder-page div.orient-div input#oriented-album:radio[name="oriented"]')):chkRadioOriented($('div.report-builder-page div.orient-div input#oriented-book:radio[name="oriented"]')),t.ReportTemplate.Numbering?($("div#rpt-bldr-cnt").attr("order-num","include"),setCssOrderNumOn(!0)):($("div#rpt-bldr-cnt").removeAttr("order-num"),setCssOrderNumOn(!1)),i=getJsonEntities(),$.each(t.ReportTemplate.TableSet,function(n,t){createSelectedEntityDiv(i,t)}),$.each(t.ReportTemplate.ReportFieldSet,function(n,t){createFieldCardFromTemplate(t);setAttributesFromFieldTemplate(t)}))}function getEntityNameFromFullName(n){return n.substring(0,n.lastIndexOf("."))}function getFieldNameFromFullName(n){return n.substring(n.lastIndexOf(".")+1)}function createFieldCardFromTemplate(n){if(n){var t="lbl-"+getEntityNameFromFullName(n.Name)+"-"+getFieldNameFromFullName(n.Name),i=$("#rpt-bldr-cnt"),r=createFieldCartDiv(t);$(r).appendTo(i);$("div.entity-div div.labels-content label#"+t).hide()}}function setAttributesFromFieldTemplate(n){var i=getEntityNameFromFullName(n.Name),r=getFieldNameFromFullName(n.Name),t=$("div.builder-content div#"+i+"-"+r+"-div");$(t).attr("fieldTitle",n.Title).find("div.text-div label#"+i+"-"+r+"-lbl").text(n.Title);n.Filter&&$(t).attr("filter","on").find("div.btns-div div.field-filter").removeClass("field-filter-off").addClass("field-filter-on");n.GroupBy&&$(t).attr("grouping","on");n.Aggregation&&($(t).attr("group-fun",n.Aggregation.Type),n.Aggregation.Condition&&$(t).attr("group-cmp-operator",n.Aggregation.Condition.Type).attr("group-cmp-val",n.Aggregation.Condition.Value));setCssButtonForGrouping($(t).attr("id"));n.SortIndex&&(n.SortIndex.Ascending?$(t).attr("sort","up").find("div.btns-div div#"+i+"-"+r+"-sort-btn").removeClass("sorting-default").addClass("field-sorting-up"):$(t).attr("sort","down").find("div.btns-div div#"+i+"-"+r+"-sort-btn").removeClass("sorting-default").addClass("field-sorting-down"),n.SortIndex.Value&&$(t).find("div.btns-div div.field-sorting-num input.sorting-num").val(n.SortIndex.Value));n.Display?$(t).attr("showInReport","on").find("div.btns-div div.show-in-report").removeClass("show-in-report-off").addClass("show-in-report-on"):$(t).attr("showInReport","off").find("div.btns-div div.show-in-report").removeClass("show-in-report-on").addClass("show-in-report-off");n.TotalAggregation&&$(t).attr("summary-results","on").find("div#btn-summary-results-"+i+"-"+r+"-div").removeClass("summary-results-off").addClass("summary-results-on")}function saveReportTemplateAndRefreshData(){var r=getSelectedTeplateId(),t="Шаблон не сохранен",i="Не успешное сохранение отчета",n=saveReportTemplate(r);n&&n.id>0&&($("div#report-builder-page-div div#rpt-bldr-cnt").attr("selectedTeplateId",n.id),createTemplatesTable(),t='Шаблон "'+$("#template-name").val()+'" сохранен.',i="Успешное сохранение отчета");alertText(t,i)}function alertText(n,t){var r="Информация",u,i;t&&(r=t);u=$('<div class="gr-cfg-btns-div"/>').append($('<input type="button" value="Да" onclick="$(\'#alert-dlg-div\').remove();" />'));i=$('<div id="alert-dlg-div"/>').append($('<div><span class="dlg-txt-span">'+n+"<\/span><\/div>"),u);$(i).addClass("hidden").dialog({autoOpen:!1,width:"350",height:"auto",resizable:!1,draggable:!0,modal:!0,title:r});$(i).dialog("open")}function saveReportTemplate(n){var t={},i;t.Id=n;t.Name=$("#template-name").val();t.Format=2;t.Landscape=$("div#rpt-bldr-cnt").attr("oriented")==="album";t.ReportTemplate=createReportTemplateObj();var r="PUT",f=JSON.stringify(t),u="";return n>0&&(r="POST",u=n),i=null,$.ajax({url:"/api/ReportBuilder/"+u,method:r,contentType:"application/json; charset=utf-8",dataType:"json",data:f,success:function(n){i=n},error:function(n,t,i){console.log(n.responseText);console.log(t);console.log(i)},async:!1}),i}function createReportTemplateObj(){var n={},f;n.Header=CKEDITOR.instances["ck-editor-hdr"].getData();n.Footer=CKEDITOR.instances["ck-editor-ftr"].getData();n.Numbering=$("div#rpt-bldr-cnt").attr("order-num")==="include";var t=[],i=null,u=[],r=null;return $("div.builder-content div.field-card").each(function(n){i=$(this).attr("entityId");i&&$.inArray(i,t)<0&&t.push(i);r=getReportFieldJObj(n,this);r&&u.push(r)}),n.TableSet=t,f=getJsonEntities(),t=addExceptionEntityForRelation(t),n.RelationSet=getArrayRelationSet(f,t),n.ReportFieldSet=u,n}function getReportFieldJObj(n,t){var i={},u,r,f;return i.Title=$(t).attr("fieldTitle"),i.Display=$(t).attr("showInReport")==="on",i.Type=$(t).attr("fieldType"),i.Dictionary=$(t).attr("dictionary"),i.CustomDictionaryId=$(t).attr("customDictionaryId"),i.AdditionalField=$(t).attr("additionalField")&&$(t).attr("additionalField").toLowerCase()==="true",i.Name=$(t).attr("entityId")+"."+$(t).attr("fieldName"),i.GroupBy=$(t).attr("grouping")==="on",i.TotalAggregation=$(t).attr("summary-results")?"Sum":null,i.Filter=$(t).attr("filter")?{Name:"arg"+n}:null,$(t).attr("sort")?(u=$(t).find("div.btns-div div.field-sorting-num input.sorting-num").val(),u||(u=n+1),i.SortIndex={Ascending:$(t).attr("sort")==="up",Value:u}):i.SortIndex=null,$(t).attr("group-fun")?(r=$(t).attr("group-cmp-operator"),r=r&&r!=="Empty"?r*1:null,f=$(t).attr("group-cmp-val"),i.Aggregation=r&&f?{Type:$(t).attr("group-fun"),Condition:{Type:r,Value:f}}:{Type:$(t).attr("group-fun"),Condition:null}):i.Aggregation=null,i}function getArrayRelationSet(n,t){var u=[],i="",r="";return n&&t&&$.each(n.relations,function(n,f){i=f.primaryKeyEntity;r=f.foreignKeyEntity;f&&$.inArray(i,t)>-1&&$.inArray(r,t)>-1&&u.push({PrimaryKey:{Entity:i,Value:f.primaryKeyField},ForeignKey:{Entity:r,Value:f.foreignKeyField}})}),u}function setOrderOption(){var n=$("#rpt-bldr-cnt");$(n).attr("order-num")?($(n).removeAttr("order-num"),setCssOrderNumOn(!1)):($(n).attr("order-num","include"),setCssOrderNumOn(!0))}function setCssOrderNumOn(n){n?$("div#ordr-num-div").removeClass("field-order-num-off").addClass("field-order-num-on"):$("div#ordr-num-div").removeClass("field-order-num-on").addClass("field-order-num-off")}function setEditable(n,t,i,r){var f=$("#"+t),u=$("#"+n);i?($(f).hide(),$(u).show().val($(f).text()).focus()):($(u).hide(),$(f).show().text($(u).val()),$("#"+r).attr("fieldTitle",$(u).val()))}function createEntityHtml(n){var t="div"+n.entityName,i,f;if(n&&$("#"+t).length===0){var r=$("<fieldset>").append("<legend>"+n.entityShowName+":<\/legend>"),u=$("<div class='labels-content' />"),e=$("<button/>",{type:"button",title:"Закрыть"}).click(function(){$("#div"+n.entityName).remove()}).addClass("entity-small-close").append("<span class='ui-button-icon-primary ui-icon ui-icon-closethick'><\/span>"),o=$("<div class='close-area'/>").append(e);$(r).append(u).append(o);i=null;$.each(n.entityFields,function(t,r){r.display!=="False"&&(i=$("<label/>",{id:"lbl-"+n.entityId+"-"+r.fieldName,entityId:n.entityId,entityName:n.entityName,entityShowName:n.entityShowName,fieldName:r.fieldName,fieldShowName:r.fieldShowName,fieldType:r.type,dictionary:r.dictionary,customDictionaryId:r.customDictionaryId,additionalField:r.additionalField,text:r.fieldShowName,title:r.fieldShowName}).addClass("entity-label"),$(u).append(i))});f=$("<div/>",{id:t,entityId:n.entityId}).addClass("entity-div").append(r);$("#entities-content").append(f);setDraggableConfigs(t)}}function createSelectedEntities(){var n=getJsonEntities();$("div#addingEntitiesDialog input.entity-chk-dlg:checkbox:checked").each(function(){$(this).attr("display")==="True"&&createSelectedEntityDiv(n,$(this).attr("entityId"))});$("#addingEntitiesDialog").dialog("close")}function getJsonEntities(){var n=null,t;return $("#entitiesHiddenField").length>0?n=JSON.parse($("#entitiesHiddenField").val()):($.ajax({url:"/api/ReportBuilder",method:"GET",contentType:"application/json; charset=utf-8",dataType:"json",success:function(t){n=t},error:function(n,t,i){console.log(n.responseText);console.log(t);console.log(i)},async:!1}),t=$("<input/>",{id:"entitiesHiddenField",type:"hidden",value:JSON.stringify(n)}),$("#entities-content").append(t)),n}function refreshJsonEntities(){$("#entitiesHiddenField").remove()}function setReportBuilderHeaderAndFooterEditors(){$("#ck-editor-hdr").length===0&&$("#rpt-hdr-cnt").append('<div id="ck-editor-hdr"/>');CKEDITOR.instances["ck-editor-hdr"]&&CKEDITOR.instances["ck-editor-hdr"].destroy();createCkEditorInElement("ck-editor-hdr","125px");$("#ck-editor-ftr").length===0&&$("#rpt-ftr-cnt").append('<div id="ck-editor-ftr"/>');CKEDITOR.instances["ck-editor-ftr"]&&CKEDITOR.instances["ck-editor-ftr"].destroy();createCkEditorInElement("ck-editor-ftr","125px")}function createCkEditorInElement(n,t){CKEDITOR.replace(n,{toolbar:[{name:"baseitems",items:["Font","FontSize","Bold","Italic","Underline","-","Image","Table","HorizontalRule","-","TextColor","BGColor","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"]},{name:"customitems",items:["Reportoptions","Filters"]}],language:"ru",width:"99.8%",height:t,resize_enabled:!0,on:{pluginsLoaded:function(){var n=this,t=n.config;n.ui.addRichCombo("Reportoptions",{label:"Опции",title:"Добавить опцию в редактируемое поле",multiSelect:!1,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(t.contentsCss)},init:function(){this.add("{#FIO#}","ФИО","ФИО пользователя");this.add("{#Position#}","Должность","Должность пользователя");this.add("Текущая дата и время: {#CurrentDateTime#}","Дата формирования","Дата и время при формирования отчета пользователем")},onClick:function(t){n.focus();n.fire("saveSnapshot");n.insertHtml(t);n.fire("saveSnapshot")}});n.ui.addRichCombo("Filters",{label:"Фильтры",title:"Выбранные фильтры из карточек полей",multiSelect:!1,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(t.contentsCss)},init:function(){var n=createOptionItems(),t=this;$.each(n,function(n,i){t.add(i.val,i.text,i.title)})},onClick:function(t){n.focus();n.fire("saveSnapshot");n.insertHtml(t);n.fire("saveSnapshot")}})}}})}function createOptionItems(){var t=[],i=null,n=null;return $("div.builder-content div.field-card[filter='on']").each(function(){i="{#"+$(this).attr("entityShowName")+"."+$(this).attr("fieldShowName")+"#}";n="Фильтр "+$(this).attr("entityShowName")+"."+$(this).attr("fieldShowName");t.push({val:i,text:n,title:n})}),t}var panelHidden,textSeparator,jwplayer,$jw,_userPlayerReady,totalPages,UsersAdministration,EpkPassports,EpkInventoryRegistry,defaultComment,JSON,links,testLinks;(function(){var n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;window.requestAnimationFrame=n})();$(function(){var n;$(document).on("mouseenter",'[data-widget="nested-menu"] > .ais-menu-item > a, [data-widget="nested-menu"] > .ais-menu-item > span',function(t){function r(){i.parent().siblings().removeClass("open cca-pre cca-ready");i.parent().toggleClass("open",!0);window.requestAnimationFrame&&(i.parent().toggleClass("cca-pre",!0),requestAnimationFrame(u))}function u(){i.parent().toggleClass("cca-ready",!0)}var i=$(t.target);n=setTimeout(r,100)});$(document).on("mouseleave",'[data-widget="nested-menu"] > .ais-menu-item',function(){clearTimeout(n)});$(document).on("mouseenter",".ais-submenu-item > a, .ais-submenu-item > span",function(n){function f(){i.parent().toggleClass("cca-ready",!0)}var i=$(n.target),t,u,r;i.parent().siblings().removeClass("open cca-pre cca-ready",!1);i.is('[data-expand="dropdown-submenu"]')&&(i.parent().toggleClass("open",!0),t=$(this).parent().find("ul"),t.css("left",0),u=t.offset(),u.left+t.width()+300>$(window).width()?(r=-t.width(),t.toggleClass("leftsided",!0)):(r=$(this).parent().width(),t.toggleClass("leftsided",!1)),t.css({left:r}),window.requestAnimationFrame&&(i.parent().toggleClass("cca-pre",!0),requestAnimationFrame(f)))});$(document).on("mouseenter",'[data-widget="nested-menu"]',function(){$(this).toggleClass("hovered",!0)});$(document).on("mouseleave",'[data-widget="nested-menu"]',function(){function t(){n.hasClass("hovered")||(n.find(".ais-menu-item").removeClass("open cca-pre cca-ready"),n.find(".ais-submenu-item").removeClass("open cca-pre cca-ready"))}var n=$(this);n.toggleClass("hovered",!1);setTimeout(t,300)})});$(function(){if(typeof Page_Validators!="undefined"){var n=typeof Page_ClientValidate=="undefined"?function(){return!0}:Page_ClientValidate;Page_ClientValidate=function(){var i=n.apply(this,arguments),t={};return $(Page_Validators).each(function(n,i){var r="'"+i.controltovalidate+"'",u=$("#"+i.controltovalidate);typeof t[r]=="undefined"&&(t[r]=!0);i.isvalid&&(typeof u.prop("isvalid")=="undefined"||u.prop("isvalid"))||(t[r]=!1);t[r]?u.removeClass("input-error"):u.addClass("input-error")}),i}}$(".new-breadcrumb-panel.move-down").length>0&&($(".new-breadcrumb-panel.move-down:first").insertAfter($(".breadcrumb-place")),$(".new-breadcrumb-panel.move-down:first").show(),Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function(n,t){t._error==null&&($(".new-breadcrumb-panel.move-down:first").insertAfter($(".breadcrumb-place")),$(".new-breadcrumb-panel.move-down:first").show())}));$("body").delegate(".int","keydown",function(n){n=n||window.event;var t=n.which||n.keyCode;return t==8||t==9||t==13||t==16||t>=33&&t<=57||t>=96&&t<=105});window.addEventListener?window.addEventListener("keyup",onPrintScreen,!1):document.attachEvent&&document.attachEvent("onkeyup",onPrintScreen);$(document).on("click","input[type=text].selectOnFocus",function(){$(this).select()});typeof ASPxComboBoxIncrementalFilteringStrategy!="undefined"&&(ASPxComboBoxIncrementalFilteringStrategy.prototype.CheckForFilterRollback=function(){return!1})});$(document).on("click","#btnOpenLinkList",function(){var n=$("#linksList");n.css("overflow-y")=="hidden"?($("#spnLinksHeader").html("&nbsp;"),n.css("overflow-y","visible")):($("#spnLinksHeader").text("Выбрать"),n.css("overflow-y","hidden"))});panelHidden=!0;$(document).on("click",".cb-real-editor-button",function(n){var i=n.target,t=$(i).parent(".cb-real-editor-button").parent(".cb-real-editor").parent(".combobox-real").find(".cb-real-list");t.length==0&&(t=$(i).parent(".cb-real-editor").parent(".combobox-real").find(".cb-real-list"));panelHidden==!0?$(t).show():$(t).hide();panelHidden=!panelHidden});$(document).on("click",".cb-real-ul li",function(n){var t=n.target,i=$(t).parent(".cb-real-ul").parent(".cb-real-list").parent(".combobox-real").find(".cb-real-editor-text");i.val($(t).text());$(t).parent(".cb-real-ul").parent(".cb-real-list").hide();panelHidden=!0});textSeparator=";";typeof jwplayer=="undefined"&&(jwplayer=function(n){if(jwplayer.api)return jwplayer.api.selectPlayer(n)},$jw=jwplayer,jwplayer.version="5.8.2011",jwplayer.vid=document.createElement("video"),jwplayer.audio=document.createElement("audio"),jwplayer.source=document.createElement("source"),function(n){function t(t){if(n.utils.exists(t)){var i=t.indexOf("://"),r=t.indexOf("?");return i>0&&(r<0||r>i)}}n.utils=function(){};n.utils.typeOf=function(n){var t=typeof n;return t==="object"&&(n?n instanceof Array&&(t="array"):t="null"),t};n.utils.extend=function(){var t=n.utils.extend.arguments,i,r;if(t.length>1){for(i=1;i<t.length;i++)for(r in t[i])t[0][r]=t[i][r];return t[0]}return null};n.utils.clone=function(){var r,t=n.utils.clone.arguments,i;if(t.length==1)switch(n.utils.typeOf(t[0])){case"object":r={};for(i in t[0])r[i]=n.utils.clone(t[0][i]);break;case"array":r=[];for(i in t[0])r[i]=n.utils.clone(t[0][i]);break;default:return t[0]}return r};n.utils.extension=function(n){return n?(n=n.substring(n.lastIndexOf("/")+1,n.length),n=n.split("?")[0],n.lastIndexOf(".")>-1)?n.substr(n.lastIndexOf(".")+1,n.length).toLowerCase():void 0:""};n.utils.html=function(n,t){n.innerHTML=t};n.utils.wrap=function(n,t){n.parentNode&&n.parentNode.replaceChild(t,n);t.appendChild(n)};n.utils.ajax=function(t,i,r){var u;u=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");u.onreadystatechange=function(){if(u.readyState===4)if(u.status===200){if(i){if(!n.utils.exists(u.responseXML))try{if(window.DOMParser){var f=(new DOMParser).parseFromString(u.responseText,"text/xml");f&&(u=n.utils.extend({},u,{responseXML:f}))}else f=new ActiveXObject("Microsoft.XMLDOM"),f.async="false",f.loadXML(u.responseText),u=n.utils.extend({},u,{responseXML:f})}catch(e){r&&r(t)}i(u)}}else r&&r(t)};try{u.open("GET",t,!0);u.send(null)}catch(f){r&&r(t)}return u};n.utils.load=function(n,t,i){n.onreadystatechange=function(){n.readyState===4&&(n.status===200?t&&t():i&&i())}};n.utils.find=function(n,t){return n.getElementsByTagName(t)};n.utils.append=function(n,t){n.appendChild(t)};n.utils.isIE=function(){return!+"\v1"||typeof ActiveXObject!="undefined"};n.utils.userAgentMatch=function(n){var t=navigator.userAgent.toLowerCase();return t.match(n)!==null};n.utils.isIOS=function(){return n.utils.userAgentMatch(/iP(hone|ad|od)/i)};n.utils.isIPad=function(){return n.utils.userAgentMatch(/iPad/i)};n.utils.isIPod=function(){return n.utils.userAgentMatch(/iP(hone|od)/i)};n.utils.isAndroid=function(){return n.utils.userAgentMatch(/android/i)};n.utils.isLegacyAndroid=function(){return n.utils.userAgentMatch(/android 2.[012]/i)};n.utils.isBlackberry=function(){return n.utils.userAgentMatch(/blackberry/i)};n.utils.isMobile=function(){return n.utils.isIOS()};n.utils.getFirstPlaylistItemFromConfig=function(n){var t={},i;return i=n.playlist&&n.playlist.length?n.playlist[0]:n,t.file=i.file,t.levels=i.levels,t.streamer=i.streamer,t.playlistfile=i.playlistfile,t.provider=i.provider,t.provider||(t.file&&(t.file.toLowerCase().indexOf("youtube.com")>-1||t.file.toLowerCase().indexOf("youtu.be")>-1)&&(t.provider="youtube"),t.streamer&&t.streamer.toLowerCase().indexOf("rtmp://")==0&&(t.provider="rtmp"),i.type&&(t.provider=i.type.toLowerCase())),t.provider=="audio"&&(t.provider="sound"),t};n.utils.getOuterHTML=function(n){if(n.outerHTML)return n.outerHTML;try{return(new XMLSerializer).serializeToString(n)}catch(t){return""}};n.utils.setOuterHTML=function(n,t){var i,r,u;n.outerHTML?n.outerHTML=t:(i=document.createElement("div"),i.innerHTML=t,r=document.createRange(),r.selectNodeContents(i),u=r.extractContents(),n.parentNode.insertBefore(u,n),n.parentNode.removeChild(n))};n.utils.hasFlash=function(){if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]!="undefined")return!0;if(typeof ActiveXObject!="undefined")try{return new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),!0}catch(n){}return!1};n.utils.getPluginName=function(n){return n.lastIndexOf("/")>=0&&(n=n.substring(n.lastIndexOf("/")+1,n.length)),n.lastIndexOf("-")>=0&&(n=n.substring(0,n.lastIndexOf("-"))),n.lastIndexOf(".swf")>=0&&(n=n.substring(0,n.lastIndexOf(".swf"))),n.lastIndexOf(".js")>=0&&(n=n.substring(0,n.lastIndexOf(".js"))),n};n.utils.getPluginVersion=function(n){return n.lastIndexOf("-")>=0?n.lastIndexOf(".js")>=0?n.substring(n.lastIndexOf("-")+1,n.lastIndexOf(".js")):n.lastIndexOf(".swf")>=0?n.substring(n.lastIndexOf("-")+1,n.lastIndexOf(".swf")):n.substring(n.lastIndexOf("-")+1):""};n.utils.getAbsolutePath=function(i,r){var e,h,u,o,s,f;if(n.utils.exists(r)||(r=document.location.href),!n.utils.exists(i))return undefined;if(t(i))return i;for(e=r.substring(0,r.indexOf("://")+3),h=r.substring(e.length,r.indexOf("/",e.length+1)),i.indexOf("/")===0?u=i.split("/"):(o=r.split("?")[0],o=o.substring(e.length+h.length+1,o.lastIndexOf("/")),u=o.split("/").concat(i.split("/"))),s=[],f=0;f<u.length;f++)if(u[f]&&n.utils.exists(u[f])&&u[f]!=".")u[f]==".."?s.pop():s.push(u[f]);else continue;return e+h+"/"+s.join("/")};n.utils.pluginPathType={ABSOLUTE:"ABSOLUTE",RELATIVE:"RELATIVE",CDN:"CDN"};n.utils.getPluginPathType=function(t){var i,u,r;if(typeof t=="string")return(t=t.split("?")[0],i=t.indexOf("://"),i>0)?n.utils.pluginPathType.ABSOLUTE:(u=t.indexOf("/"),r=n.utils.extension(t),i<0&&u<0&&(!r||!isNaN(r)))?n.utils.pluginPathType.CDN:n.utils.pluginPathType.RELATIVE};n.utils.mapEmpty=function(n){for(var t in n)return!1;return!0};n.utils.mapLength=function(n){var t=0;for(var i in n)t++;return t};n.utils.log=function(n,t){typeof console!="undefined"&&typeof console.log!="undefined"&&(t?console.log(n,t):console.log(n))};n.utils.css=function(t,i){if(n.utils.exists(t))for(var r in i)try{if(typeof i[r]=="undefined")continue;else if(typeof i[r]=="number"&&!(r=="zIndex"||r=="opacity")){if(isNaN(i[r]))continue;i[r]=r.match(/color/i)?"#"+n.utils.strings.pad(i[r].toString(16),6):Math.ceil(i[r])+"px"}t.style[r]=i[r]}catch(u){}};n.utils.isYouTube=function(n){return n.indexOf("youtube.com")>-1||n.indexOf("youtu.be")>-1};n.utils.transform=function(t,i,r,u,f){if(n.utils.exists(i)||(i=1),n.utils.exists(r)||(r=1),n.utils.exists(u)||(u=0),n.utils.exists(f)||(f=0),i==1&&r==1&&u==0&&f==0)t.style.webkitTransform="",t.style.MozTransform="",t.style.OTransform="";else{var e="scale("+i+","+r+") translate("+u+"px,"+f+"px)";t.style.webkitTransform=e;t.style.MozTransform=e;t.style.OTransform=e}};n.utils.stretch=function(t,i,r,u,f,e){var c,l;if(typeof r!="undefined"&&typeof u!="undefined"&&typeof f!="undefined"&&typeof e!="undefined"){var s=r/f,h=u/e,o={};i.parentElement&&(i.parentElement.style.overflow="hidden");n.utils.transform(i);switch(t.toUpperCase()){case n.utils.stretching.NONE:o.width=f;o.height=e;o.top=(u-o.height)/2;o.left=(r-o.width)/2;break;case n.utils.stretching.UNIFORM:s>h?(o.width=f*h,o.height=e*h):(o.width=f*s,o.height=e*s);o.top=(u-o.height)/2;o.left=(r-o.width)/2;break;case n.utils.stretching.FILL:s>h?(o.width=f*s,o.height=e*s):(o.width=f*h,o.height=e*h);o.top=(u-o.height)/2;o.left=(r-o.width)/2;break;case n.utils.stretching.EXACTFIT:o.width=f;o.height=e;c=Math.round(f/2*(1-1/s));l=Math.round(e/2*(1-1/h));n.utils.transform(i,s,h,c,l);o.top=o.left=0}n.utils.css(i,o)}};n.utils.stretching={NONE:"NONE",FILL:"FILL",UNIFORM:"UNIFORM",EXACTFIT:"EXACTFIT"};n.utils.deepReplaceKeyName=function(t,i,r){var u,f,e;switch(n.utils.typeOf(t)){case"array":for(u=0;u<t.length;u++)t[u]=n.utils.deepReplaceKeyName(t[u],i,r);break;case"object":for(f in t)e=f.replace(new RegExp(i,"g"),r),t[e]=n.utils.deepReplaceKeyName(t[f],i,r),f!=e&&delete t[f]}return t};n.utils.isInArray=function(n,t){if(!n||!(n instanceof Array))return!1;for(var i=0;i<n.length;i++)if(t===n[i])return!0;return!1};n.utils.exists=function(n){switch(typeof n){case"string":return n.length>0;case"object":return n!==null;case"undefined":return!1}return!0};n.utils.empty=function(n){if(typeof n.hasChildNodes=="function")while(n.hasChildNodes())n.removeChild(n.firstChild)};n.utils.parseDimension=function(n){return typeof n=="string"?n===""?0:n.lastIndexOf("%")>-1?n:parseInt(n.replace("px",""),10):n};n.utils.getDimensions=function(t){return t&&t.style?{x:n.utils.parseDimension(t.style.left),y:n.utils.parseDimension(t.style.top),width:n.utils.parseDimension(t.style.width),height:n.utils.parseDimension(t.style.height)}:{}};n.utils.getElementWidth=function(t){return t?t==document.body?n.utils.parentNode(t).clientWidth:t.clientWidth>0?t.clientWidth:t.style?n.utils.parseDimension(t.style.width):null:null};n.utils.getElementHeight=function(t){return t?t==document.body?n.utils.parentNode(t).clientHeight:t.clientHeight>0?t.clientHeight:t.style?n.utils.parseDimension(t.style.height):null:null};n.utils.timeFormat=function(n){return str="00:00",n>0&&(str=(Math.floor(n/60)<10?"0"+Math.floor(n/60)+":":Math.floor(n/60)+":")+(Math.floor(n%60)<10?"0"+Math.floor(n%60):Math.floor(n%60))),str};n.utils.useNativeFullscreen=function(){return navigator&&navigator.vendor&&navigator.vendor.indexOf("Apple")==0};n.utils.parentNode=function(n){return n?n.parentNode?n.parentNode:n.parentElement?n.parentElement:n:docuemnt.body};n.utils.getBoundingClientRect=function(n){return typeof n.getBoundingClientRect=="function"?n.getBoundingClientRect():{left:n.offsetLeft+document.body.scrollLeft,top:n.offsetTop+document.body.scrollTop,width:n.offsetWidth,height:n.offsetHeight}}}(jwplayer),function(n){n.events=function(){};n.events.COMPLETE="COMPLETE";n.events.ERROR="ERROR"}(jwplayer),function(n){n.events.eventdispatcher=function(t){var u=t,i,r;this.resetEventListeners=function(){i={};r=[]};this.resetEventListeners();this.addEventListener=function(type,listener,count){try{n.utils.exists(i[type])||(i[type]=[]);typeof listener=="string"&&eval("listener = "+listener);i[type].push({listener:listener,count:count})}catch(err){n.utils.log("error",err)}return!1};this.removeEventListener=function(t,r){if(i[t]){try{for(var u=0;u<i[t].length;u++)if(i[t][u].listener.toString()==r.toString()){i[t].splice(u,1);break}}catch(f){n.utils.log("error",f)}return!1}};this.addGlobalListener=function(listener,count){try{typeof listener=="string"&&eval("listener = "+listener);r.push({listener:listener,count:count})}catch(err){n.utils.log("error",err)}return!1};this.removeGlobalListener=function(t){if(r[type]){try{for(var i=0;i<r.length;i++)if(r[i].listener.toString()==t.toString()){r.splice(i,1);break}}catch(u){n.utils.log("error",u)}return!1}};this.sendEvent=function(t,f){var e,o;if(n.utils.exists(f)||(f={}),u&&n.utils.log(t,f),typeof i[t]!="undefined")for(e=0;e<i[t].length;e++){try{i[t][e].listener(f)}catch(s){n.utils.log("There was an error while handling a listener: "+s.toString(),i[t][e].listener)}i[t][e]&&(i[t][e].count===1?delete i[t][e]:i[t][e].count>0&&(i[t][e].count=i[t][e].count-1))}for(o=0;o<r.length;o++){try{r[o].listener(f)}catch(s){n.utils.log("There was an error while handling a listener: "+s.toString(),r[o].listener)}r[o]&&(r[o].count===1?delete r[o]:r[o].count>0&&(r[o].count=r[o].count-1))}}}}(jwplayer),function(n){var t={};n.utils.animations=function(){};n.utils.animations.transform=function(n,t){n.style.webkitTransform=t;n.style.MozTransform=t;n.style.OTransform=t;n.style.msTransform=t};n.utils.animations.transformOrigin=function(n,t){n.style.webkitTransformOrigin=t;n.style.MozTransformOrigin=t;n.style.OTransformOrigin=t;n.style.msTransformOrigin=t};n.utils.animations.rotate=function(t,i){n.utils.animations.transform(t,["rotate(",i,"deg)"].join(""))};n.utils.cancelAnimation=function(n){delete t[n.id]};n.utils.fadeTo=function(i,r,u,f,e,o){var h,c,l,s;if((t[i.id]==o||!n.utils.exists(o))&&i.style.opacity!=r){if(h=(new Date).getTime(),o>h&&setTimeout(function(){n.utils.fadeTo(i,r,u,f,0,o)},o-h),i.style.display=="none"&&(i.style.display="block"),n.utils.exists(f)||(f=i.style.opacity===""?1:i.style.opacity),i.style.opacity==r&&i.style.opacity!==""&&n.utils.exists(o)){r===0&&(i.style.display="none");return}if(n.utils.exists(o)||(o=h,t[i.id]=o),n.utils.exists(e)||(e=0),c=u>0?(h-o)/(u*1e3):0,c=c>1?1:c,l=r-f,s=f+c*l,s>1?s=1:s<0&&(s=0),i.style.opacity=s,e>0){t[i.id]=o+e*1e3;n.utils.fadeTo(i,r,u,f,0,t[i.id]);return}setTimeout(function(){n.utils.fadeTo(i,r,u,f,0,o)},10)}}}(jwplayer),function(n){n.utils.arrays=function(){};n.utils.arrays.indexOf=function(n,t){for(var i=0;i<n.length;i++)if(n[i]==t)return i;return-1};n.utils.arrays.remove=function(t,i){var r=n.utils.arrays.indexOf(t,i);r>-1&&t.splice(r,1)}}(jwplayer),function(n){n.utils.extensionmap={"3gp":{html5:"video/3gpp",flash:"video"},"3gpp":{html5:"video/3gpp"},"3g2":{html5:"video/3gpp2",flash:"video"},"3gpp2":{html5:"video/3gpp2"},flv:{flash:"video"},f4a:{html5:"audio/mp4"},f4b:{html5:"audio/mp4",flash:"video"},f4v:{html5:"video/mp4",flash:"video"},mov:{html5:"video/quicktime",flash:"video"},m4a:{html5:"audio/mp4",flash:"video"},m4b:{html5:"audio/mp4"},m4p:{html5:"audio/mp4"},m4v:{html5:"video/mp4",flash:"video"},mp4:{html5:"video/mp4",flash:"video"},rbs:{flash:"sound"},aac:{html5:"audio/aac",flash:"video"},mp3:{html5:"audio/mp3",flash:"sound"},ogg:{html5:"audio/ogg"},oga:{html5:"audio/ogg"},ogv:{html5:"video/ogg"},webm:{html5:"video/webm"},m3u8:{html5:"audio/x-mpegurl"},gif:{flash:"image"},jpeg:{flash:"image"},jpg:{flash:"image"},swf:{flash:"image"},png:{flash:"image"},wav:{html5:"audio/x-wav"}}}(jwplayer),function(n){function i(t,i){return n.utils.exists(i)?n.utils.extend(i,f[t]):i=f[t],i}function r(r,u){var e,o,s,f;if(t[r.tagName.toLowerCase()]&&!n.utils.exists(u))return t[r.tagName.toLowerCase()](r);u=i("element",u);e={};for(o in u)o!="length"&&(s=r.getAttribute(o),n.utils.exists(s)&&(e[u[o]]=s));return f=r.style["#background-color"],!f||f=="transparent"||f=="rgba(0, 0, 0, 0)"||(e.screencolor=f),e}function u(t,u){var o,s,h,f;u=i("media",u);o=[];s=n.utils.selectors("source",t);for(h in s)isNaN(h)||o.push(e(s[h]));return f=r(t,u),n.utils.exists(f.file)&&(o[0]={file:f.file}),f.levels=o,f}function e(n,t){t=i("source",t);var u=r(n,t);return u.width=u.width?u.width:0,u.bitrate=u.bitrate?u.bitrate:0,u}function o(n,t){t=i("video",t);return u(n,t)}n.utils.mediaparser=function(){};var f={element:{width:"width",height:"height",id:"id","class":"className",name:"name"},media:{src:"file",preload:"preload",autoplay:"autostart",loop:"repeat",controls:"controls"},source:{src:"file",type:"type",media:"media","data-jw-width":"width","data-jw-bitrate":"bitrate"},video:{poster:"image"}},t={};n.utils.mediaparser.parseMedia=function(n){return r(n)};t.media=u;t.audio=u;t.source=e;t.video=o}(jwplayer),function(n){n.utils.loaderstatus={NEW:"NEW",LOADING:"LOADING",ERROR:"ERROR",COMPLETE:"COMPLETE"};n.utils.scriptloader=function(t){var i=n.utils.loaderstatus.NEW,r=new n.events.eventdispatcher;n.utils.extend(this,r);this.load=function(){if(i==n.utils.loaderstatus.NEW){i=n.utils.loaderstatus.LOADING;var u=document.createElement("script");u.onload=function(){i=n.utils.loaderstatus.COMPLETE;r.sendEvent(n.events.COMPLETE)};u.onerror=function(){i=n.utils.loaderstatus.ERROR;r.sendEvent(n.events.ERROR)};u.onreadystatechange=function(){(u.readyState=="loaded"||u.readyState=="complete")&&(i=n.utils.loaderstatus.COMPLETE,r.sendEvent(n.events.COMPLETE))};document.getElementsByTagName("head")[0].appendChild(u);u.src=t}};this.getStatus=function(){return i}}}(jwplayer),function(n){n.utils.selectors=function(t,i){var r,u;return n.utils.exists(i)||(i=document),t=n.utils.strings.trim(t),r=t.charAt(0),r=="#"?i.getElementById(t.substr(1)):r=="."?i.getElementsByClassName?i.getElementsByClassName(t.substr(1)):n.utils.selectors.getElementsByTagAndClass("*",t.substr(1)):t.indexOf(".")>0?(u=t.split("."),n.utils.selectors.getElementsByTagAndClass(u[0],u[1])):i.getElementsByTagName(t)};n.utils.selectors.getElementsByTagAndClass=function(t,i,r){var s=[],f,u,o,e;for(n.utils.exists(r)||(r=document),f=r.getElementsByTagName(t),u=0;u<f.length;u++)if(n.utils.exists(f[u].className))for(o=f[u].className.split(" "),e=0;e<o.length;e++)o[e]==i&&s.push(f[u]);return s}}(jwplayer),function(n){n.utils.strings=function(){};n.utils.strings.trim=function(n){return n.replace(/^\s*/,"").replace(/\s*$/,"")};n.utils.strings.pad=function(n,t,i){for(i||(i="0");n.length<t;)n=i+n;return n};n.utils.strings.serialize=function(n){return n==null?null:n=="true"?!0:n=="false"?!1:isNaN(Number(n))||n.length>5||n.length==0?n:Number(n)};n.utils.strings.seconds=function(n){n=n.replace(",",".");var t=n.split(":"),i=0;return n.substr(-1)=="s"?i=Number(n.substr(0,n.length-1)):n.substr(-1)=="m"?i=Number(n.substr(0,n.length-1))*60:n.substr(-1)=="h"?i=Number(n.substr(0,n.length-1))*3600:t.length>1?(i=Number(t[t.length-1]),i+=Number(t[t.length-2])*60,t.length==3&&(i+=Number(t[t.length-3])*3600)):i=Number(n),i};n.utils.strings.xmlAttribute=function(n,t){for(var i=0;i<n.attributes.length;i++)if(n.attributes[i].name&&n.attributes[i].name.toLowerCase()==t.toLowerCase())return n.attributes[i].value.toString();return""};n.utils.strings.jsonToString=function(t){var u=u||{},f,r,e,o,i;if(u&&u.stringify)return u.stringify(t);if(f=typeof t,f!="object"||t===null)if(f=="string")t='"'+t.replace(/"/g,'\\"')+'"';else return String(t);else{r=[];e=t&&t.constructor==Array;for(o in t){i=t[o];switch(typeof i){case"string":i='"'+i.replace(/"/g,'\\"')+'"';break;case"object":n.utils.exists(i)&&(i=n.utils.strings.jsonToString(i))}e?typeof i!="function"&&r.push(String(i)):typeof i!="function"&&r.push('"'+o+'":'+String(i))}return e?"["+String(r)+"]":"{"+String(r)+"}"}}}(jwplayer),function(n){function i(n){if(["true","false","t","f"].toString().indexOf(n.toLowerCase().replace(" ",""))>=0)return"boolean";if(t.test(n))return"color";if(isNaN(parseInt(n,10))||parseInt(n,10).toString().length!=n.length){if(!isNaN(parseFloat(n))&&parseFloat(n).toString().length==n.length)return"float"}else return"integer";return"string"}function r(t,i){if(!n.utils.exists(i))return t;switch(i){case"color":return t.length>0?u(t):null;case"integer":return parseInt(t,10);case"float":return parseFloat(t);case"boolean":return t.toLowerCase()=="true"?!0:t=="1"?!0:!1}return t}function u(n){switch(n.toLowerCase()){case"blue":return parseInt("0000FF",16);case"green":return parseInt("00FF00",16);case"red":return parseInt("FF0000",16);case"cyan":return parseInt("00FFFF",16);case"magenta":return parseInt("FF00FF",16);case"yellow":return parseInt("FFFF00",16);case"black":return parseInt("000000",16);case"white":return parseInt("FFFFFF",16);default:return n=n.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2"),n.length==3&&(n=n.charAt(0)+n.charAt(0)+n.charAt(1)+n.charAt(1)+n.charAt(2)+n.charAt(2)),parseInt(n,16)}return parseInt("000000",16)}var t=new RegExp(/^(#|0x)[0-9a-fA-F]{3,6}/);n.utils.typechecker=function(t,u){return u=n.utils.exists(u)?u:i(t),r(t,u)}}(jwplayer),function(n){n.utils.parsers=function(){};n.utils.parsers.localName=function(n){return n?n.localName?n.localName:n.baseName?n.baseName:"":""};n.utils.parsers.textContent=function(n){return n?n.textContent?n.textContent:n.text?n.text:"":""}}(jwplayer),function(n){n.utils.parsers.jwparser=function(){};n.utils.parsers.jwparser.PREFIX="jwplayer";n.utils.parsers.jwparser.parseEntry=function(t,i){for(var r=0;r<t.childNodes.length;r++)t.childNodes[r].prefix==n.utils.parsers.jwparser.PREFIX&&(i[n.utils.parsers.localName(t.childNodes[r])]=n.utils.strings.serialize(n.utils.parsers.textContent(t.childNodes[r]))),!i.file&&String(i.link).toLowerCase().indexOf("youtube")>-1&&(i.file=i.link);return i};n.utils.parsers.jwparser.getProvider=function(t){if(t.type)return t.type;if(t.file.indexOf("youtube.com/w")>-1||t.file.indexOf("youtube.com/v")>-1||t.file.indexOf("youtu.be/")>-1)return"youtube";if(t.streamer&&t.streamer.indexOf("rtmp")==0)return"rtmp";if(t.streamer&&t.streamer.indexOf("http")==0)return"http";var i=n.utils.strings.extension(t.file);return extensions.hasOwnProperty(i)?extensions[i]:""}}(jwplayer),function(n){n.utils.parsers.mediaparser=function(){};n.utils.parsers.mediaparser.PREFIX="media";n.utils.parsers.mediaparser.parseGroup=function(t,i){for(var u,f=!1,r=0;r<t.childNodes.length;r++)if(t.childNodes[r].prefix==n.utils.parsers.mediaparser.PREFIX){if(!n.utils.parsers.localName(t.childNodes[r]))continue;switch(n.utils.parsers.localName(t.childNodes[r]).toLowerCase()){case"content":f||(i.file=n.utils.strings.xmlAttribute(t.childNodes[r],"url"));n.utils.strings.xmlAttribute(t.childNodes[r],"duration")&&(i.duration=n.utils.strings.seconds(n.utils.strings.xmlAttribute(t.childNodes[r],"duration")));n.utils.strings.xmlAttribute(t.childNodes[r],"start")&&(i.start=n.utils.strings.seconds(n.utils.strings.xmlAttribute(t.childNodes[r],"start")));t.childNodes[r].childNodes&&t.childNodes[r].childNodes.length>0&&(i=n.utils.parsers.mediaparser.parseGroup(t.childNodes[r],i));(n.utils.strings.xmlAttribute(t.childNodes[r],"width")||n.utils.strings.xmlAttribute(t.childNodes[r],"bitrate")||n.utils.strings.xmlAttribute(t.childNodes[r],"url"))&&(i.levels||(i.levels=[]),i.levels.push({width:n.utils.strings.xmlAttribute(t.childNodes[r],"width"),bitrate:n.utils.strings.xmlAttribute(t.childNodes[r],"bitrate"),file:n.utils.strings.xmlAttribute(t.childNodes[r],"url")}));break;case"title":i.title=n.utils.parsers.textContent(t.childNodes[r]);break;case"description":i.description=n.utils.parsers.textContent(t.childNodes[r]);break;case"keywords":i.tags=n.utils.parsers.textContent(t.childNodes[r]);break;case"thumbnail":i.image=n.utils.strings.xmlAttribute(t.childNodes[r],"url");break;case"credit":i.author=n.utils.parsers.textContent(t.childNodes[r]);break;case"player":u=t.childNodes[r].url;(u.indexOf("youtube.com")>=0||u.indexOf("youtu.be")>=0)&&(f=!0,i.file=n.utils.strings.xmlAttribute(t.childNodes[r],"url"));break;case"group":n.utils.parsers.mediaparser.parseGroup(t.childNodes[r],i)}}return i}}(jwplayer),function(n){function t(t){for(var i={},r=0;r<t.childNodes.length;r++)if(n.utils.parsers.localName(t.childNodes[r]))switch(n.utils.parsers.localName(t.childNodes[r]).toLowerCase()){case"enclosure":i.file=n.utils.strings.xmlAttribute(t.childNodes[r],"url");break;case"title":i.title=n.utils.parsers.textContent(t.childNodes[r]);break;case"pubdate":i.date=n.utils.parsers.textContent(t.childNodes[r]);break;case"description":i.description=n.utils.parsers.textContent(t.childNodes[r]);break;case"link":i.link=n.utils.parsers.textContent(t.childNodes[r]);break;case"category":i.tags?i.tags+=n.utils.parsers.textContent(t.childNodes[r]):i.tags=n.utils.parsers.textContent(t.childNodes[r])}return i=n.utils.parsers.mediaparser.parseGroup(t,i),i=n.utils.parsers.jwparser.parseEntry(t,i),new n.html5.playlistitem(i)}n.utils.parsers.rssparser=function(){};n.utils.parsers.rssparser.parse=function(i){for(var u,f=[],r=0;r<i.childNodes.length;r++)if(n.utils.parsers.localName(i.childNodes[r]).toLowerCase()=="channel")for(u=0;u<i.childNodes[r].childNodes.length;u++)n.utils.parsers.localName(i.childNodes[r].childNodes[u]).toLowerCase()=="item"&&f.push(t(i.childNodes[r].childNodes[u]));return f}}(jwplayer),function(n){var i={},t={};n.plugins=function(){};n.plugins.loadPlugins=function(r,u){return t[r]=new n.plugins.pluginloader(new n.plugins.model(i),u),t[r]};n.plugins.registerPlugin=function(r,u,f){var e=n.utils.getPluginName(r),o;if(i[e])i[e].registerPlugin(r,u,f);else{n.utils.log("A plugin ("+r+") was registered with the player that was not loaded. Please check your configuration.");for(o in t)t[o].pluginFailed()}}}(jwplayer),function(n){n.plugins.model=function(t){this.addPlugin=function(i){var r=n.utils.getPluginName(i);return t[r]||(t[r]=new n.plugins.plugin(i)),t[r]}}}(jwplayer),function(n){n.plugins.pluginmodes={FLASH:"FLASH",JAVASCRIPT:"JAVASCRIPT",HYBRID:"HYBRID"};n.plugins.plugin=function(t){function s(){switch(n.utils.getPluginPathType(t)){case n.utils.pluginPathType.ABSOLUTE:return t;case n.utils.pluginPathType.RELATIVE:return n.utils.getAbsolutePath(t,window.location.href);case n.utils.pluginPathType.CDN:var i=n.utils.getPluginName(t),r=n.utils.getPluginVersion(t),u=window.location.href.indexOf("https://")==0?o.replace("http://","https://secure"):o;return u+"/"+n.version.split(".")[0]+"/"+i+"/"+i+(r!==""?"-"+r:"")+".js"}}function h(){e=setTimeout(function(){r=n.utils.loaderstatus.COMPLETE;f.sendEvent(n.events.COMPLETE)},1e3)}function c(){r=n.utils.loaderstatus.ERROR;f.sendEvent(n.events.ERROR)}var o="http://plugins.longtailvideo.com",r=n.utils.loaderstatus.NEW,i,u,e,f=new n.events.eventdispatcher;n.utils.extend(this,f);this.load=function(){if(r==n.utils.loaderstatus.NEW){if(t.lastIndexOf(".swf")>0){i=t;r=n.utils.loaderstatus.COMPLETE;f.sendEvent(n.events.COMPLETE);return}r=n.utils.loaderstatus.LOADING;var u=new n.utils.scriptloader(s());u.addEventListener(n.events.COMPLETE,h);u.addEventListener(n.events.ERROR,c);u.load()}};this.registerPlugin=function(t,o,s){e&&(clearTimeout(e),e=undefined);o&&s?(i=s,u=o):typeof o=="string"?i=o:typeof o=="function"?u=o:o||s||(i=t);r=n.utils.loaderstatus.COMPLETE;f.sendEvent(n.events.COMPLETE)};this.getStatus=function(){return r};this.getPluginName=function(){return n.utils.getPluginName(t)};this.getFlashPath=function(){if(i)switch(n.utils.getPluginPathType(i)){case n.utils.pluginPathType.ABSOLUTE:return i;case n.utils.pluginPathType.RELATIVE:return t.lastIndexOf(".swf")>0?n.utils.getAbsolutePath(i,window.location.href):n.utils.getAbsolutePath(i,s());case n.utils.pluginPathType.CDN:return i.indexOf("-")>-1?i+"h":i+"-h"}return null};this.getJS=function(){return u};this.getPluginmode=function(){return typeof i!="undefined"&&typeof u!="undefined"?n.plugins.pluginmodes.HYBRID:typeof i!="undefined"?n.plugins.pluginmodes.FLASH:typeof u!="undefined"?n.plugins.pluginmodes.JAVASCRIPT:void 0};this.getNewInstance=function(n,t,i){return new u(n,t,i)};this.getURL=function(){return t}}}(jwplayer),function(n){n.plugins.pluginloader=function(t,i){function h(){f||(f=!0,u=n.utils.loaderstatus.COMPLETE,s.sendEvent(n.events.COMPLETE))}function e(){var t,i;if(!f){t=0;for(plugin in r)i=r[plugin].getStatus(),(i==n.utils.loaderstatus.LOADING||i==n.utils.loaderstatus.NEW)&&t++;t==0&&h()}}var r={},u=n.utils.loaderstatus.NEW,o=!1,f=!1,s=new n.events.eventdispatcher;n.utils.extend(this,s);this.setupPlugins=function(n,t,i){var s={length:0,plugins:{}},f={length:0,plugins:{}},u,o,e;for(u in r)if(o=r[u].getPluginName(),r[u].getFlashPath()&&(s.plugins[r[u].getFlashPath()]=t.plugins[u],s.plugins[r[u].getFlashPath()].pluginmode=r[u].getPluginmode(),s.length++),r[u].getJS()&&(e=document.createElement("div"),e.id=n.id+"_"+o,e.style.position="absolute",e.style.zIndex=f.length+10,f.plugins[o]=r[u].getNewInstance(n,t.plugins[u],e),f.length++,typeof f.plugins[o].resize!="undefined")){n.onReady(i(f.plugins[o],e,!0));n.onResize(i(f.plugins[o],e))}return n.plugins=f.plugins,s};this.load=function(){u=n.utils.loaderstatus.LOADING;o=!0;for(var f in i)n.utils.exists(f)&&(r[f]=t.addPlugin(f),r[f].addEventListener(n.events.COMPLETE,e),r[f].addEventListener(n.events.ERROR,e));for(f in r)r[f].load();o=!1;e()};this.pluginFailed=function(){h()};this.getStatus=function(){return u}}}(jwplayer),function(n){var t=[];n.api=function(t){function l(n,t){return function(r,u,e,o){if(n.renderingMode=="flash"||n.renderingMode=="html5"){var s;u?(f[r]=u,s="jwplayer('"+n.id+"').callback('"+r+"')"):!u&&f[r]&&delete f[r];i.jwDockSetButton(r,s,e,o)}return t}}function a(n){return function(t){var u=t.newstate,f=t.oldstate,i,r;if(u==n&&(i=e[u],i))for(r=0;r<i.length;r++)typeof i[r]=="function"&&i[r].call(this,{oldstate:f,newstate:u})}}function v(n,t){return function(i){var r,f;if(n==i.component&&(r=u[n][t],r))for(f=0;f<r.length;f++)typeof r[f]=="function"&&r[f].call(this,i)}}function y(t,i){var r=n.utils.extend({},i),u,f;t!=n.api.events.JWPLAYER_FULLSCREEN||r.fullscreen?typeof r.data=="object"&&(r=n.utils.extend(r,r.data),delete r.data):(r.fullscreen=r.message=="true"?!0:!1,delete r.message);u=["position","duration","offset"];for(f in u)r[u[f]]&&(r[u[f]]=Math.round(r[u[f]]*1e3)/1e3);return r}this.container=t;this.id=t.id;var r={},e={},u={},i=undefined,s=!1,o=[],c=n.utils.getOuterHTML(t),h={},f={};return this.getBuffer=function(){return this.callInternal("jwGetBuffer")},this.getContainer=function(){return this.container},this.getPlugin=function(t){var r=this,i={};return t=="dock"?n.utils.extend(i,{setButton:l(r,i),show:function(){return r.callInternal("jwDockShow"),i},hide:function(){return r.callInternal("jwDockHide"),i},onShow:function(t){return r.componentListener("dock",n.api.events.JWPLAYER_COMPONENT_SHOW,t),i},onHide:function(t){return r.componentListener("dock",n.api.events.JWPLAYER_COMPONENT_HIDE,t),i}}):t=="controlbar"?n.utils.extend(i,{show:function(){return r.callInternal("jwControlbarShow"),i},hide:function(){return r.callInternal("jwControlbarHide"),i},onShow:function(t){return r.componentListener("controlbar",n.api.events.JWPLAYER_COMPONENT_SHOW,t),i},onHide:function(t){return r.componentListener("controlbar",n.api.events.JWPLAYER_COMPONENT_HIDE,t),i}}):t=="display"?n.utils.extend(i,{show:function(){return r.callInternal("jwDisplayShow"),i},hide:function(){return r.callInternal("jwDisplayHide"),i},onShow:function(t){return r.componentListener("display",n.api.events.JWPLAYER_COMPONENT_SHOW,t),i},onHide:function(t){return r.componentListener("display",n.api.events.JWPLAYER_COMPONENT_HIDE,t),i}}):this.plugins[t]},this.callback=function(n){if(f[n])return f[n]()},this.getDuration=function(){return this.callInternal("jwGetDuration")},this.getFullscreen=function(){return this.callInternal("jwGetFullscreen")},this.getHeight=function(){return this.callInternal("jwGetHeight")},this.getLockState=function(){return this.callInternal("jwGetLockState")},this.getMeta=function(){return this.getItemMeta()},this.getMute=function(){return this.callInternal("jwGetMute")},this.getPlaylist=function(){var i=this.callInternal("jwGetPlaylist"),t;for(this.renderingMode=="flash"&&n.utils.deepReplaceKeyName(i,"__dot__","."),t=0;t<i.length;t++)n.utils.exists(i[t].index)||(i[t].index=t);return i},this.getPlaylistItem=function(t){return n.utils.exists(t)||(t=this.getCurrentItem()),this.getPlaylist()[t]},this.getPosition=function(){return this.callInternal("jwGetPosition")},this.getRenderingMode=function(){return this.renderingMode},this.getState=function(){return this.callInternal("jwGetState")},this.getVolume=function(){return this.callInternal("jwGetVolume")},this.getWidth=function(){return this.callInternal("jwGetWidth")},this.setFullscreen=function(t){return n.utils.exists(t)?this.callInternal("jwSetFullscreen",t):this.callInternal("jwSetFullscreen",!this.callInternal("jwGetFullscreen")),this},this.setMute=function(t){return n.utils.exists(t)?this.callInternal("jwSetMute",t):this.callInternal("jwSetMute",!this.callInternal("jwGetMute")),this},this.lock=function(){return this},this.unlock=function(){return this},this.load=function(n){return this.callInternal("jwLoad",n),this},this.playlistItem=function(n){return this.callInternal("jwPlaylistItem",n),this},this.playlistPrev=function(){return this.callInternal("jwPlaylistPrev"),this},this.playlistNext=function(){return this.callInternal("jwPlaylistNext"),this},this.resize=function(n,t){if(this.renderingMode=="html5")i.jwResize(n,t);else{this.container.width=n;this.container.height=t;var r=document.getElementById(this.id+"_wrapper");r&&(r.style.width=n+"px",r.style.height=t+"px")}return this},this.play=function(t){return typeof t=="undefined"?(t=this.getState(),t==n.api.events.state.PLAYING||t==n.api.events.state.BUFFERING?this.callInternal("jwPause"):this.callInternal("jwPlay")):this.callInternal("jwPlay",t),this},this.pause=function(t){return typeof t=="undefined"?(t=this.getState(),t==n.api.events.state.PLAYING||t==n.api.events.state.BUFFERING?this.callInternal("jwPause"):this.callInternal("jwPlay")):this.callInternal("jwPause",t),this},this.stop=function(){return this.callInternal("jwStop"),this},this.seek=function(n){return this.callInternal("jwSeek",n),this},this.setVolume=function(n){return this.callInternal("jwSetVolume",n),this},this.onBufferChange=function(t){return this.eventListener(n.api.events.JWPLAYER_MEDIA_BUFFER,t)},this.onBufferFull=function(t){return this.eventListener(n.api.events.JWPLAYER_MEDIA_BUFFER_FULL,t)},this.onError=function(t){return this.eventListener(n.api.events.JWPLAYER_ERROR,t)},this.onFullscreen=function(t){return this.eventListener(n.api.events.JWPLAYER_FULLSCREEN,t)},this.onMeta=function(t){return this.eventListener(n.api.events.JWPLAYER_MEDIA_META,t)},this.onMute=function(t){return this.eventListener(n.api.events.JWPLAYER_MEDIA_MUTE,t)},this.onPlaylist=function(t){return this.eventListener(n.api.events.JWPLAYER_PLAYLIST_LOADED,t)},this.onPlaylistItem=function(t){return this.eventListener(n.api.events.JWPLAYER_PLAYLIST_ITEM,t)},this.onReady=function(t){return this.eventListener(n.api.events.API_READY,t)},this.onResize=function(t){return this.eventListener(n.api.events.JWPLAYER_RESIZE,t)},this.onComplete=function(t){return this.eventListener(n.api.events.JWPLAYER_MEDIA_COMPLETE,t)},this.onSeek=function(t){return this.eventListener(n.api.events.JWPLAYER_MEDIA_SEEK,t)},this.onTime=function(t){return this.eventListener(n.api.events.JWPLAYER_MEDIA_TIME,t)},this.onVolume=function(t){return this.eventListener(n.api.events.JWPLAYER_MEDIA_VOLUME,t)},this.onBuffer=function(t){return this.stateListener(n.api.events.state.BUFFERING,t)},this.onPause=function(t){return this.stateListener(n.api.events.state.PAUSED,t)},this.onPlay=function(t){return this.stateListener(n.api.events.state.PLAYING,t)},this.onIdle=function(t){return this.stateListener(n.api.events.state.IDLE,t)},this.remove=function(){r={};o=[];n.utils.getOuterHTML(this.container)!=c&&n.api.destroyPlayer(this.id,c)},this.setup=function(t){var r,i;return n.embed?(r=this.id,this.remove(),i=n(r),i.config=t,new n.embed(i)):this},this.registerPlugin=function(t,i,r){n.plugins.registerPlugin(t,i,r)},this.setPlayer=function(n,t){i=n;this.renderingMode=t},this.stateListener=function(t,i){return e[t]||(e[t]=[],this.eventListener(n.api.events.JWPLAYER_PLAYER_STATE,a(t))),e[t].push(i),this},this.detachMedia=function(){if(this.renderingMode=="html5")return this.callInternal("jwDetachMedia")},this.attachMedia=function(){if(this.renderingMode=="html5")return this.callInternal("jwAttachMedia")},this.componentListener=function(n,t,i){return u[n]||(u[n]={}),u[n][t]||(u[n][t]=[],this.eventListener(t,v(n,t))),u[n][t].push(i),this},this.addInternalListener=function(n,t){n.jwAddEventListener(t,'function(dat) { jwplayer("'+this.id+'").dispatchEvent("'+t+'", dat); }')},this.eventListener=function(n,t){return r[n]||(r[n]=[],i&&s&&this.addInternalListener(i,n)),r[n].push(t),this},this.dispatchEvent=function(n){var i,t;if(r[n])for(i=y(n,arguments[1]),t=0;t<r[n].length;t++)typeof r[n][t]=="function"&&r[n][t].call(this,i)},this.callInternal=function(t,r){if(s)return typeof i!="undefined"&&typeof i[t]=="function"?n.utils.exists(r)?i[t](r):i[t]():null;o.push({method:t,parameters:r})},this.playerReady=function(t){var f,u;s=!0;i||this.setPlayer(document.getElementById(t.id));this.container=document.getElementById(this.id);for(f in r)this.addInternalListener(i,f);for(this.eventListener(n.api.events.JWPLAYER_PLAYLIST_ITEM,function(){h={}}),this.eventListener(n.api.events.JWPLAYER_MEDIA_META,function(t){n.utils.extend(h,t.metadata)}),this.dispatchEvent(n.api.events.API_READY);o.length>0;)u=o.shift(),this.callInternal(u.method,u.parameters)},this.getItemMeta=function(){return h},this.getCurrentItem=function(){return this.callInternal("jwGetPlaylistIndex")},this};n.api.selectPlayer=function(t){var i,r;return(n.utils.exists(t)||(t=0),t.nodeType?i=t:typeof t=="string"&&(i=document.getElementById(t)),i)?(r=n.api.playerById(i.id),r?r:n.api.addPlayer(new n.api(i))):typeof t=="number"?n.getPlayers()[t]:null};n.api.events={API_READY:"jwplayerAPIReady",JWPLAYER_READY:"jwplayerReady",JWPLAYER_FULLSCREEN:"jwplayerFullscreen",JWPLAYER_RESIZE:"jwplayerResize",JWPLAYER_ERROR:"jwplayerError",JWPLAYER_COMPONENT_SHOW:"jwplayerComponentShow",JWPLAYER_COMPONENT_HIDE:"jwplayerComponentHide",JWPLAYER_MEDIA_BUFFER:"jwplayerMediaBuffer",JWPLAYER_MEDIA_BUFFER_FULL:"jwplayerMediaBufferFull",JWPLAYER_MEDIA_ERROR:"jwplayerMediaError",JWPLAYER_MEDIA_LOADED:"jwplayerMediaLoaded",JWPLAYER_MEDIA_COMPLETE:"jwplayerMediaComplete",JWPLAYER_MEDIA_SEEK:"jwplayerMediaSeek",JWPLAYER_MEDIA_TIME:"jwplayerMediaTime",JWPLAYER_MEDIA_VOLUME:"jwplayerMediaVolume",JWPLAYER_MEDIA_META:"jwplayerMediaMeta",JWPLAYER_MEDIA_MUTE:"jwplayerMediaMute",JWPLAYER_PLAYER_STATE:"jwplayerPlayerState",JWPLAYER_PLAYLIST_LOADED:"jwplayerPlaylistLoaded",JWPLAYER_PLAYLIST_ITEM:"jwplayerPlaylistItem"};n.api.events.state={BUFFERING:"BUFFERING",IDLE:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING"};n.api.playerById=function(n){for(var i=0;i<t.length;i++)if(t[i].id==n)return t[i];return null};n.api.addPlayer=function(n){for(var i=0;i<t.length;i++)if(t[i]==n)return n;return t.push(n),n};n.api.destroyPlayer=function(i,r){for(var u,o,s,f=-1,e=0;e<t.length;e++)if(t[e].id==i){f=e;continue}return f>=0&&(u=document.getElementById(t[f].id),document.getElementById(t[f].id+"_wrapper")&&(u=document.getElementById(t[f].id+"_wrapper")),u&&(r?n.utils.setOuterHTML(u,r):(o=document.createElement("div"),s=u.id,u.id.indexOf("_wrapper")==u.id.length-8&&(newID=u.id.substring(0,u.id.length-8)),o.setAttribute("id",s),u.parentNode.replaceChild(o,u))),t.splice(f,1)),null};n.getPlayers=function(){return t.slice(0)}}(jwplayer),_userPlayerReady=typeof playerReady=="function"?playerReady:undefined,playerReady=function(n){var t=jwplayer.api.playerById(n.id);t?t.playerReady(n):jwplayer.api.selectPlayer(n.id).playerReady(n);_userPlayerReady&&_userPlayerReady.call(this,n)},function(n){function i(){var f,r,u;if(!document.body)return setTimeout(i,15);for(f=t.selectors.getElementsByTagAndClass("video","jwplayer"),r=0;r<f.length;r++)u=f[r],u.id==""&&(u.id="jwplayer_"+Math.round(Math.random()*1e5)),n(u.id).setup({})}var t=n.utils;n.embed=function(i){function o(n,t){for(var i in t)typeof n[i]=="function"&&n[i].call(n,t[i])}function f(){var f,e,s,h,c,y,l,a,v;if(u.getStatus()==t.loaderstatus.COMPLETE){for(f=0;f<r.modes.length;f++)if(r.modes[f].type&&n.embed[r.modes[f].type]){if(e=r.modes[f].config,s=r,e)for(s=t.extend(t.clone(r),e),h=["file","levels","playlist"],c=0;c<h.length;c++)if(y=h[c],t.exists(e[y]))for(l=0;l<h.length;l++)l!=c&&(a=h[l],t.exists(s[a])&&!t.exists(e[a])&&delete s[a]);if(v=new n.embed[r.modes[f].type](document.getElementById(i.id),r.modes[f],s,u,i),v.supportsConfig())return v.embed(),o(i,r.events),i}t.log("No suitable players found");new n.embed.logo(t.extend({hide:!0},r.components.logo),"none",i.id)}}var e=t.mediaparser.parseMedia(i.container),r=new n.embed.config(t.extend({width:400,height:300,components:{controlbar:{position:"over"}}},e,i.config),this),u=n.plugins.loadPlugins(i.id,r.plugins);return u.addEventListener(n.events.COMPLETE,f),u.addEventListener(n.events.ERROR,f),u.load(),i};i()}(jwplayer),function(n){function t(){return[{type:"flash",src:"/jwplayer/player.swf"},{type:"html5"},{type:"download"}]}function e(n){return n instanceof Array||typeof n=="object"&&!n.position&&!n.size}function f(n){return typeof n=="string"&&(parseInt(n).toString()==n||n.toLowerCase().indexOf("px")>-1)?parseInt(n):n}function o(t){var u={},f,r,i;switch(n.utils.typeOf(t.plugins)){case"object":for(f in t.plugins)u[n.utils.getPluginName(f)]=f;break;case"string":for(r=t.plugins.split(","),i=0;i<r.length;i++)u[n.utils.getPluginName(r[i])]=r[i]}return u}function u(t,i,r,u){var f,e;n.utils.typeOf(t[i])!="object"&&(t[i]={});f=t[i][r];n.utils.typeOf(f)!="object"&&(t[i][r]=f={});u&&(i=="plugins"?(e=n.utils.getPluginName(r),f[u]=t[e+"."+u],delete t[e+"."+u]):(f[u]=t[r+"."+u],delete t[r+"."+u]))}var i={players:"modes",autoplay:"autostart"},r=["playlist","dock","controlbar","logo","display"];n.embed.deserialize=function(t){var f=o(t),s,i;for(s in f)u(t,"plugins",f[s]);for(i in t)if(i.indexOf(".")>-1){var h=i.split("."),e=h[0],i=h[1];n.utils.isInArray(r,e)?u(t,"components",e,i):f[e]&&u(t,"plugins",f[e],i)}return t};n.embed.config=function(u){var o=n.utils.extend({},u),p,a,c,v,y,s,l,h;if(e(o.playlist)&&(p=o.playlist,delete o.playlist),o=n.embed.deserialize(o),o.height=f(o.height),o.width=f(o.width),typeof o.plugins=="string")for(a=o.plugins.split(","),typeof o.plugins!="object"&&(o.plugins={}),c=0;c<a.length;c++)v=n.utils.getPluginName(a[c]),typeof o[v]=="object"?(o.plugins[a[c]]=o[v],delete o[v]):o.plugins[a[c]]={};for(y=0;y<r.length;y++)s=r[y],n.utils.exists(o[s])&&(typeof o[s]!="object"?(o.components[s]||(o.components[s]={}),s=="logo"?o.components[s].file=o[s]:o.components[s].position=o[s],delete o[s]):(o.components[s]||(o.components[s]={}),n.utils.extend(o.components[s],o[s]),delete o[s])),typeof o[s+"size"]!="undefined"&&(o.components[s]||(o.components[s]={}),o.components[s].size=o[s+"size"],delete o[s+"size"]);typeof o.icons!="undefined"&&(o.components.display||(o.components.display={}),o.components.display.icons=o.icons,delete o.icons);for(l in i)o[l]&&(o[i[l]]||(o[i[l]]=o[l]),delete o[l]);return o.flashplayer&&!o.modes?(h=t(),h[0].src=o.flashplayer,delete o.flashplayer):o.modes?(typeof o.modes=="string"?(h=t(),h[0].src=o.modes):o.modes instanceof Array?h=o.modes:typeof o.modes=="object"&&o.modes.type&&(h=[o.modes]),delete o.modes):h=t(),o.modes=h,p&&(o.playlist=p),o}}(jwplayer),function(n){n.embed.download=function(t,i,r,u,f){function e(t,i,r){var f,u;return r?!1:(f=["image","sound","youtube","http"],i&&f.toString().indexOf(i)>-1)?!0:(!i||i&&i=="video")&&(u=n.utils.extension(t),u&&n.utils.extensionmap[u])?!0:!1}this.embed=function(){function v(){_imageWidth=i.display_image.naturalWidth;_imageHeight=i.display_image.naturalHeight;y()}function y(){n.utils.stretch(n.utils.stretching.UNIFORM,i.display_image,o,e,_imageWidth,_imageHeight)}var w=n.utils.extend({},r),i={},o=r.width?r.width:480,e,s,h,c,u,a,l,p;typeof o!="number"&&(o=parseInt(o,10));e=r.height?r.height:320;typeof e!="number"&&(e=parseInt(e,10));u={};r.playlist&&r.playlist.length?(u.file=r.playlist[0].file,h=r.playlist[0].image,u.levels=r.playlist[0].levels):(u.file=r.file,h=r.image,u.levels=r.levels);u.file?s=u.file:u.levels&&u.levels.length&&(s=u.levels[0].file);c=s?"pointer":"auto";a={display:{style:{cursor:c,width:o,height:e,backgroundColor:"#000",position:"relative",textDecoration:"none",border:"none",display:"block"}},display_icon:{style:{cursor:c,position:"absolute",display:s?"block":"none",top:0,left:0,border:0,margin:0,padding:0,zIndex:3,width:50,height:50,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNrs18ENgjAYhmFouDOCcQJGcARHgE10BDcgTOIosAGwQOuPwaQeuFRi2p/3Sb6EC5L3QCxZBgAAAOCorLW1zMn65TrlkH4NcV7QNcUQt7Gn7KIhxA+qNIR81spOGkL8oFJDyLJRdosqKDDkK+iX5+d7huzwM40xptMQMkjIOeRGo+VkEVvIPfTGIpKASfYIfT9iCHkHrBEzf4gcUQ56aEzuGK/mw0rHpy4AAACAf3kJMACBxjAQNRckhwAAAABJRU5ErkJggg==)"}},display_iconBackground:{style:{cursor:c,position:"absolute",display:s?"block":"none",top:(e-50)/2,left:(o-50)/2,border:0,width:50,height:50,margin:0,padding:0,zIndex:2,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEpJREFUeNrszwENADAIA7DhX8ENoBMZ5KR10EryckCJiIiIiIiIiIiIiIiIiIiIiIh8GmkRERERERERERERERERERERERGRHSPAAPlXH1phYpYaAAAAAElFTkSuQmCC)"}},display_image:{style:{width:o,height:e,display:h?"block":"none",position:"absolute",cursor:c,left:0,top:0,margin:0,padding:0,textDecoration:"none",zIndex:1,border:"none"}}};l=function(i,r,u){var f=document.createElement(i);return f.id=u?u:t.id+"_jwplayer_"+r,n.utils.css(f,a[r].style),f};i.display=l("a","display",t.id);s&&i.display.setAttribute("href",n.utils.getAbsolutePath(s));i.display_image=l("img","display_image");i.display_image.setAttribute("alt","Click to download...");h&&i.display_image.setAttribute("src",n.utils.getAbsolutePath(h));!0&&(i.display_icon=l("div","display_icon"),i.display_iconBackground=l("div","display_iconBackground"),i.display.appendChild(i.display_image),i.display_iconBackground.appendChild(i.display_icon),i.display.appendChild(i.display_iconBackground));_css=n.utils.css;_hide=function(n){_css(n,{display:"none"})};i.display_image.onerror=function(){_hide(i.display_image)};i.display_image.onload=v;t.parentNode.replaceChild(i.display,t);p=r.plugins&&r.plugins.logo?r.plugins.logo:{};i.display.appendChild(new n.embed.logo(r.components.logo,"download",t.id));f.container=document.getElementById(f.id);f.setPlayer(i.display,"download")};this.supportsConfig=function(){var t,i;if(r){if(t=n.utils.getFirstPlaylistItemFromConfig(r),typeof t.file=="undefined"&&typeof t.levels=="undefined")return!0;if(t.file)return e(t.file,t.provider,t.playlistfile);if(t.levels&&t.levels.length)for(i=0;i<t.levels.length;i++)if(t.levels[i].file&&e(t.levels[i].file,t.provider,t.playlistfile))return!0}else return!0}}}(jwplayer),function(n){n.embed.flash=function(t,i,r,u,f){function e(n,t,i){var r=document.createElement("param");r.setAttribute("name",t);r.setAttribute("value",i);n.appendChild(r)}function h(t,i,r){return function(){var u,e;r&&document.getElementById(f.id+"_wrapper").appendChild(i);u=document.getElementById(f.id).getPluginConfig("display");t.resize(u.width,u.height);e={left:u.x,top:u.y};n.utils.css(i,e)}}function o(n,t){var f,i,r,u;if(n[t]){f=n[t];for(i in f)if(r=f[i],typeof r=="string")n[i]||(n[i]=r);else for(u in r)n[i+"."+u]||(n[i+"."+u]=r[u]);delete n[t]}}function c(t){var i,u,r,o,f,e;if(!t)return{};i={};u=[];for(r in t){o=n.utils.getPluginName(r);f=t[r];u.push(r);for(e in f)i[o+"."+e]=f[e]}return i.plugins=u.join(","),i}function s(t){var r=t.netstreambasepath?"":"netstreambasepath="+encodeURIComponent(window.location.href.split("#")[0])+"&";for(var i in t)r+=typeof t[i]=="object"?i+"="+encodeURIComponent("[[JSON]]"+n.utils.strings.jsonToString(t[i]))+"&":i+"="+encodeURIComponent(t[i])+"&";return r.substring(0,r.length-1)}this.embed=function(){var k,d,p,w,g,b,v,a;r.id=f.id;var y,l=n.utils.extend({},r),nt=l.width,tt=l.height;for(t.id+"_wrapper"==t.parentNode.id?y=document.getElementById(t.id+"_wrapper"):(y=document.createElement("div"),y.id=t.id+"_wrapper",n.utils.wrap(t,y),n.utils.css(y,{position:"relative",width:nt,height:tt})),k=u.setupPlugins(f,l,h),k.length>0?n.utils.extend(l,c(k.plugins)):delete l.plugins,d=["height","width","modes","events"],p=0;p<d.length;p++)delete l[d[p]];w="opaque";l.wmode&&(w=l.wmode);o(l,"components");o(l,"providers");typeof l["dock.position"]!="undefined"&&l["dock.position"].toString().toLowerCase()=="false"&&(l.dock=l["dock.position"],delete l["dock.position"]);g="#000000";n.utils.isIE()?(v='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" bgcolor="'+g+'" width="100%" height="100%" id="'+t.id+'" name="'+t.id+'" tabindex=0"">',v+='<param name="movie" value="'+i.src+'">',v+='<param name="allowfullscreen" value="true">',v+='<param name="allowscriptaccess" value="always">',v+='<param name="seamlesstabbing" value="true">',v+='<param name="wmode" value="'+w+'">',v+='<param name="flashvars" value="'+s(l)+'">',v+="<\/object>",n.utils.setOuterHTML(t,v),b=document.getElementById(t.id)):(a=document.createElement("object"),a.setAttribute("type","application/x-shockwave-flash"),a.setAttribute("data",i.src),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("bgcolor","#000000"),a.setAttribute("id",t.id),a.setAttribute("name",t.id),a.setAttribute("tabindex",0),e(a,"allowfullscreen","true"),e(a,"allowscriptaccess","always"),e(a,"seamlesstabbing","true"),e(a,"wmode",w),e(a,"flashvars",s(l)),t.parentNode.replaceChild(a,t),b=a);f.container=b;f.setPlayer(b,"flash")};this.supportsConfig=function(){var t,i;if(n.utils.hasFlash())if(r){if(t=n.utils.getFirstPlaylistItemFromConfig(r),typeof t.file=="undefined"&&typeof t.levels=="undefined")return!0;if(t.file)return flashCanPlay(t.file,t.provider);if(t.levels&&t.levels.length)for(i=0;i<t.levels.length;i++)if(t.levels[i].file&&flashCanPlay(t.levels[i].file,t.provider))return!0}else return!0;return!1};flashCanPlay=function(t,i){var r;return i&&["video","http","sound","image"].toString().indexOf(i<0)?!0:(r=n.utils.extension(t),!r)?!0:n.utils.exists(n.utils.extensionmap[r])&&!n.utils.exists(n.utils.extensionmap[r].flash)?!1:!0}}}(jwplayer),function(n){n.embed.html5=function(t,i,r,u,f){function e(n,i,r){return function(){var u=document.getElementById(t.id+"_displayarea");r&&u.appendChild(i);n.resize(u.clientWidth,u.clientHeight);i.left=u.style.left;i.top=u.style.top}}this.embed=function(){var i,s,o,h;if(n.html5){for(u.setupPlugins(f,r,e),t.innerHTML="",i=n.utils.extend({screencolor:"0x000000"},r),s=["plugins","modes","events"],o=0;o<s.length;o++)delete i[s[o]];i.levels&&!i.sources&&(i.sources=r.levels);i.skin&&i.skin.toLowerCase().indexOf(".zip")>0&&(i.skin=i.skin.replace(/\.zip/i,".xml"));h=new(n.html5(t).setup)(i);f.container=document.getElementById(f.id);f.setPlayer(h,"html5")}else return null};this.supportsConfig=function(){var t,i;if(!!n.vid.canPlayType)if(r){if(t=n.utils.getFirstPlaylistItemFromConfig(r),typeof t.file=="undefined"&&typeof t.levels=="undefined")return!0;if(t.file)return html5CanPlay(n.vid,t.file,t.provider,t.playlistfile);if(t.levels&&t.levels.length)for(i=0;i<t.levels.length;i++)if(t.levels[i].file&&html5CanPlay(n.vid,t.levels[i].file,t.provider,t.playlistfile))return!0}else return!0;return!1};html5CanPlay=function(t,i,r,u){if(u)return!1;if(r&&r=="youtube")return!0;if(r&&r!="video"&&r!="http"&&r!="sound")return!1;var f=n.utils.extension(i);return!n.utils.exists(f)||!n.utils.exists(n.utils.extensionmap[f])?!0:n.utils.exists(n.utils.extensionmap[f].html5)?n.utils.isLegacyAndroid()&&f.match(/m4v|mp4/)?!0:browserCanPlay(t,n.utils.extensionmap[f].html5):!1};browserCanPlay=function(n,t){return t?n.canPlayType(t)?!0:t=="audio/mp3"&&navigator.userAgent.match(/safari/i)?n.canPlayType("audio/mpeg"):!1:!0}}}(jwplayer),function(n){n.embed.logo=function(t,i,r){function s(){h();l();a()}function h(){if(e.prefix){var t=n.version.split(/\W/).splice(0,2).join("/");e.prefix.indexOf(t)<0&&(e.prefix+=t+"/")}u=n.utils.extend({},e)}function c(){var n={border:"none",textDecoration:"none",position:"absolute",cursor:"pointer",zIndex:10},t,i;n.display=u.hide?"none":"block";t=u.position.toLowerCase().split("-");for(i in t)n[t[i]]=u.margin;return n}function l(){(f=document.createElement("img"),f.id=r+"_jwplayer_logo",f.style.display="none",f.onload=function(){_css(f,c());o()},u.file)&&(f.src=u.file.indexOf("http://")===0?u.file:u.prefix+u.file)}function a(){u.link?(f.onmouseover=y,f.onmouseout=o,f.onclick=v):this.mouseEnabled=!1}function v(n){typeof n!="undefined"&&(n.preventDefault(),n.stopPropagation());u.link&&window.open(u.link,"_blank");return}function o(){u.link&&(f.style.opacity=u.out);return}function y(){u.hide&&(f.style.opacity=u.over);return}var e={prefix:"http://l.longtailvideo.com/"+i+"/",file:"logo.png",link:"http://www.longtailvideo.com/players/jw-flv-player/",margin:8,out:.5,over:1,timeout:5,hide:!1,position:"bottom-left"},f,u;if(_css=n.utils.css,s(),u.file)return f}}(jwplayer),function(n){n.html5=function(t){var i=t;return this.setup=function(t){return n.utils.extend(this,new n.html5.api(i,t)),this},this}}(jwplayer),function(n){var t=n.utils,i=t.css;n.html5.view=function(r,u,f){function rt(){function n(){return s.skin.getComponentSettings("display")&&s.skin.getComponentSettings("display").backgroundcolor?s.skin.getComponentSettings("display").backgroundcolor:parseInt("000000",16)}h=document.createElement("div");h.id=c.id;h.className=c.className;_videowrapper=document.createElement("div");_videowrapper.id=h.id+"_video_wrapper";c.id=h.id+"_video";i(h,{position:"relative",height:e.height,width:e.width,padding:0,backgroundColor:n(),zIndex:0});i(c,{width:"100%",height:"100%",top:0,left:0,zIndex:1,margin:"auto",display:"block"});i(_videowrapper,{overflow:"hidden",position:"absolute",top:0,left:0,bottom:0,right:0});t.wrap(c,h);t.wrap(c,_videowrapper);o=document.createElement("div");o.id=h.id+"_displayarea";h.appendChild(o)}function ut(){for(var n,i=0;i<e.plugins.order.length;i++)n=e.plugins.order[i],t.exists(e.plugins.object[n].getDisplayElement)&&(e.plugins.object[n].height=t.parseDimension(e.plugins.object[n].getDisplayElement().style.height),e.plugins.object[n].width=t.parseDimension(e.plugins.object[n].getDisplayElement().style.width),e.plugins.config[n].currentPosition=e.plugins.config[n].position);tt()}function ft(t){i(o,{display:e.getMedia()&&e.getMedia().hasChrome()&&t.newstate!=n.api.events.state.IDLE?"none":"block"})}function tt(){var n=e.getMedia()?e.getMedia().getDisplayElement():null,i,r;if(t.exists(n))for(v!=n&&(v&&v.parentNode&&v.parentNode.replaceChild(n,v),v=n),i=0;i<e.plugins.order.length;i++)r=e.plugins.order[i],t.exists(e.plugins.object[r].getDisplayElement)&&(e.plugins.config[r].currentPosition=e.plugins.config[r].position);y(e.width,e.height)}function et(t){switch(t.keyCode){case 27:s.jwGetFullscreen()&&s.jwSetFullscreen(!1);break;case 32:s.jwGetState()!=n.api.events.state.IDLE&&s.jwGetState()!=n.api.events.state.PAUSED?s.jwPause():s.jwPlay()}}function y(n,r){var f,u,s,c;if(h.style.display!="none"){if(f=[].concat(e.plugins.order),f.reverse(),b=f.length+2,w())try{e.fullscreen&&!e.getMedia().getDisplayElement().webkitDisplayingFullscreen&&(e.fullscreen=!1)}catch(v){}e.fullscreen?w()||k(ht,f,!0):(l=n,a=r,l=typeof n=="string"&&n.indexOf("%")>0?t.getElementWidth(t.parentNode(h))*parseInt(n.replace("%"),"")/100:n,a=typeof r=="string"&&r.indexOf("%")>0?t.getElementHeight(t.parentNode(h))*parseInt(r.replace("%"),"")/100:r,i(o,{top:0,bottom:0,left:0,right:0,width:l,height:a,position:"absolute"}),i(h,{height:a,width:l}),u=k(ot,f),u.length>0&&(b+=u.length,s=u.indexOf("playlist"),c=u.indexOf("controlbar"),s>=0&&c>=0&&(u[s]=u.splice(c,1,u[s])[0]),k(st,u,!0)),g=t.getElementWidth(o),nt=t.getElementHeight(o));d()}}function k(r,u,f){for(var o,s,l,a,c=[],h=0;h<u.length;h++)o=u[h],t.exists(e.plugins.object[o].getDisplayElement)&&(e.plugins.config[o].currentPosition!=n.html5.view.positions.NONE?(s=r(o,b--),s?(l=s.width,a=s.height,f&&(delete s.width,delete s.height),i(e.plugins.object[o].getDisplayElement(),s),e.plugins.object[o].resize(l,a)):c.push(o)):i(e.plugins.object[o].getDisplayElement(),{display:"none"}));return c}function ot(n,i){if(t.exists(e.plugins.object[n].getDisplayElement)&&e.plugins.config[n].position&&lt(e.plugins.config[n].position)){t.exists(e.plugins.object[n].getDisplayElement().parentNode)||h.appendChild(e.plugins.object[n].getDisplayElement());var r=ct(n);return r.zIndex=i,r}return!1}function st(n,i){return t.exists(e.plugins.object[n].getDisplayElement().parentNode)||o.appendChild(e.plugins.object[n].getDisplayElement()),{position:"absolute",width:t.getElementWidth(o)-t.parseDimension(o.style.left)-t.parseDimension(o.style.right),height:t.getElementHeight(o)-t.parseDimension(o.style.top)-t.parseDimension(o.style.bottom),zIndex:i}}function ht(n,t){return{position:"fixed",width:e.width,height:e.height,zIndex:t}}function d(){var r,u,f;t.exists(e.getMedia())&&(o.style.position="absolute",r=e.getMedia().getDisplayElement(),r&&r.tagName.toLowerCase()=="video"?(r.style.position="absolute",r.parentNode&&(r.parentNode.style.left=o.style.left,r.parentNode.style.top=o.style.top),e.fullscreen&&s.jwGetStretching()==n.utils.stretching.EXACTFIT&&!t.isMobile()?(u=document.createElement("div"),t.stretch(n.utils.stretching.UNIFORM,u,t.getElementWidth(o),t.getElementHeight(o),g,nt),t.stretch(n.utils.stretching.EXACTFIT,r,t.parseDimension(u.style.width),t.parseDimension(u.style.height),r.videoWidth?r.videoWidth:400,r.videoHeight?r.videoHeight:300),i(r,{left:u.style.left,top:u.style.top})):t.stretch(s.jwGetStretching(),r,t.getElementWidth(o),t.getElementHeight(o),r.videoWidth?r.videoWidth:400,r.videoHeight?r.videoHeight:300)):(f=e.plugins.object.display.getDisplayElement(),f?e.getMedia().resize(t.parseDimension(f.style.width),t.parseDimension(f.style.height)):e.getMedia().resize(t.parseDimension(o.style.width),t.parseDimension(o.style.height))))}function ct(i){var r={position:"absolute",margin:0,padding:0,top:null},u=e.plugins.config[i].currentPosition.toLowerCase();switch(u.toUpperCase()){case n.html5.view.positions.TOP:r.top=t.parseDimension(o.style.top);r.left=t.parseDimension(o.style.left);r.width=t.getElementWidth(o)-t.parseDimension(o.style.left)-t.parseDimension(o.style.right);r.height=e.plugins.object[i].height;o.style[u]=t.parseDimension(o.style[u])+e.plugins.object[i].height+"px";o.style.height=t.getElementHeight(o)-r.height+"px";break;case n.html5.view.positions.RIGHT:r.top=t.parseDimension(o.style.top);r.right=t.parseDimension(o.style.right);r.width=e.plugins.object[i].width;r.height=t.getElementHeight(o)-t.parseDimension(o.style.top)-t.parseDimension(o.style.bottom);o.style.width=t.getElementWidth(o)-r.width+"px";break;case n.html5.view.positions.BOTTOM:r.bottom=t.parseDimension(o.style.bottom);r.left=t.parseDimension(o.style.left);r.width=t.getElementWidth(o)-t.parseDimension(o.style.left)-t.parseDimension(o.style.right);r.height=e.plugins.object[i].height;o.style.height=t.getElementHeight(o)-r.height+"px";break;case n.html5.view.positions.LEFT:r.top=t.parseDimension(o.style.top);r.left=t.parseDimension(o.style.left);r.width=e.plugins.object[i].width;r.height=t.getElementHeight(o)-t.parseDimension(o.style.top)-t.parseDimension(o.style.bottom);o.style[u]=t.parseDimension(o.style[u])+e.plugins.object[i].width+"px";o.style.width=t.getElementWidth(o)-r.width+"px"}return r}function lt(t){return[n.html5.view.positions.TOP,n.html5.view.positions.RIGHT,n.html5.view.positions.BOTTOM,n.html5.view.positions.LEFT].toString().indexOf(t.toUpperCase())>-1}function w(){return s.jwGetState()!=n.api.events.state.IDLE&&!p&&e.getMedia()&&e.getMedia().getDisplayElement()&&e.getMedia().getDisplayElement().webkitSupportsFullscreen&&t.useNativeFullscreen()?!0:!1}var s=r,c=u,e=f,h,l,a,o,b,it,v,p=!1,g,nt;this.setup=function(){e&&e.getMedia()&&(c=e.getMedia().getDisplayElement());rt();ut();s.jwAddEventListener(n.api.events.JWPLAYER_PLAYER_STATE,ft);s.jwAddEventListener(n.api.events.JWPLAYER_MEDIA_LOADED,tt);s.jwAddEventListener(n.api.events.JWPLAYER_MEDIA_META,function(){d()});var i;t.exists(window.onresize)&&(i=window.onresize);window.onresize=function(n){if(t.exists(i))try{i(n)}catch(u){}if(s.jwGetFullscreen()){if(!w()){var r=t.getBoundingClientRect(document.body);e.width=Math.abs(r.left)+Math.abs(r.right);e.height=window.innerHeight;y(e.width,e.height)}}else y(e.width,e.height)}};this.resize=y;this.fullscreen=function(n){var r,f,u;try{r=e.getMedia().getDisplayElement()}catch(s){}if(w()&&r&&r.webkitSupportsFullscreen){if(n&&!r.webkitDisplayingFullscreen)try{t.transform(r);r.webkitEnterFullscreen()}catch(c){}else if(!n&&(d(),r.webkitDisplayingFullscreen))try{r.webkitExitFullscreen()}catch(c){}p=!1}else n?(document.onkeydown=et,clearInterval(it),f=t.getBoundingClientRect(document.body),e.width=Math.abs(f.left)+Math.abs(f.right),e.height=window.innerHeight,u={position:"fixed",width:"100%",height:"100%",top:0,left:0,zIndex:2147483e3},i(h,u),u.zIndex=1,e.getMedia()&&e.getMedia().getDisplayElement()&&i(e.getMedia().getDisplayElement(),u),u.zIndex=2,i(o,u),p=!0):(document.onkeydown="",e.width=l,e.height=a,i(h,{position:"relative",height:e.height,width:e.width,zIndex:0}),p=!1),y(e.width,e.height)}};n.html5.view.positions={TOP:"TOP",RIGHT:"RIGHT",BOTTOM:"BOTTOM",LEFT:"LEFT",OVER:"OVER",NONE:"NONE"}}(jwplayer),function(n){var t={backgroundcolor:"",margin:10,font:"Arial,sans-serif",fontsize:10,fontcolor:parseInt("000000",16),fontstyle:"normal",fontweight:"bold",buttoncolor:parseInt("ffffff",16),position:n.html5.view.positions.BOTTOM,idlehide:!1,hideplaylistcontrols:!1,layout:{left:{position:"left",elements:[{name:"play",type:"button"},{name:"divider",type:"divider"},{name:"prev",type:"button"},{name:"divider",type:"divider"},{name:"next",type:"button"},{name:"divider",type:"divider"},{name:"elapsed",type:"text"}]},center:{position:"center",elements:[{name:"time",type:"slider"}]},right:{position:"right",elements:[{name:"duration",type:"text"},{name:"blank",type:"button"},{name:"divider",type:"divider"},{name:"mute",type:"button"},{name:"volume",type:"slider"},{name:"divider",type:"divider"},{name:"fullscreen",type:"button"}]}}};_utils=n.utils;_css=_utils.css;_hide=function(n){_css(n,{display:"none"})};_show=function(n){_css(n,{display:"block"})};n.html5.controlbar=function(i,r){function c(){return d||(d=u.skin.getSkinElement("controlbar","background"),d||(d={width:0,height:0,src:null})),d}function hi(){var t,n,i;lt=0;at=0;ct=0;p||(t={height:c().height,backgroundColor:e.backgroundcolor},o=document.createElement("div"),o.id=u.id+"_jwplayer_controlbar",_css(o,t));n=u.skin.getSkinElement("controlbar","capLeft");i=u.skin.getSkinElement("controlbar","capRight");n&&s("capLeft","left",!1,o);w("background",o,{position:"absolute",height:c().height,left:n?n.width:0,zIndex:0},"img");c().src&&(f.background.src=c().src);w("elements",o,{position:"relative",height:c().height,zIndex:1});i&&s("capRight","right",!1,o)}function kt(){var t=["timeSlider","volumeSlider","timeSliderRail","volumeSliderRail"],i,n;for(i in t)n=t[i],typeof f[n]!="undefined"&&(l[n]=_utils.getBoundingClientRect(f[n]))}function dt(t){if(!v)if(clearTimeout(rt),e.position==n.html5.view.positions.OVER||u.jwGetFullscreen())switch(u.jwGetState()){case n.api.events.state.PAUSED:case n.api.events.state.IDLE:o&&o.style.opacity<1&&(!e.idlehide||_utils.exists(t))&&(et=!1,setTimeout(function(){et||ot()},100));e.idlehide&&(rt=setTimeout(function(){gt()},2e3));break;default:et=!0;t&&ot();rt=setTimeout(function(){gt()},2e3)}else ot()}function gt(){v||(st(),o.style.opacity==1&&(_utils.cancelAnimation(o),_utils.fadeTo(o,0,.1,1,0)))}function ot(){v||(tt(),o.style.opacity==0&&(_utils.cancelAnimation(o),_utils.fadeTo(o,1,.1,0,0)))}function ni(n){return function(){ft&&ut!=n&&(ut=n,bt.sendEvent(n,{component:"controlbar",boundingRect:ci()}))}}function ci(){return e.position==n.html5.view.positions.OVER||u.jwGetFullscreen()?_utils.getDimensions(o):{x:0,y:0,width:0,height:0}}function w(n,t,i,r){var u;return p?u=document.getElementById(o.id+"_"+n):(r||(r="div"),u=document.createElement(r),f[n]=u,u.id=o.id+"_"+n,t.appendChild(u)),_utils.exists(i)&&_css(u,i),u}function li(){if(u.jwGetHeight()<=40){e.layout=_utils.clone(e.layout);for(var n=0;n<e.layout.left.elements.length;n++)e.layout.left.elements[n].name=="fullscreen"&&e.layout.left.elements.splice(n,1);for(n=0;n<e.layout.right.elements.length;n++)e.layout.right.elements[n].name=="fullscreen"&&e.layout.right.elements.splice(n,1);fi()}ht(e.layout.left);ht(e.layout.center);ht(e.layout.right)}function ht(n,t){var u=n.position=="right"?"right":"left",r=_utils.extend([],n.elements),n,i;for(_utils.exists(t)&&r.reverse(),n=w(n.position+"Group",f.elements,{float:"left",styleFloat:"left",cssFloat:"left",height:"100%"}),i=0;i<r.length;i++)vi(r[i],u,n)}function ai(){return ct++}function vi(n,t,i){var v,o,h,y,l,r,e;if(i||(i=f.elements),n.type=="divider"){s("divider"+ai(),t,!0,i,undefined,n.width,n.element);return}switch(n.name){case"play":s("playButton",t,!1,i);s("pauseButton",t,!0,i);a("playButton","jwPlay");a("pauseButton","jwPause");break;case"prev":s("prevButton",t,!0,i);a("prevButton","jwPlaylistPrev");break;case"stop":s("stopButton",t,!0,i);a("stopButton","jwStop");break;case"next":s("nextButton",t,!0,i);a("nextButton","jwPlaylistNext");break;case"elapsed":s("elapsedText",t,!0,i);break;case"time":o=_utils.exists(u.skin.getSkinElement("controlbar","timeSliderCapLeft"))?u.skin.getSkinElement("controlbar","timeSliderCapLeft").width:0;h=_utils.exists(u.skin.getSkinElement("controlbar","timeSliderCapRight"))?u.skin.getSkinElement("controlbar","timeSliderCapRight").width:0;v=t=="left"?o:h;l={height:c().height,position:"relative",float:"left",styleFloat:"left",cssFloat:"left"};r=w("timeSlider",i,l);s("timeSliderCapLeft",t,!0,r,"relative");s("timeSliderRail",t,!1,r,"relative");s("timeSliderBuffer",t,!1,r,"absolute");s("timeSliderProgress",t,!1,r,"absolute");s("timeSliderThumb",t,!1,r,"absolute");s("timeSliderCapRight",t,!0,r,"relative");ii("time");break;case"fullscreen":s("fullscreenButton",t,!1,i);s("normalscreenButton",t,!0,i);a("fullscreenButton","jwSetFullscreen",!0);a("normalscreenButton","jwSetFullscreen",!1);break;case"volume":o=_utils.exists(u.skin.getSkinElement("controlbar","volumeSliderCapLeft"))?u.skin.getSkinElement("controlbar","volumeSliderCapLeft").width:0;h=_utils.exists(u.skin.getSkinElement("controlbar","volumeSliderCapRight"))?u.skin.getSkinElement("controlbar","volumeSliderCapRight").width:0;v=t=="left"?o:h;y=u.skin.getSkinElement("controlbar","volumeSliderRail").width+o+h;l={height:c().height,position:"relative",width:y,float:"left",styleFloat:"left",cssFloat:"left"};e=w("volumeSlider",i,l);s("volumeSliderCapLeft",t,!1,e,"relative");s("volumeSliderRail",t,!1,e,"relative");s("volumeSliderProgress",t,!1,e,"absolute");s("volumeSliderThumb",t,!1,e,"absolute");s("volumeSliderCapRight",t,!1,e,"relative");ii("volume");break;case"mute":s("muteButton",t,!1,i);s("unmuteButton",t,!0,i);a("muteButton","jwSetMute",!0);a("unmuteButton","jwSetMute",!1);break;case"duration":s("durationText",t,!0,i)}}function s(n,t,i,r,o,s,h){var l,a,y,v;(_utils.exists(u.skin.getSkinElement("controlbar",n))||n.indexOf("Text")>0||n.indexOf("divider")===0)&&(l={height:"100%",position:o?o:"relative",display:"block",float:"left",styleFloat:"left",cssFloat:"left"},(n.indexOf("next")===0||n.indexOf("prev")===0)&&(u.jwGetPlaylist().length<2||e.hideplaylistcontrols)&&(i=!1,l.display="none"),n.indexOf("Text")>0?(n.innerhtml="00:00",l.font=e.fontsize+"px/"+(c().height+1)+"px "+e.font,l.color=e.fontcolor,l.textAlign="center",l.fontWeight=e.fontweight,l.fontStyle=e.fontstyle,l.cursor="default",a=14+3*e.fontsize):n.indexOf("divider")===0?s?isNaN(parseInt(s))||(a=parseInt(s)):h?(y=u.skin.getSkinElement("controlbar",h),y&&(l.background="url("+y.src+") repeat-x center left",a=y.width)):(l.background="url("+u.skin.getSkinElement("controlbar","divider").src+") repeat-x center left",a=u.skin.getSkinElement("controlbar","divider").width):(l.background="url("+u.skin.getSkinElement("controlbar",n).src+") repeat-x center left",a=u.skin.getSkinElement("controlbar",n).width),t=="left"?i&&(lt+=a):t=="right"&&i&&(at+=a),_utils.typeOf(r)=="undefined"&&(r=f.elements),l.width=a,p?_css(f[n],l):(v=w(n,r,l),_utils.exists(u.skin.getSkinElement("controlbar",n+"Over"))&&(v.onmouseover=function(){v.style.backgroundImage=["url(",u.skin.getSkinElement("controlbar",n+"Over").src,")"].join("")},v.onmouseout=function(){v.style.backgroundImage=["url(",u.skin.getSkinElement("controlbar",n).src,")"].join("")}),n.indexOf("divider")==0&&v.setAttribute("class","divider")))}function yi(){u.jwAddEventListener(n.api.events.JWPLAYER_PLAYLIST_LOADED,pi);u.jwAddEventListener(n.api.events.JWPLAYER_PLAYLIST_ITEM,wi);u.jwAddEventListener(n.api.events.JWPLAYER_MEDIA_BUFFER,g);u.jwAddEventListener(n.api.events.JWPLAYER_PLAYER_STATE,ui);u.jwAddEventListener(n.api.events.JWPLAYER_MEDIA_TIME,b);u.jwAddEventListener(n.api.events.JWPLAYER_MEDIA_MUTE,ri);u.jwAddEventListener(n.api.events.JWPLAYER_MEDIA_VOLUME,oi);u.jwAddEventListener(n.api.events.JWPLAYER_MEDIA_COMPLETE,ki)}function pi(){e.hideplaylistcontrols||(u.jwGetPlaylist().length>1?(_show(f.nextButton),_show(f.prevButton)):(_hide(f.nextButton),_hide(f.prevButton)),ei(),ti())}function wi(n){h=u.jwGetPlaylist()[n.index].duration;b({id:u.id,duration:h,position:0});g({id:u.id,bufferProgress:0})}function ti(){b({id:u.id,duration:u.jwGetDuration(),position:0});g({id:u.id,bufferProgress:0});ri({id:u.id,mute:u.jwGetMute()});ui({id:u.id,newstate:n.api.events.state.IDLE});oi({id:u.id,volume:u.jwGetVolume()})}function a(n,t,i){if(!p&&_utils.exists(u.skin.getSkinElement("controlbar",n))){var r=f[n];_utils.exists(r)&&(_css(r,{cursor:"pointer"}),r.onmouseup=t=="fullscreen"?function(n){n.stopPropagation();u.jwSetFullscreen(!u.jwGetFullscreen())}:function(n){n.stopPropagation();_utils.exists(i)?u[t](i):u[t]()})}}function ii(n){if(!p){var t=f[n+"Slider"];_css(f.elements,{cursor:"pointer"});_css(t,{cursor:"pointer"});t.onmousedown=function(){y=n};t.onmouseup=function(n){n.stopPropagation();bi(n.pageX)};t.onmousemove=function(t){if(y=="time"){it=!0;var i=t.pageX-l[n+"Slider"].left-window.pageXOffset;_css(f[y+"SliderThumb"],{left:i})}}}}function bi(t){var f,i,r;it=!1;y=="time"?(f=t-l.timeSliderRail.left+window.pageXOffset,i=f/l.timeSliderRail.width*h,i<0?i=0:i>h&&(i=h-3),(u.jwGetState()==n.api.events.state.PAUSED||u.jwGetState()==n.api.events.state.IDLE)&&u.jwPlay(),u.jwSeek(i)):y=="volume"&&(f=t-l.volumeSliderRail.left-window.pageXOffset,r=Math.round(f/l.volumeSliderRail.width*100),r<0?r=0:r>100&&(r=100),u.jwGetMute()&&u.jwSetMute(!1),u.jwSetVolume(r));y="none"}function g(n){if(_utils.exists(n.bufferPercent)&&(nt=n.bufferPercent),l.timeSliderRail){var t=u.skin.getSkinElement("controlbar","timeSliderCapLeft"),i=l.timeSliderRail.width,r=isNaN(Math.round(i*nt/100))?0:Math.round(i*nt/100);_css(f.timeSliderBuffer,{width:r,left:t?t.width:0})}}function ri(n){n.mute?(_hide(f.muteButton),_show(f.unmuteButton),_hide(f.volumeSliderProgress)):(_show(f.muteButton),_hide(f.unmuteButton),_show(f.volumeSliderProgress))}function ui(t){t.newstate==n.api.events.state.BUFFERING||t.newstate==n.api.events.state.PLAYING?(_show(f.pauseButton),_hide(f.playButton)):(_hide(f.pauseButton),_show(f.playButton));dt();t.newstate==n.api.events.state.IDLE?(_hide(f.timeSliderBuffer),_hide(f.timeSliderProgress),_hide(f.timeSliderThumb),b({id:u.id,duration:u.jwGetDuration(),position:0})):(_show(f.timeSliderBuffer),t.newstate!=n.api.events.state.BUFFERING&&(_show(f.timeSliderProgress),_show(f.timeSliderThumb)))}function ki(n){g({bufferPercent:0});b(_utils.extend(n,{position:0,duration:h}))}function b(n){var r,t;if(_utils.exists(n.position)&&(k=n.position),_utils.exists(n.duration)&&(h=n.duration),r=k/h,t=l.timeSliderRail,t){var e=isNaN(Math.round(t.width*r))?0:Math.round(t.width*r),i=u.skin.getSkinElement("controlbar","timeSliderCapLeft"),o=e+(i?i.width:0);f.timeSliderProgress&&(_css(f.timeSliderProgress,{width:e,left:i?i.width:0}),it||f.timeSliderThumb&&(f.timeSliderThumb.style.left=o+"px"))}f.durationText&&(f.durationText.innerHTML=_utils.timeFormat(h));f.elapsedText&&(f.elapsedText.innerHTML=_utils.timeFormat(k))}function fi(){for(var n,t,e=f.elements.childNodes,r,i,u=0;u<e.length;u++){n=e[u].childNodes;for(t in n)isNaN(parseInt(t,10))||(n[t].id.indexOf(o.id+"_divider")===0&&i&&i.id.indexOf(o.id+"_divider")===0&&n[t].style.backgroundImage==i.style.backgroundImage?n[t].style.display="none":n[t].id.indexOf(o.id+"_divider")===0&&r&&r.style.display!="none"&&(n[t].style.display="block"),n[t].style.display!="none"&&(i=n[t]),r=n[t])}}function di(){u.jwGetFullscreen()?(_show(f.normalscreenButton),_hide(f.fullscreenButton)):(_hide(f.normalscreenButton),_show(f.fullscreenButton));u.jwGetState()==n.api.events.state.BUFFERING||u.jwGetState()==n.api.events.state.PLAYING?(_show(f.pauseButton),_hide(f.playButton)):(_hide(f.pauseButton),_show(f.playButton));u.jwGetMute()==!0?(_hide(f.muteButton),_show(f.unmuteButton)):(_show(f.muteButton),_hide(f.unmuteButton))}function ei(){var t,i,r,s;fi();di();t={width:vt};i={float:"left",styleFloat:"left",cssFloat:"left"};(e.position==n.html5.view.positions.OVER||u.jwGetFullscreen())&&(t.left=e.margin,t.width-=2*e.margin,t.top=yt-c().height-e.margin,t.height=c().height);r=u.skin.getSkinElement("controlbar","capLeft");s=u.skin.getSkinElement("controlbar","capRight");i.width=t.width-(r?r.width:0)-(s?s.width:0);var y=_utils.getBoundingClientRect(f.leftGroup).width,p=_utils.getBoundingClientRect(f.rightGroup).width,l=i.width-y-p,h=l,a=u.skin.getSkinElement("controlbar","timeSliderCapLeft"),v=u.skin.getSkinElement("controlbar","timeSliderCapRight");return _utils.exists(a)&&(h-=a.width),_utils.exists(v)&&(h-=v.width),f.timeSlider.style.width=l+"px",f.timeSliderRail.style.width=h+"px",_css(o,t),_css(f.elements,i),_css(f.background,i),kt(),t}function oi(n){var t;if(_utils.exists(f.volumeSliderRail)){var r=isNaN(n.volume/100)?1:n.volume/100,i=_utils.parseDimension(f.volumeSliderRail.style.width),e=isNaN(Math.round(i*r))?0:Math.round(i*r),s=_utils.parseDimension(f.volumeSliderRail.style.right),o=_utils.exists(u.skin.getSkinElement("controlbar","volumeSliderCapLeft"))?u.skin.getSkinElement("controlbar","volumeSliderCapLeft").width:0;_css(f.volumeSliderProgress,{width:e,left:o});f.volumeSliderThumb&&(t=e-Math.round(_utils.parseDimension(f.volumeSliderThumb.style.width)/2),t=Math.min(Math.max(t,0),i-_utils.parseDimension(f.volumeSliderThumb.style.width)),_css(f.volumeSliderThumb,{left:t}));_utils.exists(f.volumeSliderCapLeft)&&_css(f.volumeSliderCapLeft,{left:0})}}function si(){wt=document.getElementById(u.id);wt.addEventListener("mousemove",dt)}function gi(){hi();li();kt();p=!0;yi();e.idlehide=e.idlehide.toString().toLowerCase()=="true";e.position==n.html5.view.positions.OVER&&e.idlehide?(o.style.opacity=0,ft=!0):(o.style.opacity=1,setTimeout(function(){ft=!0;tt()},1));si();ti()}var u,e,et,tt,st;if(window.controlbar=this,u=i,e=_utils.extend({},t,u.skin.getComponentSettings("controlbar"),r),e.position!=n.html5.view.positions.NONE&&typeof n.html5.view.positions[e.position]!="undefined"){_utils.mapLength(u.skin.getComponentLayout("controlbar"))>0&&(e.layout=u.skin.getComponentLayout("controlbar"));var o,ct,lt,at,y="none",it,k,h,nt,vt,yt,f={},p=!1,l={},d,v=!1,rt,ut,ft=!1,pt=!1,wt,bt=new n.html5.eventdispatcher;return _utils.extend(this,bt),this.getDisplayElement=function(){return o},this.resize=function(n,t){si();_utils.cancelAnimation(o);vt=n;yt=t;pt!=u.jwGetFullscreen()&&(pt=u.jwGetFullscreen(),ut=undefined);var i=ei();return b({id:u.id,duration:h,position:k}),g({id:u.id,bufferPercent:nt}),i},this.show=function(){v&&(v=!1,_show(o),tt())},this.hide=function(){v||(v=!0,_hide(o),st())},tt=ni(n.api.events.JWPLAYER_COMPONENT_SHOW),st=ni(n.api.events.JWPLAYER_COMPONENT_HIDE),gi(),this}}}(jwplayer),function(n){var t=n.utils;n.html5.controller=function(r,u,f,e){function et(n){y?s.sendEvent(n.type,n):p.push(n)}function ot(t){var i,r;if(!y){for(y=!0,s.sendEvent(n.api.events.JWPLAYER_READY,t),n.utils.exists(window.playerReady)&&playerReady(t),n.utils.exists(window[f.config.playerReady])&&window[f.config.playerReady](t);p.length>0;)i=p.shift(),s.sendEvent(i.type,i);for(f.config.autostart&&!n.utils.isIOS()&&it();w.length>0;)r=w.shift(),rt(r.method,r.arguments)}}function l(){try{return h(o.item),o.playlist[o.item].levels[0].file.length>0&&(k||o.state==n.api.events.state.IDLE?(o.getMedia().load(o.playlist[o.item]),k=!1):o.state==n.api.events.state.PAUSED&&o.getMedia().play()),!0}catch(t){s.sendEvent(n.api.events.JWPLAYER_ERROR,t)}return!1}function st(){try{if(o.playlist[o.item].levels[0].file.length>0)switch(o.state){case n.api.events.state.PLAYING:case n.api.events.state.BUFFERING:o.getMedia()&&o.getMedia().pause()}return!0}catch(t){s.sendEvent(n.api.events.JWPLAYER_ERROR,t)}return!1}function ht(t){try{if(o.playlist[o.item].levels[0].file.length>0){typeof t!="number"&&(t=parseFloat(t));switch(o.state){case n.api.events.state.IDLE:v<0&&(v=o.playlist[o.item].start,o.playlist[o.item].start=t);l();break;case n.api.events.state.PLAYING:case n.api.events.state.PAUSED:case n.api.events.state.BUFFERING:o.seek(t)}}return!0}catch(i){s.sendEvent(n.api.events.JWPLAYER_ERROR,i)}return!1}function a(i){t.exists(i)||(i=!0);try{return o.getMedia()&&o.getMedia().stop(i),!0}catch(r){s.sendEvent(n.api.events.JWPLAYER_ERROR,r)}return!1}function d(){try{if(o.playlist[o.item].levels[0].file.length>0&&(o.config.shuffle?h(g()):o.item+1==o.playlist.length?h(0):h(o.item+1)),o.state!=n.api.events.state.IDLE){var t=o.state;o.state=n.api.events.state.IDLE;s.sendEvent(n.api.events.JWPLAYER_PLAYER_STATE,{oldstate:t,newstate:n.api.events.state.IDLE})}return l(),!0}catch(i){s.sendEvent(n.api.events.JWPLAYER_ERROR,i)}return!1}function ct(){try{if(o.playlist[o.item].levels[0].file.length>0&&(o.config.shuffle?h(g()):o.item===0?h(o.playlist.length-1):h(o.item-1)),o.state!=n.api.events.state.IDLE){var t=o.state;o.state=n.api.events.state.IDLE;s.sendEvent(n.api.events.JWPLAYER_PLAYER_STATE,{oldstate:t,newstate:n.api.events.state.IDLE})}return l(),!0}catch(i){s.sendEvent(n.api.events.JWPLAYER_ERROR,i)}return!1}function g(){var n=null;if(o.playlist.length>1)while(!t.exists(n))n=Math.floor(Math.random()*o.playlist.length),n==o.item&&(n=null);else n=0;return n}function nt(t){if(!o.playlist||!o.playlist[t])return!1;try{if(o.playlist[t].levels[0].file.length>0){var i=o.state;i!==n.api.events.state.IDLE&&(o.playlist[o.item].provider==o.playlist[t].provider?a(!1):a());h(t);l()}return!0}catch(r){s.sendEvent(n.api.events.JWPLAYER_ERROR,r)}return!1}function h(t){o.playlist[t]&&(o.setActiveMediaProvider(o.playlist[t]),o.item!=t&&(o.item=t,k=!0,s.sendEvent(n.api.events.JWPLAYER_PLAYLIST_ITEM,{index:t})))}function lt(t){try{h(o.item);var i=o.getMedia();switch(typeof t){case"number":i.volume(t);break;case"string":i.volume(parseInt(t,10))}return!0}catch(r){s.sendEvent(n.api.events.JWPLAYER_ERROR,r)}return!1}function at(t){try{h(o.item);var i=o.getMedia();return typeof t=="undefined"?i.mute(!o.mute):t.toString().toLowerCase()=="true"?i.mute(!0):i.mute(!1),!0}catch(r){s.sendEvent(n.api.events.JWPLAYER_ERROR,r)}return!1}function vt(t,i){try{return o.width=t,o.height=i,b.resize(t,i),s.sendEvent(n.api.events.JWPLAYER_RESIZE,{width:o.width,height:o.height}),!0}catch(r){s.sendEvent(n.api.events.JWPLAYER_ERROR,r)}return!1}function tt(t){try{return typeof t=="undefined"&&(t=!o.fullscreen),t!=o.fullscreen&&(t.toString().toLowerCase()=="true"?(o.fullscreen=!0,b.fullscreen(!0),s.sendEvent(n.api.events.JWPLAYER_FULLSCREEN,{fullscreen:!0})):(o.fullscreen=!1,b.fullscreen(!1),s.sendEvent(n.api.events.JWPLAYER_FULLSCREEN,{fullscreen:!1})),s.sendEvent(n.api.events.JWPLAYER_RESIZE,{width:o.width,height:o.height})),!0}catch(i){s.sendEvent(n.api.events.JWPLAYER_ERROR,i)}return!1}function yt(t){try{return a(),o.loadPlaylist(t),o.playlist[o.item].provider?(h(o.item),o.config.autostart.toString().toLowerCase()=="true"&&l(),!0):!1}catch(i){s.sendEvent(n.api.events.JWPLAYER_ERROR,i)}return!1}function it(){h(o.playlist[o.item]);o.config.autostart.toString().toLowerCase()=="true"&&l()}function pt(n){tt(n.fullscreen)}function wt(){try{return o.getMedia().detachMedia()}catch(n){return null}}function bt(){try{return o.getMedia().attachMedia()}catch(n){return null}}function kt(){switch(o.config.repeat.toUpperCase()){case n.html5.controller.repeatoptions.SINGLE:l();break;case n.html5.controller.repeatoptions.ALWAYS:o.item!=o.playlist.length-1||o.config.shuffle?d():nt(0);break;case n.html5.controller.repeatoptions.LIST:o.item!=o.playlist.length-1||o.config.shuffle?d():(a(),h(0));break;default:a()}}function c(n){return function(){y?rt(n,arguments):w.push({method:n,arguments:arguments})}}function rt(n,t){var r=[];for(i=0;i<t.length;i++)r.push(t[i]);n.apply(this,r)}var dt=r,o=f,b=e,ut=u,k=!0,v=-1,ft=t.exists(o.config.debug)&&o.config.debug.toString().toLowerCase()=="console",s=new n.html5.eventdispatcher(ut.id,ft),p,y,w;t.extend(this,s);p=[];y=!1;o.addGlobalListener(et);o.addEventListener(n.api.events.JWPLAYER_MEDIA_BUFFER_FULL,function(){o.getMedia().play()});o.addEventListener(n.api.events.JWPLAYER_MEDIA_TIME,function(n){n.position>=o.playlist[o.item].start&&v>=0&&(o.playlist[o.item].start=v,v=-1)});o.addEventListener(n.api.events.JWPLAYER_MEDIA_COMPLETE,function(){setTimeout(kt,25)});o.addEventListener(n.api.events.JWPLAYER_PLAYLIST_LOADED,it);o.addEventListener(n.api.events.JWPLAYER_FULLSCREEN,pt);n.html5.controller.repeatoptions={LIST:"LIST",ALWAYS:"ALWAYS",SINGLE:"SINGLE",NONE:"NONE"};w=[];this.play=c(l);this.pause=c(st);this.seek=c(ht);this.stop=c(a);this.next=c(d);this.prev=c(ct);this.item=c(nt);this.setVolume=c(lt);this.setMute=c(at);this.resize=c(vt);this.setFullscreen=c(tt);this.load=c(yt);this.playerReady=ot;this.detachMedia=wt;this.attachMedia=bt}}(jwplayer),function(n){n.html5.defaultSkin=function(){return this.text='<?xml version="1.0" ?><skin author="LongTail Video" name="Five" version="1.1"><components><component name="controlbar"><settings><setting name="margin" value="20"/><setting name="fontsize" value="11"/><setting name="fontcolor" value="0x000000"/><\/settings><layout><group position="left"><button name="play"/><divider name="divider"/><button name="prev"/><divider name="divider"/><button name="next"/><divider name="divider"/><text name="elapsed"/><\/group><group position="center"><slider name="time"/><\/group><group position="right"><text name="duration"/><divider name="divider"/><button name="blank"/><divider name="divider"/><button name="mute"/><slider name="volume"/><divider name="divider"/><button name="fullscreen"/><\/group><\/layout><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAIAAABvFaqvAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAElJREFUOI3t1LERACAMQlFgGvcfxNIhHMK4gsUvUviOmgtNsiAZkBSEKxKEnCYkkQrJn/YwbUNiSDDYRZaQRDaShv+oX9GBZEIuK+8hXVLs+/YAAAAASUVORK5CYII="/><element name="blankButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAYCAYAAAAyJzegAAAAFElEQVQYV2P8//8/AzpgHBUc7oIAGZdH0RjKN8EAAAAASUVORK5CYII="/><element name="capLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAQElEQVQIWz3LsRGAMADDQJ0XB5bMINABZ9GENGrszxhjT2WLSqxEJG2JQrTMdV2q5LpOAvyRaVmsi7WdeZ/7+AAaOTq7BVrfOQAAAABJRU5ErkJggg=="/><element name="capRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAQElEQVQIWz3LsRGAMADDQJ0XB5bMINABZ9GENGrszxhjT2WLSqxEJG2JQrTMdV2q5LpOAvyRaVmsi7WdeZ/7+AAaOTq7BVrfOQAAAABJRU5ErkJggg=="/><element name="divider" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADhJREFUCB0FwcENgEAAw7Aq+893g8APUILNOQcbFRktVGqUVFRkWNz3xTa2sUaLNUosKlRUvvf5AdbWOTtzmzyWAAAAAElFTkSuQmCC"/><element name="playButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAANUlEQVR42u2RsQkAAAjD/NTTPaW6dXLrINJA1kBpGPMAjDWmOgp1HFQXx+b1KOefO4oxY57R73YnVYCQUCQAAAAASUVORK5CYII="/><element name="pauseButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAIUlEQVQ4jWNgGAWjYOiD/0gYG3/U0FFDB4Oho2AUDAYAAEwiL9HrpdMVAAAAAElFTkSuQmCC"/><element name="prevButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAQklEQVQ4y2NgGAWjYOiD/1AMA/JAfB5NjCJD/YH4PRaLyDa0H4lNNUP/DxlD59PCUBCIp3ZEwYA+NZLUKBgFgwEAAN+HLX9sB8u8AAAAAElFTkSuQmCC"/><element name="nextButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAQElEQVQ4y2NgGAWjYOiD/0B8Hojl0cT+U2ooCL8HYn9qGwrD/bQw9P+QMXQ+tSMqnpoRBUpS+tRMUqNgFAwGAADxZy1/mHvFnAAAAABJRU5ErkJggg=="/><element name="timeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAOElEQVRIDe3BwQkAIRADwAhhw/nU/kWwUK+KPITMABFh19Y+F0acY8CJvX9wYpXgRElwolSIiMf9ZWEDhtwurFsAAAAASUVORK5CYII="/><element name="timeSliderBuffer" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAN0lEQVRIDe3BwQkAMQwDMBcc55mRe9zi7RR+FCwBEWG39vcfGHFm4MTuhhMlwYlVBSdKhYh43AW/LQMKm1spzwAAAABJRU5ErkJggg=="/><element name="timeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAIElEQVRIiWNgGAWjYBTQBfynMR61YCRYMApGwSigMQAAiVWPcbq6UkIAAAAASUVORK5CYII="/><element name="timeSliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAYCAYAAAA/OUfnAAAAO0lEQVQYlWP4//8/Awwz0JgDBP/BeN6Cxf/hnI2btiI4u/fsQ3AOHjqK4Jw4eQbBOX/hEoKDYjSd/AMA4cS4mfLsorgAAAAASUVORK5CYII="/><element name="muteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAJklEQVQ4y2NgGAUjDcwH4v/kaPxPikZkxcNVI9mBQ5XoGAWDFwAAsKAXKQQmfbUAAAAASUVORK5CYII="/><element name="unmuteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAMklEQVQ4y2NgGAWDHPyntub5xBr6Hwv/Pzk2/yfVG/8psRFE25Oq8T+tQnsIaB4FVAcAi2YVysVY52AAAAAASUVORK5CYII="/><element name="volumeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAgMAAACdGdVrAAAACVBMVEUAAACmpqampqbBXAu8AAAAAnRSTlMAgJsrThgAAAArSURBVAhbY2AgErBAyA4I2QEhOyBkB4TsYOhAoaCCUCUwDTDtMMNgRuMHAFB5FoGH5T0UAAAAAElFTkSuQmCC"/><element name="volumeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAgMAAACdGdVrAAAACVBMVEUAAAAAAAAAAACDY+nAAAAAAnRSTlMAgJsrThgAAAArSURBVAhbY2AgErBAyA4I2QEhOyBkB4TsYOhAoaCCUCUwDTDtMMNgRuMHAFB5FoGH5T0UAAAAAElFTkSuQmCC"/><element name="volumeSliderCapRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAYCAYAAAAyJzegAAAAFElEQVQYV2P8//8/AzpgHBUc7oIAGZdH0RjKN8EAAAAASUVORK5CYII="/><element name="fullscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAQklEQVRIiWNgGAWjYMiD/0iYFDmSLbDHImdPLQtgBpEiR7Zl2NijAA5oEkT/0Whi5UiyAJ8BVMsHNMtoo2AUDAIAAGdcIN3IDNXoAAAAAElFTkSuQmCC"/><element name="normalscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAP0lEQVRIx2NgGAWjYMiD/1RSQ5QB/wmIUWzJfzx8qhj+n4DYCAY0DyJ7PBbYU8sHMEvwiZFtODXUjIJRMJgBACpWIN2ZxdPTAAAAAElFTkSuQmCC"/><\/elements><\/component><component name="display"><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlOZpuml+rYAAAASSURBVBhXY2AYJuA/GBwY6jQAyDyoK8QcL4QAAAAASUVORK5CYII="/><element name="playIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAiUlEQVR42u3XSw2AMBREURwgAQlIQAISKgUpSEFKJeCg5b0E0kWBTVcD9ySTsL0Jn9IBAAAA+K2UUrBlW/Rr5ZDoIeeuoFkxJD9ss03aIXXQqB9SttoG7ZA6qNcOKdttiwcJh9RB+iFl4SshkRBuLR72+9cvH0SOKI2HRo7x/Fi1/uoCAAAAwLsD8ki99IlO2dQAAAAASUVORK5CYII="/><element name="muteIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAVUlEQVR42u3WMQrAIAxAUW/g/SdvGmvpoOBeSHgPsjj5QTANAACARCJilIhYM0tEvJM+Ik3Id9E957kQIb+F3OdCPC0hPkQriqWx9hp/x/QGAABQyAPLB22VGrpLDgAAAABJRU5ErkJggg=="/><element name="errorIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAA/0lEQVR42u2U0QmEMBAF7cASLMESUoIlpARLSCkpwRJSgiWkhOvAXD4WsgRkyaG5DbyB+Yvg8KITAAAAAAAYk+u61mwk15EjPtlEfihmqIiZR1Qx80ghjgdUuiHXGHSVsoag0x6x8DUoyjD5KovmEJ9NTDMRPIT0mtdIUkjlonuNohO+Ha99DTmkuGgKCTcvebAzx82ZoCWC3/3aIMWSRucaxcjORSFY4xpFdjYJGp1rFGcyCYZ/RVh6AUnfcNZ2zih3/mGj1jVCdiNDwyrq1rA/xMdeEXvDVdnYc1vDc3uPkDObXrlaxbNHSOohQhr/WOeLEWfWTgAAAAAAADzNF9sHJ7PJ57MlAAAAAElFTkSuQmCC"/><element name="bufferIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAACBklEQVR42u3Zv0sCYRzH8USTzOsHHEWGkC1HgaDgkktGDjUYtDQ01RDSljQ1BLU02+rk1NTm2NLq4Nx/0L/h9fnCd3j4cnZe1/U8xiO8h3uurufF0/3COd/3/0UWYiEWYiEWYiGJQ+J8xuPxKhXjEMZANinjIZhkGuVRNioE4wVURo4JkHm0xKWmhRAc1bh1EyCUw5BcBIjHiApKa4CErko6DEJwuRo6IRKzyJD8FJAyI3Zp2zRImiBcRhlfo5RtlxCcE3CcDNpGrhYIT2IhAJKilO0VRmzJ32fAMTpBTS0QMfGwlcuKMRftE0DJ0wCJdcOsCkBdXP3Mh9CEFUBTPS9mDZJBG6io4aqVzMdCokCw9H3kT6j/C/9iDdSeUMNC7DkyyxAs/Rk6Qss8FPWRZgdVtUH4DjxEn1zxh+/zj1wHlf4MQhNGrwqA6sY40U8JonRJwEQh+AO3AvCG6gHv4U7IY4krxkroWoAOkoQMGfCBrgIm+YBGqPENpIJ66CJg3x66Y0gnSUidAEEnNr9jjLiWMn5DiWP0OC/oAsCgkq43xBdGDMQr7YASP/vEkHvdl1+JOCcEV5sC4hGEOzTlPuKgd0b0xD4JkRcOgnRRTjdErkYhAsQVq6IdUuPJtmk7BCL3t/h88cx91pKQkI/pkDx6pmYTIjEoxiHsN1YWYiEWYiEWknhflZ5IErA5nr8AAAAASUVORK5CYII="/><\/elements><\/component><component name="dock"><settings><setting name="fontcolor" value="0xffffff"/><\/settings><elements><element name="button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlOZpuml+rYAAAASSURBVBhXY2AYJuA/GBwY6jQAyDyoK8QcL4QAAAAASUVORK5CYII="/><\/elements><\/component><component name="playlist"><settings><setting name="backgroundcolor" value="0xe8e8e8"/><\/settings><elements><element name="item" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAIAAAC1nk4lAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHBJREFUaN7t2MENwCAMBEEe9N8wSKYC/D8YV7CyJoRkVtVImxkZPQInMxoP0XiIxkM0HsGbjjSNBx544IEHHnjggUe/6UQeey0PIh7XTftGxKPj4eXCtLsHHh+ZxkO0Iw8PR55Ni8ZD9Hu/EAoP0dc5RRg9qeRjVF8AAAAASUVORK5CYII="/><element name="sliderCapTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAHCAYAAADnCQYGAAAAFUlEQVQokWP8//8/A7UB46ihI9hQAKt6FPPXhVGHAAAAAElFTkSuQmCC"/><element name="sliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAAKElEQVQ4y2P4//8/Az68bNmy/+iYkB6GUUNHDR01dNTQUUNHDaXcUABUDOKhcxnsSwAAAABJRU5ErkJggg=="/><element name="sliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAAJUlEQVQ4T2P4//8/Ay4MBP9xYbz6Rg0dNXTU0FFDRw0dNZRyQwHH4NBa7GJsXAAAAABJRU5ErkJggg=="/><element name="sliderCapBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAHCAYAAADnCQYGAAAAFUlEQVQokWP8//8/A7UB46ihI9hQAKt6FPPXhVGHAAAAAElFTkSuQmCC"/><\/elements><\/component><\/components><\/skin>',this.xml=null,window.DOMParser?(parser=new DOMParser,this.xml=parser.parseFromString(this.text,"text/xml")):(this.xml=new ActiveXObject("Microsoft.XMLDOM"),this.xml.async="false",this.xml.loadXML(this.text)),this}}(jwplayer),function(n){_utils=n.utils;_css=_utils.css;_hide=function(n){_css(n,{display:"none"})};_show=function(n){_css(n,{display:"block"})};n.html5.display=function(t,i){function pt(){u.display=h("div","display");u.display_text=h("div","display_text");u.display.appendChild(u.display_text);u.display_image=h("img","display_image");u.display_image.onerror=function(){_hide(u.display_image)};u.display_image.onload=wt;u.display_icon=h("div","display_icon");u.display_iconBackground=h("div","display_iconBackground");u.display.appendChild(u.display_image);u.display_iconBackground.appendChild(u.display_icon);u.display.appendChild(u.display_iconBackground);bt();setTimeout(function(){et=!0;l.icons.toString()=="true"&&d()},1)}function wt(){g=u.display_image.naturalWidth;nt=u.display_image.naturalHeight;ct()}function ct(){if(r.jwGetFullscreen()&&r.jwGetStretching()==n.utils.stretching.EXACTFIT){var t=document.createElement("div");_utils.stretch(n.utils.stretching.UNIFORM,t,e,f,ot,st);_utils.stretch(n.utils.stretching.EXACTFIT,u.display_image,_utils.parseDimension(t.style.width),_utils.parseDimension(t.style.height),g,nt);_css(u.display_image,{left:t.style.left,top:t.style.top})}else _utils.stretch(r.jwGetStretching(),u.display_image,e,f,g,nt)}function h(n,t){var i=document.createElement(n);return i.id=r.id+"_jwplayer_"+t,_css(i,p[t].style),i}function bt(){for(var n in u)_utils.exists(p[n].click)&&(u[n].onclick=p[n].click)}function kt(t){typeof t.preventDefault!="undefined"?t.preventDefault():t.returnValue=!1;r.jwGetState()!=n.api.events.state.PLAYING?r.jwPlay():r.jwPause()}function w(n){if(v){c();return}u.display_icon.style.backgroundImage=["url(",r.skin.getSkinElement("display",n).src,")"].join("");_css(u.display_icon,{width:r.skin.getSkinElement("display",n).width,height:r.skin.getSkinElement("display",n).height,top:(r.skin.getSkinElement("display","background").height-r.skin.getSkinElement("display",n).height)/2,left:(r.skin.getSkinElement("display","background").width-r.skin.getSkinElement("display",n).width)/2});dt();_utils.exists(r.skin.getSkinElement("display",n+"Over"))?(u.display_icon.onmouseover=function(){u.display_icon.style.backgroundImage=["url(",r.skin.getSkinElement("display",n+"Over").src,")"].join("")},u.display_icon.onmouseout=function(){u.display_icon.style.backgroundImage=["url(",r.skin.getSkinElement("display",n).src,")"].join("")}):(u.display_icon.onmouseover=null,u.display_icon.onmouseout=null)}function c(){l.icons.toString()=="true"&&(_hide(u.display_icon),_hide(u.display_iconBackground),at())}function dt(){s||l.icons.toString()!="true"||(_show(u.display_icon),_show(u.display_iconBackground),d())}function gt(n){v=!0;c();u.display_text.innerHTML=n.message;_show(u.display_text);u.display_text.style.top=(f-_utils.getBoundingClientRect(u.display_text).height)/2+"px"}function b(){u.display_image.style.display="none"}function k(t){(t.type==n.api.events.JWPLAYER_PLAYER_STATE||t.type==n.api.events.JWPLAYER_PLAYLIST_ITEM)&&v&&(v=!1,_hide(u.display_text));var i=r.jwGetState();i!=ft&&(ft=i,y>=0&&clearTimeout(y),o||r.jwGetState()==n.api.events.state.PLAYING||r.jwGetState()==n.api.events.state.PAUSED?rt(r.jwGetState()):y=setTimeout(ni(r.jwGetState()),500))}function ni(n){return function(){rt(n)}}function rt(t){_utils.exists(a)&&(clearInterval(a),a=null,_utils.animations.rotate(u.display_icon,0));switch(t){case n.api.events.state.BUFFERING:_utils.isMobile()?(b(),c()):(r.jwGetPlaylist()[r.jwGetItem()].provider=="sound"&&ut(),tt=0,a=setInterval(function(){tt+=vt;_utils.animations.rotate(u.display_icon,tt%360)},yt),w("bufferIcon"),o=!0);break;case n.api.events.state.PAUSED:_utils.isMobile()||(r.jwGetPlaylist()[r.jwGetItem()].provider!="sound"&&_css(u.display_image,{background:"transparent no-repeat center center"}),w("playIcon"),o=!0);break;case n.api.events.state.IDLE:r.jwGetPlaylist()[r.jwGetItem()]&&r.jwGetPlaylist()[r.jwGetItem()].image?ut():b();w("playIcon");o=!0;break;default:r.jwGetPlaylist()[r.jwGetItem()]&&r.jwGetPlaylist()[r.jwGetItem()].provider=="sound"?_utils.isMobile()?(b(),o=!1):ut():(b(),o=!1);r.jwGetMute()&&l.showmute?w("muteIcon"):c()}y=-1}function ut(){r.jwGetPlaylist()[r.jwGetItem()]&&r.jwGetPlaylist()[r.jwGetItem()].image&&(_css(u.display_image,{display:"block"}),u.display_image.src=_utils.getAbsolutePath(r.jwGetPlaylist()[r.jwGetItem()].image))}function lt(n){return function(){et&&(s||it==n||(it=n,ht.sendEvent(n,{component:"display",boundingRect:_utils.getDimensions(u.display_iconBackground)})))}}var l=_utils.extend({},{icons:!0,showmute:!1},i),r=t,u={},e,f,g,nt,tt,a,v,vt=_utils.exists(r.skin.getComponentSettings("display").bufferrotation)?parseInt(r.skin.getComponentSettings("display").bufferrotation,10):15,yt=_utils.exists(r.skin.getComponentSettings("display").bufferinterval)?parseInt(r.skin.getComponentSettings("display").bufferinterval,10):100,y=-1,ft="",o=!0,it,s=!1,et=!1,ot,st,ht=new n.html5.eventdispatcher,p,d,at;return _utils.extend(this,ht),p={display:{style:{cursor:"pointer",top:0,left:0,overflow:"hidden"},click:kt},display_icon:{style:{cursor:"pointer",position:"absolute",top:(r.skin.getSkinElement("display","background").height-r.skin.getSkinElement("display","playIcon").height)/2,left:(r.skin.getSkinElement("display","background").width-r.skin.getSkinElement("display","playIcon").width)/2,border:0,margin:0,padding:0,zIndex:3,display:"none"}},display_iconBackground:{style:{cursor:"pointer",position:"absolute",top:(f-r.skin.getSkinElement("display","background").height)/2,left:(e-r.skin.getSkinElement("display","background").width)/2,border:0,backgroundImage:["url(",r.skin.getSkinElement("display","background").src,")"].join(""),width:r.skin.getSkinElement("display","background").width,height:r.skin.getSkinElement("display","background").height,margin:0,padding:0,zIndex:2,display:"none"}},display_image:{style:{display:"none",width:e,height:f,position:"absolute",cursor:"pointer",left:0,top:0,margin:0,padding:0,textDecoration:"none",zIndex:1}},display_text:{style:{zIndex:4,position:"relative",opacity:.8,backgroundColor:parseInt("000000",16),color:parseInt("ffffff",16),textAlign:"center",fontFamily:"Arial,sans-serif",padding:"0 5px",fontSize:14}}},r.jwAddEventListener(n.api.events.JWPLAYER_PLAYER_STATE,k),r.jwAddEventListener(n.api.events.JWPLAYER_MEDIA_MUTE,k),r.jwAddEventListener(n.api.events.JWPLAYER_PLAYLIST_ITEM,k),r.jwAddEventListener(n.api.events.JWPLAYER_ERROR,gt),pt(),this.getDisplayElement=function(){return u.display},this.resize=function(n,t){_css(u.display,{width:n,height:t});_css(u.display_text,{width:n-10,top:(t-_utils.getBoundingClientRect(u.display_text).height)/2});_css(u.display_iconBackground,{top:(t-r.skin.getSkinElement("display","background").height)/2,left:(n-r.skin.getSkinElement("display","background").width)/2});(e!=n||f!=t)&&(e=n,f=t,it=undefined,d());r.jwGetFullscreen()||(ot=n,st=t);ct();k({})},this.show=function(){s&&(s=!1,rt(r.jwGetState()))},this.hide=function(){s||(c(),s=!0)},d=lt(n.api.events.JWPLAYER_COMPONENT_SHOW),at=lt(n.api.events.JWPLAYER_COMPONENT_HIDE),this}}(jwplayer),function(n){var t=n.utils,i=t.css;n.html5.dock=function(r,u){function ot(){return{align:n.html5.view.positions.RIGHT}}function it(i,u){var nt,w,b,y;if(et(),s.length>0){var v=10,p=v,tt=-1,it=r.skin.getSkinElement("dock","button").height,rt=r.skin.getSkinElement("dock","button").width,ut=i-rt-v,e,o;for(k.align==n.html5.view.positions.LEFT&&(tt=1,ut=v),nt=0;nt<s.length;nt++)w=Math.floor(p/u),p+it+v>(w+1)*u&&(p=(w+1)*u+v,w=Math.floor(p/u)),b=f[s[nt]].div,b.style.top=p%u+"px",b.style.left=ut+(r.skin.getSkinElement("dock","button").width+v)*w*tt+"px",y={x:t.parseDimension(b.style.left),y:t.parseDimension(b.style.top),width:rt,height:it},(!e||y.x<=e.x&&y.y<=e.y)&&(e=y),(!o||y.x>=o.x&&y.y>=o.y)&&(o=y),p+=r.skin.getSkinElement("dock","button").height+v;g={x:e.x,y:e.y,width:o.x-e.x+o.width,height:e.y-o.y+o.height}}(d!=r.jwGetFullscreen()||c!=i||l!=u)&&(c=i,l=u,d=r.jwGetFullscreen(),a=undefined,setTimeout(h,1))}function rt(n){return function(){!o&&a!=n&&s.length>0&&(a=n,tt.sendEvent(n,{component:"dock",boundingRect:g}))}}function st(i){t.isMobile()?i.newstate==n.api.events.state.IDLE?p():w():ut()}function ut(i){if(!o)if(clearTimeout(v),u.position==n.html5.view.positions.OVER||r.jwGetFullscreen())switch(r.jwGetState()){case n.api.events.state.PAUSED:case n.api.events.state.IDLE:e&&e.style.opacity<1&&(!u.idlehide||t.exists(i))&&b();u.idlehide&&(v=setTimeout(function(){ft()},2e3));break;default:t.exists(i)&&b();v=setTimeout(function(){ft()},2e3)}else b()}function ft(){o||(y(),e.style.opacity==1&&(t.cancelAnimation(e),t.fadeTo(e,0,.1,1,0)))}function b(){o||(h(),e.style.opacity==0&&(t.cancelAnimation(e),t.fadeTo(e,1,.1,0,0)))}function et(){nt=document.getElementById(r.id);nt.addEventListener("mousemove",ut)}var k=t.extend({},ot(),u),e,h,y,p,w;if(k.align!="FALSE"){var f={},s=[],c,l,o=!1,d=!1,g={x:0,y:0,width:0,height:0},a,nt,v,tt=new n.html5.eventdispatcher;return t.extend(this,tt),e=document.createElement("div"),e.id=r.id+"_jwplayer_dock",e.style.opacity=1,et(),r.jwAddEventListener(n.api.events.JWPLAYER_PLAYER_STATE,st),this.getDisplayElement=function(){return e},this.setButton=function(i,u,o,h){!u&&f[i]?(t.arrays.remove(s,i),e.removeChild(f[i].div),delete f[i]):u&&(f[i]||(f[i]={}),f[i].handler=u,f[i].outGraphic=o,f[i].overGraphic=h,f[i].div||(s.push(i),f[i].div=document.createElement("div"),f[i].div.style.position="relative",e.appendChild(f[i].div),f[i].div.appendChild(document.createElement("img")),f[i].div.childNodes[0].style.position="absolute",f[i].div.childNodes[0].style.left=0,f[i].div.childNodes[0].style.top=0,f[i].div.childNodes[0].style.zIndex=10,f[i].div.childNodes[0].style.cursor="pointer",f[i].div.appendChild(document.createElement("img")),f[i].div.childNodes[1].style.position="absolute",f[i].div.childNodes[1].style.left=0,f[i].div.childNodes[1].style.top=0,r.skin.getSkinElement("dock","button")&&(f[i].div.childNodes[1].src=r.skin.getSkinElement("dock","button").src),f[i].div.childNodes[1].style.zIndex=9,f[i].div.childNodes[1].style.cursor="pointer",f[i].div.onmouseover=function(){f[i].overGraphic&&(f[i].div.childNodes[0].src=f[i].overGraphic);r.skin.getSkinElement("dock","buttonOver")&&(f[i].div.childNodes[1].src=r.skin.getSkinElement("dock","buttonOver").src)},f[i].div.onmouseout=function(){f[i].outGraphic&&(f[i].div.childNodes[0].src=f[i].outGraphic);r.skin.getSkinElement("dock","button")&&(f[i].div.childNodes[1].src=r.skin.getSkinElement("dock","button").src)},r.skin.getSkinElement("dock","button")&&(f[i].div.childNodes[1].src=r.skin.getSkinElement("dock","button").src)),f[i].outGraphic?f[i].div.childNodes[0].src=f[i].outGraphic:f[i].overGraphic&&(f[i].div.childNodes[0].src=f[i].overGraphic),u&&(f[i].div.onclick=function(t){t.preventDefault();n(r.id).callback(i);f[i].overGraphic&&(f[i].div.childNodes[0].src=f[i].overGraphic);r.skin.getSkinElement("dock","button")&&(f[i].div.childNodes[1].src=r.skin.getSkinElement("dock","button").src)}));it(c,l)},h=rt(n.api.events.JWPLAYER_COMPONENT_SHOW),y=rt(n.api.events.JWPLAYER_COMPONENT_HIDE),this.resize=it,p=function(){i(e,{display:"block"});o&&(o=!1,h())},w=function(){i(e,{display:"none"});o||(y(),o=!0)},this.hide=w,this.show=p,this}}}(jwplayer),function(n){n.html5.eventdispatcher=function(t,i){var r=new n.events.eventdispatcher(i);n.utils.extend(this,r);this.sendEvent=function(i,u){n.utils.exists(u)||(u={});n.utils.extend(u,{id:t,version:n.version,type:i});r.sendEvent(i,u)}}}(jwplayer),function(n){var t={prefix:"http://l.longtailvideo.com/html5/",file:"logo.png",link:"http://www.longtailvideo.com/players/jw-flv-player/",margin:8,out:.5,over:1,timeout:5,hide:!0,position:"bottom-left"};_css=n.utils.css;n.html5.logo=function(i,r){function c(){l();o.jwAddEventListener(n.api.events.JWPLAYER_PLAYER_STATE,d);a();v()}function l(){if(t.prefix){var f=i.version.split(/\W/).splice(0,2).join("/");t.prefix.indexOf(f)<0&&(t.prefix+=f+"/")}r.position==n.html5.view.positions.OVER&&(r.position=t.position);try{window.location.href.indexOf("https")==0&&(t.prefix=t.prefix.replace("http://l.longtailvideo.com","https://securel.longtailvideo.com"))}catch(e){}u=n.utils.extend({},t)}function a(){(f=document.createElement("img"),f.id=o.id+"_jwplayer_logo",f.style.display="none",f.onload=function(){_css(f,w());h()},u.file)&&(f.src=u.file.indexOf("/")>=0?u.file:u.prefix+u.file)}function v(){u.link?(f.onmouseover=p,f.onmouseout=h,f.onclick=y):this.mouseEnabled=!1}function y(n){if(typeof n!="undefined"&&n.stopPropagation(),e){o.jwPause();o.jwSetFullscreen(!1);u.link&&window.open(u.link,"_top");return}}function h(){u.link&&e&&(f.style.opacity=u.out);return}function p(){e&&(f.style.opacity=u.over);return}function w(){var n={textDecoration:"none",position:"absolute",cursor:"pointer"},t,i;n.display=u.hide.toString()=="true"&&!e?"none":"block";t=u.position.toLowerCase().split("-");for(i in t)n[t[i]]=u.margin;return n}function b(){u.hide.toString()=="true"&&(f.style.display="block",f.style.opacity=0,n.utils.fadeTo(f,u.out,.1,parseFloat(f.style.opacity)),s=setTimeout(function(){k()},u.timeout*1e3));e=!0}function k(){e=!1;u.hide.toString()=="true"&&n.utils.fadeTo(f,0,.1,parseFloat(f.style.opacity))}function d(t){t.newstate==n.api.events.state.BUFFERING&&(clearTimeout(s),b())}var o=i,s,u,f,e=!1;if(c(),u.file)return this.resize=function(){},this.getDisplayElement=function(){return f},this}}(jwplayer),function(n){var r={ended:n.api.events.state.IDLE,playing:n.api.events.state.PLAYING,pause:n.api.events.state.PAUSED,buffering:n.api.events.state.BUFFERING},t=n.utils,u=t.css,i=t.isMobile();n.html5.mediavideo=function(u,f){function ft(n,i){return function(n){l&&t.exists(n.target.parentNode)&&i(n)}}function et(){e=document.createElement("video");c=n.api.events.state.IDLE;for(var t in rt)e.addEventListener(t,ft(t,rt[t]),!0);l=!0;e.setAttribute("x-webkit-airplay","allow");p.parentNode&&p.parentNode.replaceChild(e,p);e.id||(e.id=p.id);e.volume=o.volume/100}function v(t){if((t!=n.api.events.state.PAUSED||c!=n.api.events.state.IDLE)&&c!=t){var i=c;o.state=c=t;s.sendEvent(n.api.events.JWPLAYER_PLAYER_STATE,{oldstate:i,newstate:t})}}function a(){}function ot(){var t=Math.round(e.volume*100);t!=o.volume&&(o.volume=t,s.sendEvent(n.api.events.JWPLAYER_MEDIA_VOLUME,{volume:o.volume}));e.muted!=o.mute&&(o.mute=e.muted,s.sendEvent(n.api.events.JWPLAYER_MEDIA_MUTE,{mute:o.mute}))}function tt(i){var r,u;t.exists(i)&&i.lengthComputable&&i.total?r=i.loaded/i.total*100:t.exists(e.buffered)&&e.buffered.length>0&&(u=e.buffered.length-1,u>=0&&(r=e.buffered.end(u)/e.duration*100));w===!1&&c==n.api.events.state.BUFFERING&&(s.sendEvent(n.api.events.JWPLAYER_MEDIA_BUFFER_FULL),w=!0);nt||(r==100&&(nt=!0),t.exists(r)&&r>o.buffer&&(o.buffer=Math.round(r),s.sendEvent(n.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:Math.round(r)})))}function st(i){if(t.exists(i)&&t.exists(i.target)&&(!isNaN(i.target.duration)&&(isNaN(o.duration)||o.duration<1)&&(o.duration=i.target.duration==Infinity?0:Math.round(i.target.duration*10)/10),!b&&e.readyState>0&&(e.style.display="block",v(n.api.events.state.PLAYING)),c==n.api.events.state.PLAYING)){if(!b&&e.readyState>0){b=!0;try{e.currentTime<y.start&&(e.currentTime=y.start)}catch(r){}e.volume=o.volume/100;e.muted=o.mute}o.position=o.duration>0?Math.round(i.target.currentTime*10)/10:0;s.sendEvent(n.api.events.JWPLAYER_MEDIA_TIME,{position:o.position,duration:o.duration});o.position>=o.duration&&(o.position>0||o.duration>0)&&ut()}tt(i)}function ht(){}function h(n){r[n.type]&&(n.type=="ended"?ut():v(r[n.type]))}function it(t){var i=Math.round(t.target.duration*10)/10,r={height:t.target.videoHeight,width:t.target.videoWidth,duration:i};(o.duration<i||isNaN(o.duration))&&t.target.duration!=Infinity&&(o.duration=i);s.sendEvent(n.api.events.JWPLAYER_MEDIA_META,{metadata:r})}function ct(i){var r,u;if(c!=n.api.events.state.IDLE){if(r="There was an error: ",i.target.error&&i.target.tagName.toLowerCase()=="video"||i.target.parentNode.error&&i.target.parentNode.tagName.toLowerCase()=="video"){u=t.exists(i.target.error)?i.target.error:i.target.parentNode.error;switch(u.code){case u.MEDIA_ERR_ABORTED:r="You aborted the video playback: ";break;case u.MEDIA_ERR_NETWORK:r="A network error caused the video download to fail part-way: ";break;case u.MEDIA_ERR_DECODE:r="The video playback was aborted due to a corruption problem or because the video used features your browser did not support: ";break;case u.MEDIA_ERR_SRC_NOT_SUPPORTED:r="The video could not be loaded, either because the server or network failed or because the format is not supported: ";break;default:r="An unknown error occurred: "}}else if(i.target.tagName.toLowerCase()=="source"){if(d--,d>0)return;r="The video could not be loaded, either because the server or network failed or because the format is not supported: "}else{t.log("An unknown error occurred.  Continuing...");return}_stop(!1);r+=lt();_error=!0;s.sendEvent(n.api.events.JWPLAYER_ERROR,{message:r});return}}function lt(){var t="",i,r,u;for(i in y.levels)r=y.levels[i],u=p.ownerDocument.createElement("source"),t+=n.utils.getAbsolutePath(r.file),i<y.levels.length-1&&(t+=", ");return t}function at(){t.exists(k)||(k=setInterval(function(){tt()},100))}function vt(){clearInterval(k);k=null}function ut(){c!=n.api.events.state.IDLE&&(_stop(!1),s.sendEvent(n.api.events.JWPLAYER_MEDIA_COMPLETE))}function yt(){t.exists(e.webkitDisplayingFullscreen)&&o.fullscreen&&!e.webkitDisplayingFullscreen&&s.sendEvent(n.api.events.JWPLAYER_FULLSCREEN,{fullscreen:!1})}function pt(n){var r,i,u;if(n.length>0&&t.isIOS()&&t.extension(n[0].file)!="mp4"){for(r=-1,i=1;i<n.length;i++)if(t.extension(n[i].file)=="mp4"){r=i;break}r>-1&&(u=n.splice(r,1)[0],n.unshift(u))}}var rt={abort:a,canplay:h,canplaythrough:h,durationchange:it,emptied:a,ended:h,error:ct,loadeddata:it,loadedmetadata:it,loadstart:h,pause:h,play:a,playing:h,progress:tt,ratechange:a,seeked:h,seeking:h,stalled:h,suspend:h,timeupdate:st,volumechange:ot,waiting:h,canshowcurrentframe:a,dataunavailable:a,empty:a,load:ht,loadedfirstframe:a,webkitfullscreenchange:yt},s=new n.html5.eventdispatcher;t.extend(this,s);var o=u,p=f,e,c,b,y,k,g=!1,l=!1,nt,w,d;et();this.load=function(r,u){var f,h;if(typeof u=="undefined"&&(u=!0),l){if(y=r,t.empty(e),d=0,r.levels&&r.levels.length>0)if(r.levels.length==1)e.src=r.levels[0].file;else for(pt(r.levels),e.src&&e.removeAttribute("src"),f=0;f<r.levels.length;f++)h=e.ownerDocument.createElement("source"),h.src=r.levels[f].file,e.appendChild(h),d++;else e.src=r.file;i&&(r.image&&(e.poster=r.image),e.style.display="block",setTimeout(function(){e.setAttribute("controls","controls")},100));nt=w=b=!1;o.buffer=0;t.exists(r.start)||(r.start=0);o.duration=r.duration;s.sendEvent(n.api.events.JWPLAYER_MEDIA_LOADED);(i||r.levels.length!=1)&&g||e.load();g=!1;u&&(v(n.api.events.state.BUFFERING),s.sendEvent(n.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:0}),this.play())}};this.play=function(){l&&c!=n.api.events.state.PLAYING&&(at(),w?v(n.api.events.state.PLAYING):v(n.api.events.state.BUFFERING),e.play())};this.pause=function(){l&&(e.pause(),v(n.api.events.state.PAUSED))};this.seek=function(n){l&&(o.duration<=0||isNaN(o.duration)||o.position<=0||isNaN(o.position)||(e.currentTime=n,e.play()))};_stop=this.stop=function(i){if(l){if(t.exists(i)||(i=!0),vt(),i){e.style.display="none";w=!1;var r=navigator.userAgent;if(r.match(/chrome/i)?e.src=undefined:r.match(/safari/i)||r.match(/firefox/i)?e.removeAttribute("src"):e.src="",e.removeAttribute("controls"),e.removeAttribute("poster"),t.empty(e),e.load(),g=!0,e.webkitSupportsFullscreen)try{e.webkitExitFullscreen()}catch(u){}}v(n.api.events.state.IDLE)}};this.fullscreen=function(n){n===!0?this.resize("100%","100%"):this.resize(o.config.width,o.config.height)};this.resize=function(){};this.volume=function(n){i||(e.volume=n/100)};this.mute=function(n){i||(e.muted=n)};this.getDisplayElement=function(){return e};this.hasChrome=function(){return i};this.detachMedia=function(){return l=!1,this.getDisplayElement()};this.attachMedia=function(){l=!0}}}(jwplayer),function(n){var i={ended:n.api.events.state.IDLE,playing:n.api.events.state.PLAYING,pause:n.api.events.state.PAUSED,buffering:n.api.events.state.BUFFERING},t=n.utils.css;n.html5.mediayoutube=function(i,r){function c(t){if(h!=t){var i=h;s.state=t;h=t;e.sendEvent(n.api.events.JWPLAYER_PLAYER_STATE,{oldstate:i,newstate:t})}}function l(n){var t=n.levels[0].file,r,e,i,s,h;t=["http://www.youtube.com/v/",a(t),"&amp;hl=en_US&amp;fs=1&autoplay=1"].join("");u=document.createElement("object");u.id=f.id;u.style.position="absolute";r={movie:t,allowfullscreen:"true",allowscriptaccess:"always"};for(e in r)i=document.createElement("param"),i.name=e,i.value=r[e],u.appendChild(i);o=document.createElement("embed");u.appendChild(o);s={src:t,type:"application/x-shockwave-flash",allowfullscreen:"true",allowscriptaccess:"always",width:u.width,height:u.height};for(h in s)o.setAttribute(h,s[h]);u.appendChild(o);u.style.zIndex=2147483e3;f!=u&&f.parentNode&&f.parentNode.replaceChild(u,f);f=u}function a(n){for(var r=n.split(/\?|\#\!/),t="",i=0;i<r.length;i++)r[i].substr(0,2)=="v="&&(t=r[i].substr(2));return t==""&&(t=n.indexOf("/v/")>=0?n.substr(n.indexOf("/v/")+3):n.indexOf("youtu.be")>=0?n.substr(n.indexOf("youtu.be/")+9):n),t.indexOf("?")>-1&&(t=t.substr(0,t.indexOf("?"))),t.indexOf("&")>-1&&(t=t.substr(0,t.indexOf("&"))),t}var e=new n.html5.eventdispatcher;n.utils.extend(this,e);var s=i,f=document.getElementById(r.id),h=n.api.events.state.IDLE,u,o;return this.getDisplayElement=this.detachMedia=function(){return f},this.attachMedia=function(){},this.play=function(){h==n.api.events.state.IDLE?(e.sendEvent(n.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:100}),e.sendEvent(n.api.events.JWPLAYER_MEDIA_BUFFER_FULL),c(n.api.events.state.PLAYING)):h==n.api.events.state.PAUSED&&c(n.api.events.state.PLAYING)},this.pause=function(){c(n.api.events.state.PAUSED)},this.seek=function(){},this.stop=function(i){_utils.exists(i)||(i=!0);s.position=0;c(n.api.events.state.IDLE);i&&t(f,{display:"none"})},this.volume=function(t){s.volume=t;e.sendEvent(n.api.events.JWPLAYER_MEDIA_VOLUME,{volume:Math.round(t)})},this.mute=function(t){f.muted=t;s.mute=t;e.sendEvent(n.api.events.JWPLAYER_MEDIA_MUTE,{mute:t})},this.resize=function(n,t){n*t>0&&u&&(u.width=o.width=n,u.height=o.height=t)},this.fullscreen=function(n){n===!0?this.resize("100%","100%"):this.resize(s.config.width,s.config.height)},this.load=function(i){l(i);t(u,{display:"block"});c(n.api.events.state.BUFFERING);e.sendEvent(n.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:0});e.sendEvent(n.api.events.JWPLAYER_MEDIA_LOADED);this.play()},this.hasChrome=function(){return h!=n.api.events.state.IDLE},this.embed=o,this}}(jwplayer),function(n){var t=["width","height","start","duration","volume","mute","fullscreen","item","plugins","stretching"];n.html5.model=function(i,r,u){function st(t){var i=new n.html5.playlistloader;i.addEventListener(n.api.events.JWPLAYER_PLAYLIST_LOADED,function(t){f.playlist=new n.html5.playlist(t);tt(!0)});i.addEventListener(n.api.events.JWPLAYER_ERROR,function(){f.playlist=new n.html5.playlist({playlist:[]});tt(!1)});i.load(t)}function tt(){f.config.shuffle?f.item=ht():(f.config.item>=f.playlist.length?f.config.item=f.playlist.length-1:f.config.item<0&&(f.config.item=0),f.item=f.config.item);f.position=0;f.duration=f.playlist.length>0?f.playlist[f.item].duration:0;a.sendEvent(n.api.events.JWPLAYER_PLAYLIST_LOADED,{playlist:f.playlist});a.sendEvent(n.api.events.JWPLAYER_PLAYLIST_ITEM,{index:f.item})}function ht(){var t=null;if(f.playlist.length>1)while(!n.utils.exists(t))t=Math.floor(Math.random()*f.playlist.length),t==f.item&&(t=null);else t=0;return t}function ot(t){t.type==n.api.events.JWPLAYER_MEDIA_LOADED&&(p=e.getDisplayElement());a.sendEvent(t.type,t)}var it=i,p=r,f={id:p.id,playlist:[],state:n.api.events.state.IDLE,position:0,buffer:0,config:{width:480,height:320,item:-1,skin:undefined,file:undefined,image:undefined,start:0,duration:0,bufferlength:5,volume:90,mute:!1,fullscreen:!1,repeat:"",stretching:n.utils.stretching.UNIFORM,autostart:!1,debug:undefined,screencolor:undefined}},e,a=new n.html5.eventdispatcher,s,rt,c,h,l,ut,b,v,w,k,d,g,ft,o,nt,et,y;n.utils.extend(f,a);for(s in u){typeof u[s]=="string"&&(rt=/color$/.test(s)?"color":null,u[s]=n.utils.typechecker(u[s],rt));c=f.config;h=s.split(".");for(l in h)l==h.length-1?c[h[l]]=u[s]:(n.utils.exists(c[h[l]])||(c[h[l]]={}),c=c[h[l]])}for(ut in t)b=t[ut],f[b]=f.config[b];if(v=["display","logo","controlbar","playlist","dock"].concat([]),n.utils.exists(f.plugins)&&typeof f.plugins=="string"){w=f.plugins.split(",");for(k in w)typeof w[k]=="string"&&v.push(w[k].replace(/^\s+|\s+$/g,""))}if(n.utils.isMobile()?(v=["display","logo","dock","playlist"],n.utils.exists(f.config.repeat)||(f.config.repeat="list")):f.config.chromeless&&(v=["logo","dock","playlist"],n.utils.exists(f.config.repeat)||(f.config.repeat="list")),f.plugins={order:v,config:{},object:{}},typeof f.config.components!="undefined")for(d in f.config.components)f.plugins.config[d]=f.config.components[d];g=!1;for(ft in f.plugins.order)o=f.plugins.order[ft],nt=n.utils.exists(f.plugins.config[o])?f.plugins.config[o]:{},f.plugins.config[o]=n.utils.exists(f.plugins.config[o])?n.utils.extend(f.plugins.config[o],nt):nt,n.utils.exists(f.plugins.config[o].position)?(o=="playlist"&&(g=!0),f.plugins.config[o].position=f.plugins.config[o].position.toString().toUpperCase()):f.plugins.config[o].position=o=="playlist"?n.html5.view.positions.NONE:n.html5.view.positions.OVER;if(f.plugins.config.controlbar&&g&&(f.plugins.config.controlbar.hideplaylistcontrols=!0),typeof f.plugins.config.dock!="undefined"&&(typeof f.plugins.config.dock!="object"&&(et=f.plugins.config.dock.toString().toUpperCase(),f.plugins.config.dock={position:et}),typeof f.plugins.config.dock.position!="undefined"&&(f.plugins.config.dock.align=f.plugins.config.dock.position,f.plugins.config.dock.position=n.html5.view.positions.OVER),typeof f.plugins.config.dock.idlehide=="undefined"))try{f.plugins.config.dock.idlehide=f.plugins.config.controlbar.idlehide}catch(ct){}return f.loadPlaylist=function(arg){var input,config;if(typeof arg=="string")if(arg.indexOf("[")==0||arg.indexOf("{")=="0")try{input=eval(arg)}catch(err){input=arg}else input=arg;else input=arg;switch(n.utils.typeOf(input)){case"object":config=input;break;case"array":config={playlist:input};break;default:config={file:input}}f.playlist=new n.html5.playlist(config);f.item=f.config.item>=0?f.config.item:0;f.playlist[f.item].provider?tt():st(f.playlist[f.item].file)},y={},f.setActiveMediaProvider=function(t){t.provider=="audio"&&(t.provider="sound");var i=t.provider,r=e?e.getDisplayElement():null;if((i=="sound"||i=="http"||i=="")&&(i="video"),n.utils.exists(y[i]))e!=y[i]&&(e&&e.stop(),e=y[i]);else{switch(i){case"video":e=new n.html5.mediavideo(f,r?r:p);break;case"youtube":e=new n.html5.mediayoutube(f,r?r:p)}if(!n.utils.exists(e))return!1;e.addGlobalListener(ot);y[i]=e}return!0},f.getMedia=function(){return e},f.seek=function(t){return a.sendEvent(n.api.events.JWPLAYER_MEDIA_SEEK,{position:f.position,offset:t}),e.seek(t)},f.setupPlugins=function(){var i,t;if(!n.utils.exists(f.plugins)||!n.utils.exists(f.plugins.order)||f.plugins.order.length==0)return n.utils.log("No plugins to set up"),f;for(i=0;i<f.plugins.order.length;i++)try{t=f.plugins.order[i];n.utils.exists(n.html5[t])?f.plugins.object[t]=t=="playlist"?new n.html5.playlistcomponent(it,f.plugins.config[t]):new n.html5[t](it,f.plugins.config[t]):f.plugins.order.splice(plugin,plugin+1);typeof f.plugins.object[t].addGlobalListener=="function"&&f.plugins.object[t].addGlobalListener(ot)}catch(r){n.utils.log("Could not setup "+t)}},f}}(jwplayer),function(n){n.html5.playlist=function(t){var i=[],r;if(t.playlist&&t.playlist instanceof Array&&t.playlist.length>0)for(r in t.playlist)isNaN(parseInt(r))||i.push(new n.html5.playlistitem(t.playlist[r]));else i.push(new n.html5.playlistitem(t));return i}}(jwplayer),function(n){var i={size:180,position:n.html5.view.positions.NONE,itemheight:60,thumbs:!0,fontcolor:"#000000",overcolor:"",activecolor:"",backgroundcolor:"#f8f8f8",font:"_sans",fontsize:"",fontstyle:"",fontweight:""},t={_sans:"Arial, Helvetica, sans-serif",_serif:"Times, Times New Roman, serif",_typewriter:"Courier New, Courier, monospace"};_utils=n.utils;_css=_utils.css;_hide=function(n){_css(n,{display:"none"})};_show=function(n){_css(n,{display:"block"})};n.html5.playlistcomponent=function(r,u){function p(){o=document.createElement("div");o.id=s.id+"_jwplayer_playlistcomponent";o.style.overflow="hidden";switch(f.position){case n.html5.view.positions.RIGHT:case n.html5.view.positions.LEFT:o.style.width=f.size+"px";break;case n.html5.view.positions.TOP:case n.html5.view.positions.BOTTOM:o.style.height=f.size+"px"}ut();e.item&&(f.itemheight=e.item.height);o.style.backgroundColor="#C6C6C6";s.jwAddEventListener(n.api.events.JWPLAYER_PLAYLIST_LOADED,d);s.jwAddEventListener(n.api.events.JWPLAYER_PLAYLIST_ITEM,it);s.jwAddEventListener(n.api.events.JWPLAYER_PLAYER_STATE,rt)}function w(){var n=document.createElement("ul");return _css(n,{width:o.style.width,minWidth:o.style.width,height:o.style.height,backgroundColor:f.backgroundcolor,backgroundImage:e.background?"url("+e.background.src+")":"",color:f.fontcolor,listStyle:"none",margin:0,padding:0,fontFamily:t[f.font]?t[f.font]:t._sans,fontSize:(f.fontsize?f.fontsize:11)+"px",fontStyle:f.fontstyle,fontWeight:f.fontweight,overflowY:"auto"}),n}function b(n){return function(){var r=h.getElementsByClassName("item")[n],t=f.fontcolor,i=e.item?"url("+e.item.src+")":"";n==s.jwGetPlaylistIndex()&&(f.activecolor!==""&&(t=f.activecolor),e.itemActive&&(i="url("+e.itemActive.src+")"));_css(r,{color:f.overcolor!==""?f.overcolor:t,backgroundImage:e.itemOver?"url("+e.itemOver.src+")":i})}}function a(n){return function(){var r=h.getElementsByClassName("item")[n],t=f.fontcolor,i=e.item?"url("+e.item.src+")":"";n==s.jwGetPlaylistIndex()&&(f.activecolor!==""&&(t=f.activecolor),e.itemActive&&(i="url("+e.itemActive.src+")"));_css(r,{color:t,backgroundImage:i})}}function k(t){var i=c[t],u=document.createElement("li"),d,s,l,o,p;u.className="item";_css(u,{height:f.itemheight,display:"block",cursor:"pointer",backgroundImage:e.item?"url("+e.item.src+")":"",backgroundSize:"100% "+f.itemheight+"px"});u.onmouseover=b(t);u.onmouseout=a(t);var g=document.createElement("div"),r=new Image,w=0,h=0,k=0;return tt()&&(i.image||i["playlist.image"]||e.itemImage)&&(r.className="image",e.itemImage?(w=(f.itemheight-e.itemImage.height)/2,h=e.itemImage.width,k=e.itemImage.height):(h=f.itemheight*4/3,k=f.itemheight),_css(g,{height:k,width:h,float:"left",styleFloat:"left",cssFloat:"left",margin:"0 5px 0 0",background:"black",overflow:"hidden",margin:w+"px",position:"relative"}),_css(r,{position:"relative"}),g.appendChild(r),r.onload=function(){n.utils.stretch(n.utils.stretching.FILL,r,h,k,this.naturalWidth,this.naturalHeight)},i["playlist.image"]?r.src=i["playlist.image"]:i.image?r.src=i.image:e.itemImage&&(r.src=e.itemImage.src),u.appendChild(g)),d=v-h-w*2,y<f.itemheight*c.length&&(d-=15),s=document.createElement("div"),_css(s,{position:"relative",height:"100%",overflow:"hidden"}),l=document.createElement("span"),i.duration>0&&(l.className="duration",_css(l,{fontSize:(f.fontsize?f.fontsize:11)+"px",fontWeight:f.fontweight?f.fontweight:"bold",width:"40px",height:f.fontsize?f.fontsize+10:20,lineHeight:24,float:"right",styleFloat:"right",cssFloat:"right"}),l.innerHTML=_utils.timeFormat(i.duration),s.appendChild(l)),o=document.createElement("span"),o.className="title",_css(o,{padding:"5px 5px 0 "+(w?0:"5px"),height:f.fontsize?f.fontsize+10:20,lineHeight:f.fontsize?f.fontsize+10:20,overflow:"hidden",float:"left",styleFloat:"left",cssFloat:"left",width:(i.duration>0?d-50:d)-10+"px",fontSize:(f.fontsize?f.fontsize:13)+"px",fontWeight:f.fontweight?f.fontweight:"bold"}),o.innerHTML=i?i.title:"",s.appendChild(o),i.description&&(p=document.createElement("span"),p.className="description",_css(p,{display:"block",float:"left",styleFloat:"left",cssFloat:"left",margin:0,paddingLeft:o.style.paddingLeft,paddingRight:o.style.paddingRight,lineHeight:(f.fontsize?f.fontsize+4:16)+"px",overflow:"hidden",position:"relative"}),p.innerHTML=i.description,s.appendChild(p)),u.appendChild(s),u}function d(){var n,t,i;if(o.innerHTML="",c=s.jwGetPlaylist(),c){for(items=[],h=w(),n=0;n<c.length;n++)t=k(n),t.onclick=g(n),h.appendChild(t),items.push(t);l=s.jwGetPlaylistIndex();a(l)();o.appendChild(h);_utils.isIOS()&&window.iScroll&&(h.style.height=f.itemheight*c.length+"px",i=new iScroll(o.id))}}function g(n){return function(){s.jwPlaylistItem(n);s.jwPlay(!0)}}function nt(){h.scrollTop=s.jwGetPlaylistIndex()*f.itemheight}function tt(){return f.thumbs.toString().toLowerCase()=="true"}function it(n){l>=0&&(a(l)(),l=n.index);a(n.index)();nt()}function rt(){if(f.position==n.html5.view.positions.OVER)switch(s.jwGetState()){case n.api.events.state.IDLE:_show(o);break;default:_hide(o)}}function ut(){for(var n in e)e[n]=ft(n)}function ft(n){return s.skin.getSkinElement("playlist",n)}var s=r,f=n.utils.extend({},i,s.skin.getComponentSettings("playlist"),u),o,v,y,c,h,l,e;if(f.position!=n.html5.view.positions.NONE&&typeof n.html5.view.positions[f.position]!="undefined")return l=-1,e={background:undefined,item:undefined,itemOver:undefined,itemImage:undefined,itemActive:undefined},this.getDisplayElement=function(){return o},this.resize=function(n,t){if(v=n,y=t,s.jwGetFullscreen())_hide(o);else{var i={display:"block",width:v,height:y};_css(o,i)}},this.show=function(){_show(o)},this.hide=function(){_hide(o)},p(),this}}(jwplayer),function(n){function t(t){var i,r,u;if(n.utils.isYouTube(t.file))return"youtube";if(i=n.utils.extension(t.file),i&&n.utils.extensionmap[i]){if(i=="m3u8")return"video";r=n.utils.extensionmap[i].html5}else t.type&&(r=t.type);if(r){if(u=r.split("/")[0],u=="audio")return"sound";if(u=="video")return u}return""}n.html5.playlistitem=function(i){var r=n.utils.extend({},{author:"",date:"",description:"",image:"",link:"",mediaid:"",tags:"",title:"",provider:"",file:"",streamer:"",duration:-1,start:0,currentLevel:-1,levels:[]},i);return r.type&&(r.provider=r.type,delete r.type),r.levels.length===0&&(r.levels[0]=new n.html5.playlistitemlevel(r)),r.provider=r.provider?r.provider.toLowerCase():t(r.levels[0]),r}}(jwplayer),function(n){n.html5.playlistitemlevel=function(t){var i={file:"",streamer:"",bitrate:0,width:0};for(var r in i)n.utils.exists(t[r])&&(i[r]=t[r]);return i}}(jwplayer),function(n){n.html5.playlistloader=function(){function r(r){var u=[];try{u=n.utils.parsers.rssparser.parse(r.responseXML.firstChild);t.sendEvent(n.api.events.JWPLAYER_PLAYLIST_LOADED,{playlist:new n.html5.playlist({playlist:u})})}catch(f){i("Could not parse the playlist")}}function i(i){t.sendEvent(n.api.events.JWPLAYER_ERROR,{message:i?i:"Could not load playlist an unknown reason."})}var t=new n.html5.eventdispatcher;n.utils.extend(this,t);this.load=function(t){n.utils.ajax(t,r,i)}}}(jwplayer),function(n){n.html5.skin=function(){var t={},i=!1;this.load=function(r,u){new n.html5.skinloader(r,function(n){i=!0;t=n;u()},function(){new n.html5.skinloader("",function(n){i=!0;t=n;u()})})};this.getSkinElement=function(r,u){if(i)try{return t[r].elements[u]}catch(f){n.utils.log("No such skin component / element: ",[r,u])}return null};this.getComponentSettings=function(n){return i?t[n].settings:null};this.getComponentLayout=function(n){return i?t[n].layout:null}}}(jwplayer),function(n){n.html5.skinloader=function(t,i,r){function v(){typeof f!="string"||f===""?e(n.html5.defaultSkin().xml):n.utils.ajax(n.utils.getAbsolutePath(f),function(t){try{if(n.utils.exists(t.responseXML)){e(t.responseXML);return}}catch(i){p()}e(n.html5.defaultSkin().xml)},function(){e(n.html5.defaultSkin().xml)})}function e(t){var o=t.getElementsByTagName("component"),f,i,ut,g,a,v,p,c,w,nt,b,r,k,tt,it,e,l,d,rt;if(o.length!==0)for(f=0;f<o.length;f++){for(i=o[f].getAttribute("name"),ut={settings:{},elements:{},layout:{}},u[i]=ut,g=o[f].getElementsByTagName("elements")[0].getElementsByTagName("element"),a=0;a<g.length;a++)y(g[a],i);if(v=o[f].getElementsByTagName("settings")[0],v&&v.childNodes.length>0)for(p=v.getElementsByTagName("setting"),c=0;c<p.length;c++){var ft=p[c].getAttribute("name"),et=p[c].getAttribute("value"),ot=/color$/.test(ft)?"color":null;u[i].settings[ft]=n.utils.typechecker(et,ot)}if(w=o[f].getElementsByTagName("layout")[0],w&&w.childNodes.length>0)for(nt=w.getElementsByTagName("group"),b=0;b<nt.length;b++){for(r=nt[b],u[i].layout[r.getAttribute("position")]={elements:[]},k=0;k<r.attributes.length;k++)tt=r.attributes[k],u[i].layout[r.getAttribute("position")][tt.name]=tt.value;for(it=r.getElementsByTagName("*"),e=0;e<it.length;e++){for(l=it[e],u[i].layout[r.getAttribute("position")].elements.push({type:l.tagName}),d=0;d<l.attributes.length;d++)rt=l.attributes[d],u[i].layout[r.getAttribute("position")].elements[e][rt.name]=rt.value;n.utils.exists(u[i].layout[r.getAttribute("position")].elements[e].name)||(u[i].layout[r.getAttribute("position")].elements[e].name=l.tagName)}}h=!1;s()}}function s(){clearInterval(o);c||(o=setInterval(function(){w()},100))}function y(t,i){var r=new Image,l=t.getAttribute("name"),e=t.getAttribute("src"),o,h,v;e.indexOf("data:image/png;base64,")===0?o=e:(h=n.utils.getAbsolutePath(f),v=h.substr(0,h.lastIndexOf("/")),o=[v,i,e].join("/"));u[i].elements[l]={height:0,width:0,src:"",ready:!1,image:r};r.onload=function(){b(r,l,i)};r.onerror=function(){c=!0;s();a()};r.src=o}function p(){var t,n,i,r,f;for(t in u){n=u[t];for(i in n.elements)r=n.elements[i],f=r.image,f.onload=null,f.onerror=null,delete r.image,delete n.elements[i];delete u[t]}}function w(){var n,t;for(n in u)if(n!="properties")for(t in u[n].elements)if(!u[n].elements[t].ready)return;h===!1&&(clearInterval(o),l(u))}function b(t,i,r){u[r]&&u[r].elements[i]?(u[r].elements[i].height=t.height,u[r].elements[i].width=t.width,u[r].elements[i].src=t.src,u[r].elements[i].ready=!0,s()):n.utils.log("Loaded an image for a missing element: "+r+"."+i)}var u={},l=i,a=r,h=!0,o,f=t,c=!1;v()}}(jwplayer),function(n){n.html5.api=function(t,i){function l(){u.state==n.api.events.state.PLAYING||u.state==n.api.events.state.BUFFERING?f.pause():f.play()}function e(n){return function(){return u[n]}}function s(n,t,i){return function(){var r=u.plugins.object[n];r&&r[t]&&typeof r[t]=="function"&&r[t].apply(r,i)}}function a(){u.config.playlistfile?(u.addEventListener(n.api.events.JWPLAYER_PLAYLIST_LOADED,h),u.loadPlaylist(u.config.playlistfile)):typeof u.config.playlist=="string"?(u.addEventListener(n.api.events.JWPLAYER_PLAYLIST_LOADED,h),u.loadPlaylist(u.config.playlist)):(u.loadPlaylist(u.config),setTimeout(h,25))}function h(t){u.removeEventListener(n.api.events.JWPLAYER_PLAYLIST_LOADED,h);u.setupPlugins();c.setup();var t={id:r.id,version:r.version};f.playerReady(t)}var r={},o=document.createElement("div");t.parentNode.replaceChild(o,t);o.id=t.id;r.version=n.version;r.id=o.id;var u=new n.html5.model(r,o,i),c=new n.html5.view(r,o,u),f=new n.html5.controller(r,o,u,c);return r.skin=new n.html5.skin,r.jwPlay=function(n){typeof n=="undefined"?l():n.toString().toLowerCase()=="true"?f.play():f.pause()},r.jwPause=function(n){typeof n=="undefined"?l():n.toString().toLowerCase()=="true"?f.pause():f.play()},r.jwStop=f.stop,r.jwSeek=f.seek,r.jwPlaylistItem=f.item,r.jwPlaylistNext=f.next,r.jwPlaylistPrev=f.prev,r.jwResize=f.resize,r.jwLoad=f.load,r.jwDetachMedia=f.detachMedia,r.jwAttachMedia=f.attachMedia,r.jwGetItem=e("item"),r.jwGetPosition=e("position"),r.jwGetDuration=e("duration"),r.jwGetBuffer=e("buffer"),r.jwGetWidth=e("width"),r.jwGetHeight=e("height"),r.jwGetFullscreen=e("fullscreen"),r.jwSetFullscreen=f.setFullscreen,r.jwGetVolume=e("volume"),r.jwSetVolume=f.setVolume,r.jwGetMute=e("mute"),r.jwSetMute=f.setMute,r.jwGetStretching=function(){return u.stretching.toUpperCase()},r.jwGetState=e("state"),r.jwGetVersion=function(){return r.version},r.jwGetPlaylist=function(){return u.playlist},r.jwGetPlaylistIndex=r.jwGetItem,r.jwAddEventListener=f.addEventListener,r.jwRemoveEventListener=f.removeEventListener,r.jwSendEvent=f.sendEvent,r.jwDockSetButton=function(n,t,i,r){u.plugins.object.dock&&u.plugins.object.dock.setButton&&u.plugins.object.dock.setButton(n,t,i,r)},r.jwControlbarShow=s("controlbar","show"),r.jwControlbarHide=s("controlbar","hide"),r.jwDockShow=s("dock","show"),r.jwDockHide=s("dock","hide"),r.jwDisplayShow=s("display","show"),r.jwDisplayHide=s("display","hide"),r.jwGetLevel=function(){},r.jwGetBandwidth=function(){},r.jwGetLockState=function(){},r.jwLock=function(){},r.jwUnlock=function(){},u.config.chromeless&&!n.utils.isIOS()?a():r.skin.load(u.config.skin,a),r}}(jwplayer)),function(n,t,i,r){var nt="100%",tt=10,ot="absolute",st="relative",et="hidden",ii=" while executing ",p="function",yt="mousewheel",b="px",lt="inline-block",pt="span",d="0px",at="none",it="div",kt="fixed",wt="undefined",ct=",",k="number",l="",dt="string",f=null,e=!0,rt=.5,o=!1,a,s,v,c,gt,h,y,ht,ri,ui,vt,fi,ti,bt,ft,ei,oi,g,si,ut;n.Seadragon||(n.Seadragon={});a=n.Seadragon;s=a.Config,function(){s||(s=a.Config={debugMode:o,animationTime:1.5,blendTime:rt,alwaysBlend:o,autoHideControls:e,constrainDuringPan:e,immediateRender:o,logarithmicZoom:e,wrapHorizontal:o,wrapVertical:o,wrapOverlays:o,transformOverlays:o,minZoomDimension:f,minZoomImageRatio:.8,maxZoomPixelRatio:2,visibilityRatio:.8,springStiffness:5,imageLoaderLimit:2,clickTimeThreshold:200,clickDistThreshold:5,zoomPerClick:2,zoomPerScroll:i.pow(2,1/3),zoomPerSecond:2,proxyUrl:f,imagePath:"/images/seadragon/"})}();v=a.Strings,function(){var n="Некорректное изображение DeepZoom.";v||(v=a.Strings={Errors:{Failure:"Не удается запустить просмотровщик!",Dzc:"Deep Zoom коллекции не поддерживаются!",Dzi:n,Xml:n,Empty:"Изображение не задано",ImageFormat:"Формат {0}-не поддерживается.",Security:"Ошибка настроек безопасности браузера.",Status:"({0} {1}).",Unknown:"Ошибка!"},Messages:{Loading:"Идет загрузка..."},Tooltips:{FullPage:"Развернуть на всю страницу",Home:"Вернуть изначальный размер",ZoomIn:"Увеличить (Вы также можете использовать колесико мыши)",ZoomOut:"Уменьшить (Вы также можете использовать колесико мыши)"}},v.getString=function(n){for(var r,u=n.split("."),t=v,i=0;i<u.length;i++)t=t[u[i]]||{};return typeof t!=dt&&(t=l),r=arguments,t.replace(/\{\d+\}/g,function(n){var t=parseInt(n.match(/\d+/))+1;return t<r.length?r[t]:l})},v.setString=function(n,t){for(var r=n.split("."),u=v,i=0;i<r.length-1;i++)u[r[i]]||(u[r[i]]={}),u=u[r[i]];u[r[i]]=t})}();c=function(){this.log=function(t,i){var r=n.console||{},u=s.debugMode;u&&r.log?r.log(t):u&&i&&alert(t)};this.error=function(t,i){var u=n.console||{},r=s.debugMode;if(r&&u.error?u.error(t):r&&alert(t),r)throw i||new Error(t);};this.fail=function(n){alert(v.getString("Errors.Failure"));throw new Error(n);}};c=a.Debug=new c;gt=a.Profiler=function(){var n=this,y=n,i=o,t=0,r=f,u=f,s=Infinity,h=0,c=0,l=Infinity,a=0,v=0;n.getAvgUpdateTime=function(){return h};n.getMinUpdateTime=function(){return s};n.getMaxUpdateTime=function(){return c};n.getAvgIdleTime=function(){return a};n.getMinIdleTime=function(){return l};n.getMaxIdleTime=function(){return v};n.isMidUpdate=function(){return i};n.getNumUpdates=function(){return t};n.beginUpdate=function(){if(i&&y.endUpdate(),i=e,r=(new Date).getTime(),!(t<1)){var n=r-u;a=(a*(t-1)+n)/t;n<l&&(l=n);n>v&&(v=n)}};n.endUpdate=function(){if(i){u=(new Date).getTime();i=o;var n=u-r;t++;h=(h*(t-1)+n)/t;n<s&&(s=n);n>c&&(c=n)}};n.clearProfile=function(){i=o;t=0;r=f;u=f;s=Infinity;h=0;c=0;l=Infinity;a=0;v=0}};h=a.Point,function(){if(!h){h=a.Point=function(n,t){this.x=typeof n==k?n:0;this.y=typeof t==k?t:0};var n=h.prototype;n.plus=function(n){return new h(this.x+n.x,this.y+n.y)};n.minus=function(n){return new h(this.x-n.x,this.y-n.y)};n.times=function(n){return new h(this.x*n,this.y*n)};n.divide=function(n){return new h(this.x/n,this.y/n)};n.negate=function(){return new h(-this.x,-this.y)};n.distanceTo=function(n){return i.sqrt(i.pow(this.x-n.x,2)+i.pow(this.y-n.y,2))};n.apply=function(n){return new h(n(this.x),n(this.y))};n.equals=function(n){return n instanceof h&&this.x===n.x&&this.y===n.y};n.toString=function(){return"("+this.x+ct+this.y+")"}}}();y=a.Rect,function(){if(!y){y=a.Rect=function(n,t,i,r){var u=this;u.x=typeof n==k?n:0;u.y=typeof t==k?t:0;u.width=typeof i==k?i:0;u.height=typeof r==k?r:0};var n=y.prototype;n.getAspectRatio=function(){return this.width/this.height};n.getTopLeft=function(){return new h(this.x,this.y)};n.getBottomRight=function(){var n=this;return new h(n.x+n.width,n.y+n.height)};n.getCenter=function(){var n=this;return new h(n.x+n.width/2,n.y+n.height/2)};n.getSize=function(){return new h(this.width,this.height)};n.equals=function(n){var t=this;return n instanceof y&&t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height};n.toString=function(){var n=this;return"["+n.x+ct+n.y+ct+n.width+"x"+n.height+"]"}}}();var ni=a.Spring=function(n){function c(n){var t=s.springStiffness;return(1-i.exp(-n*t))/(1-i.exp(-t))}var u=this,f=typeof n==k?n:0,e=f,t=f,r=(new Date).getTime(),o=r,h=r;u.getCurrent=function(){return f};u.getTarget=function(){return t};u.resetTo=function(n){t=n;h=r;e=t;o=h};u.springTo=function(n){e=f;o=r;t=n;h=o+1e3*s.animationTime};u.shiftBy=function(n){e+=n;t+=n};u.update=function(){r=(new Date).getTime();f=r>=h?t:e+(t-e)*c((r-o)/(h-o))}},w=a.Browser={UNKNOWN:0,IE:1,FIREFOX:2,SAFARI:3,CHROME:4,OPERA:5},u=function(){function ut(n,i){return i&&n!=t.body?t.body:n.offsetParent}var g="DOMMouseScroll",r=this,a=r,nt=["Msxml2.XMLHTTP","Msxml3.XMLHTTP","Microsoft.XMLHTTP"],ft={bmp:o,jpeg:e,jpg:e,png:e,tif:o,wdp:o},y=w.UNKNOWN,v=0,tt=o,rt={};(function(){var f=navigator.appName,p=navigator.appVersion,i=navigator.userAgent,e,o,l,r,u;if(f!="Microsoft Internet Explorer"||!n.attachEvent||!n.ActiveXObject)if(f!="Netscape"||!n.addEventListener)f!="Opera"||!n.opera||!n.attachEvent||(y=w.OPERA,v=parseFloat(p));else{var c=i.indexOf("Firefox"),s=i.indexOf("Safari"),b=i.indexOf("Chrome");c>=0?(y=w.FIREFOX,v=parseFloat(i.substring(c+8))):s>=0&&(l=i.substring(0,s).lastIndexOf("/"),y=b>=0?w.CHROME:w.SAFARI,v=parseFloat(i.substring(l+1,s)))}else e=i.indexOf("MSIE"),y=w.IE,v=parseFloat(i.substring(e+5,i.indexOf(";",e))),o=t.documentMode,typeof o!==wt&&(v=o);for(var k=n.location.search.substring(1),a=k.split("&"),h=0;h<a.length;h++)r=a[h],u=r.indexOf("="),u>0&&(rt[r.substring(0,u)]=decodeURIComponent(r.substring(u+1)));tt=y==w.IE&&v<9||y==w.CHROME&&v<2})();r.getBrowser=function(){return y};r.getBrowserVersion=function(){return v};r.getElement=function(n){return typeof n==dt&&(n=t.getElementById(n)),n};r.getElementPosition=function(n){for(var n=a.getElement(n),t=new h,i=a.getElementStyle(n).position==kt,r=ut(n,i);r;)t.x+=n.offsetLeft,t.y+=n.offsetTop,i&&(t=t.plus(a.getPageScroll())),n=r,i=a.getElementStyle(n).position==kt,r=ut(n,i);return t};r.getElementSize=function(n){var n=a.getElement(n);return new h(n.clientWidth,n.clientHeight)};r.getElementStyle=function(t){var t=a.getElement(t);if(t.currentStyle)return t.currentStyle;if(n.getComputedStyle)return n.getComputedStyle(t,l);c.fail("Unknown element style, no known technique.")};r.getEvent=function(t){return t?t:n.event};r.getMousePosition=function(n){var n=a.getEvent(n),i=new h;return n.type==g&&y==w.FIREFOX&&v<3?(i.x=n.screenX,i.y=n.screenY):typeof n.pageX==k?(i.x=n.pageX,i.y=n.pageY):typeof n.clientX==k?(i.x=n.clientX+t.body.scrollLeft+t.documentElement.scrollLeft,i.y=n.clientY+t.body.scrollTop+t.documentElement.scrollTop):c.fail("Unknown event mouse position, no known technique."),i};r.getMouseScroll=function(n){var n=a.getEvent(n),t=0;return typeof n.wheelDelta==k?t=n.wheelDelta:typeof n.detail==k?t=n.detail*-1:c.fail("Unknown event mouse scroll, no known technique."),t?t/i.abs(t):0};r.getPageScroll=function(){var i=new h,r=t.documentElement||{},u=t.body||{};return typeof n.pageXOffset==k?(i.x=n.pageXOffset,i.y=n.pageYOffset):u.scrollLeft||u.scrollTop?(i.x=u.scrollLeft,i.y=u.scrollTop):(r.scrollLeft||r.scrollTop)&&(i.x=r.scrollLeft,i.y=r.scrollTop),i};r.getWindowSize=function(){var i=new h,r=t.documentElement||{},u=t.body||{};return typeof n.innerWidth==k?(i.x=n.innerWidth,i.y=n.innerHeight):r.clientWidth||r.clientHeight?(i.x=r.clientWidth,i.y=r.clientHeight):u.clientWidth||u.clientHeight?(i.x=u.clientWidth,i.y=u.clientHeight):c.fail("Unknown window size, no known technique."),i};r.imageFormatSupported=function(n){var n=n?n:l;return!!ft[n.toLowerCase()]};r.makeCenteredNode=function(n){var e="border:none; margin:0px; padding:0px;",n=u.getElement(n),i=a.makeNeutralElement(it),t=[],r,f;for(t.push('<div style="display:table; height:100%; width:100%;'),t.push(e),t.push('#position:relative; overflow:hidden; text-align:left;">'),t.push('<div style="#position:absolute; #top:50%; width:100%; '),t.push(e),t.push('display:table-cell; vertical-align:middle;">'),t.push('<div style="#position:relative; #top:-50%; width:100%; '),t.push(e),t.push('text-align:center;"><\/div><\/div><\/div>'),i.innerHTML=t.join(l),i=i.firstChild,r=i,f=i.getElementsByTagName(it);f.length>0;)r=f[0],f=r.getElementsByTagName(it);return r.appendChild(n),i};r.makeNeutralElement=function(n){var r=t.createElement(n),i=r.style;return i.background="transparent none",i.border=at,i.margin=d,i.padding=d,i.position="static",r};r.makeTransparentImage=function(n){var i=a.makeNeutralElement("img"),t=f;return y==w.IE&&v<7?(t=a.makeNeutralElement(pt),t.style.display=lt,i.onload=function(){t.style.width=t.style.width||i.width+b;t.style.height=t.style.height||i.height+b;i.onload=f;i=f},i.src=n,t.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+n+"', sizingMethod='scale')"):(t=i,t.src=n),t};r.setElementOpacity=function(n,t,r){var n=a.getElement(n),u,f,e;(r&&tt&&(t=i.round(t)),n.style.opacity=t<1?t:l,u=n.style.filter||l,n.style.filter=u.replace(/[\s]*alpha\(.*?\)[\s]*/g,l),t>=1)||(f=i.round(100*t),e=" alpha(opacity="+f+") ",n.style.filter+=e)};r.addEvent=function(n,t,i,r){var n=a.getElement(n);n.addEventListener?(t==yt&&n.addEventListener(g,i,r),n.addEventListener(t,i,r)):n.attachEvent?(n.attachEvent("on"+t,i),r&&n.setCapture&&n.setCapture()):c.fail("Unable to attach event handler, no known technique.")};r.removeEvent=function(n,t,i,r){var n=a.getElement(n);n.removeEventListener?(t==yt&&n.removeEventListener(g,i,r),n.removeEventListener(t,i,r)):n.detachEvent?(n.detachEvent("on"+t,i),r&&n.releaseCapture&&n.releaseCapture()):c.fail("Unable to detach event handler, no known technique.")};r.cancelEvent=function(n){var n=a.getEvent(n);n.preventDefault&&n.preventDefault();n.cancel=e;n.returnValue=o};r.stopEvent=function(n){var n=a.getEvent(n);n.stopPropagation&&n.stopPropagation();n.cancelBubble=e};r.createCallback=function(n,t){for(var r=[],i=2;i<arguments.length;i++)r.push(arguments[i]);return function(){for(var u=r.concat([]),i=0;i<arguments.length;i++)u.push(arguments[i]);return t.apply(n,u)}};r.getUrlParameter=function(n){var t=rt[n];return t?t:f};r.makeAjaxRequest=function(t,i){var e=typeof i==p,r=f,h,i,o;if(e&&(h=i,i=function(){n.setTimeout(u.createCallback(f,h,r),1)}),n.ActiveXObject)for(o=0;o<nt.length;o++)try{r=new ActiveXObject(nt[o]);break}catch(l){continue}else n.XMLHttpRequest&&(r=new XMLHttpRequest);r||c.fail("Browser doesn't support XMLHttpRequest.");s.proxyUrl&&(t=s.proxyUrl+t);e&&(r.onreadystatechange=function(){r.readyState==4&&(r.onreadystatechange=new Function,i())});try{r.open("GET",t,e);r.send(f)}catch(l){c.log(l.name+" while making AJAX request: "+l.message);r.onreadystatechange=f;r=f;e&&i()}return e?f:r};r.parseXml=function(t){var i=f,u;if(n.ActiveXObject)try{i=new ActiveXObject("Microsoft.XMLDOM");i.async=o;i.loadXML(t)}catch(r){c.log(r.name+" while parsing XML (ActiveX): "+r.message)}else if(n.DOMParser)try{u=new DOMParser;i=u.parseFromString(t,"text/xml")}catch(r){c.log(r.name+" while parsing XML (DOMParser): "+r.message)}else c.fail("Browser doesn't support XML DOM.");return i}};u=a.Utils=new u;ht=a.MouseTracker,function(){function nt(n){return u.getMousePosition(n)}function l(n,t){var i=u.getMousePosition(n),r=u.getElementPosition(t);return i.minus(r)}function y(n,i){for(var r=t.body;i&&n!=i&&r!=i;)try{i=i.parentNode}catch(u){return o}return n==i}function tt(){k=e}function it(){k=o}var r="mouseup",b="mousedown";if(!ht){var h=u.getBrowser()==w.IE&&u.getBrowserVersion()<9,k=o,d=o,g={},v=[];(function(){h?(u.addEvent(t,b,tt,o),u.addEvent(t,r,it,o)):(u.addEvent(n,b,tt,e),u.addEvent(n,r,it,e))})();ht=a.MouseTracker=function(a){function ei(){ut||(u.addEvent(a,bt,at,o),u.addEvent(a,wt,vt,o),u.addEvent(a,b,ni,o),u.addEvent(a,r,rt,o),u.addEvent(a,yt,fi,o),u.addEvent(a,"click",ri,o),ut=e,g[ct]=st)}function oi(){ut&&(u.removeEvent(a,bt,at,o),u.removeEvent(a,wt,vt,o),u.removeEvent(a,b,ni,o),u.removeEvent(a,r,rt,o),u.removeEvent(a,yt,fi,o),u.removeEvent(a,"click",ri,o),lt(),ut=o,delete g[ct])}function si(){it||(h?(u.removeEvent(a,r,rt,o),u.addEvent(a,r,ti,e),u.addEvent(a,ot,ui,e)):(u.addEvent(n,r,ii,e),u.addEvent(n,ot,pt,e)),it=e)}function lt(){it&&(h?(u.removeEvent(a,ot,ui,e),u.removeEvent(a,r,ti,e),u.addEvent(a,r,rt,o)):(u.removeEvent(n,ot,pt,e),u.removeEvent(n,r,ii,e)),it=o)}function gt(n,t){var i=g;for(var r in i)i.hasOwnProperty(r)&&ct!=r&&i[r][n](t)}function hi(){return et}function at(n){var n=u.getEvent(n),i,r;if((h&&it&&!y(n.srcElement,a)&&gt("onMouseOver",n),i=n.target?n.target:n.srcElement,r=n.relatedTarget?n.relatedTarget:n.fromElement,y(a,i)&&!y(a,r))&&(et=e,typeof w.enterHandler==p))try{w.enterHandler(w,l(n,a),ft,k)}catch(t){c.error(t.name+" while executing enter handler: "+t.message,t)}}function vt(n){var n=u.getEvent(n),i,r;if((h&&it&&!y(n.srcElement,a)&&gt("onMouseOut",n),i=n.target?n.target:n.srcElement,r=n.relatedTarget?n.relatedTarget:n.toElement,y(a,i)&&!y(a,r))&&(et=o,typeof w.exitHandler==p))try{w.exitHandler(w,l(n,a),ft,k)}catch(t){c.error(t.name+" while executing exit handler: "+t.message,t)}}function ni(n){var n=u.getEvent(n);if(n.button!=2){if(ft=e,ht=nt(n),dt=ht,kt=(new Date).getTime(),typeof w.pressHandler==p)try{w.pressHandler(w,l(n,a))}catch(t){c.error(t.name+" while executing press handler: "+t.message,t)}(w.pressHandler||w.dragHandler)&&u.cancelEvent(n);h&&d?h&&v.push(st):(si(),d=e,v=[st])}}function rt(n){var n=u.getEvent(n),i=ft,r=et;if(n.button!=2){if(ft=o,typeof w.releaseHandler==p)try{w.releaseHandler(w,l(n,a),i,r)}catch(t){c.error(t.name+" while executing release handler: "+t.message,t)}i&&r&&ci(n)}}function ti(n){var n=u.getEvent(n),i,r;if(n.button!=2){for(i=0;i<v.length;i++)r=v[i],r.hasMouse()||r.onMouseUp(n);lt();d=o;n.srcElement.fireEvent("on"+n.type,t.createEventObject(n));u.stopEvent(n)}}function ii(n){et||rt(n);lt()}function ri(n){w.clickHandler&&u.cancelEvent(n)}function ci(n){var n=u.getEvent(n);if(n.button!=2){var i=(new Date).getTime()-kt,r=nt(n),f=dt.distanceTo(r),e=i<=s.clickTimeThreshold&&f<=s.clickDistThreshold;if(typeof w.clickHandler==p)try{w.clickHandler(w,l(n,a),e,n.shiftKey)}catch(t){c.error(t.name+" while executing click handler: "+t.message,t)}}}function pt(n){var n=u.getEvent(n),i=nt(n),r=i.minus(ht);if(ht=i,typeof w.dragHandler==p){try{w.dragHandler(w,l(n,a),r,n.shiftKey)}catch(t){c.error(t.name+" while executing drag handler: "+t.message,t)}u.cancelEvent(n)}}function ui(n){for(var t=0;t<v.length;t++)v[t].onMouseMove(n);u.stopEvent(n)}function fi(n){var n=u.getEvent(n),i=u.getMouseScroll(n);if(typeof w.scrollHandler==p){if(i)try{w.scrollHandler(w,l(n,a),i,n.shiftKey)}catch(t){c.error(t.name+" while executing scroll handler: "+t.message,t)}u.cancelEvent(n)}}var ot="mousemove",wt="mouseout",bt="mouseover",tt=this,w=tt,st=f,ct=i.random(),a=u.getElement(a),ut=o,it=o,ft=o,et=o,ht=f,kt=f,dt=f;tt.target=a;tt.enterHandler=f;tt.exitHandler=f;tt.pressHandler=f;tt.releaseHandler=f;tt.clickHandler=f;tt.dragHandler=f;tt.scrollHandler=f,function(){st={hasMouse:hi,onMouseOver:at,onMouseOut:vt,onMouseUp:rt,onMouseMove:pt}}();tt.isTracking=function(){return ut};tt.setTracking=function(n){n?ei():oi()}}}}();ri=a.EventManager=function(){var i=this,t={};i.addListener=function(n,i){typeof i==p&&(t[n]||(t[n]=[]),t[n].push(i))};i.removeListener=function(n,i){var u=t[n],r;if(typeof i==p&&u)for(r=0;r<u.length;r++)if(i==u[r]){u.splice(r,1);return}};i.clearListeners=function(n){t[n]&&delete t[n]};i.trigger=function(i){var u=t[i],e=[],r;if(u){for(r=1;r<arguments.length;r++)e.push(arguments[r]);for(r=0;r<u.length;r++)try{u[r].apply(n,e)}catch(f){c.error(f.name+ii+i+" handler: "+f.message,f)}}}},function(){function i(i,r){function h(t){u.onload=f;u.onabort=f;u.onerror=f;s&&n.clearTimeout(s);n.setTimeout(function(){r(i,t?u:f)},1)}var u=f,s=f;this.start=function(){u=new Image;var f=function(){h(e)},r=function(){h(o)},l=function(){c.log("Image timed out: "+i);h(o)};u.onload=f;u.onabort=r;u.onerror=r;s=n.setTimeout(l,t);u.src=i}}var t=15e3;ui=a.ImageLoader=function(){function t(t,i,r){if(n--,typeof t==p)try{t(r)}catch(u){c.error(u.name+ii+i+" callback: "+u.message,u)}}var n=0;this.loadImage=function(r,h){if(n>=s.imageLoaderLimit)return o;var c=u.createCallback(f,t,h),l=new i(r,c);return n++,l.start(),e}}}(),function(){var t={REST:0,GROUP:1,HOVER:2,DOWN:3};vt=a.Button=function(r,s,h,c,a,v,y,b,k,g){function kt(){n.setTimeout(gt,20)}function gt(){if(vt){var t=(new Date).getTime(),r=t-bt,n=1-r/dt;n=i.min(1,n);n=i.max(0,n);u.setElementOpacity(ft,n,e);n>0&&kt()}}function ni(){vt=e;bt=(new Date).getTime()+wt;n.setTimeout(kt,wt)}function ti(){vt=o;u.setElementOpacity(ft,1,e)}function rt(n){n>=t.GROUP&&nt==t.REST&&(ti(),nt=t.GROUP);n>=t.HOVER&&nt==t.GROUP&&(ct.style.visibility=l,nt=t.HOVER);n>=t.DOWN&&nt==t.HOVER&&(at.style.visibility=l,nt=t.DOWN)}function ut(n){n<=t.HOVER&&nt==t.DOWN&&(at.style.visibility=et,nt=t.HOVER);n<=t.GROUP&&nt==t.HOVER&&(ct.style.visibility=et,nt=t.GROUP);n<=t.REST&&nt==t.GROUP&&(ni(),nt=t.REST)}function ii(n,i,r,u){r?(rt(t.DOWN),k&&k()):u||rt(t.HOVER)}function ri(n,i,r){ut(t.GROUP);r&&g&&g()}function ui(){rt(t.DOWN);v&&v()}function fi(n,i,r,u){r&&u?(ut(t.HOVER),y&&y()):r?ut(t.GROUP):rt(t.HOVER)}function ei(n,t,i){b&&i&&b()}var tt=u.makeNeutralElement(pt),nt=t.GROUP,it=new ht(tt),yt=u.makeTransparentImage(s),ft=u.makeTransparentImage(h),ct=u.makeTransparentImage(c),at=u.makeTransparentImage(a),v=typeof v==p?v:f,y=typeof y==p?y:f,b=typeof b==p?b:f,k=typeof k==p?k:f,g=typeof g==p?g:f,wt=0,dt=2e3,bt=f,vt=o;this.elmt=tt;this.notifyGroupEnter=function(){rt(t.GROUP)};this.notifyGroupExit=function(){ut(t.REST)},function(){tt.style.display=lt;tt.style.position=st;tt.title=r;tt.appendChild(yt);tt.appendChild(ft);tt.appendChild(ct);tt.appendChild(at);var o=yt.style,f=ft.style,n=ct.style,i=at.style;f.position=n.position=i.position=ot;f.top=n.top=i.top=d;f.left=n.left=i.left=d;n.visibility=i.visibility=et;u.getBrowser()==w.FIREFOX&&u.getBrowserVersion()<3&&(f.top=n.top=i.top=l);it.enterHandler=ii;it.exitHandler=ri;it.pressHandler=ui;it.releaseHandler=fi;it.clickHandler=ei;it.setTracking(e);ut(t.REST)}()};fi=a.ButtonGroup=function(n){function r(){for(var t=0;t<n.length;t++)n[t].notifyGroupEnter()}function f(t,i,r){if(!r)for(var u=0;u<n.length;u++)n[u].notifyGroupExit()}function o(t,i,r,u){if(!u)for(var f=0;f<n.length;f++)n[f].notifyGroupExit()}var t=u.makeNeutralElement(pt),n=n.concat([]),i=new ht(t);this.elmt=t;this.emulateEnter=function(){r()};this.emulateExit=function(){f()},function(){t.style.display=lt;for(var u=0;u<n.length;u++)t.appendChild(n[u].elmt);i.enterHandler=r;i.exitHandler=f;i.releaseHandler=o;i.setTracking(e)}()}}();ti=a.TileSource=function(n,t,r,u,f,e){var s=this,o=s,c=t/n;s.width=n;s.height=t;s.aspectRatio=n/t;s.dimensions=new h(n,t);s.minLevel=f?f:0;s.maxLevel=e?e:i.ceil(i.log(i.max(n,t))/i.log(2));s.tileSize=r?r:0;s.tileOverlap=u?u:0;s.getLevelScale=function(n){return 1/(1<<o.maxLevel-n)};s.getNumTiles=function(r){var u=o.getLevelScale(r),f=i.ceil(u*n/o.tileSize),e=i.ceil(u*t/o.tileSize);return new h(f,e)};s.getPixelRatio=function(n){var t=o.dimensions.times(o.getLevelScale(n)),i=1/t.x,r=1/t.y;return new h(i,r)};s.getTileAtPoint=function(n,t){var r=o.dimensions.times(o.getLevelScale(n)),u=t.times(r.x),f,e;return f=t.x>=0&&t.x<=1?i.floor(u.x/o.tileSize):i.ceil(r.x/o.tileSize)*i.floor(u.x/r.x)+i.floor((r.x+u.x%r.x)%r.x/o.tileSize),e=t.y>=0&&t.y<=c?i.floor(u.y/o.tileSize):i.ceil(r.y/o.tileSize)*i.floor(u.y/r.y)+i.floor((r.y+u.y%r.y)%r.y/o.tileSize),new h(f,e)};s.getTileBounds=function(n,t,r){var f=o.dimensions.times(o.getLevelScale(n)),h=t===0?0:o.tileSize*t-o.tileOverlap,c=r===0?0:o.tileSize*r-o.tileOverlap,e=o.tileSize+(t===0?1:2)*o.tileOverlap,s=o.tileSize+(r===0?1:2)*o.tileOverlap,u;return e=i.min(e,f.x-h),s=i.min(s,f.y-c),u=1/f.x,new y(h*u,c*u,e*u,s*u)};s.getTileUrl=function(){throw new Error("Method not implemented.");};s.tileExists=function(n,t,i){var r=o.getNumTiles(n);return n>=o.minLevel&&n<=o.maxLevel&&t>=0&&i>=0&&t<r.x&&i<r.y}};bt=a.DisplayRect=function(n,t,i,r,u,f){y.apply(this,arguments);this.minLevel=u;this.maxLevel=f};bt.prototype=new y;ft=a.DziTileSource=function(n,t,r,u,f,s,h){var c=this,v,a;ti.apply(c,[n,t,r,u]);v=c;a={};c.fileFormat=s;c.tileFormat=s;c.displayRects=h,function(){var t,i,n;if(h)for(t=h.length-1;t>=0;t--)for(i=h[t],n=i.minLevel;n<=i.maxLevel;n++)a[n]||(a[n]=[]),a[n].push(i)}();c.getTileUrl=function(n,t,i){return[f,n,"/",t,"_",i,".",s].join(l)};c.tileExists=function(n,t,u){var h=a[n],s,c,f;if(!h||!h.length)return e;for(s=v.getLevelScale(n),c=h.length-1;c>=0;c--)if(f=h[c],!(n<f.minLevel)&&!(n>f.maxLevel)){var l=f.x*s,y=f.y*s,p=l+f.width*s,w=y+f.height*s;if(l=i.floor(l/r),y=i.floor(y/r),p=i.ceil(p/r),w=i.ceil(w/r),l<=t&&t<p&&y<=u&&u<w)return e}return o}};ft.prototype=new ti,function(){function t(n){Error.apply(this,arguments);this.message=n}function i(n){return n instanceof t||(c.error(n.name+" while creating DZI from XML: "+n.message),n=new t(v.getString("Errors.Unknown"))),n}function r(n){var t=n.split("/"),i=t[t.length-1],r=i.lastIndexOf(".");return r>-1&&(t[t.length-1]=i.slice(0,r)),t.join("/")+"_files/"}function s(n,i){var o,s,r;if(n){if(n.status!==200&&n.status!==0){o=n.status;s=o==404?"Not Found":n.statusText;throw new t(v.getString("Errors.Status",o,s));}}else throw new t(v.getString("Errors.Security"));return r=f,n.responseXML&&n.responseXML.documentElement?r=n.responseXML:n.responseText&&(r=u.parseXml(n.responseText)),e(r,i)}function e(n,i){var f="Errors.Dzi",r,u,o;if(!n||!n.documentElement)throw new t(v.getString("Errors.Xml"));if(r=n.documentElement,u=r.tagName,u=="Image")try{return h(r,i)}catch(e){o=v.getString(f);throw e instanceof t?e:new t(o);}else if(u=="Collection")throw new t(v.getString("Errors.Dzc"));else if(u=="Error")return l(r);throw new t(v.getString(f));}function h(n,i){var e=n.getAttribute("Format"),f,r;if(!u.imageFormatSupported(e))throw new t(v.getString("Errors.ImageFormat",e.toUpperCase()));for(var s=n.getElementsByTagName("Size")[0],h=n.getElementsByTagName("DisplayRect"),l=parseInt(s.getAttribute("Width"),tt),a=parseInt(s.getAttribute("Height"),tt),y=parseInt(n.getAttribute("TileSize")),p=parseInt(n.getAttribute("Overlap")),c=[],o=0;o<h.length;o++)f=h[o],r=f.getElementsByTagName("Rect")[0],c.push(new bt(parseInt(r.getAttribute("X"),tt),parseInt(r.getAttribute("Y"),tt),parseInt(r.getAttribute("Width"),tt),parseInt(r.getAttribute("Height"),tt),parseInt(f.getAttribute("MinLevel"),tt),parseInt(f.getAttribute("MaxLevel"),tt)));return new ft(l,a,y,p,i,e,c)}function l(n){var i=n.getElementsByTagName("Message")[0],r=i.firstChild.nodeValue;throw new t(r);}var o="Errors.Empty";t.prototype=new Error;ft.getTilesUrl=r;ft.createFromJson=function(e,s){var k=typeof s==p,w,l,h=e,a,y,b,c;if(h&&(h.url||h.tilesUrl))try{if(a=h.displayRects,a&&a.length)for(y=0,b=a.length;y<b;y++)c=a[y],a[y]=new bt(c.x||c[0],c.y||c[1],c.width||c[2],c.height||c[3],c.minLevel||c[4],c.maxLevel||c[5]);w=new ft(h.width,h.height,h.tileSize,h.tileOverlap,h.tilesUrl||r(h.url),h.tileFormat,h.displayRects);w.xmlUrl=h.url}catch(d){l=i(d)}else l=new t(v.getString(o));if(k)n.setTimeout(u.createCallback(f,s,w,l&&l.message),1);else if(l)throw l;else return w};ft.createFromXml=function(h,c,l){function y(n,t){try{var r=n(t,b);return r.xmlUrl=h,r}catch(u){if(w)return a=i(u).message,f;throw i(u);}}var w=typeof l==p,a=f,b;if(!h){if(a=v.getString(o),w)return n.setTimeout(function(){l(f,a)},1),f;throw new t(a);}return(b=r(h),w)?(c?n.setTimeout(function(){var n=y(e,u.parseXml(c));l(n,a)},1):u.makeAjaxRequest(h,function(n){var t=y(s,n);l(t,a)}),f):c?y(e,u.parseXml(c)):y(s,u.makeAjaxRequest(h))}}();ei=a.Viewport=function(n,t){function ut(){r.goHome(e);r.update()}function nt(n){return i.log(n)/it}function tt(n){return i.pow(2,n)}function k(n,t,r){return i.min(i.max(n,t),r)}function ft(n,t){var i=n.x,r=n.y,u=k(i,t.x,t.x+t.width),f=k(r,t.y,t.y+t.height);return i===u&&r===f?n:new h(u,f)}function d(n){var h=r.getZoom(n),e=1/h,c=e/r.getAspectRatio(),o=s.visibilityRatio,u=(o-rt)*e,f=(o-rt)*c,t=1-2*u,i=w-2*f;return t<0&&(u+=rt*t,t=0),i<0&&(f+=rt*i,i=0),new a.Rect(u,f,t,i)}var u=this,r=u,n=new h(n.x,n.y),g=t.x/t.y,w=t.y/t.x,c=new ni(0),l=new ni(0),v=new ni(s.logarithmicZoom?0:1),o=f,p=new y(0,0,1,w),b=p.getCenter(),it=i.LN2;u.getHomeBounds=function(){var t=r.getAspectRatio(),n=new y(p.x,p.y,p.width,p.height);return g>=t?(n.height=p.width/t,n.y=b.y-n.height/2):(n.width=p.height*t,n.x=b.x-n.width/2),n};u.getHomeCenter=function(){return b};u.getHomeZoom=function(){var n=g/r.getAspectRatio();return n>=1?1:n};u.getMinCenter=function(n){return d(n).getTopLeft()};u.getMaxCenter=function(n){return d(n).getBottomRight()};u.getMinZoom=function(){var u=r.getHomeZoom(),f;return f=s.minZoomDimension?t.x<=t.y?s.minZoomDimension/n.x:s.minZoomDimension/(n.x*w):s.minZoomImageRatio*u,i.min(f,u)};u.getMaxZoom=function(){var u=t.x*s.maxZoomPixelRatio/n.x;return i.max(u,r.getHomeZoom())};u.getAspectRatio=function(){return n.x/n.y};u.getContainerSize=function(){return new h(n.x,n.y)};u.getBounds=function(n){var i=r.getCenter(n),t=1/r.getZoom(n),u=t/r.getAspectRatio();return new y(i.x-t/2,i.y-u/2,t,u)};u.getCenter=function(t){var i=new h(c.getCurrent(),l.getCurrent()),f=new h(c.getTarget(),l.getTarget());if(t)return i;if(!o)return f;var s=r.getZoom(),u=1/s,a=u/r.getAspectRatio(),v=new y(i.x-u/2,i.y-a/2,u,a),p=r.pixelFromPoint(o,e),w=o.minus(v.getTopLeft()).times(n.x/v.width),b=w.minus(p),k=b.divide(n.x*s);return f.plus(k)};u.getZoom=function(n){var t;return n?(t=v.getCurrent(),s.logarithmicZoom?tt(t):t):(t=v.getTarget(),s.logarithmicZoom?tt(t):t)};u.applyConstraints=function(n){var h=r.getZoom(),f=k(h,r.getMinZoom(),r.getMaxZoom()),i,t,u,e;h!=f&&r.zoomTo(f,o,n);i=r.getCenter();t=ft(i,d());s.wrapHorizontal&&(t.x=i.x);s.wrapVertical&&(t.y=i.y);i.equals(t)||(u=1/f,e=u/r.getAspectRatio(),r.fitBounds(new y(t.x-rt*u,t.y-rt*e,u,e),n))};u.ensureVisible=function(n){r.applyConstraints(n)};u.fitBounds=function(t,i){var s=r.getAspectRatio(),h=t.getCenter(),u=new y(t.x,t.y,t.width,t.height),l;u.getAspectRatio()>=s?(u.height=t.width/s,u.y=h.y-u.height/2):(u.width=t.height*s,u.x=h.x-u.width/2);r.panTo(r.getCenter(e),e);r.zoomTo(r.getZoom(e),f,e);var o=r.getBounds(),a=r.getZoom(),c=1/u.width;if(c==a||u.width==o.width){r.panTo(h,i);return}l=o.getTopLeft().times(n.x/o.width).minus(u.getTopLeft().times(n.x/u.width)).divide(n.x/o.width-n.x/u.width);r.zoomTo(c,l,i)};u.goHome=function(n){var t=r.getCenter();s.wrapHorizontal&&(t.x=(1+t.x%1)%1,c.resetTo(t.x),c.update());s.wrapVertical&&(t.y=(w+t.y%w)%w,l.resetTo(t.y),l.update());r.fitBounds(p,n)};u.panBy=function(n,t){r.panTo(r.getCenter().plus(n),t)};u.panTo=function(t,i){if(i){c.resetTo(t.x);l.resetTo(t.y);return}if(!o){c.springTo(t.x);l.springTo(t.y);return}var f=r.getZoom(),u=1/f,s=u/r.getAspectRatio(),h=new y(c.getCurrent()-u/2,l.getCurrent()-s/2,u,s),v=r.pixelFromPoint(o,e),p=o.minus(h.getTopLeft()).times(n.x/h.width),w=p.minus(v),b=w.divide(n.x*f),a=t.minus(b);c.springTo(a.x);l.springTo(a.y)};u.zoomBy=function(n,t,i){r.zoomTo(r.getZoom()*n,t,i)};u.zoomTo=function(n,t,i){i?v.resetTo(s.logarithmicZoom?nt(n):n):v.springTo(s.logarithmicZoom?nt(n):n);o=t instanceof h?t:f};u.resize=function(t,i){var f=r.getBounds(),u=f,o=t.x/n.x;n=new h(t.x,t.y);i&&(u.width=f.width*o,u.height=u.width/r.getAspectRatio());r.fitBounds(u,e)};u.update=function(){var u=c.getCurrent(),s=l.getCurrent(),n=v.getCurrent(),t;if(o&&(t=r.pixelFromPoint(o,e)),v.update(),o&&v.getCurrent()!=n){var h=r.pixelFromPoint(o,e),a=h.minus(t),i=r.deltaPointsFromPixels(a,e);c.shiftBy(i.x);l.shiftBy(i.y)}else o=f;return c.update(),l.update(),c.getCurrent()!=u||l.getCurrent()!=s||v.getCurrent()!=n};u.deltaPixelsFromPoints=function(t,i){return t.times(n.x*r.getZoom(i))};u.deltaPointsFromPixels=function(t,i){return t.divide(n.x*r.getZoom(i))};u.pixelFromPoint=function(t,i){var u=r.getBounds(i);return t.minus(u.getTopLeft()).times(n.x/u.width)};u.pointFromPixel=function(t,i){var u=r.getBounds(i);return t.divide(n.x/u.width).plus(u.getTopLeft())};ut()},function(){function v(n,t,i,r,u,e){var s=this;s.level=n;s.x=t;s.y=i;s.bounds=r;s.exists=u;s.url=e;s.elmt=f;s.image=f;s.loaded=o;s.loading=o;s.style=f;s.position=f;s.size=f;s.blendStart=f;s.opacity=f;s.distance=f;s.visibility=f;s.beingDrawn=o;s.lastDrawnTime=0;s.lastTouchTime=0}function yt(n){switch(n){case g.TOP_LEFT:return function(){};case g.TOP:return function(n,t){n.x-=t.x/2};case g.TOP_RIGHT:return function(n,t){n.x-=t.x};case g.RIGHT:return function(n,t){n.x-=t.x;n.y-=t.y/2};case g.BOTTOM_RIGHT:return function(n,t){n.x-=t.x;n.y-=t.y};case g.BOTTOM:return function(n,t){n.x-=t.x/2;n.y-=t.y};case g.BOTTOM_LEFT:return function(n,t){n.y-=t.y};case g.LEFT:return function(n,t){n.y-=t.y/2};case g.CENTER:default:return function(n,t){n.x-=t.x/2;n.y-=t.y/2}}}function d(n,t,i){var r=this;r.elmt=n;r.scales=t instanceof y;r.bounds=new y(t.x,t.y,t.width,t.height);r.adjust=yt(t instanceof h?i:g.TOP_LEFT);r.position=new h(t.x,t.y);r.size=new h(t.width,t.height);r.style=n.style;r.naturalSize=new h(n.clientWidth,n.clientHeight)}for(var ft="progid:DXImageTransform.Microsoft.Matrix(",et=" when it's not yet loaded.",st="Attempting to draw tile ",pt=100,ht=rt,p=u.getBrowser(),bt=u.getBrowserVersion(),ri=navigator.userAgent,kt=!!t.createElement("canvas").getContext,dt=t.documentElement||{},lt=dt.style||{},tt=o,ni=["msTransform","WebkitTransform","MozTransform"],n,ut;n=ni.shift();)if(typeof lt[n]!==wt){tt=e;ut=/webkit/i.test(n);break}var fi=typeof lt["WebkitTransition"]!==wt,ei=new RegExp("progid:DXImageTransform.Microsoft.Matrix\\(.*?\\)","g"),si=function(){try{return p==w.IE&&!!t.documentElement.filters}catch(n){return o}}(),ti=p==w.SAFARI&&bt<4||p==w.CHROME,k=kt&&!ti,at=!k&&tt,vt=o,ii=typeof t.documentMode!==wt?"bicubic":"nearest-neighbor";v.prototype.toString=function(){return this.level+"/"+this.x+"_"+this.y};v.prototype.drawHTML=function(t){var r=this,h,a;if(!r.loaded){c.error(st+r.toString()+et);return}r.elmt||(r.elmt=u.makeNeutralElement("img"),r.elmt.src=r.url,r.style=r.elmt.style,r.style.position=ot,r.style.msInterpolationMode=ii,at&&(r.style[n+"Origin"]="0px 0px"));var s=r.elmt,v=r.image,f=r.style,e=r.position,o=r.size;s.parentNode!=t&&t.appendChild(s);at?f[n]=["matrix(",(o.x/v.width).toFixed(8),",0,0,",(o.y/v.height).toFixed(8),ct,e.x.toFixed(8),ut?ct:"px,",e.y.toFixed(8),ut?")":"px)"].join(l):vt?(h=t.clientWidth,a=t.clientHeight,f.width=h+b,f.height=a+b,f.filter=[ft,"M11=",(o.x/h).toFixed(8),",M22=",(o.y/a).toFixed(8),",Dx=",e.x.toFixed(8),",Dy=",e.y.toFixed(8),")"].join(l)):(e=e.apply(i.floor),o=o.apply(i.ceil),f.left=e.x+b,f.top=e.y+b,f.width=o.x+b,f.height=o.y+b);u.setElementOpacity(s,r.opacity)};v.prototype.drawCanvas=function(n){var t=this,i,r;if(!t.loaded){c.error(st+t.toString()+et);return}i=t.position;r=t.size;n.globalAlpha=t.opacity;n.drawImage(t.image,i.x,i.y,r.x,r.y)};v.prototype.unload=function(){var n=this;n.elmt&&n.elmt.parentNode&&n.elmt.parentNode.removeChild(n.elmt);n.elmt=f;n.image=f;n.loaded=o;n.loading=o};g=a.OverlayPlacement={CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8};d.prototype.destroy=function(){var t=this.elmt,n=this.style;t.parentNode&&t.parentNode.removeChild(t);n.top=l;n.left=l;n.position=l;this.scales&&(n.width=l,n.height=l)};d.prototype.drawHTML=function(t){var o=this,f=o.elmt,r=o.style,c=o.scales,h=o.naturalSize,e,u,a,v;f.parentNode!=t&&(t.appendChild(f),r.position=ot,h.x=f.clientWidth,h.y=f.clientHeight);e=o.position;u=o.size;c||(u.x=h.x=h.x||f.clientWidth,u.y=h.y=h.y||f.clientHeight);o.adjust(e,u);s.transformOverlays&&tt?(r[n+"Origin"]="0px 0px",r[n]=["translate(",e.x.toFixed(8),"px,",e.y.toFixed(8),"px)"].join(l),c&&(f.clientWidth||(r.width=nt),f.clientHeight||(r.height=nt),r[n]+=[" scale(",(u.x/f.clientWidth).toFixed(8),ct,(u.y/f.clientHeight).toFixed(8),")"].join(l))):s.transformOverlays&&vt?(a=t.clientWidth,v=t.clientHeight,r.width=a+b,r.height=v+b,r.filter=[ft,"M11=",(u.x/a).toFixed(8),",M22=",(u.y/v).toFixed(8),",Dx=",e.x.toFixed(8),",Dy=",e.y.toFixed(8),")"].join(l)):(e=e.apply(i.floor),u=u.apply(i.ceil),r.left=e.x+b,r.top=e.y+b,c&&(r.width=u.x+b,r.height=u.y+b))};d.prototype.update=function(n,t){this.scales=n instanceof y;this.bounds=new y(n.x,n.y,n.width,n.height);this.adjust=yt(n instanceof h?t:g.TOP_LEFT)};oi=a.Drawer=function(n,t,a){function si(t){return vt[t]||(vt[t]=n.getNumTiles(t)),vt[t]}function hi(t){return yt[t]||(yt[t]=n.getPixelRatio(t)),yt[t]}function ci(t,i,r,u,f,e){var c;if(ut[t]||(ut[t]={}),ut[t][i]||(ut[t][i]={}),!ut[t][i][r]){var o=(f+i%f)%f,s=(e+r%e)%e,h=n.getTileBounds(t,o,s),l=n.tileExists(t,o,s),a=n.getTileUrl(t,o,s);h.x+=1*(i-o)/f;h.y+=at*(r-s)/e;ut[t][i][r]=new v(t,i,r,h,l,a)}return c=ut[t][i][r],c.lastTouchTime=u,c}function li(n,t){n.loading=ti.loadImage(n.url,u.createCallback(f,ai,n,t))}function ai(n,t,r){var a,s;if(n.loading=o,wt){c.error("Tile load callback in middle of drawing routine.");return}if(r){if(t<dt){c.log("Ignoring tile "+n+" loaded before reset: "+n.url);return}}else{c.log("Tile "+n+" failed to load: "+n.url);n.exists=o;return}if(n.loaded=e,n.image=r,a=ft.length,ft.length>=pt){for(var p=i.ceil(i.log(fi)/i.log(2)),u=f,l=-1,h=ft.length-1;h>=0;h--){if(s=ft[h],s.level<=p||s.beingDrawn)continue;else if(!u){u=s;l=h;continue}var v=s.lastTouchTime,y=u.lastTouchTime,w=s.level,b=u.level;(v<y||v==y&&w>b)&&(u=s,l=h)}u&&l>=0&&(u.unload(),a=l)}ft[a]=n;tt=e}function vi(){ut={};ft=[]}function st(n,t,i){var u,s,f,h;if(!b[n])return o;if(t===r||i===r){u=b[n];for(s in u)if(u.hasOwnProperty(s)){f=u[s];for(h in f)if(f.hasOwnProperty(h)&&!f[h])return o}return e}return b[n][t]===r||b[n][t][i]===r||b[n][t][i]===e}function yi(n,t,i){return t===r||i===r?st(n+1):st(n+1,2*t,2*i)&&st(n+1,2*t,2*i+1)&&st(n+1,2*t+1,2*i)&&st(n+1,2*t+1,2*i+1)}function pi(n,t,i,r){if(!b[n]){c.error("Setting coverage for a tile before its level's coverage has been reset: "+n);return}b[n][t]||(b[n][t]={});b[n][t][i]=r}function wi(n){b[n]={}}function bi(n,t){return n?t.visibility>n.visibility?t:t.visibility==n.visibility&&t.distance<n.distance?t:n:t}function bt(n){for(var t=g.length-1;t>=0;t--)if(g[t].elmt==n)return t;return-1}function ki(){var u,nr,tr,c,a,gt,rr,ti,r,nu,y;tt=o;for(var ot=et,ur=ni,ff=ct,fr=k,ft=oi;ft.length>0;)r=ft.pop(),r.beingDrawn=o;var er=t.getContainerSize(),or=er.x,sr=er.y;fr?(ot.width=or,ot.height=sr,ur.clearRect(0,0,or,sr)):ot.innerHTML=l;var hr=t.getBounds(e),b=hr.getTopLeft(),d=hr.getBottomRight();if((s.wrapHorizontal||!(d.x<0||b.x>1))&&(s.wrapVertical||!(d.y<0||b.y>at))){var ru=si,lt=hi,uu=ci,fu=yi,vt=pi,eu=wi,ou=st,su=ei,hu=kt,cu=p===w.CHROME,lu=i.abs,ef=i.ceil,fi=i.floor,yt=i.log,ai=i.max,v=i.min,nt=t.deltaPixelsFromPoints,pt=t.pixelFromPoint,cr=n.getTileAtPoint,au=s.alwaysBlend,vi=1e3*s.blendTime,vu=s.immediateRender,ki=s.minZoomDimension,of=s.minImageRatio,di=s.wrapHorizontal,gi=s.wrapVertical,lr=s.wrapOverlays;di||(b.x=ai(b.x,0),d.x=v(d.x,1));gi||(b.y=ai(b.y,0),d.y=v(d.y,at));var wt=f,bt=o,it=(new Date).getTime(),ar=t.getCenter(),yu=pt(ar),pu=nt(lt(0),o).x,vr=vu?1:pu;ki=ki||64;var dt=ai(ii,fi(yt(ki)/yt(2))),wu=nt(lt(0),e).x,yr=v(ri,fi(yt(wu/ht)/yt(2)));for(dt=v(dt,yr),u=yr;u>=dt;u--){if(nr=o,tr=nt(lt(u),e).x,!bt&&tr>=ht||u==dt)nr=e,bt=e;else if(!bt)continue;eu(u);var bu=v(1,(tr-rt)/rt),ku=nt(lt(u),o).x,du=vr/lu(vr-ku),pr=cr(u,b),ut=cr(u,d),wr=ru(u),br=wr.x,kr=wr.y;for(di||(ut.x=v(ut.x,br-1)),gi||(ut.y=v(ut.y,kr-1)),c=pr.x;c<=ut.x;c++)for(a=pr.y;a<=ut.y;a++)if((r=uu(u,c,a,it,br,kr),gt=nr,vt(u,c,a,o),r.exists)&&(bt&&!gt&&(fu(u,c,a)?vt(u,c,a,e):gt=e),gt)){var dr=r.bounds.getTopLeft(),gr=r.bounds.getSize(),gu=pt(dr,e),ir=nt(gr,e);su||(ir=ir.plus(new h(1,1)));var nf=pt(dr,o),tf=nt(gr,o),rf=nf.plus(tf.divide(2)),uf=yu.distanceTo(rf);r.position=gu;r.size=ir;r.distance=uf;r.visibility=du;r.loaded?(r.blendStart||(r.blendStart=it),rr=it-r.blendStart,ti=vi===0?1:v(1,rr/vi),au&&(ti*=bu),r.opacity=ti,ft.push(r),ti>=1?(vt(u,c,a,e),cu&&r.lastDrawnTime!==hu&&vt(u,c,a,o)):rr<vi&&(tt=e),r.lastDrawnTime=it):r.loading||(wt=bi(wt,r))}if(ou(u))break}for(y=ft.length-1;y>=0;y--)r=ft[y],fr?r.drawCanvas(ur):r.drawHTML(ot),r.beingDrawn=e;for(nu=g.length,y=0;y<nu;y++){var ui=g[y],tu=ui.bounds,iu=tu.getTopLeft();lr&&di&&(iu.x+=fi(ar.x));lr&&gi;ui.position=pt(iu,e);ui.size=nt(tu.getSize(),e);ui.drawHTML(ct)}wt&&(li(wt,it),tt=e);kt=it}}var y=this,ct=u.getElement(a),et=u.makeNeutralElement(k?"canvas":it),ni=k?et.getContext("2d"):f,ti=new ui,lt=new gt,ii=n.minLevel,ri=n.maxLevel,fi=n.tileSize,ei=n.tileOverlap,at=n.height/n.width,vt={},yt={},ut={},ft=[],b={},g=[],oi=[],kt=0,dt=0,wt=o,tt=e;y.elmt=ct;y.profiler=lt,function(){et.style.width=nt;et.style.height=nt;et.style.position=ot;ct.style.textAlign="left";ct.appendChild(et)}();y.addOverlay=function(n,t,i){var n=u.getElement(n);bt(n)>=0||(g.push(new d(n,t,i)),tt=e)};y.updateOverlay=function(n,t,i){var n=u.getElement(n),r=bt(n);r>=0&&(g[r].update(t,i),tt=e)};y.removeOverlay=function(n){var n=u.getElement(n),t=bt(n);t>=0&&(g[t].destroy(),g.splice(t,1),tt=e)};y.clearOverlays=function(){while(g.length>0)g.pop().destroy(),tt=e};y.needsUpdate=function(){return tt};y.numTilesLoaded=function(){return ft.length};y.reset=function(){vi();dt=(new Date).getTime();tt=e};y.update=function(){lt.beginUpdate();wt=e;ki();wt=o;lt.endUpdate()};y.idle=function(){}}}(),function(){function ni(n,t,i){t==ut.TOP_RIGHT||t==ut.BOTTOM_RIGHT?i.insertBefore(n,i.firstChild):i.appendChild(n)}function r(n,t,i){var f=this,r=u.makeNeutralElement(pt);f.elmt=n;f.anchor=t;f.container=i;f.wrapper=r;r.style.display=lt;r.appendChild(n);t==ut.NONE&&(r.style.width=r.style.height=nt);ni(r,t,i)}function ti(t){function it(){t.viewport&&t.viewport.goHome()}function ut(){t.setFullPage(!t.isFullPage());t.isFullPage()?(seadragonviewer.addControl(nextControl,Seadragon.ControlAnchor.BOTTOM_RIGHT),seadragonviewer.addControl(prevControl,Seadragon.ControlAnchor.BOTTOM_RIGHT),manageVisiblityImagePaging()):(seadragonviewer.removeControl(nextControl),seadragonviewer.removeControl(prevControl),seadragonviewer.removeControl(nextImageControl),seadragonviewer.removeControl(prevImageControl),updateNavigate());u.emulateExit();t.viewport&&t.viewport.applyConstraints()}function d(){c=(new Date).getTime();a=s.zoomPerSecond;h=e;w()}function nt(){c=(new Date).getTime();a=1/s.zoomPerSecond;h=e;w()}function l(){h=o}function w(){n.setTimeout(ft,tt)}function ft(){if(h&&t.viewport){var n=(new Date).getTime(),r=n-c,u=i.pow(a,r/1e3);t.viewport.zoomBy(u);t.viewport.applyConstraints();c=n;w()}}function et(){t.viewport&&(h=o,t.viewport.zoomBy(s.zoomPerClick/1),t.viewport.applyConstraints())}function ot(){t.viewport&&(h=o,t.viewport.zoomBy(1/s.zoomPerClick),t.viewport.applyConstraints())}function st(){u.emulateEnter();u.emulateExit()}function r(n,t){return s.imagePath+n+t}var u=f,h=o,a=f,c=f,ht=new vt(v.getString("Tooltips.ZoomIn"),r(b,g),r(b,rt),r(b,ct),r(b,yt),d,l,et,d,l),lt=new vt(v.getString("Tooltips.ZoomOut"),r(k,g),r(k,rt),r(k,ct),r(k,yt),nt,l,ot,nt,l),at=new vt(v.getString("Tooltips.Home"),r(p,g),r(p,rt),r(p,ct),r(p,yt),f,it,f,f,f),pt=new vt(v.getString("Tooltips.FullPage"),r(y,g),r(y,rt),r(y,ct),r(y,yt),f,ut,f,f,f);return u=new fi([ht,lt,at,pt]),u.elmt[wt]=e,t.addEventListener("open",st),u.elmt}var wt="----seadragon----",bt=u.getBrowser();ut=a.ControlAnchor={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_RIGHT:3,BOTTOM_LEFT:4};r.prototype.destroy=function(){var n=this;n.wrapper.removeChild(n.elmt);n.container.removeChild(n.wrapper)};r.prototype.isVisible=function(){return this.wrapper.style.display!=at};r.prototype.setVisible=function(n){this.wrapper.style.display=n?lt:at};r.prototype.setOpacity=function(n){this.elmt[wt]&&bt==w.IE?u.setElementOpacity(this.elmt,n,e):u.setElementOpacity(this.wrapper,n,e)};var y="fullpage",p="home",b="zoomin",k="zoomout",g="_rest.png",rt="_grouphover.png",ct="_hover.png",yt="_pressed.png";si=a.Viewer=function(a){function wr(){var t=rt.style,i=a.style,r=ci.style,u=li.style,f=ai.style,o=vi.style;i.width=nt;i.height=nt;i.position=st;i.left=d;i.top=d;i.textAlign="left";t.width=nt;t.height=nt;t.overflow=et;t.position=ot;t.top=d;t.left=d;r.position=u.position=f.position=o.position=ot;r.top=u.top=d;r.left=o.left=d;u.right=f.right=d;o.bottom=f.bottom=d;ct.clickHandler=gr;ct.pressHandler=nu;ct.dragHandler=tu;ct.releaseHandler=iu;ct.scrollHandler=ru;ct.setTracking(e);bt=ti(w);bt.style.marginRight="4px";bt.style.marginBottom="4px";w.addControl(bt,ut.BOTTOM_RIGHT);ni.enterHandler=ar;ni.exitHandler=vr;ni.releaseHandler=dr;ni.setTracking(e);n.setTimeout(hi,1);a.appendChild(rt);a.appendChild(ci);a.appendChild(li);a.appendChild(ai);a.appendChild(vi);pt.innerHTML=l;pt.appendChild(a)}function si(n){var r="normal",f=t.createTextNode(n),i;rt.innerHTML=l;rt.appendChild(u.makeCenteredNode(f));i=f.parentNode.style;i.fontFamily="verdana";i.fontSize="13px";i.fontSizeAdjust=at;i.fontStyle=r;i.fontStretch=r;i.fontVariant=r;i.fontWeight=r;i.lineHeight="1em";i.textAlign="center";i.textDecoration=at}function fr(){return k&&er(),ii=(new Date).getTime(),n.setTimeout(function(){ii>ir&&si(v.getString("Messages.Loading"))},2e3),ii}function wi(t,i,r){if(ir=(new Date).getTime(),t<ii){c.log("Ignoring out-of-date open.");g.trigger("ignore",w);return}if(!i){si(r);g.trigger("error",w);return}if(rt.innerHTML=l,lt=u.getElementSize(a),lt.x===0||lt.y===0){n.setTimeout(function(){wi(t,i,r)},tt);return}k=i;y=new ei(lt,k.dimensions);vt=new oi(k,y,rt);wt=new gt;w.source=k;w.viewport=y;w.drawer=vt;w.profiler=wt;yt=o;ui=e;or(br);g.trigger("open",w)}function er(){w.source=k=f;w.viewport=y=f;w.drawer=vt=f;w.profiler=wt=f;rt.innerHTML=l}function or(t,r){if(yt)return n.setTimeout(t,1);var u=(new Date).getTime(),r=r?r:u,f=r+1e3/60,e=i.max(1,f-u);return n.setTimeout(t,e)}function sr(){var n,t;k&&(wt.beginUpdate(),n=u.getElementSize(a),!n.equals(lt)&&n.x>0&&n.y>0&&(y.resize(n,e),lt=n,g.trigger("resize",w)),t=y.update(),!yt&&t&&(g.trigger("animationstart",w),lr()),t?(vt.update(),g.trigger("animation",w)):ui||vt.needsUpdate()?(vt.update(),ui=o):vt.idle(),yt&&!t&&(g.trigger("animationfinish",w),fi||hi()),yt=t,wt.endUpdate())}function br(){if(k){var n=(new Date).getTime();sr();or(arguments.callee,n)}}function hr(n){for(var t=b.length-1;t>=0;t--)if(b[t].elmt==n)return t;return-1}function cr(){n.setTimeout(kr,20)}function kr(){var t;if(yi){var r=(new Date).getTime(),u=r-bi,n=1-u/pr;for(n=i.min(1,n),n=i.max(0,n),t=b.length-1;t>=0;t--)b[t].setOpacity(n);n>0&&cr()}}function lr(){yi=o;for(var n=b.length-1;n>=0;n--)b[n].setOpacity(1)}function hi(){s.autoHideControls&&(yi=e,bi=(new Date).getTime()+ki,n.setTimeout(cr,ki))}function ar(){fi=e;lr()}function vr(n,t,i){i||(fi=o,yt||hi())}function dr(n,t,i,r){r||(fi=o,yt||hi())}function gr(n,t,i,r){if(y&&i){var u=s.zoomPerClick,f=r?1/u:u;y.zoomBy(f,y.pointFromPixel(t,e));y.applyConstraints()}}function nu(n,t){y&&(rr=t,ur=y.getCenter())}function tu(n,t,i){if(y)if(s.constrainDuringPan){var r=t.minus(rr),u=y.deltaPointsFromPixels(r.negate(),e);y.panTo(ur.plus(u));y.applyConstraints()}else y.panBy(y.deltaPointsFromPixels(i.negate(),e))}function iu(n,t,i){i&&y&&y.applyConstraints()}function ru(n,t,r){if(y){var u=i.pow(s.zoomPerScroll,r);y.zoomBy(u,y.pointFromPixel(t,e));y.applyConstraints()}}function yr(n){n=u.getEvent(n);n.keyCode===27&&w.setFullPage(o)}var p=this,w=p,pt=u.getElement(a),a=u.makeNeutralElement(it),rt=u.makeNeutralElement(it),ci=u.makeNeutralElement(it),li=u.makeNeutralElement(it),ai=u.makeNeutralElement(it),vi=u.makeNeutralElement(it),k=f,vt=f,y=f,wt=f,g=new ri,ct=new ht(rt),ni=new ht(a),b=[],yi=e,bi=f,bt=f,ki=1e3,pr=2e3,bi=f,yi=o,di=t.body.style.width,gi=t.body.style.height,nr=t.body.style.overflow,tr=t.documentElement.style.overflow,pi=new h(1,1),lt=f,ii=0,ir=0,rr=f,ur=f,yt=o,ui=o,fi=o;p.container=pt;p.elmt=a;p.source=f;p.drawer=f;p.viewport=f;p.profiler=f;p.tracker=ct;p.isOpen=function(){return!!k};p.openDzi=function(n,t){var r=fr(),i=u.createCallback(f,wi,r);switch(typeof n){case dt:ft.createFromXml(n,t,i);break;default:ft.createFromJson(n,i)}};p.openTileSource=function(t){var i=fr();n.setTimeout(function(){wi(i,t)},1)};p.close=function(){k&&er()};p.addControl=function(n,t){var n=u.getElement(n),i;if(!(hr(n)>=0)){i=f;switch(t){case ut.TOP_RIGHT:i=li;n.style.position=st;break;case ut.BOTTOM_RIGHT:i=ai;n.style.position=st;break;case ut.BOTTOM_LEFT:i=vi;n.style.position=st;break;case ut.TOP_LEFT:i=ci;n.style.position=st;break;case ut.NONE:default:i=a;n.style.position=ot}b.push(new r(n,t,i))}};p.removeControl=function(n){var n=u.getElement(n),t=hr(n);t>=0&&(b[t].destroy(),b.splice(t,1))};p.clearControls=function(){while(b.length>0)b.pop().destroy()};p.getNavControl=function(){return bt};p.isDashboardEnabled=function(){for(var n=b.length-1;n>=0;n--)if(b[n].isVisible())return e;return o};p.isFullPage=function(){return a.parentNode==t.body};p.isMouseNavEnabled=function(){return ct.isTracking()};p.isVisible=function(){return a.style.visibility!=et};p.setDashboardEnabled=function(n){for(var t=b.length-1;t>=0;t--)b[t].setVisible(n)};p.setFullPage=function(n){var v,p;if(n!=w.isFullPage()){var b=t.body,r=b.style,c=t.documentElement.style,o=a.style,s=rt.style;n?(nr=r.overflow,tr=c.overflow,r.overflow=et,c.overflow=et,di=r.width,gi=r.height,r.width=nt,r.height=nt,s.backgroundColor="black",s.color="white",o.position=kt,o.zIndex="99999999",b.appendChild(a),lt=u.getWindowSize(),u.addEvent(t,"keydown",yr),ar()):(r.overflow=nr,c.overflow=tr,r.width=di,r.height=gi,s.backgroundColor=l,s.color=l,o.position=st,o.zIndex=l,pt.appendChild(a),lt=u.getElementSize(pt),u.removeEvent(t,"keydown",yr),vr());y&&(v=y.getBounds(),y.resize(lt),p=y.getBounds(),n?pi=new h(p.width/v.width,p.height/v.height):(y.update(),y.zoomBy(i.max(pi.x,pi.y),f,e)),ui=e,g.trigger("resize",w),sr())}};p.setMouseNavEnabled=function(n){ct.setTracking(n)};p.setVisible=function(n){a.style.visibility=n?l:et};p.showMessage=function(t,i){if(!i){si(t);return}n.setTimeout(function(){w.isOpen()||si(t)},i)};p.addEventListener=function(n,t){g.addListener(n,t)};p.removeEventListener=function(n,t){g.removeListener(n,t)};wr()}}()}(window,document,Math);$(function(){$(document).bind("keydown","ctrl+f3",function(){$(".searchbox input").focus()});$(document).bind("keydown","alt+f3",function(){window.location.href=$("#AdvancedSearchLnk").attr("href")});$(document).bind("keydown","alt+f12",function(){eval($("#LoginView_LoginStatus").attr("href"))});$(document).bind("keydown","alt+f1",function(){window.open($("#LoginView_HelpLnk").attr("href"))});$(document).bind("keydown","alt+pageup",function(){var n=$("input.forward-button");n.length&&n.click()});$(document).bind("keydown","alt+pagedown",function(){var n=$("input.back-button");n.length&&n.click()})});$(document).ready(function(){function t(){$('span.ClipboardGroup:has("input:checkbox")').off();$('span.ClipboardGroup:has("input:checkbox")').on("click",function(){$('span.ClipboardGroup:has("input:checkbox:checked")').length>0?$("input.ClipboardGroup:submit").removeAttr("disabled"):$("input.ClipboardGroup:submit").attr("disabled","disabled")})}if(typeof Sys!="undefined"){var n=Sys.WebForms.PageRequestManager.getInstance();n.add_endRequest(t)}});$(document).ready(function(){var n=$("#SearchTxt_I"),t="/Pages/GetSuggestions.ashx";n.autocomplete({source:t,minLength:3,select:function(t,i){n.val(i.item.value);n.change();$("#SearchBtn").click()}});$(".layout-suggestions").autocomplete({source:t,minLength:3})});$(function(){$(".main-container").delegate(".filter-apply","keydown",function(n){return clickButton(n,".main-container .filter-apply-button:first")})});$(function(){var n=$("#employeeDetailsPnl").dialog({autoOpen:!1,width:800,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#LoginStatisticsPnl").dialog({autoOpen:!1,width:500,height:300,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"))});var TREEVIEW_ID="treeView",LINK=0,CHECKBOX=1;$(function(){var n=$("#printFormsPnl").dialog({autoOpen:!1,width:200,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#userLoginStatisticsPnl").dialog({autoOpen:!1,width:500,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"))}),function(n,t){function i(n){function f(){var u=t("div.buttons>input[type=submit].block-selected-users"),f=t("div.buttons>input[type=submit].unblock-selected-users"),e=i.is(function(){return t(this).val().toLowerCase()==="blocked"}),o=i.is(function(){return t(this).val().toLowerCase()==="open"}),n=!i.is(function(){return!(t(this).val().toLowerCase()==="open"||t(this).val().toLowerCase()==="blocked")}),s=r&&n&&o,h=r&&n&&e;u.toggle(s);f.toggle(h)}function e(){function f(){var n=new Date;return new Date(n.getFullYear(),n.getMonth(),n.getDate())}var n=t("div.buttons>input[type=submit].prolong-selected-users"),i=u.parent().siblings("input[type=text].user-access-end-date"),e=!i.is(function(){return!(Date.parse(t(this).val())<f())}),o=r&&e;n.toggle(o)}function o(){var n=t("div.buttons>input[type=submit].confirm-selected-users"),u=!i.is(function(){return!(t(this).val().toLowerCase()==="registration")}),f=r&&u;n.toggle(f)}function s(){var i=t("div.buttons>input[type=submit].sendtosmev-selected-users"),f=n.attr("sendtosmev"),r=n.prop("checked"),u;r!=undefined&&(r&&f.toLowerCase()=="true"?i.show():i.hide(),u=t('input[name$="_cbSelectRecord"]:checked').not('[sendtosmev="False"]'),u.length>0?i.show():i.hide())}var u=n.filter(function(){return t(this).prop("checked")}),i=u.parent().siblings("input[type=text].user-access-state"),r=u.length>0;f();e();o();s()}n.InitUsersSelectionControls=function(){var r=t(".users-grid .select-all>input[type=checkbox]"),n=t(".users-grid .select-one>input[type=checkbox]");r.change(function(){var r=t(this).prop("checked");n.each(function(){t(this).prop("checked",r)});i(n)});n.change(function(){var u=!n.is(function(){return!t(this).prop("checked")});r.prop("checked",u);i(t(this))});i(n)}}(UsersAdministration||(UsersAdministration={}),jQuery);$(function(){UsersAdministration.InitUsersSelectionControls()});EpkPassports=function(){function e(){n!==i&&($("input, select",".b-passport-tab-content :visible").unbind("change",u),$("input, select",".b-passport-tab-content :visible").bind("change",u),$(".b-passport-tab-content____save",".b-passport-tab-content :visible").unbind("click",f),$(".b-passport-tab-content____save",".b-passport-tab-content :visible").bind("click",f))}function r(){return n===i||t===!0||confirm("Данные не сохранены. Продолжить?")}function u(){t=!1}function f(){t=!0}function o(){return r()}var n=0,i=0,t=!0;return{OnTabInit:function(t){n=t.activeTabIndex;e()},OnTabChanging:function(n,t){r()||(t.cancel=!0)},OnTabChanged:function(i,r){n=r.tab.index;t=!0},RegisterDialogOnClosingEvent:function(n){n.onbeforeclose(o)}}}();EpkInventoryRegistry=function(){function e(){n!==i&&($("input, select",".b-InventoryRegistry-tab-content :visible").unbind("change",u),$("input, select",".b-InventoryRegistry-tab-content :visible").bind("change",u),$(".b-InventoryRegistry-tab-content____save",".b-InventoryRegistry-tab-content :visible").unbind("click",f),$(".b-InventoryRegistry-tab-content____save",".b-InventoryRegistry-tab-content :visible").bind("click",f))}function r(){return n===i||t===!0||confirm("Данные не сохранены. Продолжить?")}function u(){t=!1}function f(){t=!0}function o(){return r()}var n=0,i=0,t=!0;return{OnTabInit:function(t){n=t.activeTabIndex;e()},OnTabChanging:function(n,t){r()||(t.cancel=!0)},OnTabChanged:function(i,r){n=r.tab.index;t=!0},RegisterDialogOnClosingEvent:function(n){n.onbeforeclose(o)}}}();defaultComment="Нет комментария...";JSON||(JSON={}),function(){"use strict";function i(n){return n<10?"0"+n:n}function o(n){return e.lastIndex=0,e.test(n)?'"'+n.replace(e,function(n){var t=s[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function u(i,f){var s,l,h,a,v=n,c,e=f[i];e&&typeof e=="object"&&typeof e.toJSON=="function"&&(e=e.toJSON(i));typeof t=="function"&&(e=t.call(f,i,e));switch(typeof e){case"string":return o(e);case"number":return isFinite(e)?String(e):"null";case"boolean":case"null":return String(e);case"object":if(!e)return"null";if(n+=r,c=[],Object.prototype.toString.apply(e)==="[object Array]"){for(a=e.length,s=0;s<a;s+=1)c[s]=u(s,e)||"null";return h=c.length===0?"[]":n?"[\n"+n+c.join(",\n"+n)+"\n"+v+"]":"["+c.join(",")+"]",n=v,h}if(t&&typeof t=="object")for(a=t.length,s=0;s<a;s+=1)typeof t[s]=="string"&&(l=t[s],h=u(l,e),h&&c.push(o(l)+(n?": ":":")+h));else for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&(h=u(l,e),h&&c.push(o(l)+(n?": ":":")+h));return h=c.length===0?"{}":n?"{\n"+n+c.join(",\n"+n)+"\n"+v+"}":"{"+c.join(",")+"}",n=v,h}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var f=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,r,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;if(n="",r="",typeof e=="number")for(o=0;o<e;o+=1)r+=" ";else typeof e=="string"&&(r=e);if(t=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return u("",{"":i})});typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(n,t){var r,u,i=n[t];if(i&&typeof i=="object")for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(u=walk(i,r),u!==undefined?i[r]=u:delete i[r]);return reviver.call(n,t,i)}var j;if(text=String(text),f.lastIndex=0,f.test(text)&&(text=text.replace(f,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse");})}();$(function(){var n=$("#historyPnl").dialog({autoOpen:!1,width:740,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#queryPlanExecutionDatePnl").dialog({autoOpen:!1,width:740,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#queryCreationDatePnl").dialog({autoOpen:!1,width:740,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#queryExecutionFinishDateChangePnl").dialog({autoOpen:!1,width:740,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"))});$(function(){var n=$("#dictionaryDetailsPnl").dialog({autoOpen:!1,width:500,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"))});$(function(){dlg=$("#uploadLicensePnl").dialog({autoOpen:!1,width:"auto",height:"auto",resizable:!1,draggable:!0,modal:!0});dlg.parent().appendTo($("form:first"))});$(function(){var n=$("#organizationDetailsPnl").dialog({autoOpen:!1,width:500,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"))});$(function(){var n=$("#planWorkDetailsPnl").dialog({autoOpen:!1,width:700,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#historyPnl").dialog({autoOpen:!1,width:700,height:600,minHeight:100,maxHeight:600,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#declinePlanWorkPnl").dialog({autoOpen:!1,width:700,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#sendPlanWorkToExecutionPnl").dialog({autoOpen:!1,width:700,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#returnPlanWorkToTransferToExecutionPnl").dialog({autoOpen:!1,width:700,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#planWorkPlanExecutionDatePnl").dialog({autoOpen:!1,width:700,height:300,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#planWorkExecutionPnl").dialog({autoOpen:!1,width:700,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"))});$(function(){var n=$("#storageStateInformationReportDetailsPnl").dialog({autoOpen:!1,width:500,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#statFormNumber1ReportDetailsPnl").dialog({autoOpen:!1,width:700,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#applicationFormsNumber1And3ReportDetailsPnl").dialog({autoOpen:!1,width:1e3,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#storageStateInformationReportDetailsFormPnl").dialog({autoOpen:!1,width:500,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#statFormNumber1ReportDetailsFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#applicationFormsNumber1And3ReportDetailsFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#statFormNumber1ReportSumReportFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#applicationFormsNumber1And3ReportSumReportFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsOfArchivesDevelopmentReportDetailsPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsOfArchivesDevelopmentReportDetailsFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsOfArchivesDevelopmentReportSumReportFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsAndResultsReportDetailsPnl").dialog({autoOpen:!1,width:1e3,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsAndResultsReportDetailsFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsAndResultsReportSumReportFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#dataAboutChangesInCompositionAndVolumeOfFundsReportDetailsPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#dataAboutChangesInCompositionAndVolumeOfFundsReportDetailsFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#dataAboutChangesInCompositionAndVolumeOfFundsSumReportFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#NumbersCompositionAndMovementOfWorkersOfArchivalBodiesAndInstitutionsReportDetailsPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#NumbersCompositionAndMovementOfWorkersOfArchivalBodiesAndInstitutionsReportDetailsFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#NumbersCompositionAndMovementOfWorkersOfArchivalBodiesAndInstitutionsReportDetailsSumFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsAndResultsYanaoDetailsPnl").dialog({autoOpen:!1,width:1e3,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsAndResultsYanaoDetailsFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsAndResultsYanaoSumFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsAndResultsForm1YanaoDetailsPnl").dialog({autoOpen:!1,width:1e3,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsAndResultsForm1YanaoDetailsFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsAndResultsForm1YanaoSumFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#evalIndicatorsDetailsPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#evalIndicatorsDetailsFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#indicatorFinalResultDetailsPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#indicatorFinalResultFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#developmentRateIndicatorDetailsPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#developmentRateIndicatorFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#mainDirectionsAndPerformanceIndicatorsArhivalIndustryOfKurskDetailsPnl").dialog({autoOpen:!1,width:500,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#mainDirectionsAndPerformanceIndicatorsArhivalIndustryOfKurskDetailsFormPnl").dialog({autoOpen:!1,width:500,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsAndResultsLipeskDetailsPnl").dialog({autoOpen:!1,width:1e3,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsAndResultsLipeskDetailsFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));n=$("#parametersOfMainDirectionsAndResultsLipeskSumFormPnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"))});$(function(){var n=$("#progressBarPnl").dialog({autoOpen:!1,width:340,height:130,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"))});this.imagePreview=function(){xOffset=10;yOffset=30;$("div.preview").hover(function(n){this.t=this.title;this.title="";var t=this.t!=""?"<br/>"+this.t:"";$("body").append("<p id='preview' style='z-index:999999; margin-bottom: 0px; position: fixed;'><img src='"+this.getAttribute("data-url")+"' alt='Предпросмотр' />"+t+"<\/p>");$("#preview").css("top",n.clientY-yOffset+"px").css("left",n.clientX+xOffset+"px").css("max-width",$(window).width()+"px").css("max-height",$(window).height()+"px").fadeIn("fast");$("#preview img").load(function(n){var t=parseInt($(n.target).parent().css("top").replace("px","")),i=$(window).height()-(t+$(n.target).height());i<0&&$(n.target).parent().css("top",t+i+"px")})},function(){this.title=this.t;$("#preview").remove()});$("a.preview").mousemove(function(n){$("#preview").css("top",n.clientY-yOffset+"px").css("left",n.clientX+xOffset+"px")})};$(document).ready(function(){imagePreview()});$(function(){var n=$("#storageFilesViewerPnl").dialog({autoOpen:!1,width:(document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth)-15,height:(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-15,resizable:!1,draggable:!1,modal:!0}),t;n.parent().appendTo($("form:first"));$("#storageFilesViewerPnl").bind("dialogclose",function(){stopMediaPlayer()});n=$("#IllegibleImagePnl").dialog({autoOpen:!1,width:800,autoResize:!0,resizable:!1,draggable:!0,modal:!0});n.parent().appendTo($("form:first"));t=$("#imageCropPnl").dialog({autoOpen:!1,width:(document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth)-15,height:(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-15,resizable:!1,draggable:!1,modal:!0});t.parent().appendTo($("form:first"))}),function(n){"use strict";var i,t;return i={extname:function(n){if(n.lastIndexOf(".")>0)return n.substr(n.lastIndexOf("."))}},t={charset:"UTF-8",catalog:{},lookup:function(n,t,r){var u,f=this.charset;return(t===undefined&&(t=!1),typeof t=="string"&&(f=t,t=!0),u=i.extname!==undefined?i.extname(n).toLowerCase():n.lastIndexOf(".")>0?n.substr(n.lastIndexOf(".")).toLowerCase():n,u===""&&(u=n),this.catalog[u]!==undefined)?t===!0&&this.catalog[u].indexOf("text/")===0&&this.catalog[u].indexOf("charset")<0?this.catalog[u]+"; charset="+f:this.catalog[u]:r!==undefined?t===!0&&r.indexOf("text/")===0?r+"; charset="+f:r:!1},set:function(n,t){var r=!0,i=this;return n.indexOf(",")>-1?n.split(",").forEach(function(n){n=n.trim();i.catalog[n]=t;i.catalog[n]!==t&&(r=!1)}):i.catalog[n]=t,r},del:function(n){return delete this.catalog[n],this.catalog[n]===undefined},forEach:function(n){var t=this;for(var i in t.catalog)t.catalog.hasOwnProperty(i)&&n(i,t.catalog[i]);return t.catalog}},t.set(".ez","application/andrew-inset"),t.set(".aw","application/applixware"),t.set(".atom","application/atom+xml"),t.set(".atomcat","application/atomcat+xml"),t.set(".atomsvc","application/atomsvc+xml"),t.set(".ccxml","application/ccxml+xml"),t.set(".cu","application/cu-seeme"),t.set(".davmount","application/davmount+xml"),t.set(".ecma","application/ecmascript"),t.set(".emma","application/emma+xml"),t.set(".epub","application/epub+zip"),t.set(".pfr","application/font-tdpfr"),t.set(".stk","application/hyperstudio"),t.set(".jar","application/java-archive"),t.set(".ser","application/java-serialized-object"),t.set(".class","application/java-vm"),t.set(".js","application/javascript"),t.set(".json","application/json"),t.set(".lostxml","application/lost+xml"),t.set(".hqx","application/mac-binhex40"),t.set(".cpt","application/mac-compactpro"),t.set(".mrc","application/marc"),t.set(".ma,.nb,.mb","application/mathematica"),t.set(".mathml","application/mathml+xml"),t.set(".mbox","application/mbox"),t.set(".mscml","application/mediaservercontrol+xml"),t.set(".mp4s","application/mp4"),t.set(".doc,.dot","application/msword"),t.set(".mxf","application/mxf"),t.set(".oda","application/oda"),t.set(".opf","application/oebps-package+xml"),t.set(".ogx","application/ogg"),t.set(".onetoc,.onetoc2,.onetmp,.onepkg","application/onenote"),t.set(".xer","application/patch-ops-error+xml"),t.set(".pdf","application/pdf"),t.set(".pgp","application/pgp-encrypted"),t.set(".asc,.sig","application/pgp-signature"),t.set(".prf","application/pics-rules"),t.set(".p10","application/pkcs10"),t.set(".p7m,.p7c","application/pkcs7-mime"),t.set(".p7s","application/pkcs7-signature"),t.set(".cer","application/pkix-cert"),t.set(".crl","application/pkix-crl"),t.set(".pkipath","application/pkix-pkipath"),t.set(".pki","application/pkixcmp"),t.set(".pls","application/pls+xml"),t.set(".ai,.eps,.ps","application/postscript"),t.set(".cww","application/prs.cww"),t.set(".rdf","application/rdf+xml"),t.set(".rif","application/reginfo+xml"),t.set(".rnc","application/relax-ng-compact-syntax"),t.set(".rl","application/resource-lists+xml"),t.set(".rld","application/resource-lists-diff+xml"),t.set(".rs","application/rls-services+xml"),t.set(".rsd","application/rsd+xml"),t.set(".rss","application/rss+xml"),t.set(".rtf","application/rtf"),t.set(".sbml","application/sbml+xml"),t.set(".scq","application/scvp-cv-request"),t.set(".scs","application/scvp-cv-response"),t.set(".spq","application/scvp-vp-request"),t.set(".spp","application/scvp-vp-response"),t.set(".sdp","application/sdp"),t.set(".setpay","application/set-payment-initiation"),t.set(".setreg","application/set-registration-initiation"),t.set(".shf","application/shf+xml"),t.set(".smi,.smil","application/smil+xml"),t.set(".rq","application/sparql-query"),t.set(".srx","application/sparql-results+xml"),t.set(".gram","application/srgs"),t.set(".grxml","application/srgs+xml"),t.set(".ssml","application/ssml+xml"),t.set(".plb","application/vnd.3gpp.pic-bw-large"),t.set(".psb","application/vnd.3gpp.pic-bw-small"),t.set(".pvb","application/vnd.3gpp.pic-bw-var"),t.set(".tcap","application/vnd.3gpp2.tcap"),t.set(".pwn","application/vnd.3m.post-it-notes"),t.set(".aso","application/vnd.accpac.simply.aso"),t.set(".imp","application/vnd.accpac.simply.imp"),t.set(".acu","application/vnd.acucobol"),t.set(".atc,.acutc","application/vnd.acucorp"),t.set(".air","application/vnd.adobe.air-application-installer-package+zip"),t.set(".xdp","application/vnd.adobe.xdp+xml"),t.set(".xfdf","application/vnd.adobe.xfdf"),t.set(".azf","application/vnd.airzip.filesecure.azf"),t.set(".azs","application/vnd.airzip.filesecure.azs"),t.set(".azw","application/vnd.amazon.ebook"),t.set(".acc","application/vnd.americandynamics.acc"),t.set(".ami","application/vnd.amiga.ami"),t.set(".apk","application/vnd.android.package-archive"),t.set(".cii","application/vnd.anser-web-certificate-issue-initiation"),t.set(".fti","application/vnd.anser-web-funds-transfer-initiation"),t.set(".atx","application/vnd.antix.game-component"),t.set(".mpkg","application/vnd.apple.installer+xml"),t.set(".swi","application/vnd.arastra.swi"),t.set(".aep","application/vnd.audiograph"),t.set(".mpm","application/vnd.blueice.multipass"),t.set(".bmi","application/vnd.bmi"),t.set(".rep","application/vnd.businessobjects"),t.set(".cdxml","application/vnd.chemdraw+xml"),t.set(".mmd","application/vnd.chipnuts.karaoke-mmd"),t.set(".cdy","application/vnd.cinderella"),t.set(".cla","application/vnd.claymore"),t.set(".c4g,.c4d,.c4f,.c4p,.c4u","application/vnd.clonk.c4group"),t.set(".csp","application/vnd.commonspace"),t.set(".cdbcmsg","application/vnd.contact.cmsg"),t.set(".cmc","application/vnd.cosmocaller"),t.set(".clkx","application/vnd.crick.clicker"),t.set(".clkk","application/vnd.crick.clicker.keyboard"),t.set(".clkp","application/vnd.crick.clicker.palette"),t.set(".clkt","application/vnd.crick.clicker.template"),t.set(".clkw","application/vnd.crick.clicker.wordbank"),t.set(".wbs","application/vnd.criticaltools.wbs+xml"),t.set(".pml","application/vnd.ctc-posml"),t.set(".ppd","application/vnd.cups-ppd"),t.set(".car","application/vnd.curl.car"),t.set(".pcurl","application/vnd.curl.pcurl"),t.set(".rdz","application/vnd.data-vision.rdz"),t.set(".fe_launch","application/vnd.denovo.fcselayout-link"),t.set(".dna","application/vnd.dna"),t.set(".mlp","application/vnd.dolby.mlp"),t.set(".dpg","application/vnd.dpgraph"),t.set(".dfac","application/vnd.dreamfactory"),t.set(".geo","application/vnd.dynageo"),t.set(".mag","application/vnd.ecowin.chart"),t.set(".nml","application/vnd.enliven"),t.set(".esf","application/vnd.epson.esf"),t.set(".msf","application/vnd.epson.msf"),t.set(".qam","application/vnd.epson.quickanime"),t.set(".slt","application/vnd.epson.salt"),t.set(".ssf","application/vnd.epson.ssf"),t.set(".es3,.et3","application/vnd.eszigno3+xml"),t.set(".ez2","application/vnd.ezpix-album"),t.set(".ez3","application/vnd.ezpix-package"),t.set(".fdf","application/vnd.fdf"),t.set(".mseed","application/vnd.fdsn.mseed"),t.set(".seed,.dataless","application/vnd.fdsn.seed"),t.set(".gph","application/vnd.flographit"),t.set(".ftc","application/vnd.fluxtime.clip"),t.set(".fm,.frame,.maker,.book","application/vnd.framemaker"),t.set(".fnc","application/vnd.frogans.fnc"),t.set(".ltf","application/vnd.frogans.ltf"),t.set(".fsc","application/vnd.fsc.weblaunch"),t.set(".oas","application/vnd.fujitsu.oasys"),t.set(".oa2","application/vnd.fujitsu.oasys2"),t.set(".oa3","application/vnd.fujitsu.oasys3"),t.set(".fg5","application/vnd.fujitsu.oasysgp"),t.set(".bh2","application/vnd.fujitsu.oasysprs"),t.set(".ddd","application/vnd.fujixerox.ddd"),t.set(".xdw","application/vnd.fujixerox.docuworks"),t.set(".xbd","application/vnd.fujixerox.docuworks.binder"),t.set(".fzs","application/vnd.fuzzysheet"),t.set(".txd","application/vnd.genomatix.tuxedo"),t.set(".ggb","application/vnd.geogebra.file"),t.set(".ggt","application/vnd.geogebra.tool"),t.set(".gex,.gre","application/vnd.geometry-explorer"),t.set(".gmx","application/vnd.gmx"),t.set(".kml","application/vnd.google-earth.kml+xml"),t.set(".kmz","application/vnd.google-earth.kmz"),t.set(".gqf,.gqs","application/vnd.grafeq"),t.set(".gac","application/vnd.groove-account"),t.set(".ghf","application/vnd.groove-help"),t.set(".gim","application/vnd.groove-identity-message"),t.set(".grv","application/vnd.groove-injector"),t.set(".gtm","application/vnd.groove-tool-message"),t.set(".tpl","application/vnd.groove-tool-template"),t.set(".vcg","application/vnd.groove-vcard"),t.set(".zmm","application/vnd.handheld-entertainment+xml"),t.set(".hbci","application/vnd.hbci"),t.set(".les","application/vnd.hhe.lesson-player"),t.set(".hpgl","application/vnd.hp-hpgl"),t.set(".hpid","application/vnd.hp-hpid"),t.set(".hps","application/vnd.hp-hps"),t.set(".jlt","application/vnd.hp-jlyt"),t.set(".pcl","application/vnd.hp-pcl"),t.set(".pclxl","application/vnd.hp-pclxl"),t.set(".sfd-hdstx","application/vnd.hydrostatix.sof-data"),t.set(".x3d","application/vnd.hzn-3d-crossword"),t.set(".mpy","application/vnd.ibm.minipay"),t.set(".afp,.listafp,.list3820","application/vnd.ibm.modcap"),t.set(".irm","application/vnd.ibm.rights-management"),t.set(".sc","application/vnd.ibm.secure-container"),t.set(".icc,.icm","application/vnd.iccprofile"),t.set(".igl","application/vnd.igloader"),t.set(".ivp","application/vnd.immervision-ivp"),t.set(".ivu","application/vnd.immervision-ivu"),t.set(".xpw,.xpx","application/vnd.intercon.formnet"),t.set(".qbo","application/vnd.intu.qbo"),t.set(".qfx","application/vnd.intu.qfx"),t.set(".rcprofile","application/vnd.ipunplugged.rcprofile"),t.set(".irp","application/vnd.irepository.package+xml"),t.set(".xpr","application/vnd.is-xpr"),t.set(".jam","application/vnd.jam"),t.set(".rms","application/vnd.jcp.javame.midlet-rms"),t.set(".jisp","application/vnd.jisp"),t.set(".joda","application/vnd.joost.joda-archive"),t.set(".ktz,.ktr","application/vnd.kahootz"),t.set(".karbon","application/vnd.kde.karbon"),t.set(".chrt","application/vnd.kde.kchart"),t.set(".kfo","application/vnd.kde.kformula"),t.set(".flw","application/vnd.kde.kivio"),t.set(".kon","application/vnd.kde.kontour"),t.set(".kpr,.kpt","application/vnd.kde.kpresenter"),t.set(".ksp","application/vnd.kde.kspread"),t.set(".kwd,.kwt","application/vnd.kde.kword"),t.set(".htke","application/vnd.kenameaapp"),t.set(".kia","application/vnd.kidspiration"),t.set(".kne,.knp","application/vnd.kinar"),t.set(".skp,.skd,.skt,.skm","application/vnd.koan"),t.set(".sse","application/vnd.kodak-descriptor"),t.set(".lbd","application/vnd.llamagraphics.life-balance.desktop"),t.set(".lbe","application/vnd.llamagraphics.life-balance.exchange+xml"),t.set(".123","application/vnd.lotus-1-2-3"),t.set(".apr","application/vnd.lotus-approach"),t.set(".pre","application/vnd.lotus-freelance"),t.set(".nsf","application/vnd.lotus-notes"),t.set(".org","application/vnd.lotus-organizer"),t.set(".scm","application/vnd.lotus-screencam"),t.set(".lwp","application/vnd.lotus-wordpro"),t.set(".portpkg","application/vnd.macports.portpkg"),t.set(".mcd","application/vnd.mcd"),t.set(".mc1","application/vnd.medcalcdata"),t.set(".cdkey","application/vnd.mediastation.cdkey"),t.set(".mwf","application/vnd.mfer"),t.set(".mfm","application/vnd.mfmp"),t.set(".flo","application/vnd.micrografx.flo"),t.set(".igx","application/vnd.micrografx.igx"),t.set(".mif","application/vnd.mif"),t.set(".daf","application/vnd.mobius.daf"),t.set(".dis","application/vnd.mobius.dis"),t.set(".mbk","application/vnd.mobius.mbk"),t.set(".mqy","application/vnd.mobius.mqy"),t.set(".msl","application/vnd.mobius.msl"),t.set(".plc","application/vnd.mobius.plc"),t.set(".txf","application/vnd.mobius.txf"),t.set(".mpn","application/vnd.mophun.application"),t.set(".mpc","application/vnd.mophun.certificate"),t.set(".xul","application/vnd.mozilla.xul+xml"),t.set(".cil","application/vnd.ms-artgalry"),t.set(".cab","application/vnd.ms-cab-compressed"),t.set(".xls,.xlm,.xla,.xlc,.xlt,.xlw","application/vnd.ms-excel"),t.set(".xlam","application/vnd.ms-excel.addin.macroenabled.12"),t.set(".xlsb","application/vnd.ms-excel.sheet.binary.macroenabled.12"),t.set(".xlsm","application/vnd.ms-excel.sheet.macroenabled.12"),t.set(".xltm","application/vnd.ms-excel.template.macroenabled.12"),t.set(".eot","application/vnd.ms-fontobject"),t.set(".chm","application/vnd.ms-htmlhelp"),t.set(".ims","application/vnd.ms-ims"),t.set(".lrm","application/vnd.ms-lrm"),t.set(".cat","application/vnd.ms-pki.seccat"),t.set(".stl","application/vnd.ms-pki.stl"),t.set(".ppt,.pps,.pot","application/vnd.ms-powerpoint"),t.set(".ppam","application/vnd.ms-powerpoint.addin.macroenabled.12"),t.set(".pptm","application/vnd.ms-powerpoint.presentation.macroenabled.12"),t.set(".sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"),t.set(".ppsm","application/vnd.ms-powerpoint.slideshow.macroenabled.12"),t.set(".potm","application/vnd.ms-powerpoint.template.macroenabled.12"),t.set(".mpp,.mpt","application/vnd.ms-project"),t.set(".docm","application/vnd.ms-word.document.macroenabled.12"),t.set(".dotm","application/vnd.ms-word.template.macroenabled.12"),t.set(".wps,.wks,.wcm,.wdb","application/vnd.ms-works"),t.set(".wpl","application/vnd.ms-wpl"),t.set(".xps","application/vnd.ms-xpsdocument"),t.set(".mseq","application/vnd.mseq"),t.set(".mus","application/vnd.musician"),t.set(".msty","application/vnd.muvee.style"),t.set(".nlu","application/vnd.neurolanguage.nlu"),t.set(".nnd","application/vnd.noblenet-directory"),t.set(".nns","application/vnd.noblenet-sealer"),t.set(".nnw","application/vnd.noblenet-web"),t.set(".ngdat","application/vnd.nokia.n-gage.data"),t.set(".n-gage","application/vnd.nokia.n-gage.symbian.install"),t.set(".rpst","application/vnd.nokia.radio-preset"),t.set(".rpss","application/vnd.nokia.radio-presets"),t.set(".edm","application/vnd.novadigm.edm"),t.set(".edx","application/vnd.novadigm.edx"),t.set(".ext","application/vnd.novadigm.ext"),t.set(".odc","application/vnd.oasis.opendocument.chart"),t.set(".otc","application/vnd.oasis.opendocument.chart-template"),t.set(".odb","application/vnd.oasis.opendocument.database"),t.set(".odf","application/vnd.oasis.opendocument.formula"),t.set(".odft","application/vnd.oasis.opendocument.formula-template"),t.set(".odg","application/vnd.oasis.opendocument.graphics"),t.set(".otg","application/vnd.oasis.opendocument.graphics-template"),t.set(".odi","application/vnd.oasis.opendocument.image"),t.set(".oti","application/vnd.oasis.opendocument.image-template"),t.set(".odp","application/vnd.oasis.opendocument.presentation"),t.set(".ods","application/vnd.oasis.opendocument.spreadsheet"),t.set(".ots","application/vnd.oasis.opendocument.spreadsheet-template"),t.set(".odt","application/vnd.oasis.opendocument.text"),t.set(".otm","application/vnd.oasis.opendocument.text-master"),t.set(".ott","application/vnd.oasis.opendocument.text-template"),t.set(".oth","application/vnd.oasis.opendocument.text-web"),t.set(".xo","application/vnd.olpc-sugar"),t.set(".dd2","application/vnd.oma.dd2+xml"),t.set(".oxt","application/vnd.openofficeorg.extension"),t.set(".pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),t.set(".sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"),t.set(".ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),t.set(".potx","application/vnd.openxmlformats-officedocument.presentationml.template"),t.set(".xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t.set(".xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),t.set(".docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),t.set(".dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),t.set(".dp","application/vnd.osgi.dp"),t.set(".pdb,.pqa,.oprc","application/vnd.palm"),t.set(".str","application/vnd.pg.format"),t.set(".ei6","application/vnd.pg.osasli"),t.set(".efif","application/vnd.picsel"),t.set(".plf","application/vnd.pocketlearn"),t.set(".pbd","application/vnd.powerbuilder6"),t.set(".box","application/vnd.previewsystems.box"),t.set(".mgz","application/vnd.proteus.magazine"),t.set(".qps","application/vnd.publishare-delta-tree"),t.set(".ptid","application/vnd.pvi.ptid1"),t.set(".qxd,.qxt,.qwd,.qwt,.qxl,.qxb","application/vnd.quark.quarkxpress"),t.set(".mxl","application/vnd.recordare.musicxml"),t.set(".musicxml","application/vnd.recordare.musicxml+xml"),t.set(".cod","application/vnd.rim.cod"),t.set(".rm","application/vnd.rn-realmedia"),t.set(".link66","application/vnd.route66.link66+xml"),t.set(".see","application/vnd.seemail"),t.set(".sema","application/vnd.sema"),t.set(".semd","application/vnd.semd"),t.set(".semf","application/vnd.semf"),t.set(".ifm","application/vnd.shana.informed.formdata"),t.set(".itp","application/vnd.shana.informed.formtemplate"),t.set(".iif","application/vnd.shana.informed.interchange"),t.set(".ipk","application/vnd.shana.informed.package"),t.set(".twd,.twds","application/vnd.simtech-mindmapper"),t.set(".mmf","application/vnd.smaf"),t.set(".teacher","application/vnd.smart.teacher"),t.set(".sdkm,.sdkd","application/vnd.solent.sdkm+xml"),t.set(".dxp","application/vnd.spotfire.dxp"),t.set(".sfs","application/vnd.spotfire.sfs"),t.set(".sdc","application/vnd.stardivision.calc"),t.set(".sda","application/vnd.stardivision.draw"),t.set(".sdd","application/vnd.stardivision.impress"),t.set(".smf","application/vnd.stardivision.math"),t.set(".sdw","application/vnd.stardivision.writer"),t.set(".vor","application/vnd.stardivision.writer"),t.set(".sgl","application/vnd.stardivision.writer-global"),t.set(".sxc","application/vnd.sun.xml.calc"),t.set(".stc","application/vnd.sun.xml.calc.template"),t.set(".sxd","application/vnd.sun.xml.draw"),t.set(".std","application/vnd.sun.xml.draw.template"),t.set(".sxi","application/vnd.sun.xml.impress"),t.set(".sti","application/vnd.sun.xml.impress.template"),t.set(".sxm","application/vnd.sun.xml.math"),t.set(".sxw","application/vnd.sun.xml.writer"),t.set(".sxg","application/vnd.sun.xml.writer.global"),t.set(".stw","application/vnd.sun.xml.writer.template"),t.set(".sus,.susp","application/vnd.sus-calendar"),t.set(".svd","application/vnd.svd"),t.set(".sis,.sisx","application/vnd.symbian.install"),t.set(".xsm","application/vnd.syncml+xml"),t.set(".bdm","application/vnd.syncml.dm+wbxml"),t.set(".xdm","application/vnd.syncml.dm+xml"),t.set(".tao","application/vnd.tao.intent-module-archive"),t.set(".tmo","application/vnd.tmobile-livetv"),t.set(".tpt","application/vnd.trid.tpt"),t.set(".mxs","application/vnd.triscape.mxs"),t.set(".tra","application/vnd.trueapp"),t.set(".ufd,.ufdl","application/vnd.ufdl"),t.set(".utz","application/vnd.uiq.theme"),t.set(".umj","application/vnd.umajin"),t.set(".unityweb","application/vnd.unity"),t.set(".uoml","application/vnd.uoml+xml"),t.set(".vcx","application/vnd.vcx"),t.set(".vsd,.vst,.vss,.vsw","application/vnd.visio"),t.set(".vis","application/vnd.visionary"),t.set(".vsf","application/vnd.vsf"),t.set(".wbxml","application/vnd.wap.wbxml"),t.set(".wmlc","application/vnd.wap.wmlc"),t.set(".wmlsc","application/vnd.wap.wmlscriptc"),t.set(".wtb","application/vnd.webturbo"),t.set(".wpd","application/vnd.wordperfect"),t.set(".wqd","application/vnd.wqd"),t.set(".stf","application/vnd.wt.stf"),t.set(".xar","application/vnd.xara"),t.set(".xfdl","application/vnd.xfdl"),t.set(".hvd","application/vnd.yamaha.hv-dic"),t.set(".hvs","application/vnd.yamaha.hv-script"),t.set(".hvp","application/vnd.yamaha.hv-voice"),t.set(".osf","application/vnd.yamaha.openscoreformat"),t.set(".osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"),t.set(".saf","application/vnd.yamaha.smaf-audio"),t.set(".spf","application/vnd.yamaha.smaf-phrase"),t.set(".cmp","application/vnd.yellowriver-custom-menu"),t.set(".zir,.zirz","application/vnd.zul"),t.set(".zaz","application/vnd.zzazz.deck+xml"),t.set(".vxml","application/voicexml+xml"),t.set(".hlp","application/winhlp"),t.set(".wsdl","application/wsdl+xml"),t.set(".wspolicy","application/wspolicy+xml"),t.set(".abw","application/x-abiword"),t.set(".ace","application/x-ace-compressed"),t.set(".aab,.x32,.u32,.vox","application/x-authorware-bin"),t.set(".aam","application/x-authorware-map"),t.set(".aas","application/x-authorware-seg"),t.set(".bcpio","application/x-bcpio"),t.set(".torrent","application/x-bittorrent"),t.set(".bz","application/x-bzip"),t.set(".bz2,.boz","application/x-bzip2"),t.set(".vcd","application/x-cdlink"),t.set(".chat","application/x-chat"),t.set(".pgn","application/x-chess-pgn"),t.set(".cpio","application/x-cpio"),t.set(".csh","application/x-csh"),t.set(".deb,.udeb","application/x-debian-package"),t.set(".dir,.dcr,.dxr,.cst,.cct,.cxt,.w3d,.fgd,.swa","application/x-director"),t.set(".wad","application/x-doom"),t.set(".ncx","application/x-dtbncx+xml"),t.set(".dtb","application/x-dtbook+xml"),t.set(".res","application/x-dtbresource+xml"),t.set(".dvi","application/x-dvi"),t.set(".bdf","application/x-font-bdf"),t.set(".gsf","application/x-font-ghostscript"),t.set(".psf","application/x-font-linux-psf"),t.set(".otf","application/x-font-otf"),t.set(".pcf","application/x-font-pcf"),t.set(".snf","application/x-font-snf"),t.set(".ttf,.ttc","application/x-font-ttf"),t.set(".woff","application/font-woff"),t.set(".pfa,.pfb,.pfm,.afm","application/x-font-type1"),t.set(".spl","application/x-futuresplash"),t.set(".gnumeric","application/x-gnumeric"),t.set(".gtar","application/x-gtar"),t.set(".hdf","application/x-hdf"),t.set(".jnlp","application/x-java-jnlp-file"),t.set(".latex","application/x-latex"),t.set(".prc,.mobi","application/x-mobipocket-ebook"),t.set(".application","application/x-ms-application"),t.set(".wmd","application/x-ms-wmd"),t.set(".wmz","application/x-ms-wmz"),t.set(".xbap","application/x-ms-xbap"),t.set(".mdb","application/x-msaccess"),t.set(".obd","application/x-msbinder"),t.set(".crd","application/x-mscardfile"),t.set(".clp","application/x-msclip"),t.set(".exe,.dll,.com,.bat,.msi","application/x-msdownload"),t.set(".mvb,.m13,.m14","application/x-msmediaview"),t.set(".wmf","application/x-msmetafile"),t.set(".mny","application/x-msmoney"),t.set(".pub","application/x-mspublisher"),t.set(".scd","application/x-msschedule"),t.set(".trm","application/x-msterminal"),t.set(".wri","application/x-mswrite"),t.set(".nc,.cdf","application/x-netcdf"),t.set(".p12,.pfx","application/x-pkcs12"),t.set(".p7b,.spc","application/x-pkcs7-certificates"),t.set(".p7r","application/x-pkcs7-certreqresp"),t.set(".rar","application/x-rar-compressed"),t.set(".sh","application/x-sh"),t.set(".shar","application/x-shar"),t.set(".swf","application/x-shockwave-flash"),t.set(".xap","application/x-silverlight-app"),t.set(".sit","application/x-stuffit"),t.set(".sitx","application/x-stuffitx"),t.set(".sv4cpio","application/x-sv4cpio"),t.set(".sv4crc","application/x-sv4crc"),t.set(".tar","application/x-tar"),t.set(".tcl","application/x-tcl"),t.set(".tex","application/x-tex"),t.set(".tfm","application/x-tex-tfm"),t.set(".texinfo,.texi","application/x-texinfo"),t.set(".ustar","application/x-ustar"),t.set(".src","application/x-wais-source"),t.set(".der,.crt","application/x-x509-ca-cert"),t.set(".fig","application/x-xfig"),t.set(".xpi","application/x-xpinstall"),t.set(".xenc","application/xenc+xml"),t.set(".xhtml,.xht","application/xhtml+xml"),t.set(".xml,.xsl","application/xml"),t.set(".dtd","application/xml-dtd"),t.set(".xop","application/xop+xml"),t.set(".xslt","application/xslt+xml"),t.set(".xspf","application/xspf+xml"),t.set(".mxml,.xhvml,.xvml,.xvm","application/xv+xml"),t.set(".zip","application/zip"),t.set(".adp","audio/adpcm"),t.set(".au,.snd","audio/basic"),t.set(".mid,.midi,.kar,.rmi","audio/midi"),t.set(".mp4a","audio/mp4"),t.set(".m4a,.m4p","audio/mp4a-latm"),t.set(".mpga,.mp2,.mp2a,.mp3,.m2a,.m3a","audio/mpeg"),t.set(".oga,.ogg,.spx","audio/ogg"),t.set(".eol","audio/vnd.digital-winds"),t.set(".dts","audio/vnd.dts"),t.set(".dtshd","audio/vnd.dts.hd"),t.set(".lvp","audio/vnd.lucent.voice"),t.set(".pya","audio/vnd.ms-playready.media.pya"),t.set(".ecelp4800","audio/vnd.nuera.ecelp4800"),t.set(".ecelp7470","audio/vnd.nuera.ecelp7470"),t.set(".ecelp9600","audio/vnd.nuera.ecelp9600"),t.set(".aac","audio/x-aac"),t.set(".aif,.aiff,.aifc","audio/x-aiff"),t.set(".m3u","audio/x-mpegurl"),t.set(".wax","audio/x-ms-wax"),t.set(".wma","audio/x-ms-wma"),t.set(".ram,.ra","audio/x-pn-realaudio"),t.set(".rmp","audio/x-pn-realaudio-plugin"),t.set(".wav","audio/x-wav"),t.set(".cdx","chemical/x-cdx"),t.set(".cif","chemical/x-cif"),t.set(".cmdf","chemical/x-cmdf"),t.set(".cml","chemical/x-cml"),t.set(".csml","chemical/x-csml"),t.set(".xyz","chemical/x-xyz"),t.set(".bmp","image/bmp"),t.set(".cgm","image/cgm"),t.set(".g3","image/g3fax"),t.set(".gif","image/gif"),t.set(".ief","image/ief"),t.set(".jp2","image/jp2"),t.set(".jpeg,.jpg,.jpe","image/jpeg"),t.set(".pict,.pic,.pct","image/pict"),t.set(".png","image/png"),t.set(".btif","image/prs.btif"),t.set(".svg,.svgz","image/svg+xml"),t.set(".tiff,.tif","image/tiff"),t.set(".psd","image/vnd.adobe.photoshop"),t.set(".djvu,.djv","image/vnd.djvu"),t.set(".dwg","image/vnd.dwg"),t.set(".dxf","image/vnd.dxf"),t.set(".fbs","image/vnd.fastbidsheet"),t.set(".fpx","image/vnd.fpx"),t.set(".fst","image/vnd.fst"),t.set(".mmr","image/vnd.fujixerox.edmics-mmr"),t.set(".rlc","image/vnd.fujixerox.edmics-rlc"),t.set(".mdi","image/vnd.ms-modi"),t.set(".npx","image/vnd.net-fpx"),t.set(".wbmp","image/vnd.wap.wbmp"),t.set(".xif","image/vnd.xiff"),t.set(".ras","image/x-cmu-raster"),t.set(".cmx","image/x-cmx"),t.set(".fh,.fhc,.fh4,.fh5,.fh7","image/x-freehand"),t.set(".ico","image/x-icon"),t.set(".pntg,.pnt,.mac","image/x-macpaint"),t.set(".pcx","image/x-pcx"),t.set(".pnm","image/x-portable-anymap"),t.set(".pbm","image/x-portable-bitmap"),t.set(".pgm","image/x-portable-graymap"),t.set(".ppm","image/x-portable-pixmap"),t.set(".qtif,.qti","image/x-quicktime"),t.set(".rgb","image/x-rgb"),t.set(".xbm","image/x-xbitmap"),t.set(".xpm","image/x-xpixmap"),t.set(".xwd","image/x-xwindowdump"),t.set(".eml,.mime","message/rfc822"),t.set(".igs,.iges","model/iges"),t.set(".msh,.mesh,.silo","model/mesh"),t.set(".dwf","model/vnd.dwf"),t.set(".gdl","model/vnd.gdl"),t.set(".gtw","model/vnd.gtw"),t.set(".mts","model/vnd.mts"),t.set(".vtu","model/vnd.vtu"),t.set(".wrl,.vrml","model/vrml"),t.set(".ics,.ifb","text/calendar"),t.set(".css","text/css"),t.set(".csv","text/csv"),t.set(".html,.htm","text/html"),t.set(".txt,.text,.conf,.def,.list,.log,.in","text/plain"),t.set(".dsc","text/prs.lines.tag"),t.set(".rtx","text/richtext"),t.set(".sgml,.sgm","text/sgml"),t.set(".tsv","text/tab-separated-values"),t.set(".t,.tr,.roff,.man,.me,.ms","text/troff"),t.set(".uri,.uris,.urls","text/uri-list"),t.set(".curl","text/vnd.curl"),t.set(".dcurl","text/vnd.curl.dcurl"),t.set(".scurl","text/vnd.curl.scurl"),t.set(".mcurl","text/vnd.curl.mcurl"),t.set(".fly","text/vnd.fly"),t.set(".flx","text/vnd.fmi.flexstor"),t.set(".gv","text/vnd.graphviz"),t.set(".3dml","text/vnd.in3d.3dml"),t.set(".spot","text/vnd.in3d.spot"),t.set(".jad","text/vnd.sun.j2me.app-descriptor"),t.set(".wml","text/vnd.wap.wml"),t.set(".wmls","text/vnd.wap.wmlscript"),t.set(".s,.asm","text/x-asm"),t.set(".c,.cc,.cxx,.cpp,.h,.hh,.dic","text/x-c"),t.set(".f,.for,.f77,.f90","text/x-fortran"),t.set(".p,.pas","text/x-pascal"),t.set(".java","text/x-java-source"),t.set(".etx","text/x-setext"),t.set(".uu","text/x-uuencode"),t.set(".vcs","text/x-vcalendar"),t.set(".vcf","text/x-vcard"),t.set(".3gp","video/3gpp"),t.set(".3g2","video/3gpp2"),t.set(".h261","video/h261"),t.set(".h263","video/h263"),t.set(".h264","video/h264"),t.set(".jpgv","video/jpeg"),t.set(".jpm,.jpgm","video/jpm"),t.set(".mj2,.mjp2","video/mj2"),t.set(".mp4,.mp4v,.mpg4,.m4v","video/mp4"),t.set(".webm","video/webm"),t.set(".mpeg,.mpg,.mpe,.m1v,.m2v","video/mpeg"),t.set(".ogv","video/ogg"),t.set(".qt,.mov","video/quicktime"),t.set(".fvt","video/vnd.fvt"),t.set(".mxu,.m4u","video/vnd.mpegurl"),t.set(".pyv","video/vnd.ms-playready.media.pyv"),t.set(".viv","video/vnd.vivo"),t.set(".dv,.dif","video/x-dv"),t.set(".f4v","video/x-f4v"),t.set(".fli","video/x-fli"),t.set(".flv","video/x-flv"),t.set(".asf,.asx","video/x-ms-asf"),t.set(".wm","video/x-ms-wm"),t.set(".wmv","video/x-ms-wmv"),t.set(".wmx","video/x-ms-wmx"),t.set(".wvx","video/x-ms-wvx"),t.set(".avi","video/x-msvideo"),t.set(".movie","video/x-sgi-movie"),t.set(".ice","x-conference/x-cooltalk"),t.set(".indd","application/x-indesign"),t.set(".dat","application/octet-stream"),t.set(".gz","application/x-gzip"),t.set(".tgz","application/x-tar"),t.set(".tar","application/x-tar"),t.set(".epub","application/epub+zip"),t.set(".mobi","application/x-mobipocket-ebook"),t.set("README,LICENSE,COPYING,TODO,ABOUT,AUTHORS,CONTRIBUTORS","text/plain"),t.set("manifest,.manifest,.mf,.appcache","text/cache-manifest"),n.MimeType===undefined&&(n.MimeType=t),n.mimeType===undefined&&(n.mimeType=t),n}(this),function(n){n(function(){function u(){}function y(n){var f=new u;return f.then=function(t){var u;try{return t&&(u=t(n)),e(u===r?n:u)}catch(f){return i(f)}},t(f)}function i(n){var f=new u;return f.then=function(t,u){var f;try{return u?(f=u(n),e(f===r?n:f)):i(n)}catch(o){return i(o)}},t(f)}function p(t){return n(t,function(n){return i(n)})}function f(){function a(n,t,i){return c(n,t,i)}function v(n){s(y(n))}function p(n){s(i(n))}function w(n){l(n)}var n,h,e,o,c,l,s;return e=[],o=[],c=function(n,t,i){var r=f();return e.push(function(i){i.then(n,t).then(r.resolve,r.reject,r.progress)}),i&&o.push(i),r.promise},l=function(n){for(var t,i=0;t=o[i++];)t(n)},s=function(n){var t,i=0;for(c=n.then,s=l=function(){throw new Error("already completed");},o=r;t=e[i++];)t(n);e=[]},n={},h=new u,h.then=n.then=a,n.promise=t(h),n.resolver=t({resolve:n.resolve=v,reject:n.reject=p,progress:n.progress=w}),n}function c(n){return n&&typeof n.then=="function"}function n(n,t,i,r){var u=e(n);return u.then(t,i,r)}function e(n){var i,t;return n instanceof u?i=n:(t=f(),c(n)?(n.then(t.resolve,t.reject,t.progress),i=t.promise):(t.resolve(n),i=t.promise)),i}function l(t,i,r,u,e){return v(2,arguments),n(t,function(t){function b(n){l(n)}function k(n){a(n)}function d(n){v(n)}function w(){l=a=v=tt}var c,h,p,o,l,a,v,y,s;if(y=t.length>>>0,c=Math.max(0,Math.min(i,y)),h=[],o=f(),p=n(o,r,u,e),c)for(l=function(n){h.push(n);--c||(w(),o.resolve(h))},a=function(n){w();o.reject(n)},v=o.progress,s=0;s<y;++s)s in t&&n(t[s],b,k,d);else o.resolve(h);return p})}function w(t,i,r,u){return v(1,arguments),n(t,function(n){return o(n,a,[])}).then(i,r,u)}function a(n,t,i){return n[i]=t,n}function b(n,t,i,r){function u(n){return t?t(n[0]):n[0]}return l(n,1,u,i,r)}function k(t,i){return n(t,function(n){return d(n,i)})}function d(t,i){var u,f,r;for(f=t.length>>>0,u=new Array(f),r=0;r<f;r++)r in t&&(u[r]=n(t[r],i));return o(u,a,u)}function g(t){var i=h.call(arguments,1);return n(t,function(n){return o.apply(r,[n].concat(i))})}function o(t,i,r){var f,u;return f=t.length,u=[function(t,r,u){return n(t,function(t){return n(r,function(n){return i(t,n,u,f)})})}],arguments.length>2&&u.push(r),s.apply(t,u)}function nt(t,r,u){var f=arguments.length>2;return n(t,function(n){return f&&(n=u),r.resolve(n),n},function(n){return r.reject(n),i(n)},r.progress)}function v(n,t){for(var i,r=t.length;r>n;)if(i=t[--r],i!=null&&typeof i!="function")throw new Error("callback is not a function");}function tt(){}var t,s,h,r;return n.defer=f,n.reject=p,n.isPromise=c,n.all=w,n.some=l,n.any=b,n.map=k,n.reduce=g,n.chain=nt,t=Object.freeze||function(n){return n},u.prototype=t({always:function(n,t){return this.then(n,n,t)},otherwise:function(n){return this.then(r,n)}}),h=[].slice,s=[].reduce||function(n){var i,u,r,f,t;if(t=0,i=Object(this),f=i.length>>>0,u=arguments,u.length<=1)for(;;){if(t in i){r=i[t++];break}if(++t>=f)throw new TypeError;}else r=u[1];for(;t<f;++t)t in i&&(r=n(r,i[t],t,i));return r},n})}(typeof define=="function"?define:function(n){typeof module!="undefined"?module.exports=n():jQuery.mapster_when=n()}),function(n){n.fn.mapster=function(t){var i=n.mapster.impl;if(n.isFunction(i[t]))return i[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t!="object"&&t)n.error("Method "+t+" does not exist on jQuery.mapster");else return i.bind.apply(this,arguments)};n.mapster={version:"1.2.10",render_defaults:{isSelectable:!0,isDeselectable:!0,fade:!1,fadeDuration:150,fill:!0,fillColor:"000000",fillColorMask:"FFFFFF",fillOpacity:.7,highlight:!0,stroke:!1,strokeColor:"ff0000",strokeOpacity:1,strokeWidth:1,includeKeys:"",altImage:null,altImageId:null,altImages:{}},defaults:{clickNavigate:!1,wrapClass:null,wrapCss:null,onGetList:null,sortList:!1,listenToList:!1,mapKey:"",mapValue:"",singleSelect:!1,listKey:"value",listSelectedAttribute:"selected",listSelectedClass:null,onClick:null,onMouseover:null,onMouseout:null,mouseoutDelay:0,onStateChange:null,boundList:null,onConfigured:null,configTimeout:3e4,noHrefIsMask:!0,scaleMap:!0,safeLoad:!1,areas:[]},shared_defaults:{render_highlight:{fade:!0},render_select:{fade:!1},staticState:null,selected:null},area_defaults:{includeKeys:"",isMask:!1},canvas_style:{position:"absolute",left:0,top:0,padding:0,border:0},hasCanvas:null,isTouch:null,map_cache:[],hooks:{},addHook:function(n,t){this.hooks[n]=(this.hooks[n]||[]).push(t)},callHooks:function(t,i){n.each(this.hooks[t]||[],function(n,t){t.apply(i)})},utils:{when:n.mapster_when,defer:n.mapster_when.defer,subclass:function(n,t){var i=function(){var i=this,r=Array.prototype.slice.call(arguments,0);i.base=n.prototype;i.base.init=function(){n.prototype.constructor.apply(i,r)};t.apply(i,r)};return i.prototype=new n,i.prototype.constructor=i,i},asArray:function(n){return n.constructor===Array?n:this.split(n)},split:function(t,i){for(var f,u=t.split(","),r=0;r<u.length;r++)f=n.trim(u[r]),f===""?u.splice(r,1):u[r]=i?i(f):f;return u},updateProps:function(t,i){var u,r=t||{},f=n.isEmptyObject(r)?i:t;return u=[],n.each(f,function(n){u.push(n)}),n.each(Array.prototype.slice.call(arguments,1),function(t,i){n.each(i||{},function(t){if(!u||n.inArray(t,u)>=0){var f=i[t];n.isPlainObject(f)?r[t]=n.extend(r[t]||{},f):f&&f.constructor===Array?r[t]=f.slice(0):typeof f!="undefined"&&(r[t]=i[t])}})}),r},isElement:function(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName=="string"},indexOfProp:function(t,i,r){var u=t.constructor===Array?-1:null;return n.each(t,function(n,t){if(t&&(i?t[i]:t)===r)return u=n,!1}),u},boolOrDefault:function(n,t){return this.isBool(n)?n:t||!1},isBool:function(n){return typeof n=="boolean"},isUndef:function(n){return typeof n=="undefined"},ifFunction:function(t,i,r){n.isFunction(t)&&t.call(i,r)},size:function(t,i){var r=n.mapster.utils;return{width:i?t.width||t.naturalWidth:r.imgWidth(t,!0),height:i?t.height||t.naturalHeight:r.imgHeight(t,!0),complete:function(){return!!this.height&&!!this.width}}},setOpacity:function(t,i){n.mapster.hasCanvas()?t.style.opacity=i:n(t).each(function(t,r){typeof r.opacity!="undefined"?r.opacity=i:n(r).css("opacity",i)})},fader:function(){var t={},i=0,r=function(u,f,e,o){var h,c=o/15,s,l=n.mapster.utils;if(typeof u=="number"){if(s=t[u],!s)return}else h=l.indexOfProp(t,null,u),h&&delete t[h],t[++i]=s=u,u=i;e=e||1;f=f+e/c>e-.01?e:f+e/c;l.setOpacity(s,f);f<e&&setTimeout(function(){r(u,f,e,o)},15)};return r}()},getBoundList:function(t,i){if(!t.boundList)return null;var r,f,u=n(),e=n.mapster.utils.split(i);return t.boundList.each(function(i,o){for(r=0;r<e.length;r++)f=e[r],n(o).is("["+t.listKey+'="'+f+'"]')&&(u=u.add(o))}),u},setBoundListProperties:function(t,i,r){i.each(function(i,u){t.listSelectedClass&&(r?n(u).addClass(t.listSelectedClass):n(u).removeClass(t.listSelectedClass));t.listSelectedAttribute&&n(u).attr(t.listSelectedAttribute,r)})},getMapDataIndex:function(t){var i,r;switch(t.tagName&&t.tagName.toLowerCase()){case"area":r=n(t).parent().attr("name");i=n("img[usemap='#"+r+"']")[0];break;case"img":i=t}return i?this.utils.indexOfProp(this.map_cache,"image",i):-1},getMapData:function(n){var t=this.getMapDataIndex(n.length?n[0]:n);if(t>=0)return t>=0?this.map_cache[t]:null},queueCommand:function(n,t,i,r){return n?!n.complete||n.currentAction?(n.commands.push({that:t,command:i,args:r}),!0):!1:!1},unload:function(){this.impl.unload();this.utils=null;this.impl=null;n.fn.mapster=null;n.mapster=null;n("*").unbind()}};var t=n.mapster,i=t.utils,r=Array.prototype;n.each(["width","height"],function(t,r){var u=r.substr(0,1).toUpperCase()+r.substr(1);i["img"+u]=function(t,i){return(i?n(t)[r]():0)||t[r]||t["natural"+u]||t["client"+u]||t["offset"+u]}});t.Method=function(n,t,i,u){var f=this;f.name=u.name;f.output=n;f.input=n;f.first=u.first||!1;f.args=u.args?r.slice.call(u.args,0):[];f.key=u.key;f.func_map=t;f.func_area=i;f.name=u.name;f.allowAsync=u.allowAsync||!1};t.Method.prototype={constructor:t.Method,go:function(){for(var f,e,u,o=this.input,s=[],i=this,h=o.length,r=0;r<h;r++)if(f=n.mapster.getMapData(o[r]),f){if(!i.allowAsync&&t.queueCommand(f,i.input,i.name,i.args)){this.first&&(u="");continue}if(e=f.getData(o[r].nodeName==="AREA"?o[r]:this.key),e?n.inArray(e,s)<0&&s.push(e):u=this.func_map.apply(f,i.args),this.first||typeof u!="undefined")break}return n(s).each(function(n,t){u=i.func_area.apply(t,i.args)}),typeof u!="undefined"?u:this.output}};n.mapster.impl=function(){function o(){var i=n("<div />").appendTo("body"),t,r;return i.html('<v:shape id="vml_flag1" adj="1" />'),t=i[0].firstChild,t.style.behavior="url(#default#VML)",r=t?typeof t.adj=="object":!0,i.remove(),r}function u(){return typeof document.namespaces=="object"?document.namespaces:null}function s(){var t=u();return t&&t.g_vml_?!1:n("<canvas />")[0].getContext?!0:!1}function h(t,r){var u,f,e=t.options.areas;r&&n.each(r,function(r,o){o&&o.key&&(f=i.indexOfProp(e,"key",o.key),f>=0?n.extend(e[f],o):e.push(o),u=t.getDataForKey(o.key),u&&n.extend(u.options,o))})}function c(n,t){var r=i.updateProps({},t);delete r.areas;i.updateProps(n.options,r);h(n,t.areas);i.updateProps(n.area_options,n.options)}var r={},f=function(n){return t.map_cache.push(n)-1},e=function(n){t.map_cache.splice(n.index,1);for(var i=t.map_cache.length-1;i>=this.index;i--)t.map_cache[i].index--};return r.get=function(n){var i=t.getMapData(this);if(!(i&&i.complete))throw"Can't access data until binding complete.";return new t.Method(this,function(){return this.getSelected()},function(){return this.isSelected()},{name:"get",args:arguments,key:n,first:!0,allowAsync:!0,defaultReturn:""}).go()},r.data=function(n){return new t.Method(this,null,function(){return this},{name:"data",args:arguments,key:n}).go()},r.highlight=function(n){return new t.Method(this,function(){if(n===!1)this.ensureNoHighlight();else{var t=this.highlightId;return t>=0?this.data[t].key:null}},function(){this.highlight()},{name:"highlight",args:arguments,key:n,first:!0}).go()},r.keys=function(i,r){function e(t){var u,i=[];r?(u=t.areas(),n.each(u,function(n,t){i=i.concat(t.keys)})):i.push(t.key);n.each(i,function(t,i){n.inArray(i,f)<0&&f.push(i)})}var f=[],u=t.getMapData(this);if(!(u&&u.complete))throw"Can't access data until binding complete.";return(u&&u.complete)?(typeof i=="string"?r?e(u.getDataForKey(i)):f=[u.getKeysForGroup(i)]:(r=i,this.each(function(n,t){t.nodeName==="AREA"&&e(u.getDataForArea(t))})),f.join(",")):""},r.select=function(){r.set.call(this,!0)},r.deselect=function(){r.set.call(this,!1)},r.set=function(r,u,f){function v(n){if(n)switch(r){case!0:n.select(s);break;case!1:n.deselect(!0);break;default:n.toggle(s)}}function l(t){t&&n.inArray(t,c)<0&&(c.push(t),h+=(h===""?"":",")+t.key)}function a(i){n.each(c,function(n,t){v(t)});r||i.removeSelectionFinish();i.options.boundList&&t.setBoundListProperties(i.options,t.getBoundList(i.options,h),r)}var o,e,s=f,h,c;return this.filter("img,area").each(function(f,v){var y;e=t.getMapData(v);e!==o&&(o&&a(o),c=[],h="");e&&(y="",v.nodeName.toUpperCase()==="IMG"?t.queueCommand(e,n(v),"set",[r,u,s])||(u instanceof Array?u.length&&(y=u.join(",")):y=u,y&&n.each(i.split(y),function(n,t){l(e.getDataForKey(t.toString()));o=e})):(s=u,t.queueCommand(e,n(v),"set",[r,s])||(l(e.getDataForArea(v)),o=e)))}),e&&a(e),this},r.unbind=function(n){return new t.Method(this,function(){this.clearEvents();this.clearMapData(n);e(this)},null,{name:"unbind",args:arguments}).go()},r.rebind=function(n){return new t.Method(this,function(){var t=this;t.complete=!1;t.configureOptions(n);t.bindImages().then(function(){t.buildDataset(!0);t.complete=!0})},null,{name:"rebind",args:arguments}).go()},r.get_options=function(r,u){var f=i.isBool(r)?r:u;return new t.Method(this,function(){var r=n.extend({},this.options);return f&&(r.render_select=i.updateProps({},t.render_defaults,r,r.render_select),r.render_highlight=i.updateProps({},t.render_defaults,r,r.render_highlight)),r},function(){return f?this.effectiveOptions():this.options},{name:"get_options",args:arguments,first:!0,allowAsync:!0,key:r}).go()},r.set_options=function(n){return new t.Method(this,function(){c(this,n)},null,{name:"set_options",args:arguments}).go()},r.unload=function(){for(var i=t.map_cache.length-1;i>=0;i--)t.map_cache[i]&&r.unbind.call(n(t.map_cache[i].image));r.graphics=null},r.snapshot=function(){return new t.Method(this,function(){n.each(this.data,function(n,t){t.selected=!1});this.base_canvas=this.graphics.createVisibleCanvas(this);n(this.image).before(this.base_canvas)},null,{name:"snapshot"}).go()},r.state=function(){var i,r=null;return n(this).each(function(n,u){if(u.nodeName==="IMG")return i=t.getMapData(u),i&&(r=i.state()),!1}),r},r.bind=function(i){return this.each(function(u,e){var s,c,h,o;if(s=n(e),o=t.getMapData(e),o){if(r.unbind.apply(s),!o.complete)return s.bind(),!0;o=null}if(h=this.getAttribute("usemap"),c=h&&n('map[name="'+h.substr(1)+'"]'),!(s.is("img")&&h&&c.size()>0))return!0;s.css("border",0);o||(o=new t.MapData(this,i),o.index=f(o),o.map=c,o.bindImages().then(function(){o.initialize()}))})},r.init=function(r){var f,e;t.hasCanvas=function(){return i.isBool(t.hasCanvas.value)||(t.hasCanvas.value=i.isBool(r)?r:s()),t.hasCanvas.value};t.hasVml=function(){if(!i.isBool(t.hasVml.value)){var r=u();r&&!r.v&&(r.add("v","urn:schemas-microsoft-com:vml"),f=document.createStyleSheet(),e=["shape","rect","oval","circ","fill","stroke","imagedata","group","textbox"],n.each(e,function(n,t){f.addRule("v\\:"+t,"behavior: url(#default#VML); antialias:true")}));t.hasVml.value=o()}return t.hasVml.value};t.isTouch=!!document.documentElement.ontouchstart;n.extend(t.defaults,t.render_defaults,t.shared_defaults);n.extend(t.area_defaults,t.render_defaults,t.shared_defaults)},r.test=function(obj){return eval(obj)},r}();n.mapster.impl.init()}(jQuery),function(n){function o(t,i,r){var u=t,e=u.map_data,f=r.isMask;n.each(i.areas(),function(n,t){r.isMask=f||t.nohref&&e.options.noHrefIsMask;u.addShape(t,r)});r.isMask=f}function u(n){return Math.max(0,Math.min(parseInt(n,16),255))}function s(n,t){return"rgba("+u(n.substr(0,2))+","+u(n.substr(2,2))+","+u(n.substr(4,2))+","+t+")"}function h(){}var i,t=n.mapster,r=t.utils,f,e;t.Graphics=function(n){var t=this;t.active=!1;t.canvas=null;t.width=0;t.height=0;t.shapes=[];t.masks=[];t.map_data=n};i=t.Graphics.prototype={constructor:t.Graphics,begin:function(t,i){var r=n(t);this.elementName=i;this.canvas=t;this.width=r.width();this.height=r.height();this.shapes=[];this.masks=[];this.active=!0},addShape:function(n,t){var i=t.isMask?this.masks:this.shapes;i.push({mapArea:n,options:t})},createVisibleCanvas:function(i){return n(this.createCanvasFor(i)).addClass("mapster_el").css(t.canvas_style)[0]},addShapeGroup:function(i,u,f){var h=this,l,a,s,c=this.map_data,e=i.effectiveRenderOptions(u);f&&n.extend(e,f);u==="select"?(a="static_"+i.areaId.toString(),s=c.base_canvas):s=c.overlay_canvas;h.begin(s,a);e.includeKeys&&(l=r.split(e.includeKeys),n.each(l,function(n,t){var i=c.getDataForKey(t.toString());o(h,i,i.effectiveRenderOptions(u))}));o(h,i,e);h.render();e.fade&&r.fader(t.hasCanvas()?s:n(s).find("._fill").not(".mapster_mask"),0,t.hasCanvas()?1:e.fillOpacity,e.fadeDuration)}};f={renderShape:function(n,t,i){var u,r=t.coords(null,i);switch(t.shape){case"rect":n.rect(r[0],r[1],r[2]-r[0],r[3]-r[1]);break;case"poly":for(n.moveTo(r[0],r[1]),u=2;u<t.length;u+=2)n.lineTo(r[u],r[u+1]);n.lineTo(r[0],r[1]);break;case"circ":case"circle":n.arc(r[0],r[1],r[2],0,Math.PI*2,!1)}},addAltImage:function(n,t,i,r){n.beginPath();this.renderShape(n,i);n.closePath();n.clip();n.globalAlpha=r.altImageOpacity||r.fillOpacity;n.drawImage(t,0,0,i.owner.scaleInfo.width,i.owner.scaleInfo.height)},render:function(){var u,r,i=this,f=i.map_data,o=i.masks.length,e=i.createCanvasFor(f),t=e.getContext("2d"),h=i.canvas.getContext("2d");return o&&(u=i.createCanvasFor(f),r=u.getContext("2d"),r.clearRect(0,0,u.width,u.height),n.each(i.masks,function(n,t){r.save();r.beginPath();i.renderShape(r,t.mapArea);r.closePath();r.clip();r.lineWidth=0;r.fillStyle="#000";r.fill();r.restore()})),n.each(i.shapes,function(n,r){t.save();r.options.fill&&(r.options.altImageId?i.addAltImage(t,f.images[r.options.altImageId],r.mapArea,r.options):(t.beginPath(),i.renderShape(t,r.mapArea),t.closePath(),t.fillStyle=s(r.options.fillColor,r.options.fillOpacity),t.fill()));t.restore()}),n.each(i.shapes.concat(i.masks),function(n,r){var u=r.options.strokeWidth===1?.5:0;r.options.stroke&&(t.save(),t.strokeStyle=s(r.options.strokeColor,r.options.strokeOpacity),t.lineWidth=r.options.strokeWidth,t.beginPath(),i.renderShape(t,r.mapArea,u),t.closePath(),t.stroke(),t.restore())}),o?(r.globalCompositeOperation="source-out",r.drawImage(e,0,0),h.drawImage(u,0,0)):h.drawImage(e,0,0),i.active=!1,i.canvas},createCanvasFor:function(t){return n('<canvas width="'+t.scaleInfo.width+'" height="'+t.scaleInfo.height+'"><\/canvas>')[0]},clearHighlight:function(){var n=this.map_data.overlay_canvas;n.getContext("2d").clearRect(0,0,n.width,n.height)},refreshSelections:function(){var i,t=this.map_data;i=t.base_canvas;t.base_canvas=this.createVisibleCanvas(t);n(t.base_canvas).hide();n(i).before(t.base_canvas);t.redrawSelections();n(t.base_canvas).show();n(i).remove()}};e={renderShape:function(t,i,r){var f=this,e,o,a,s,h,c,l,u=t.coords();h=f.elementName?'name="'+f.elementName+'" ':"";c=r?'class="'+r+'" ':"";s='<v:fill color="#'+i.fillColor+'" class="_fill" opacity="'+(i.fill?i.fillOpacity:0)+'" /><v:stroke class="_fill" opacity="'+i.strokeOpacity+'"/>';o=i.stroke?" strokeweight="+i.strokeWidth+' stroked="t" strokecolor="#'+i.strokeColor+'"':' stroked="f"';e=i.fill?' filled="t"':' filled="f"';switch(t.shape){case"rect":l="<v:rect "+c+h+e+o+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+u[0]+"px;top:"+u[1]+"px;width:"+(u[2]-u[0])+"px;height:"+(u[3]-u[1])+'px;">'+s+"<\/v:rect>";break;case"poly":l="<v:shape "+c+h+e+o+' coordorigin="0,0" coordsize="'+f.width+","+f.height+'" path="m '+u[0]+","+u[1]+" l "+u.slice(2).join(",")+' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:'+f.width+"px;height:"+f.height+'px;">'+s+"<\/v:shape>";break;case"circ":case"circle":l="<v:oval "+c+h+e+o+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+(u[0]-u[2])+"px;top:"+(u[1]-u[2])+"px;width:"+u[2]*2+"px;height:"+u[2]*2+'px;">'+s+"<\/v:oval>"}return a=n(l),n(f.canvas).append(a),a},render:function(){var t,i=this;return n.each(this.shapes,function(n,t){i.renderShape(t.mapArea,t.options)}),this.masks.length&&n.each(this.masks,function(n,u){t=r.updateProps({},u.options,{fillOpacity:1,fillColor:u.options.fillColorMask});i.renderShape(u.mapArea,t,"mapster_mask")}),this.active=!1,this.canvas},createCanvasFor:function(t){var i=t.scaleInfo.width,r=t.scaleInfo.height;return n('<var width="'+i+'" height="'+r+'" style="zoom:1;overflow:hidden;display:block;width:'+i+"px;height:"+r+'px;"><\/var>')[0]},clearHighlight:function(){n(this.map_data.overlay_canvas).children().remove()},removeSelections:function(t){t>=0?n(this.map_data.base_canvas).find('[name="static_'+t.toString()+'"]').remove():n(this.map_data.base_canvas).children().remove()}};n.each(["renderShape","addAltImage","render","createCanvasFor","clearHighlight","removeSelections","refreshSelections"],function(n,r){i[r]=function(n){return function(){return i[n]=(t.hasCanvas()?f[n]:e[n])||h,i[n].apply(this,arguments)}}(r)})}(jQuery),function(n){var t=n.mapster,r=t.utils,i=[];t.MapImages=function(n){this.owner=n;this.clear()};t.MapImages.prototype={constructor:t.MapImages,slice:function(){return i.slice.apply(this,arguments)},splice:function(){i.slice.apply(this.status,arguments);return i.slice.apply(this,arguments)},complete:function(){return n.inArray(!1,this.status)<0},_add:function(n){var t=i.push.call(this,n)-1;return this.status[t]=!1,t},indexOf:function(t){return n.inArray(t,this)},clear:function(){var t=this;t.ids&&t.ids.length>0&&n.each(t.ids,function(n,i){delete t[i]});t.ids=[];t.length=0;t.status=[];t.splice(0)},add:function(t,i){var u,f,r=this;if(t){if(typeof t=="string"){if(f=t,t=r[f],typeof t=="object")return r.indexOf(t);t=n("<img />").addClass("mapster_el").hide();u=r._add(t[0]);t.bind("load",function(n){r.imageLoaded.call(r,n)}).bind("error",function(n){r.imageLoadError.call(r,n)});t.attr("src",f)}else u=r._add(n(t)[0]);if(i){if(this[i])throw i+" is already used or is not available as an altImage alias.";r.ids.push(i);r[i]=r[u]}return u}},bind:function(){var n=this,t,u=n.owner.options.configTimeout/200,i=function(){for(var t=n.length;t-->0;)if(!n.isLoaded(t))break;n.complete()?n.resolve():u-->0?n.imgTimeout=window.setTimeout(function(){i.call(n,!0)},50):n.imageLoadError.call(n)};return t=n.deferred=r.defer(),i(),t},resolve:function(){var n=this,t=n.deferred;t&&(n.deferred=null,t.resolve())},imageLoaded:function(t){var i=this,r=i.indexOf(t.target);r>=0&&(i.status[r]=!0,n.inArray(!1,i.status)<0&&i.resolve())},imageLoadError:function(n){clearTimeout(this.imgTimeout);this.triesLeft=0;var t=n?"The image "+n.target.src+" failed to load.":"The images never seemed to finish loading. You may just need to increase the configTimeout if images could take a long time to load.";throw t;},isLoaded:function(n){var t,u=this,i=u.status;return i[n]?!0:(t=u[n],i[n]=typeof t.complete!="undefined"?t.complete:!!r.imgWidth(t),i[n])}}}(jQuery),function(n){function u(t){n.extend(t,{complete:!1,map:null,base_canvas:null,overlay_canvas:null,commands:[],data:[],mapAreas:[],_xref:{},highlightId:-1,currentAreaId:-1,_tooltip_events:[],scaleInfo:null,index:-1,activeAreaEvent:null})}function f(n){return[n,n.render_highlight,n.render_select]}function e(r){var u=r.options,e=r.images;t.hasCanvas()&&(n.each(u.altImages||{},function(n,t){e.add(t,n)}),n.each([u].concat(u.areas),function(t,i){n.each(f(i),function(n,t){t&&t.altImage&&(t.altImageId=e.add(t.altImage))})}));r.area_options=i.updateProps({},t.area_defaults,u)}function r(n,t,u,f){function e(t){n.currentAreaId!==t&&n.highlightId>=0&&f.resolve()}if(f=f||i.when.defer(),n.activeAreaEvent&&(window.clearTimeout(n.activeAreaEvent),n.activeAreaEvent=0),!(t<0))return u.owner.currentAction||t?n.activeAreaEvent=window.setTimeout(function(){return function(){r(n,0,u,f)}}(u),t||100):e(u.areaId),f}function o(n){t.hasCanvas()||this.blur();n.preventDefault()}function s(t,i){var u=t.getAllDataForArea(this),r=u.length?u[0]:null;!r||r.isNotRendered()||r.owner.currentAction||t.currentAreaId!==r.areaId&&(t.highlightId!==r.areaId&&(t.clearEffects(),r.highlight(),t.options.showToolTip&&n.each(u,function(n,t){t.effectiveOptions().toolTip&&t.showToolTip()})),t.currentAreaId=r.areaId,n.isFunction(t.options.onMouseover)&&t.options.onMouseover.call(this,{e:i,options:r.effectiveOptions(),key:r.key,selected:r.isSelected()}))}function h(t,i){var e,u=t.getDataForArea(this),f=t.options;t.currentAreaId<0||!u||(e=t.getDataForArea(i.relatedTarget),e!==u)&&(t.currentAreaId=-1,u.area=null,r(t,f.mouseoutDelay,u).then(t.clearEffects),n.isFunction(f.onMouseout)&&f.onMouseout.call(this,{e:i,options:f,key:u.key,selected:u.isSelected()}))}function c(t){var i=t.options;t.ensureNoHighlight();i.toolTipClose&&n.inArray("area-mouseout",i.toolTipClose)>=0&&t.activeToolTip&&t.clearToolTip()}function l(r,u){function v(e){var o,w;if(c=e.isSelectable()&&(e.isDeselectable()||!e.isSelected()),h=c?!e.isSelected():e.isSelected(),s=t.getBoundList(f,e.key),n.isFunction(f.onClick)&&(l=f.onClick.call(p,{e:u,listTarget:s,key:e.key,selected:h}),i.isBool(l))){if(!l)return!1;if(w=n(e.area).attr("href"),w!=="#")return window.location.href=w,!1}c&&(y=e.toggle());f.boundList&&f.boundList.length>0&&t.setBoundListProperties(f,s,e.isSelected());o=e.effectiveOptions();o.includeKeys&&(a=i.split(o.includeKeys),n.each(a,function(n,t){var i=r.getDataForKey(t.toString());i.options.isMask||v(i)}))}var y,a,s,h,c,l,p=this,e=r.getDataForArea(this),f=r.options;if(o.call(this,u),f.clickNavigate&&e.href){window.location.href=e.href;return}e&&!e.owner.currentAction&&(f=r.options,v(e))}var t=n.mapster,i=t.utils;t.MapData=function(n,i){var r=this;r.image=n;r.images=new t.MapImages(r);r.graphics=new t.Graphics(r);r.imgCssText=n.style.cssText||null;u(r);r.configureOptions(i);r.mouseover=function(n){s.call(this,r,n)};r.mouseout=function(n){h.call(this,r,n)};r.click=function(n){l.call(this,r,n)};r.clearEffects=function(n){c.call(this,r,n)}};t.MapData.prototype={constructor:t.MapData,configureOptions:function(n){this.options=i.updateProps({},t.defaults,n)},bindImages:function(){var n=this,t=n.images;return t.length>2?t.splice(2):t.length===0&&(t.add(n.image),t.add(n.image.src)),e(n),n.images.bind()},isActive:function(){return!this.complete||this.currentAction},state:function(){return{complete:this.complete,resizing:this.currentAction==="resizing",zoomed:this.zoomed,zoomedArea:this.zoomedArea,scaleInfo:this.scaleInfo}},wrapId:function(){return"mapster_wrap_"+this.index},_idFromKey:function(n){return typeof n=="string"&&this._xref.hasOwnProperty(n)?this._xref[n]:-1},getSelected:function(){var t="";return n.each(this.data,function(n,i){i.isSelected()&&(t+=(t?",":"")+this.key)}),t},getAllDataForArea:function(t,r){var f,e,o,s=this,u=n(t).filter("area").attr(s.options.mapKey);if(u)for(o=[],u=i.split(u),f=0;f<(r||u.length);f++)e=s.data[s._idFromKey(u[f])],e.area=t.length?t[0]:t,o.push(e);return o},getDataForArea:function(n){var t=this.getAllDataForArea(n,1);return t?t[0]||null:null},getDataForKey:function(n){return this.data[this._idFromKey(n)]},getKeysForGroup:function(n){var t=this.getDataForKey(n);return t?t.isPrimary?t.key:this.getPrimaryKeysForMapAreas(t.areas()).join(","):""},getPrimaryKeysForMapAreas:function(t){var i=[];return n.each(t,function(t,r){n.inArray(r.keys[0],i)<0&&i.push(r.keys[0])}),i},getData:function(n){return typeof n=="string"?this.getDataForKey(n):n&&n.mapster||i.isElement(n)?this.getDataForArea(n):null},ensureNoHighlight:function(){var n;this.highlightId>=0&&(this.graphics.clearHighlight(),n=this.data[this.highlightId],n.changeState("highlight",!1),this.setHighlightId(-1))},setHighlightId:function(n){this.highlightId=n},clearSelections:function(){n.each(this.data,function(n,t){t.selected&&t.deselect(!0)});this.removeSelectionFinish()},setAreaOptions:function(n){var r,t,u;for(n=n||[],r=n.length-1;r>=0;r--)t=n[r],t&&(u=this.getDataForKey(t.key),u&&(i.updateProps(u.options,t),i.isBool(t.selected)&&(u.selected=t.selected)))},drawSelections:function(n){for(var r=i.asArray(n),t=r.length-1;t>=0;t--)this.data[r[t]].drawSelection()},redrawSelections:function(){n.each(this.data,function(n,t){t.isSelectedOrStatic()&&t.drawSelection()})},initialize:function(){var v,y,p,f,o,c,s,h,e,w,l,a,r=this,u=r.options;if(!r.complete){for(e=n(r.image),o=e.parent().attr("id"),o&&o.length>=12&&o.substring(0,12)==="mapster_wrap"?(f=e.parent(),f.attr("id",r.wrapId())):(f=n('<div id="'+r.wrapId()+'"><\/div>'),u.wrapClass&&(u.wrapClass===!0?f.addClass(e[0].className):f.addClass(u.wrapClass))),r.wrapper=f,r.scaleInfo=a=i.scaleMap(r.images[0],r.images[1],u.scaleMap),r.base_canvas=y=r.graphics.createVisibleCanvas(r),r.overlay_canvas=p=r.graphics.createVisibleCanvas(r),v=n(r.images[1]).addClass("mapster_el "+r.images[0].className).attr({id:null,usemap:null}),h=i.size(r.images[0]),h.complete&&v.css({width:h.width,height:h.height}),r.buildDataset(),c={display:"block",position:"relative",padding:0,width:a.width,height:a.height},u.wrapCss&&n.extend(c,u.wrapCss),e.parent()[0]!==r.wrapper[0]&&e.before(r.wrapper),f.css(c),n(r.images.slice(2)).hide(),s=1;s<r.images.length;s++)f.append(r.images[s]);f.append(y).append(p).append(e.css(t.canvas_style));i.setOpacity(r.images[0],0);n(r.images[1]).show();i.setOpacity(r.images[1],1);u.isSelectable&&u.onGetList&&(l=r.data.slice(0),u.sortList&&(w=u.sortList==="desc"?function(n,t){return n===t?0:n>t?-1:1}:function(n,t){return n===t?0:n<t?-1:1},l.sort(function(n,t){return n=n.value,t=t.value,w(n,t)})),r.options.boundList=u.onGetList.call(r.image,l));r.complete=!0;r.processCommandQueue();u.onConfigured&&typeof u.onConfigured=="function"&&u.onConfigured.call(e,!0)}},buildDataset:function(i){function g(n,i){var u=new t.AreaData(r,n,i);return u.areaId=r._xref[n]=r.data.push(u)-1,u.areaId}var d,b,c,u,e,l,a,o,p,k,s,v,f,w,r=this,h=r.options,y;for(r._xref={},r.data=[],i||(r.mapAreas=[]),y=!h.mapKey,y&&(h.mapKey="data-mapster-key"),d=t.hasVml()?"area":y?"area[coords]":"area["+h.mapKey+"]",b=n(r.map).find(d).unbind(".mapster"),s=0;s<b.length;s++)if(u=0,l=b[s],e=n(l),l.coords){for(y?(a=String(s),e.attr("data-mapster-key",a)):a=l.getAttribute(h.mapKey),i?(o=r.mapAreas[e.data("mapster")-1],o.configure(a)):(o=new t.MapArea(r,l,a),r.mapAreas.push(o)),k=o.keys,c=k.length-1;c>=0;c--)p=k[c],h.mapValue&&(v=e.attr(h.mapValue)),y?(u=g(r.data.length,v),f=r.data[u],f.key=p=u.toString()):(u=r._xref[p],u>=0?(f=r.data[u],v&&!r.data[u].value&&(f.value=v)):(u=g(p,v),f=r.data[u],f.isPrimary=c===0)),o.areaDataXref.push(u),f.areasXref.push(s);w=e.attr("href");w&&w!=="#"&&!f.href&&(f.href=w);o.nohref||(e.bind("click.mapster",r.click),t.isTouch||e.bind("mouseover.mapster",r.mouseover).bind("mouseout.mapster",r.mouseout).bind("mousedown.mapster",r.mousedown));e.data("mapster",s+1)}r.setAreaOptions(h.areas);r.redrawSelections()},processCommandQueue:function(){for(var n,i=this;!i.currentAction&&i.commands.length;)n=i.commands[0],i.commands.splice(0,1),t.impl[n.command].apply(n.that,n.args)},clearEvents:function(){n(this.map).find("area").unbind(".mapster");n(this.images).unbind(".mapster")},_clearCanvases:function(t){t||n(this.base_canvas).remove();n(this.overlay_canvas).remove()},clearMapData:function(t){var r=this;this._clearCanvases(t);n.each(this.data,function(n,t){t.reset()});this.data=null;t||(this.image.style.cssText=this.imgCssText,n(this.wrapper).before(this.image).remove());r.images.clear();this.image=null;i.ifFunction(this.clearTooltip,this)},removeSelectionFinish:function(){var n=this.graphics;n.refreshSelections();n.clearHighlight()}}}(jQuery),function(n){function r(t){var i=this,r=i.owner;r.options.singleSelect&&r.clearSelections();i.isSelected()||(t&&(i.optsCache=n.extend(i.effectiveRenderOptions("select"),t,{altImageId:r.images.add(t.altImage)})),i.drawSelection(),i.selected=!0,i.changeState("select",!0));r.options.singleSelect&&r.graphics.refreshSelections()}function u(n){var t=this;t.selected=!1;t.changeState("select",!1);t.optsCache=null;t.owner.graphics.removeSelections(t.areaId);n||t.owner.removeSelectionFinish()}function f(n){var t=this;return t.isSelected()?t.deselect():t.select(n),t.isSelected()}var i=n.mapster,t=i.utils;i.AreaData=function(t,i,r){n.extend(this,{owner:t,key:i||"",isPrimary:!0,areaId:-1,href:"",value:r||"",options:{},selected:null,areasXref:[],area:null,optsCache:null})};i.AreaData.prototype={constuctor:i.AreaData,select:r,deselect:u,toggle:f,areas:function(){for(var t=[],n=0;n<this.areasXref.length;n++)t.push(this.owner.mapAreas[this.areasXref[n]]);return t},coords:function(t){var i=[];return n.each(this.areas(),function(n,r){i=i.concat(r.coords(t))}),i},reset:function(){n.each(this.areas(),function(n,t){t.reset()});this.areasXref=[];this.options=null},isSelectedOrStatic:function(){var n=this.effectiveOptions();return t.isBool(n.staticState)?n.staticState:this.isSelected()},isSelected:function(){return t.isBool(this.selected)?this.selected:t.isBool(this.owner.area_options.selected)?this.owner.area_options.selected:!1},isSelectable:function(){return t.isBool(this.effectiveOptions().staticState)?!1:t.isBool(this.owner.options.staticState)?!1:t.boolOrDefault(this.effectiveOptions().isSelectable,!0)},isDeselectable:function(){return t.isBool(this.effectiveOptions().staticState)?!1:t.isBool(this.owner.options.staticState)?!1:t.boolOrDefault(this.effectiveOptions().isDeselectable,!0)},isNotRendered:function(){var t=n(this.area);return t.attr("nohref")||!t.attr("href")||this.effectiveOptions().isMask},effectiveOptions:function(n){var i=t.updateProps({},this.owner.area_options,this.options,n||{},{id:this.areaId});return i.selected=this.isSelected(),i},effectiveRenderOptions:function(i,r){var f,u=this.optsCache;return u&&i!=="highlight"||(f=this.effectiveOptions(r),u=t.updateProps({},f,f["render_"+i]),i!=="highlight"&&(this.optsCache=u)),n.extend({},u)},changeState:function(t,i){n.isFunction(this.owner.options.onStateChange)&&this.owner.options.onStateChange.call(this.owner.image,{key:this.key,state:t,selected:i})},highlight:function(n){var t=this.owner;this.effectiveOptions().highlight&&t.graphics.addShapeGroup(this,"highlight",n);t.setHighlightId(this.areaId);this.changeState("highlight",!0)},drawSelection:function(){this.owner.graphics.addShapeGroup(this,"select")}};i.MapArea=function(i,r,u){if(i){var f=this;f.owner=i;f.area=r;f.areaDataXref=[];f.originalCoords=[];n.each(t.split(r.coords),function(n,t){f.originalCoords.push(parseFloat(t))});f.length=f.originalCoords.length;f.shape=r.shape.toLowerCase();f.nohref=r.nohref||!r.href;f.configure(u)}};i.MapArea.prototype={constructor:i.MapArea,configure:function(n){this.keys=t.split(n)},reset:function(){this.area=null},coords:function(t){return n.map(this.originalCoords,function(n){return t?n:n+t})}}}(jQuery),function(n){var t=n.mapster.utils;t.areaCorners=function(i,r,u,f,e){var s,k,w,b,y,p,d,g,nt,tt,a,v,it,o,ft=0,et=0,ot,st,c,rt,ut,l,h=[];for(i=i.length?i:[i],u=u?n(u):n(document.body),s=u.offset(),ot=s.left,st=s.top,r&&(s=n(r).offset(),ft=s.left,et=s.top),o=0;o<i.length;o++)if(l=i[o],l.nodeName==="AREA"){c=t.split(l.coords,parseInt);switch(l.shape){case"circle":for(a=c[0],v=c[1],rt=c[2],h=[],o=0;o<360;o+=20)ut=o*Math.PI/180,h.push(a+rt*Math.cos(ut),v+rt*Math.sin(ut));break;case"rect":h.push(c[0],c[1],c[2],c[1],c[2],c[3],c[0],c[3]);break;default:h=h.concat(c)}for(o=0;o<h.length;o+=2)h[o]=parseInt(h[o],10)+ft,h[o+1]=parseInt(h[o+1],10)+et}else l=n(l),s=l.position(),h.push(s.left,s.top,s.left+l.width(),s.top,s.left+l.width(),s.top+l.height(),s.left,s.top+l.height());for(w=b=d=nt=999999,y=p=g=tt=-1,o=h.length-2;o>=0;o-=2)a=h[o],v=h[o+1],a<w&&(w=a,tt=v),a>y&&(y=a,nt=v),v<b&&(b=v,g=a),v>p&&(p=v,d=a);return f&&e&&(k=!1,n.each([[g-f,b-e],[d,b-e],[w-f,tt-e],[w-f,nt],[y,tt-e],[y,nt],[g-f,p],[d,p]],function(n,t){if(!k&&t[0]>ot&&t[1]>st)return it=t,k=!0,!1}),k||(it=[y,p])),it}}(jQuery),function(n){var t=n.mapster,i=t.utils,r=t.MapArea.prototype;t.utils.getScaleInfo=function(n,t){var i;return t?(i=n.width/t.width||n.height/t.height,i>.98&&i<1.02&&(i=1)):(i=1,t=n),{scale:i!==1,scalePct:i,realWidth:t.width,realHeight:t.height,width:n.width,height:n.height,ratio:n.width/n.height}};t.utils.scaleMap=function(n,t,r){var u=i.size(n),f=i.size(t,!0);if(!f.complete())throw"Another script, such as an extension, appears to be interfering with image loading. Please let us know about this.";return u.complete()||(u=f),this.getScaleInfo(u,r?f:null)};t.MapData.prototype.resize=function(r,u,f,e){function y(i,r,u){t.hasCanvas()?(i.width=r,i.height=u):(n(i).width(r),n(i).height(u))}function b(){o.currentAction="";n.isFunction(e)&&e();o.processCommandQueue()}function p(){if(y(o.overlay_canvas,r,u),v>=0){var n=o.data[v];n.tempOptions={fade:!1};o.getDataForKey(n.key).highlight();n.tempOptions=null}y(o.base_canvas,r,u);o.redrawSelections();b()}function w(){n(o.image).css(c);o.scaleInfo=i.getScaleInfo({width:r,height:u},{width:o.scaleInfo.realWidth,height:o.scaleInfo.realHeight});n.each(o.data,function(t,i){n.each(i.areas(),function(n,t){t.resize()})})}var s,h,c,a,v,l,o=this;(e=e||f,o.scaleInfo.width!==r||o.scaleInfo.height!==u)&&(v=o.highlightId,r||(l=u/o.scaleInfo.realHeight,r=Math.round(o.scaleInfo.realWidth*l)),u||(l=r/o.scaleInfo.realWidth,u=Math.round(o.scaleInfo.realHeight*l)),c={width:String(r)+"px",height:String(u)+"px"},t.hasCanvas()||n(o.base_canvas).children().remove(),a=n(o.wrapper).find(".mapster_el").add(o.wrapper),f?(h=[],o.currentAction="resizing",a.each(function(t,r){s=i.defer();h.push(s);n(r).animate(c,{duration:f,complete:s.resolve,easing:"linear"})}),s=i.defer(),h.push(s),i.when.all(h).then(p),w(),s.resolve()):(a.css(c),w(),p()))};t.MapArea=i.subclass(t.MapArea,function(){this.base.init();this.owner.scaleInfo.scale&&this.resize()});r.coords=function(n,t){var i,r=[],u=n||this.owner.scaleInfo.scalePct,f=t||0;if(u===1&&t===0)return this.originalCoords;for(i=0;i<this.length;i++)r.push(Math.round(this.originalCoords[i]*u)+f);return r};r.resize=function(){this.area.coords=this.coords().join(",")};r.reset=function(){this.area.coords=this.coords(1).join(",")};t.impl.resize=function(n,i,r,u){if(!n&&!i)return!1;return new t.Method(this,function(){this.resize(n,i,r,u)},null,{name:"resize",args:arguments}).go()}}(jQuery),function(n){function u(t,i,r){var u;return i?(u=typeof i=="string"?n(i):n(i).clone(),u.append(t)):u=n(t),u.css(n.extend(r||{},{display:"block",position:"absolute"})).hide(),n("body").append(u),u.attr("data-opacity",u.css("opacity")).css("opacity",0),u.show()}function o(n,t){var r={left:t.left+"px",top:t.top+"px"},u=n.attr("data-opacity")||0,f=n.css("z-index");(parseInt(f,10)===0||f==="auto")&&(r["z-index"]=9999);n.css(r).addClass("mapster_tooltip");t.fadeDuration&&t.fadeDuration>0?i.fader(n[0],0,u,t.fadeDuration):i.setOpacity(n[0],u)}function r(t,i,r,u,f,e){var o=r+".mapster-tooltip";if(n.inArray(i,t)>=0)return u.unbind(o).bind(o,function(n){(!f||f.call(this,n))&&(u.unbind(".mapster-tooltip"),e&&e.call(this))}),{object:u,event:o}}function f(n,t,r,u,f){var s,e={};return f=f||{},t?(s=i.areaCorners(t,r,u,n.outerWidth(!0),n.outerHeight(!0)),e.left=s[0],e.top=s[1]):(e.left=f.left,e.top=f.top),e.left+=f.offsetx||0,e.top+=f.offsety||0,e.css=f.css,e.fadeDuration=f.fadeDuration,o(n,e),n}function e(n){return n?typeof n=="string"||n.jquery?n:n.content:null}var t=n.mapster,i=t.utils;n.extend(t.defaults,{toolTipContainer:'<div style="border: 2px solid black; background: #EEEEEE; width:160px; padding:4px; margin: 4px; -moz-box-shadow: 3px 3px 5px #535353; -webkit-box-shadow: 3px 3px 5px #535353; box-shadow: 3px 3px 5px #535353; -moz-border-radius: 6px 6px 6px 6px; -webkit-border-radius: 6px; border-radius: 6px 6px 6px 6px; opacity: 0.9;"><\/dteniv>',showToolTip:!1,toolTipFade:!0,toolTipClose:["area-mouseout","image-mouseout"],onShowToolTip:null,onHideToolTip:null});n.extend(t.area_defaults,{toolTip:null,toolTipClose:null});t.MapData.prototype.clearToolTip=function(){this.activeToolTip&&(this.activeToolTip.stop().remove(),this.activeToolTip=null,this.activeToolTipID=null,i.ifFunction(this.options.onHideToolTip,this))};t.AreaData.prototype.showToolTip=function(t,e){var c,h,y,l,v,s=this,o=s.owner,a=s.effectiveOptions();if(e=e?n.extend({},e):{},t=t||a.toolTip,h=e.closeEvents||a.toolTipClose||o.options.toolTipClose||"tooltip-click",v=typeof e.template!="undefined"?e.template:o.options.toolTipContainer,e.closeEvents=typeof h=="string"?h=i.split(h):h,e.fadeDuration=e.fadeDuration||(o.options.toolTipFade?o.options.fadeDuration||a.fadeDuration:0),y=s.area?s.area:n.map(s.areas(),function(n){return n.area}),o.activeToolTipID!==s.areaId)return o.clearToolTip(),o.activeToolTip=c=u(t,v,e.css),o.activeToolTipID=s.areaId,l=function(){o.clearToolTip()},r(h,"area-click","click",n(o.map),null,l),r(h,"tooltip-click","click",c,null,l),r(h,"image-mouseout","mouseout",n(o.image),function(n){return n.relatedTarget&&n.relatedTarget.nodeName!=="AREA"&&n.relatedTarget!==s.area},l),f(c,y,o.image,e.container,v,e),i.ifFunction(o.options.onShowToolTip,s.area,{toolTip:c,options:{},areaOptions:a,key:s.key,selected:s.isSelected()}),c};t.impl.tooltip=function(i,o){return new t.Method(this,function(){var s,h,t=this;if(i){if(h=n(i),t.activeToolTipID===h[0])return;t.clearToolTip();t.activeToolTip=s=u(e(o),o.template||t.options.toolTipContainer,o.css);t.activeToolTipID=h[0];r(["tooltip-click"],"tooltip-click","click",s,null,function(){t.clearToolTip()});t.activeToolTip=s=f(s,h,t.image,o.container,o)}else t.clearToolTip()},function(){n.isPlainObject(i)&&!o&&(o=i);this.showToolTip(e(o),o)},{name:"tooltip",args:arguments,key:i}).go()}}(jQuery),function(n){function f(){return n("<div/>")}var u=Math.abs,i=Math.max,r=Math.min,t=Math.round;n.imgAreaSelect=function(e,o){function kt(n){return n+rt.left-ct.left}function dt(n){return n+rt.top-ct.top}function st(n){return n-rt.left+ct.left}function ht(n){return n-rt.top+ct.top}function ui(n){return n.pageX-ct.left}function fi(n){return n.pageY-ct.top}function ot(n){var i=n||ni,r=n||ti;return{x1:t(s.x1*i),y1:t(s.y1*r),x2:t(s.x2*i),y2:t(s.y2*r),width:t(s.x2*i)-t(s.x1*i),height:t(s.y2*r)-t(s.y1*r)}}function ir(n,i,r,u,f){var e=f||ni,o=f||ti;s={x1:t(n/e||0),y1:t(i/o||0),x2:t(r/e||0),y2:t(u/o||0)};s.width=s.x2-s.x1;s.height=s.y2-s.y1}function vt(){si&&g.width()&&(rt={left:t(g.offset().left),top:t(g.offset().top)},nt=g.innerWidth(),d=g.innerHeight(),rt.top+=g.outerHeight()-d>>1,rt.left+=g.outerWidth()-nt>>1,ii=t(o.minWidth/ni)||0,ri=t(o.minHeight/ti)||0,di=t(r(o.maxWidth/ni||16777216,nt)),gi=t(r(o.maxHeight/ti||16777216,d)),n().jquery!="1.3.2"||ci!="fixed"||nr.getBoundingClientRect||(rt.top+=i(document.body.scrollTop,nr.scrollTop),rt.left+=i(document.body.scrollLeft,nr.scrollLeft)),ct=/absolute|relative/.test(wt.css("position"))?{left:t(wt.offset().left)-wt.scrollLeft(),top:t(wt.offset().top)-wt.scrollTop()}:ci=="fixed"?{left:n(document).scrollLeft(),top:n(document).scrollTop()}:{left:0,top:0},w=kt(0),b=dt(0),(s.x2>nt||s.y2>d)&&yi())}function vi(t){if(li){v.css({left:kt(s.x1),top:dt(s.y1)}).add(pt).width(et=s.width).height(at=s.height);pt.add(k).add(p).css({left:0,top:0});k.width(i(et-k.outerWidth()+k.innerWidth(),0)).height(i(at-k.outerHeight()+k.innerHeight(),0));n(y[0]).css({left:w,top:b,width:s.x1,height:d});n(y[1]).css({left:w+s.x1,top:b,width:et,height:s.y1});n(y[2]).css({left:w+s.x2,top:b,width:nt-s.x2,height:d});n(y[3]).css({left:w+s.x1,top:b+s.y2,width:et,height:d-s.y2});et-=p.outerWidth();at-=p.outerHeight();switch(p.length){case 8:n(p[4]).css({left:et>>1});n(p[5]).css({left:et,top:at>>1});n(p[6]).css({left:et>>1,top:at});n(p[7]).css({top:at>>1});case 4:p.slice(1,3).css({left:et});p.slice(2,4).css({top:at})}t!==!1&&(n.imgAreaSelect.onKeyPress!=pr&&n(document).unbind(n.imgAreaSelect.keyPress,n.imgAreaSelect.onKeyPress),o.keys&&n(document)[n.imgAreaSelect.keyPress](n.imgAreaSelect.onKeyPress=pr));gt&&k.outerWidth()-k.innerWidth()==2&&(k.css("margin",0),setTimeout(function(){k.css("margin","auto")},0))}}function rr(n){vt();vi(n);h=kt(s.x1);c=dt(s.y1);l=kt(s.x2);a=dt(s.y2)}function ur(n,t){o.fadeSpeed?n.fadeOut(o.fadeSpeed,t):n.hide()}function yt(n){var t=st(ui(n))-s.x1,i=ht(fi(n))-s.y1;if(!tr){vt();tr=!0;v.one("mouseout",function(){tr=!1})}tt="";o.resizable&&(i<=o.resizeMargin?tt="n":i>=s.height-o.resizeMargin&&(tt="s"),t<=o.resizeMargin?tt+="w":t>=s.width-o.resizeMargin&&(tt+="e"));v.css("cursor",tt?tt+"-resize":o.movable?"move":"");hi&&hi.toggle()}function hr(){n("body").css("cursor","");(o.autoHide||s.width*s.height==0)&&ur(v.add(y),function(){n(this).hide()});n(document).unbind("mousemove",fr);v.mousemove(yt);o.onSelectEnd(e,ot())}function cr(t){if(t.which!=1)return!1;if(vt(),tt){n("body").css("cursor",tt+"-resize");h=kt(s[/w/.test(tt)?"x2":"x1"]);c=dt(s[/n/.test(tt)?"y2":"y1"]);n(document).mousemove(fr).one("mouseup",hr);v.unbind("mousemove",yt)}else if(o.movable){bi=w+s.x1-ui(t);ki=b+s.y1-fi(t);v.unbind("mousemove",yt);n(document).mousemove(lr).one("mouseup",function(){o.onSelectEnd(e,ot());n(document).unbind("mousemove",lr);v.mousemove(yt)})}else g.mousedown(t);return!1}function ei(n){ft&&(n?(l=i(w,r(w+nt,h+u(a-c)*ft*(l>h||-1))),a=t(i(b,r(b+d,c+u(l-h)/ft*(a>c||-1)))),l=t(l)):(a=i(b,r(b+d,c+u(l-h)/ft*(a>c||-1))),l=t(i(w,r(w+nt,h+u(a-c)*ft*(l>h||-1)))),a=t(a)))}function yi(){h=r(h,w+nt);c=r(c,b+d);u(l-h)<ii&&(l=h-ii*(l<h||-1),l<w?h=w+ii:l>w+nt&&(h=w+nt-ii));u(a-c)<ri&&(a=c-ri*(a<c||-1),a<b?c=b+ri:a>b+d&&(c=b+d-ri));l=i(w,r(l,w+nt));a=i(b,r(a,b+d));ei(u(l-h)<u(a-c)*ft);u(l-h)>di&&(l=h-di*(l<h||-1),ei());u(a-c)>gi&&(a=c-gi*(a<c||-1),ei(!0));s={x1:st(r(h,l)),x2:st(i(h,l)),y1:ht(r(c,a)),y2:ht(i(c,a)),width:u(l-h),height:u(a-c)};vi();o.onSelectChange(e,ot())}function fr(n){return l=/w|e|^$/.test(tt)||ft?ui(n):kt(s.x2),a=/n|s|^$/.test(tt)||ft?fi(n):dt(s.y2),yi(),!1}function oi(t,i){l=(h=t)+s.width;a=(c=i)+s.height;n.extend(s,{x1:st(h),y1:ht(c),x2:st(l),y2:ht(a)});vi();o.onSelectChange(e,ot())}function lr(n){return h=i(w,r(bi+ui(n),w+nt-s.width)),c=i(b,r(ki+fi(n),b+d-s.height)),oi(h,c),n.preventDefault(),!1}function er(){n(document).unbind("mousemove",er);vt();l=h;a=c;yi();tt="";y.is(":visible")||v.add(y).hide().fadeIn(o.fadeSpeed||0);li=!0;n(document).unbind("mouseup",pi).mousemove(fr).one("mouseup",hr);v.unbind("mousemove",yt);o.onSelectStart(e,ot())}function pi(){if(n(document).unbind("mousemove",er).unbind("mouseup",pi),ur(v.add(y)),ir(st(h),ht(c),st(h),ht(c)),!(this instanceof n.imgAreaSelect)){o.onSelectChange(e,ot());o.onSelectEnd(e,ot())}}function ar(t){return t.which!=1||y.is(":animated")?!1:(vt(),bi=h=ui(t),ki=c=fi(t),n(document).mousemove(er).mouseup(pi),!1)}function vr(){rr(!1)}function yr(){si=!0;or(o=n.extend({classPrefix:"imgareaselect",movable:!0,parent:"body",resizable:!0,resizeMargin:10,onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},o));v.add(y).css({visibility:""});o.show&&(li=!0,vt(),vi(),v.add(y).hide().fadeIn(o.fadeSpeed||0));setTimeout(function(){o.onInit(e,ot())},0)}function wi(n,t){for(var i in t)o[i]!==undefined&&n.css(t[i],o[i])}function or(t){if(t.parent&&(wt=n(t.parent)).append(v.add(y)),n.extend(o,t),vt(),t.handles!=null){for(p.remove(),p=n([]),bt=t.handles?t.handles=="corners"?4:8:0;bt--;)p=p.add(f());p.addClass(o.classPrefix+"-handle").css({position:"absolute",fontSize:0,zIndex:ut+1||1});!parseInt(p.css("width"))>=0&&p.width(5).height(5);(it=o.borderWidth)&&p.css({borderWidth:it,borderStyle:"solid"});wi(p,{borderColor1:"border-color",borderColor2:"background-color",borderOpacity:"opacity"})}for(ni=o.imageWidth/nt||1,ti=o.imageHeight/d||1,t.x1!=null&&(ir(t.x1,t.y1,t.x2,t.y2),t.show=!t.hide),t.keys&&(o.keys=n.extend({shift:1,ctrl:"resize"},t.keys)),y.addClass(o.classPrefix+"-outer"),pt.addClass(o.classPrefix+"-selection"),bt=0;bt++<4;)n(k[bt-1]).addClass(o.classPrefix+"-border"+bt);wi(pt,{selectionColor:"background-color",selectionOpacity:"opacity"});wi(k,{borderOpacity:"opacity",borderWidth:"border-width"});wi(y,{outerColor:"background-color",outerOpacity:"opacity"});(it=o.borderColor1)&&n(k[0]).css({borderStyle:"solid",borderColor:it});(it=o.borderColor2)&&n(k[1]).css({borderStyle:"dashed",borderColor:it});v.append(pt.add(k).add(hi)).append(p);gt&&((it=(y.css("filter")||"").match(/opacity=(\d+)/))&&y.css("opacity",it[1]/100),(it=(k.css("filter")||"").match(/opacity=(\d+)/))&&k.css("opacity",it[1]/100));t.hide?ur(v.add(y)):t.show&&si&&(li=!0,v.add(y).fadeIn(o.fadeSpeed||0),rr());ft=(sr=(o.aspectRatio||"").split(/:/))[0]/sr[1];g.add(y).unbind("mousedown",ar);o.disable||o.enable===!1?(v.unbind("mousemove",yt).unbind("mousedown",cr),n(window).unbind("resize",vr)):((o.enable||o.disable===!1)&&((o.resizable||o.movable)&&v.mousemove(yt).mousedown(cr),n(window).resize(vr)),o.persistent||g.add(y).mousedown(ar));o.enable=o.disable=undefined}var g=n(e),si,v=f(),pt=f(),k=f().add(f()).add(f()).add(f()),y=f().add(f()).add(f()).add(f()),p=n([]),hi,w,b,rt={left:0,top:0},nt,d,wt,ct={left:0,top:0},ut=0,ci="absolute",bi,ki,ni,ti,tt,ii,ri,di,gi,ft,li,h,c,l,a,s={x1:0,y1:0,x2:0,y2:0,width:0,height:0},nr=document.documentElement,ai=navigator.userAgent,lt,sr,bt,it,et,at,tr,pr=function(n){var t=o.keys,u,f,e=n.keyCode;if(u=!isNaN(t.alt)&&(n.altKey||n.originalEvent.altKey)?t.alt:!isNaN(t.ctrl)&&n.ctrlKey?t.ctrl:!isNaN(t.shift)&&n.shiftKey?t.shift:isNaN(t.arrows)?10:t.arrows,t.arrows=="resize"||t.shift=="resize"&&n.shiftKey||t.ctrl=="resize"&&n.ctrlKey||t.alt=="resize"&&(n.altKey||n.originalEvent.altKey)){switch(e){case 37:u=-u;case 39:f=i(h,l);h=r(h,l);l=i(f+u,h);ei();break;case 38:u=-u;case 40:f=i(c,a);c=r(c,a);a=i(f+u,c);ei(!0);break;default:return}yi()}else{h=r(h,l);c=r(c,a);switch(e){case 37:oi(i(h-u,w),c);break;case 38:oi(h,i(c-u,b));break;case 39:oi(h+r(u,nt-st(l)),c);break;case 40:oi(h,c+r(u,d-ht(a)));break;default:return}}return!1};this.remove=function(){or({disable:!0});v.add(y).remove()};this.getOptions=function(){return o};this.setOptions=or;this.getSelection=ot;this.setSelection=ir;this.cancelSelection=pi;this.update=rr;var gt=(/msie ([\w.]+)/i.exec(ai)||[])[1],wr=/opera/i.test(ai),br=/webkit/i.test(ai)&&!/chrome/i.test(ai);for(lt=g;lt.length;)ut=i(ut,isNaN(lt.css("z-index"))?ut:lt.css("z-index")),lt.css("position")=="fixed"&&(ci="fixed"),lt=lt.parent(":not(body)");ut=o.zIndex||ut;gt&&g.attr("unselectable","on");n.imgAreaSelect.keyPress=gt||br?"keydown":"keypress";wr&&(hi=f().css({width:"100%",height:"100%",position:"absolute",zIndex:ut+2||2}));v.add(y).css({visibility:"hidden",position:ci,overflow:"hidden",zIndex:ut||"0"});v.css({zIndex:ut+2||2});pt.add(k).css({position:"absolute",fontSize:0});e.complete||e.readyState=="complete"||!g.is("img")?yr():g.one("load",yr);!si&&gt&&gt>=7&&(e.src=e.src)};n.fn.imgAreaSelect=function(t){return(t=t||{},this.each(function(){n(this).data("imgAreaSelect")?t.remove?(n(this).data("imgAreaSelect").remove(),n(this).removeData("imgAreaSelect")):n(this).data("imgAreaSelect").setOptions(t):t.remove||(t.enable===undefined&&t.disable===undefined&&(t.enable=!0),n(this).data("imgAreaSelect",new n.imgAreaSelect(this,t)))}),t.instance)?n(this).data("imgAreaSelect"):this}}(jQuery),function(n){typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports=="object"?module.exports=n(require("jquery")):n(jQuery)}(function(n){function i(n){return t.raw?n:encodeURIComponent(n)}function f(n){return t.raw?n:decodeURIComponent(n)}function e(n){return i(t.json?JSON.stringify(n):String(n))}function o(n){n.indexOf('"')===0&&(n=n.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return n=decodeURIComponent(n.replace(u," ")),t.json?JSON.parse(n):n}catch(i){}}function r(i,r){var u=t.raw?i:o(i);return n.isFunction(r)?r(u):u}var u=/\+/g,t=n.cookie=function(u,o,s){var v,c;if(arguments.length>1&&!n.isFunction(o))return s=n.extend({},t.defaults,s),typeof s.expires=="number"&&(v=s.expires,c=s.expires=new Date,c.setMilliseconds(c.getMilliseconds()+v*864e5)),document.cookie=[i(u),"=",e(o),s.expires?"; expires="+s.expires.toUTCString():"",s.path?"; path="+s.path:"",s.domain?"; domain="+s.domain:"",s.secure?"; secure":""].join("");for(var l=u?undefined:{},y=document.cookie?document.cookie.split("; "):[],a=0,b=y.length;a<b;a++){var p=y[a].split("="),w=f(p.shift()),h=p.join("=");if(u===w){l=r(h,o);break}u||(h=r(h))===undefined||(l[w]=h)}return l};t.defaults={};n.removeCookie=function(t,i){return n.cookie(t,"",n.extend({},i,{expires:-1})),!n.cookie(t)}});$(function(){$(document).on("click","[data-blind-toggler]",function(n){n.preventDefault();var t=$("[data-blind-panel]"),r=$(this),i=t.is(":visible");i?t.slideUp():t.slideDown();r.toggleClass("active",!i)}).on("click","[data-font]",function(){$("body").removeClass("font-normal font-lg font-xl").addClass("font-"+$(this).data("font"));_aspxSetCookie("lovisFontSize",$(this).data("font"))}).on("click","[data-scheme]",function(){$("body").removeClass("Lovis Svis").addClass($(this).data("scheme"));_aspxSetCookie("lovisScheme",$(this).data("scheme"))}).on("click","[data-reset-visual]",function(){$("body").removeClass("font-normal font-lg font-xl Lovis Svis");_aspxSetCookie("lovisFontSize","normal");_aspxSetCookie("lovisScheme","Svis")})});$(function(){if(typeof ASPxClientUtils!="undefined"&&ASPxClientUtils.ie)$(document).on("click","a[href^=javascript]",function(e){var $el=$(this),script=$el.attr("href").replace("javascript:","");eval(script);e.stopPropagation();e.preventDefault()})})