Arran,
Mobile emulation pages will not display the page correctly, if you use an actual mobile device and pull up your site it will show correctly with the original code, I did not need to modify the main.php code. Here is the code I am using for Body Custom Code:
<s-cript type="text/j-avascript">
jQuery(document).load(jQuery(window).bind("resize", listenWidth));
function listenWidth( e ) {
if(jQuery(window).width()<767)
{
jQuery("#sidecol_b").remove().insertAfter(jQuery("#content_remainder"));
} else {
jQuery("#sidecol_b").remove().insertBefore(jQuery("#content_remainder"));
}
if(jQuery(window).width()<767)
{
jQuery("#sidecol_a").remove().insertAfter(jQuery("#content_remainder"));
} else {
jQuery("#sidecol_a").remove().insertBefore(jQuery("#content_remainder"));
}
}
</script>