in Salesforce 1 its not redirecting to the correct record page in Salesforce 1 but is instead redirecting to the Standard Salesforce Web Browser version of the page.
Here is the code:
<div id="center" onclick="myFunction()">
<apex:image value="{!$Resource.Submit}" styleClass="button"/>
</div>
<script type='text/javascript'>
Sfdc.canvas.publisher.subscribe({name: 'publisher.post', onData:function(e) {
insertSignature();
}});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-36269828-12', 'salesforce.com');
ga('send', 'pageview');
</script>
</body>
</html>
<script>
function myFunction(){
if( (typeof sforce != 'undefined') && (sforce != null) ) {
// Salesforce1
alert("made it");
var recordId = 'a04B00000011w41IAA';
var type = 'detail';
sforce.one.navigateToSObject(recordId, type);
} else {
// Desktop
window.location.href = '/a04B00000011w41IAA';
}
}