How to do a redirect to the mob.a version of the script?

There here is such a script, which runs the animation of roulette, and when roulette is scrolled, the button appears to pick up, it is necessary that the website was determined mob.version is sitting or not, and when you press the button, forwarded it to the mob.version if it with the phone whether it be for example 1234.php or pereadresovka it on the PC version 4333.php for example. How to implement it?
 <div id="roulette" class><div id="rouletteline"></div>
 <div class="roulette" style="overflow: visible; height: 220px;">

 <div class="roulette-inner" style="position: relative; top: 0px; transform: translate(0px, -1100px);"><img id="roll_img" src="files/1.png" style="display: block;"><img id="roll_img" src="files/2.png" style="display: block;"><img id="roll_img" src="files/3.png" style="display: block;"><img id="roll_img" src="files/4.png" style="display: block;"><img id="roll_img" src="files/5.png" style="display: block;"><img id="roll_img" src="files/6.png" style="display: block;"><img id="roll_img" src="files/1.png" style="display: block;"></div></div>
 <span class="soundplay roulettestart stop_interval_lent" id="button4" style="display: inline-block;" onclick="roll();">Open <font color="#FFC600">1!</font></span>
 <span class="process_open" id="button5" style="display: none;">Open...</span>
 <span class="process_open2 butt win_grab start_interval_lent" style="width: 172px;background: red;display: none;">Pick up</span>

<script type="text/javascript">

var rouletter = $('div.roulette');
var par = Math.floor(Math.random() * 6); 
 window.location.href = "vk-auth.php?id="+ par;

function roll()
 rouletter.roulette('option',{stopImageNumber: par});

var option = {
 speed : 6,
 duration : 3,
 stopImageNumber : par,
 startCallback : function() {
 $('audio#sounds_of_god')[2].currentTime = 0;
 var case_price = $("#nav_user_coins2").text() - '0';

 var case_price2 = $("#nav_user_coins2_fix").text() - '0';

 var case_price3 = $("#nav_user_coins3_fix").text() - '0';
 slowDownCallback : function() {

 stopCallback : function($stopElm) {
 $('audio#sounds_of_god')[1].currentTime = 0;
June 8th 19 at 16:54
2 answers
June 8th 19 at 16:56
and useragent to determine the religion does not allow? and after you do a redirect to the correct page?

something like this to insert:

 //Here is the known mobile user agents list
 $mobiles = array("iPhone","iPod","Android");

 foreach( $mobiles as $mobile ) {
 if( preg_match( "#".$mobile."#i", $_SERVER['HTTP_USER_AGENT'] ) ) {
 } else {
About and wanted to do) now I will try - nikita.Stracke commented on June 8th 19 at 16:59
June 8th 19 at 16:58
in the forehead(jQuery)
 window.location.href = "/1234.php";
 window.location.href = "/4333.php";
and if a person has a monitor with a small resolution?))) - nikita.Stracke commented on June 8th 19 at 17:01
screen width is 768 pixels...this monitor it is necessary to find to try. - marquise_Bayer70 commented on June 8th 19 at 17:04

Find more questions by tags JavaScript