var _screen=(screen?screen:(window&&window.screen?window.screen:false));var _uagent=navigator.userAgent.toLowerCase();var _ismobile=(_uagent.search('iphone')>-1||_uagent.search('ipod')>-1);var _isadbot=(_uagent.search('adsbot')>-1);var bm_fullweb=location.href.indexOf("fullweb=1")>0-1||document.cookie.indexOf("fullweb=1")>=0;if(typeof(bm_test)=='Undefined'){var bm_test=false}if(bm_fullweb){var d=new Date();d.setTime(d.getTime()+86400000);document.cookie="fullweb=1; expires="+d.toGMTString()+"; path=/"}if(bm_test){alert(location.href.indexOf("fullweb=1"));alert(document.cookie.indexOf("fullweb=1"));alert(bm_fullweb)}if(!_isadbot&&(_ismobile||(!_screen)||(_screen.width<=600||_screen.height<=600))){if(bm_test)alert('mobile!');if(bm_test&&bm_fullweb){alert('fullweb')}if(bm_test){var r=location.protocol+'//'+bm_mobile_domain+'/?url='+encodeURI(location.href);alert('redirecting to '+r)}if(!bm_fullweb&&!bm_test){var r=location.protocol+'//'+bm_mobile_domain+'/?url='+encodeURI(location.href);window.location=r;document.location=r}if(!bm_showlink_text){bm_showlink_text='Go to mobile version'}if(bm_showlink){setTimeout('bmAddLink()',1000)}}else{if(bm_test)alert('not mobile')}function bmAddLink(){if(!document.body){setTimeout('bmAddLink()',1000)}var d=document.createElement("div");d.style.width="100%";d.style.background="gray";d.style.textAlign="left";d.style.fontSize=Math.min(Math.max(_screen.height/40,10),40)+"px";d.innerHTML='<a href="'+location.protocol+'//'+bm_mobile_domain+'/?url='+encodeURI(location.href)+'">'+bm_showlink_text+'</a>';document.body.insertBefore(d,document.body.childNodes[0])}
