if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
getCookie = document.cookie;
function getTag(name) { 
index = getCookie.indexOf(name + "=");
if (index == -1) return null;
startVal = getCookie.indexOf("=", index) + 1;
finishVal = getCookie.indexOf(";", startVal);
if (finishVal == -1) finishVal = getCookie.length;
return unescape(getCookie.substring(startVal, finishVal)); }
if (!getTag("firstVisit")) {

if (confirm("BIMMERPOST is now available in the App Store.  Download it now?")) { 
 // do things if OK

location.href="http://itunes.apple.com/us/app/bimmerpost/id399728258?mt=8";
}

document.cookie = "firstVisit=true";
}
}
