// JavaScript Document
function checkMode(switchWapStatus,runMode,wapPrefix,aliax){
	var htmlFileUrl = window.location.pathname.toLowerCase();
	var isWap = checkWap();
	var queryString = window.location.search;
	if(isWap && switchWapStatus){
		if( runMode == 1 ) {
			if(htmlFileUrl.indexOf("wap/")<0){
				window.location.href = wapPrefix;
			}
		} else {
			if(htmlFileUrl.indexOf("wap.asp")<0){
				window.location.href = aliax + 'wap.asp' + ( queryString != '' ? queryString : '' );
			}
		}
	}
	if(!isWap){ //只要时电脑访问手机路径，一律转PC地址
		if(htmlFileUrl.indexOf("/wap")>-1){
			//window.location.href= htmlFileUrl.replace("/wap","");
		}
	}
}
function checkWap(){
	var userAgentInfo = navigator.userAgent;  
	var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");  
	var flag = false;  
	for (var i = 0; i < Agents.length; i++) {  
	   if (userAgentInfo.indexOf(Agents[i]) > 0) { 
			flag = true; 
			break; 
	   }  
	}
	return flag;
}