//document.write("all");

function SPONgetCookie (name)
{
function SPONgetCookieVal (offset)
{
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return SPONgetCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}

var spMobileClients=[
"iphone"
];

function spIsMobileClient(userAgent) {
try {
userAgent=userAgent.toLowerCase();
for (var i=0; i < spMobileClients.length; i++)
if (userAgent.indexOf(spMobileClients[i]) != -1)
return true;
}
catch (e) { // pssst.
}
//document.write( userAgent );
return false;
}
function spIsThisBrowserMobileClient() {
return spIsMobileClient(navigator.userAgent);
}
function spRedirectIfMobileClient() {
try {
if (spIsThisBrowserMobileClient()) {
if (document.location.href.indexOf('nomobile') != -1) {
document.cookie='nomobile';
return;
}
if (document.cookie && document.cookie.indexOf('nomobile') != -1)
return;
document.location.href= document.location.search + "?;mobileclient=1";
}
}
catch (e) {
}
}

var loc = document.URL;
var loc2=loc.match(/mobileclient/);
//alert(loc2);
if (loc2 != 'mobileclient') {
//document.write("LOC: "+ loc);     
spRedirectIfMobileClient();
}
//spRedirectIfMobileClient();


