function get_cookie( cookieName )
{
    strValue = false;
    
    if( strCookie = document.cookie )
        {
            if( arrCookie = strCookie.match( new RegExp( cookieName + '=([^;]*)', 'g')))
                {
                    strValue=RegExp.$1;
                }
        }
    return(strValue);
}


if(get_cookie('switchmobile') != 'yes') {
	if (navigator.userAgent.indexOf('iPhone') != -1 || 
	navigator.userAgent.indexOf('Opera Mini') != -1 || 
	navigator.userAgent.indexOf('SymbianOS') != -1 || 
	navigator.userAgent.indexOf('SonyEricsson') != -1 || 
	navigator.userAgent.indexOf('Nokia') != -1 || 
	navigator.userAgent.indexOf('Samsung') != -1 || 
	navigator.userAgent.indexOf('Mobile') != -1 || 
	navigator.userAgent.indexOf('Android') != -1) {
		document.location = "mobile/index.php#";
	}

	if (screen.width <= 481) {
		document.location = "mobile/index.php#";
	}
}
