/* Per-book JavaScript. 
  * Maintained by [[User:Darklama]]
  * Use book-specific stylesheet and JavaScript.
  * You can ask an administrator to add or update a global book specific Stylesheet or JavaScript.
  */

 if (wgIsArticle && wgNamespaceNumber != 8) {
   /* global */
   if (wgNamespaceNumber != 2) {
     importStylesheet("MediaWiki:Perbook/" + wgBookName + ".css");
     importScript("MediaWiki:Perbook/" + wgBookName + ".js");
   }
   /* user specific */
   if ( wgUserName ) {
     var bookname = wgBookName;
     if (wgPageName.indexOf("User:" + wgUserName + "/") == 0) {
       bookname = wgPageName.split("/")[1];
     }
     if ( bookname != "per_book" ) {
       var perbook = "User:" + wgUserName + "/per_book/" + bookname;
       importStylesheet(perbook + ".css");
       importScript(perbook + ".js");
     }
   }
 }