var mobile_clients =[
"midp",
"240x320",
"blackberry",
"netfront",
"nokia",
"panasonic",
"portalmmm",
"sharp",
"sie-",
"sonyericsson",
"symbian",
"windows ce",
"benq",
"mda",
"mot-",
"opera mini",
"philips",
"pocket pc",
"sagem",
"samsung",
"sda",
"sgh-",
"vodafone",
"xda",
"iphone",
"ipod",
"htc_wildfire"
];

function isMobileDevice() {
  try {
    if( document.location.href.indexOf('usemobile') != -1 ) {
      document.cookie = 'dont_use_mobile';
    }
    if (document.cookie && document.cookie.indexOf('dont_use_mobile') != -1) {
		  return false;
		}
    userAgent = navigator.userAgent.toLowerCase( );
    for ( var i=0; i < mobile_clients.length; i++ ) {
      if (userAgent.indexOf( mobile_clients[i] ) != -1) {
        return true;
      }
    }
  }
  catch (e) { }
  return false;
}

function redirectIfIsMobileDevice() {
  try {
    if (isMobileDevice()) {
      /* So the next step is: check if the user is a mobile device but likes to see the normal web page */
      document.location.href="http://m.deag.de";
    }
  }
  catch (e) {
    alert( e );
  }
}


