var base = "http://"+location.hostname;
//var prefix="/article/public_html/";
var prefix="/";
base = base+prefix;

var link = [];

link[0]='theme/officesoya/stylesheet/default.css';
link[1]='theme/officesoya/stylesheet/print.css';
link[1]='theme/officesoya/stylesheet/sbmlink.css';
link[2]='theme/officesoya/stylesheet/jquery-ui-1.7.1.custom.css';
link[3]='javascript/jquery/thickbox/thickbox.css';

var head= document.getElementsByTagName('head')[0];

for(i=0; i<link.length ;i++){
var css = document.createElement('link');
 	css.type = 'text/css';
	css.href = base+link[i] ;
	css.id =link[i] ;
	css.rel ='stylesheet';
	head.appendChild(css);
}
var ary = [];
//ary[0]='javascript/jquery/jquery-1.3.2.min.js';
ary[1]='javascript/jquery/thickbox/thickbox.js';
ary[2]='javascript/jquery/tab.js';
ary[3]='javascript/jquery/screenshot.js';
ary[4]='javascript/jquery/jquery.cycle.all.min.js';
ary[0]='javascript/jquery/ui.datepicker.js';
//alert(ary.length);
var load = function(src, check, next) {
  check = new Function('return !!(' + check + ')');
  if (!check()) {
    var script = document.createElement('script')
    script.src = src;
    head.appendChild(script);
    setTimeout(function() {
      if (!check()) setTimeout(arguments.callee, 100);
      else next();
    }, 100);
  }
  else next();
};

load('http://code.jquery.com/jquery-latest.js', 'window.jQuery', function() {


for(i=0; i<ary.length ;i++){

var js = document.createElement('script');
 	 js.type = 'text/javascript';
 	 js.charset = "utf-8";
 	 js.defer = 'defer';
	js.src = base+ary[i] ;
	head.appendChild(js);
}
})
