
var mobileDetect = 0;



function detectAllMobile() {
	//Initialize our user agent string to lower case.
	var uagent = navigator.userAgent.toLowerCase();
	
	//detect iphone/ipad--------------------------
	var deviceIphone = "iphone";
	var deviceIpod = "ipod";
	
	//**************************
	// Detects if the current device is an iPhone.
	function DetectIphone()
	{
	   if (uagent.search(deviceIphone) > -1)
	      mobileDetect = 1;
	   else
	      return false;
	}
	
	//**************************
	// Detects if the current device is an iPod Touch.
	function DetectIpod()
	{
	   if (uagent.search(deviceIpod) > -1)
	      mobileDetect = 1;
	   else
	      return false;
	}
	
	//**************************
	// Detects if the current device is an iPhone or iPod Touch.
	
	    if (DetectIphone())
	    	mobileDetect = 1;
	    else if (DetectIpod())
	    	mobileDetect = 1;
	
	
	//detect symbian------------------------------
	var deviceS60 = "series60";
	var deviceSymbian = "symbian";
	var engineWebKit = "webkit";
	
	//**************************
	// Detects if the current browser is the S60 Open Source Browser.
	// Screen out older devices and the old WML browser.
	
	   if (uagent.search(engineWebKit) > -1)
	   {
	     if ((uagent.search(deviceS60) > -1 || uagent.search(deviceSymbian) > -1))
	        mobileDetect = 1;
	   }
	  	
	
	//detect android ----------------------------
	var deviceAndroid = "android";

		//**************************
		// Detects if the current device is an Android OS-based device.
		function DetectAndroid()
		{
		   if (uagent.search(deviceAndroid) > -1)
		      mobileDetect = 1;
		}
		
		
		//**************************
		// Detects if the current device is an Android OS-based device and
		//   the browser is based on WebKit.
		
		   if (DetectAndroid())
		   {
		     if (uagent.search(engineWebKit) > -1)
		        mobileDetect = 1;
		   }
			   
	
	
	//windows phone------------------------------
	var deviceWinMob = "windows ce";
	
	//**************************
	// Detects if the current browser is a Windows Mobile device.
	
   if (uagent.search(deviceWinMob) > -1)
      mobileDetect = 1;
  
	
	//Blackberry----------------------------------
	var deviceBB = "blackberry";
	
	//**************************
	// Detects if the current browser is a BlackBerry of some sort.
	
	   if (uagent.search(deviceBB) > -1)
	      mobileDetect = 1;
	
	
	
	//Palm----------------------------------------
	var devicePalm = "palm";
	
	//**************************
	// Detects if the current browser is on a PalmOS device.


   if (uagent.search(devicePalm) > -1)
      mobileDetect = 1;
   
	
	
	if(mobileDetect==1){
		return true
	} else {
		return false
	}
	
}

