{exp:mobile_detect:redirect location="http://m.site.com/"}
<!-- Menu -->
{exp:mobile_detect:pair ignore_cookies="yes"}
{if mobile}
<a href="#" onClick="Set_Cookie( 'exp'+'_'+'mobile_redirect', 'off', 'http://www.site.com/' );">Show full site</a>
{/if}
{if not_mobile}
<a href="#" onClick="Set_Cookie( 'exp'+'_'+'mobile_redirect', 'on', 'http://m.site.com/' );">Show mobile site</a>
{/if}
{/exp:mobile_detect:pair}
<script language="javascript">
function Set_Cookie( name, value, url )
{
var expires = '';
var path = '/';
var domain = '';
var secure = '';
var today = new Date();
today.setTime( today.getTime() );
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );
document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
if (url == '') {
window.location.reload();
} else {
window.location = url;
}
}
</script>