QUIERO CONVERTIR ESTE FRAGMENTO PHP A JAVA SCRIP AYUDENME
<?php
$iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
$palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS");
$berry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
$ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");
if ($iphone || $android || $palmpre || $ipod || $berry == true)
{
header('Location:http://carluys.wordpress.com/'); //URL de la interfaz para m�vil
echo "<script>window.location='http://carluys.wordpress.com'</script>"; //URL de la interfaz para m�vil
}
else
{
header('Location: http://carluys.wordpress.com/'); //URL original
echo "<script>window.location='http://carluys.wordpress.com'</script>"; //URL original
}
?>