var agent = navigator.userAgent.toLowerCase();

var typical_smartphone_size = 500;

var possible_smartphone_agents = new Array('iphone','ipod','android','webos','windows ce','opera mobi','opera mini','windows phone','windows mobile','blackberry','palmos','htc-','htc_','wap','symbian','nokia','palmsource')

function isItSmartphone()
{
var could_be_smartphone = 0;

for (i=0; i < possible_smartphone_agents.length; i++)
	{
	if (agent.indexOf(possible_smartphone_agents[i]) != -1)
		could_be_smartphone  = 1;
	}

if (could_be_smartphone && ( (screen.width <= typical_smartphone_size) || (screen.height <= typical_smartphone_size) ))
	return 1;
else
	return 0;
}

//alert(agent);
//alert("screen = " + screen.width + "(w) x " + screen.height + "(h)");
//alert("smartphone? " + isItSmartphone());
