//判断是手机跳转到相应页面
var webroot 	 = window.location.protocol+"//" + window.location.host; //http:
var hostname 	 = window.location.hostname; //返回www.xxx.com
var weburlname   = window.location.pathname; //返回/about/
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|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
			    var gourl = "";
				if(webhtmlpath==""){ 
				  //未设置PC纯静态路径			   
				  if(webmurl==""){ 
					if(weburlname=="/index.html" || weburlname=="/"){ 
						gourl =  webroot +  '/' + webmhtmlpath + '/index.html'; //未设置手机域名
					}else{
						gourl =  window.location.protocol + "//" +  hostname + '/' + webmhtmlpath + weburlname;
					}
				  }else{
					if(weburlname=="/index.html" || weburlname=="/"){ 
						gourl = window.location.protocol + "//" +  webmurl + weburlname;
					}else{
						gourl = window.location.protocol + "//" + webmurl + weburlname;  //已设置手机域名
					}
				  }
				}else{  		
				  //设置了PC纯静态路径
				  if(webmurl==""){
					if(weburlname=="/index.html" || weburlname=="/"){   
						gourl =  webroot +  '/' + webmhtmlpath + '/index.html'; //未设置手机域名
					}else{
						gourl = webroot + weburlname.replace(webhtmlpath,webmhtmlpath);
					}
				  }else{
					if(weburlname=="/index.html" || weburlname=="/"){   
						gourl = window.location.protocol + "//" + webmurl + weburlname;  //已设置手机域名首页
					}else{
						gourl = window.location.protocol + "//" + webmurl + weburlname.replace('/'+webhtmlpath,'');
					}
				  }
				}
				window.location.href = gourl;
			}
		}catch(e){}
	}
} 