	var deviceIphone = "iphone";
	var deviceIpod = "ipod";
	var deviceS60 = "series60";
	var deviceSymbian = "symbian";
	var engineWebKit = "webkit";
	var deviceAndroid = "android";
	var devicePalm = "palm";
	var deviceWap = "wap";
	var operamini="opera mini";
	var nokia="nokia";
	var blackberry="blackberry";
	var stc=" stc";
	var sam="linux armv7l";
	var series60 = "series60";

	//Initialize our user agent string to lower case.

	var uagent = navigator.userAgent.toLowerCase();
	var platfrm = navigator.platform.toLowerCase();

	function IsMobileDevices()
	{
		if (DetectIphone())
       			return true;
    		else if (DetectIpod())
       			return true;
    		else if(DetectS60OssBrowser())
			return true;
		else if(DetectAndroid())
			return true;       			
		else if(DetectAndroidWebKit())
			return true;
		else if(DetectPalmOS())
			return true;
		else if(DetectWap())
			return true;
		else if(DetectOperaMini())
			return true;
		else if(DetectNokia())
			return true;
		else if(DetectBlackberry())
			return true;
		else if(DetectStc())
			return true;
		else if(DetectSamsung())
			return true;
		else if(Detectseries60())
			return true;
		else
			return false;
		
	}

	// Detects if series60 Device
	function Detectseries60()
	{
	   if (platfrm.search(series60) > -1)
	      return true;
	   else
	      return false;
	}


	// Detects if the current device  is Samsung
	function DetectSamsung()
	{
	   if (uagent.search(sam) > -1)
	      return true;
	   else
	      return false;
	}

	// Detects if the current device 
	function DetectStc()
	{
	   if (uagent.search(stc) > -1)
	      return true;
	   else
	      return false;
	}

	// Detects if the current device is a blackberry 
	function DetectBlackberry()
	{
	   if (platfrm.search(blackberry) > -1)
	      return true;
	   else
	      return false;
	}

	// Detects if the current device is an nokia Mobile
	function DetectNokia()
	{
	   if (uagent.search(nokia) > -1)
	      return true;
	   else
	      return false;
	}



	// Detects if the current device is an Mobile with opera.
	function DetectOperaMini()
	{
	   if (uagent.search(operamini) > -1)
	      return true;
	   else
	      return false;
	}

	// Detects if the current device is an iPhone.
	function DetectWap()
	{
	   if (uagent.search(deviceWap) > -1)
	      return true;
	   else
	      return false;
	}

	
	// Detects if the current device is an iPhone.
	function DetectIphone()
	{
	   if (uagent.search(deviceIphone) > -1)
	      return true;
	   else
	      return false;
	}


	// Detects if the current device is an iPod Touch.
	//**************************
	
	function DetectIpod()
	{
	   if (uagent.search(deviceIpod) > -1)
	      return true;
	   else
	      return false;
	}


	//**************************
	// Detects if the current browser is the S60 Open Source Browser.
	// Screen out older devices and the old WML browser.


	function DetectS60OssBrowser()
	{
	   if (uagent.search(engineWebKit) > -1)
	   {
	     if ((uagent.search(deviceS60) > -1 || uagent.search(deviceSymbian) > -1))
        	return true;
	     else
        	return false;
   	   }
	  else
 	     return false;
	}


	//**************************
	// Detects if the current device is an Android OS-based device.
	function DetectAndroid()
	{
	   if (uagent.search(deviceAndroid) > -1)
	      return true;
	   else
	      return false;
	}


	//**************************
	// Detects if the current device is an Android OS-based device and
	//   the browser is based on WebKit.

	function DetectAndroidWebKit()
	{
	   if (DetectAndroid())
	   {
	     if (DetectWebkit())
	        return true;
	     else
	        return false;
	   }
	   else
	      return false;
	}



	function DetectPalmOS()
	{
	   if (uagent.search(devicePalm) > -1)
	      return true;
	   else
	      return false;
	}


