var minWidth = 320;
var minHeight = 480;
function mobileRedirect() {
	
	var myWidth = 0, myHeight = 0;
	
	var mobi = ['opera', 'iemobile', 'webos', 'android', 'safari'];
	var midp = ['blackberry', 'symbian'];
	var ua = navigator.userAgent.toLowerCase();
		
	if( typeof( window.innerWidth ) == 'number' ) {
		/*Non-IE*/ myWidth = window.innerWidth; myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ){
		/*IE 6+ in 'standards compliant mode'*/	myWidth = document.documentElement.clientWidth;	myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		/* IE 4 compatible */ myWidth = document.body.clientWidth; myHeight = document.body.clientHeight;
	}
	
	if( (ua.indexOf('iphone') > -1) || (ua.indexOf('ipad') > -1) ) {
		// do nothing
	} else if( 
		(Math.max(myWidth,myHeight) <= Math.max(minWidth,minHeight)) || 
		(Math.min(myWidth,myHeight) <= Math.min(minWidth,minHeight)) ||
		(ua.indexOf('midp') != -1) || (ua.indexOf('mobi') != -1) || 
		((ua.indexOf('ppc') != -1) && (ua.indexOf('mac') == -1)) || 
		(ua.indexOf('webos') != -1) 
	) window.location="http://m.nti.nl";
}

if(location.pathname == "/" || location.pathname == "") mobileRedirect();
