function check_mobile(){ var wmin = screen.width; if(screen.availWidth < wmin) wmin = screen.availWidth; if(window.innerWidth < wmin) wmin = window.innerWidth; if((wmin < 650) && (document.fmob.scr.value != 'mobile')){ document.fmob.scr.value = "mobile"; document.fmob.submit(); } if((650 < wmin) && (document.fmob.scr.value != 'normal')){ document.fmob.scr.value = 'normal'; document.fmob.submit(); } }