/* DMH20090714A: The following code checks to see if the user is coming from the mobile home page */
var HomeURL  = window.location.toString();
var mobileHomeCheck = HomeURL.indexOf('fromMobileHome=true');
if (mobileHomeCheck !== -1){
	fromMobileHome = 1;
}else{
	fromMobileHome = 0;
}
/* /DMH20090714A*/

/* DMH20090716A: if the user is on an iPhone and has not come to this page from the mobile home page, send user there */
//Get the iPhone & iTouch users first:
if(((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))) && (fromMobileHome==0))
{
var AccelerometerEnabledCheck = HomeURL.indexOf('MMfrom=4sq');
if (AccelerometerEnabledCheck !== -1){
location.replace("http://mobilemeteor.com/window.php?Business_ID=" + businessID + "&AccelerometerEnabled=false&Redirect=" + escape(window.location));
}else{
location.replace("http://mobilemeteor.com/window.php?Business_ID=" + businessID + "&Redirect=" + escape(window.location));
}
}

//now the others:
var uagent = navigator.userAgent.toLowerCase();
if (((uagent.search("windows ce") > -1) || (uagent.search("android") > -1) || (uagent.search("blackberry") > -1) || (uagent.search("palm") > -1) || (uagent.search("webos") > -1)) && (fromMobileHome==0))
{location.replace("http://mobilemeteor.com/window.php?Business_ID=" + businessID + "&Redirect=" + escape(window.location));}

if ((uagent.search("webkit") > -1) && (fromMobileHome==0)){if ((uagent.search("series60") > -1 || uagent.search("symbian") > -1))
{location.replace("http://mobilemeteor.com/window.php?Business_ID=" + businessID + "&Redirect=" + escape(window.location));}}

if ((uagent.search("maemo") > -1) && (fromMobileHome==0))
{location.replace("http://mobilemeteor.com/window.php?Business_ID=" + businessID + "&Redirect=" + escape(window.location));}

/* /DMH20090716A */

