﻿var browser = navigator.userAgent;
include("/include/css/all/all.css");

if (browser.toLowerCase().indexOf('msie 6.0') > 0) {
  include("/include/css/ie6/ie6.css");
}
else if (browser.toLowerCase().indexOf('msie 7.0') > 0) {
  include("/include/css/ie7/ie7.css");
}
else if (browser.toLowerCase().indexOf('msie 8.0') > 0) {
  include("/include/css/ie8/ie8.css");
}
else if (browser.toLowerCase().indexOf('firefox') > 0) {
  include("/include/css/firefox/firefox.css");
}


function include(file) {
  String.prototype.endsWith = function(str){return (this.match(str+"$")==str)};
  if (file.endsWith("js")) {
    var script = document.createElement("script");
    script.setAttribute("type", "text/javascript");
    script.setAttribute("src", file);
    document.getElementsByTagName("head")[0].appendChild(script);
  }
  if (file.endsWith("css")) {
    var css = document.createElement("link");
    css.setAttribute("rel", "stylesheet");
    css.setAttribute("type", "text/css");
    css.setAttribute("media", "screen");
    css.setAttribute("href", file);
    document.getElementsByTagName("head")[0].appendChild(css);
  }
}
