dedecms默认模板里的index.htm里的以下javascript代码是起什么作用的?谢谢!

 <script type="text/javascript">
    if(window.location.toString().indexOf('pref=padindex') != -1){
    }else{
        if(/AppleWebKit.*Mobile/i.test(navigator.userAgent)
                || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){
            if(window.location.href.indexOf("?mobile")<0){
                try{
                    if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
                        window.location.href="{dede:global.cfg_mobileurl/}/index.php";
                    }else if(/iPad/i.test(navigator.userAgent)){}
                    else{}
                }catch(e){}
            }
        }
    }
</script>

移动端浏览器访问时进行跳转用的