function include_file(file, _type, callback) { var _doc = document.getelementsbytagname('head')[0]; var isie = navigator.useragent.touppercase().indexof("msie") == -1 ? false : true; var _fileobj; if (_type == "script") { _fileobj = document.createelement('script'); _fileobj.setattribute('type', 'text/javascript'); _fileobj.setattribute('src', file); _doc.appendchild(_fileobj); if (!isie) { _fileobj.onload = function () { callback() } } else { _fileobj.onreadystatechange = function () { if (_fileobj.readystate == 'loaded' || _fileobj.readystate == 'complete') { callback() } } } } else if (_type == "css") { _fileobj = document.createelement('link'); _fileobj.setattribute('type', 'text/css'); _fileobj.setattribute('rel', 'stylesheet'); _fileobj.setattribute('href', file); _doc.appendchild(_fileobj); if (!isie) { callback() } else { _fileobj.onreadystatechange = function () { if (_fileobj.readystate == 'loaded' || _fileobj.readystate == 'complete') { callback() } } } } } jquery(document).ready(function ($) { include_file("/skins/default/resetcommonindex.css", "css", function () { if (!isloads("/js/jquery-1.3.2.min.js")) { include_file("/js/jquery-1.3.2.min.js", "script", action) } else { action() } action(); }) }); function action() { $(document.body).append("
"); $('#roll_top').click(function () { $('html,body').animate({ scrolltop: '0px' }, 800) }); $('#ct').click(function () { $('html,body').animate({ scrolltop: $('.ct').offset().top }, 800) }); $(window).scroll(function (event) { if ($.browser.ie6) { $('#roll').css('top', $(this).scrolltop() + $(this).height() - 170) } if ($(this).scrolltop() > 260) { $('#roll').fadein() } else { $('#roll').fadeout() } }) } function isloads(src) { var isloaded = false; var scripts = document.getelementsbytagname("script"); for (i = 0; i < scripts.length; i++) { if (scripts[i].src && scripts[i].src.indexof(src) != -1) { if (scripts[i].readystate == "loaded" || scripts[i].readystate == "complete") { isloaded = true; break } } } return isloaded }