function detectamobo() {
	if (document.cookie.indexOf("amobo_redirect=false") < 0) {
		if (!navigator.userAgent.match(/Opera/i) && !navigator.userAgent.match(/Dolphin/i)) {
			if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
				setamoboCookies();
				if (confirm("amobo jetzt als App für iPhone und iPod laden! Klicke OK zum kostenlosen Download."))
					window.location = "http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=443412309&mt=8";
			} else if(navigator.userAgent.match(/iPad/i)) {
				setamoboCookies();
				if (confirm("amobo jetzt als App für dein iPad laden! Klicke OK zum kostenlosen Download."))
					window.location = "http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=444092817&mt=8";
			} else if(navigator.userAgent.match(/android/i)) {
				setamoboCookies();
				if (confirm("amobo jetzt als App für Android laden! Klicke OK zum kostenlosen Download."))
					window.location = "market://details?id=air.de.chhubmann.AmoboApp";
			} 
			else if((navigator.userAgent.match(/Windows Phone/i)) || (navigator.userAgent.match(/ZuneWP7/i))) {
				setamoboCookies();
				if (confirm("amobo jetzt als App für dein WindowsPhone laden! Klicke OK zum kostenlosen Download."))      
					window.location = "zune://navigate/?phoneAppID=e30d6f93-a927-e011-854c-00237de2db9e";
			} 
		

//			else if(navigator.userAgent.match(/webOS/i)) {
//				setamoboCookies();
//				if (confirm("This forum has an app for webOS phone! Click OK to learn more about Tapatalk."))      
//					window.location = "http://developer.palm.com/appredirect/?packageid=com.newnessdevelopments.forums";
//			}
			
		}
	}
}

function setamoboCookies() {
	var date = new Date();
	var days = 90;
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+ date.toGMTString();
	document.cookie = "amobo_redirect=false" + expires; 
}

detectamobo();
