jQuery.cookie=function(B,I,L){if(typeof I!="undefined"){L=L||{};
if(I===null){I="";
L.expires=-1
}var E="";
if(L.expires&&(typeof L.expires=="number"||L.expires.toUTCString)){var F;
if(typeof L.expires=="number"){F=new Date();
F.setTime(F.getTime()+(L.expires*24*60*60*1000))
}else{F=L.expires
}E="; expires="+F.toUTCString()
}var K=L.path?"; path="+L.path:"";
var G=L.domain?"; domain="+L.domain:"";
var A=L.secure?"; secure":"";
document.cookie=[B,"=",encodeURIComponent(I),E,K,G,A].join("")
}else{var D=null;
if(document.cookie&&document.cookie!=""){var J=document.cookie.split(";");
for(var H=0;
H<J.length;
H++){var C=jQuery.trim(J[H]);
if(C.substring(0,B.length+1)==(B+"=")){D=decodeURIComponent(C.substring(B.length+1));
break
}}}return D
}};
AJS.$(function(C){if(typeof (K15T)!="undefined"){return 
}function B(D){if(typeof (k15t_scrolloffice_messages)!="undefined"&&(typeof (k15t_scrolloffice_messages[D]))!="undefined"){return k15t_scrolloffice_messages[D]
}else{return D
}}function A(D){if((typeof (D)=="string")&&(D.indexOf('action="/confluence/dologin.action"')!=-1)){window.location.href=CONTEXT_PATH+"/login.action?os_destination="+encodeURIComponent(window.location.href)
}}K15T=function(){};
K15T.Popup=function(D,F){var E=this;
if(D){this.height=(D.height||200);
this.width=(D.width||200);
this.url=(D.url||200);
this.title=(D.title||"Application Title");
this.applicationName=(D.applicationName||"Application Name");
this.applicationLink=(D.applicationLink||"http://www.k15t.com");
this.applicationVersion=(D.applicationVersion||"0.0");
this.afterInit=(D.afterInit||function(){})
}if(AJS.Dialog){this.container=new AJS.Dialog(this.width,this.height);
this.element=this.container.popup.element
}else{alert("ERROR: AJS.Dialog not defined.")
}this.element.html("<div class='com-k15t-popup'><div class='title' style='background-image: url("+CONTEXT_PATH+"/download/resources/com.k15t.scroll.scroll-office:ui-required/images/title_bg.png)'>  <h2>"+B("com.k15t.scroll.office.frame.title")+"<span style='float: right;'><a href='' class='com-k15t-scroll-close' style='text-decoration: none; color: #666666;' title='"+B("com.k15t.scroll.office.frame.title.action.close")+"'><img src='"+CONTEXT_PATH+"/download/resources/com.k15t.scroll.scroll-office:ui-required/images/title_btn_close.png' title='"+B("com.k15t.scroll.office.frame.title.action.close")+"' /></a></span>  </h2></div><div class='content settings' style='height: "+(E.height-120)+"px;'>Please wait...</div><div class='content loading' style='text-align: center; height: "+(E.height-120)+"px; display: none;'>  <div class='animation'><img src='"+CONTEXT_PATH+"/download/resources/com.k15t.scroll.scroll-office:ui-required/images/ani.gif' title='Edit Export Settings'/><br/><br/>Please wait a second or two.</div></div><div class='poweredby' style='background-image:url("+CONTEXT_PATH+"/download/resources/com.k15t.scroll.scroll-office:ui-required/images/footer_bg.png)'>  <span class='logo' style='background-image: url("+CONTEXT_PATH+"/download/resources/com.k15t.scroll.scroll-office:ui-required/images/footer_scrolllogo.png)'></span>  <span class='footertext'>"+B("com.k15t.scroll.office.frame.footer.text")+"  </span></div></div>");
this.element.find(".com-k15t-scroll-close").unbind("click").bind("click",function(G){G.preventDefault();
E.close()
});
C.ajax({type:"GET",url:E.url,beforeSend:function(G){E.show()
},success:function(G,I,H){A(G);
E.show(G);
E.afterInit.call(this,G,I,H)
},error:function(H,I,G){E.show(H.responseText)
},dataType:"html"})
};
K15T.Popup.prototype.show=function(D){var E=this;
if(D){this.element.find(".settings").show();
this.element.find(".settings").html(D);
this.element.find(".loading").hide();
this.element.find(".com-k15t-scroll-close").unbind("click").bind("click",function(F){F.preventDefault();
E.close()
});
C("a.com-k15t-scroll-ajaxified").unbind("click").bind("click",function(F){F.preventDefault();
F.stopPropagation();
C.ajax({type:"GET",url:C(this).attr("href"),beforeSend:function(G){E.show()
},error:function(H,I,G){E.show(H.responseText)
},success:function(G,I,H){A(G);
E.show(G)
},dataType:"html"})
});
C("form.com-k15t-scroll-ajaxified").unbind("submit").bind("submit",function(F){F.preventDefault();
F.stopPropagation();
C.ajax({type:"GET",url:C(this).attr("action"),data:C(this).serialize(),beforeSend:function(G){E.show()
},error:function(H,I,G){E.show(H.responseText)
},success:function(G,I,H){A(G);
E.show(G)
},dataType:"html"})
});
this.container.show()
}else{this.element.find(".settings").hide();
this.element.find(".loading").show();
this.container.show()
}};
K15T.Popup.prototype.hide=function(D){this.container.hide()
};
K15T.Popup.prototype.close=function(D){this.element.find(".settings").html("");
this.container.hide()
}
});
SCROLL_VERSION="${project.version}";
AJS.$(function(A){A(document).ready(function(){CONTEXT_PATH=(A("#confluence-context-path").attr("content")||"");
A.getScript(CONTEXT_PATH+"/plugins/com.k15t.scroll.office/i18n.action");
var B=A("#com-k15t-confluence-scroll-office-word-link");
if(B){B.find("span").append("<img id='com-k15t-confluence-scroll-office-word-quick-link' src='"+CONTEXT_PATH+"/download/resources/com.k15t.scroll.scroll-office:ui-required/images/page_go.png' title='One-click Export' style='float:right; position:relative; z-index:1000; padding: 0 2px' />");
A("#com-k15t-confluence-scroll-office-word-quick-link").click(function(C){C.preventDefault();
C.stopPropagation();
var D=new K15T.Popup({width:620,height:520,url:B.attr("href").replace(/settings.action/,"export.action"),title:"Export to Word",applicationName:"Scroll Office",applicationLink:"http://www.k15t.com/display/web/Scroll+Office",applicationVersion:SCROLL_VERSION,afterInit:function(E,G,F){}})
});
B.click(function(D){D.preventDefault();
D.stopPropagation();
var C=new K15T.Popup({width:620,height:520,url:B.attr("href"),title:"Export to Word",applicationName:"Scroll&trade; Office",applicationLink:"http://www.k15t.com/display/web/Scroll+Office",applicationVersion:SCROLL_VERSION,afterInit:function(E){A("#includeLabelList").unbind("click").bind("click",function(){A("#includePageWithLabels").attr("checked","checked")
})
}})
})
}})
});

