var deviceIphone = "iphone";
var deviceIpod = "ipod";
var deviceBB = "blackberry";

//Initialize our user agent string to lower case.
var uagent = navigator.userAgent.toLowerCase();

//**************************
// 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 device is an iPhone or iPod Touch.
function DetectIphoneOrIpod()
{
    if (DetectIphone())
       return true;
    else if (DetectIpod())
       return true;
    else
       return false;
}
//**************************
// Detects if the current browser is a BlackBerry of some sort.
function DetectBlackBerry()
{

if (uagent.search(deviceBB) > -1)
      return true;
   else
      return false;
}

if(DetectBlackBerry() || DetectIphoneOrIpod()) {
	
	document.write('<link rel="stylesheet" href="mobile.css" type="text/css" />');
	document.write('<meta name="viewport" content="width = 320" />');
	document.write('<meta name="viewport" content="initial-scale=1, user-scalable=no" />');
}
else {
	swfobject.embedSWF("main.swf", "flashcontent", "100%", "100%", "10.0.0", "expressInstall.swf", flashvars, params, attributes);
	document.write('<link rel="stylesheet" href="normal.css" type="text/css" />');
	swffit.fit("flashcontent",1000,550);
}

