/* -------------------------------------------------------------------------- */
/** 
 *    @fileoverview
 *       external js/css files loader.
 *
 *    @version 2.0.2010/02/01
 */
/* -------------------------------------------------------------------------- */
if(typeof BAJL=="undefined"){BAJL={}}BAJL.ImportJS=function(B){if(!B||typeof B!="string"){throw new TypeError("BAJL.ImportJS: first argument must be a file name or file path or full URL.")}else{var D=arguments.callee;var A=(B.match("/"))?"":D.dir;var C=A+B;if(!D.isImported(C)){if(D.isCapableOfDOM()){(D.getHeadElement().appendChild(document.createElement("script"))).src=C}else{document.write('<script type="text/javascript" src="'+C+'"><\/script>')}D.imported.push(C)}}};BAJL.ImportJS.dir="./";BAJL.ImportJS.imported=[];BAJL.ImportJS.isImported=function(C){if(!C||typeof C!="string"){throw new TypeError("BAJL.ImportJS.isImported: first argument must be a file name or file path or full URL.")}else{for(var A=0,B=false;(A<this.imported.length&&!B);A++){B=(this.imported[A]==C)}return B}};BAJL.ImportJS.isCapableOfDOM=function(){return false};BAJL.ImportJS.getHeadElement=function(){var A=arguments.callee;return A._cache_||(A._cache_=document.getElementsByTagName("head")[0])};BAJL.ImportJS.from=function(D){if(!D||typeof D!="string"){throw new TypeError("BAJL.ImportJS.from: first argument must be a directory path or a file name.")}else{if(D.match("/")){if(D.substr(D.length-1)!="/"){throw new TypeError("BAJL.ImportJS.from: first argument must end with '/' in the case of specifying directory path.")}else{this.dir=D}}else{var B=this.getHeadElement().getElementsByTagName("script");for(var C=0,E=B.length;C<E;C++){var A=B[C].src.split("/");if(A.pop()==D){this.dir=A.join("/")+"/";break}}}}return this.dir};BAJL.ImportCSS=function(D,C){if(!D||typeof D!="string"){throw new TypeError('BAJL.ImportCSS: argument "path" must be a file name or file path or full URL.')}else{if(C&&typeof C!="string"){throw new TypeError('BAJL.ImportCSS: argument "media" must be a string.')}else{var F=arguments.callee;var A=(D.match("/"))?"":F.dir;var E=A+D;if(!F.isImported(E)){if(F.isCapableOfDOM()){var B=document.createElement("link");B.rel="stylesheet";B.type="text/css";B.href=E;B.media=C||"all";F.getHeadElement().appendChild(B)}else{document.write('<link rel="stylesheet" type="text/css" href="'+E+'" media="'+(C||"all")+'" />')}F.imported.push(E)}return B}}};BAJL.ImportCSS.dir="./";BAJL.ImportCSS.imported=[];BAJL.ImportCSS.isImported=BAJL.ImportJS.isImported;BAJL.ImportCSS.isCapableOfDOM=BAJL.ImportJS.isCapableOfDOM;BAJL.ImportCSS.getHeadElement=BAJL.ImportJS.getHeadElement;BAJL.ImportCSS.from=function(A){if(!A||typeof A!="string"){throw new TypeError("BAJL.ImportCSS.from: first argument must be a directory path or a file name.")}else{if(A.match("/")){if(A.substr(A.length-1)!="/"){throw new Error("BAJL.ImportCSS.from: first argument must end with '/' in the case of specifying directory path.")}else{this.dir=A}}else{throw new Error("BAJL.ImportCSS.from: first argument must end with '/' in the case of specifying directory path.")}}return this.dir};



/* --------------- import external scripts --------------- */

BAJL.ImportJS.from('/ja/shared/js/');   // URL/path to js-directory, or filename of this file.

BAJL.ImportJS('jquery.js');
BAJL.ImportJS('jquery.lightbox.js');
BAJL.ImportJS('jquery.lightbox-pref.js');

BAJL.ImportJS('bajl.js');
BAJL.ImportJS('bajl.settings.js');
BAJL.ImportJS('bajl.rollover.js');
BAJL.ImportJS('bajl.scriptStyle.js');
BAJL.ImportJS('bajl.tabView.js');
BAJL.ImportJS('bajl.stay.js');
BAJL.ImportJS('bajl.wastingSpan.js');



