if ((navigator.userAgent.indexOf('iPhone') != -1)||(navigator.userAgent.indexOf('Android') != -1)){

	dtype = GetCookie("DType");
	if(dtype == ""){
	  SetCookie("DType","spn");
	  dtype="spn";
	}

     if(dtype != "pc"){
	if (location.href.indexOf("smart=1") == -1) {
		absoluteURL = location.pathname;
		if(absoluteURL == "/" || absoluteURL == "/index.html"){
			location.href = "/s/";
		}
		else if(absoluteURL == "/inquiry/" || absoluteURL == "/inquiry/index.html"){
			location.href = "/s/inquiry/";
		}
		else if(absoluteURL == "/legal/" || absoluteURL == "/legal/index.html"){
			location.href = "/s/legal/";
		}
		else if(absoluteURL == "/prdct/" || absoluteURL == "/prdct/index.html"){
			location.href = "/s/prdct/";
		}
		else if(absoluteURL == "/privacy/" || absoluteURL == "/privacy/index.html"){
			location.href = "/s/privacy/";
		}
		else{
			location.href = "/s/";
		}
	} else {
		SetCookie("DType","pc");
		document.write("<center><a href=\"/s/\" onClick=\"SetSpn(); return true;\"><img src=\"/images/go_spn950.jpg\" width=\"950\" height=\"183\" alt=\"To view the smartphone-friendly version of this site, please tap here.\"></a></center>");
	}
     }
     else{
          document.write("<center><a href=\"/s/\" onClick=\"SetSpn(); return true;\"><img src=\"/images/go_spn950.jpg\" width=\"950\" height=\"183\" alt=\"To view the smartphone-friendly version of this site, please tap here.\"></a></center>");
     }

}

function GetCookie(key){
	var tmp = document.cookie + ";";
	var index1 = tmp.indexOf(key, 0);
	if(index1 != -1){
		tmp = tmp.substring(index1,tmp.length);
		var index2 = tmp.indexOf("=",0) + 1;
		var index3 = tmp.indexOf(";",index2);
		return(unescape(tmp.substring(index2,index3)));
	}
	return("");
}

function SetCookie(key, val){
	document.cookie = key + "=" + escape(val) + ";";
}

function SetSpn(){
	SetCookie("DType","spn");
}
