<script>
var winW = 0, winH = 0;
if (document.body && document.body.offsetWidth) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
if (document.compatMode=='CSS1Compat' && document.documentElement && document.documentElement.offsetWidth ) {
winW = document.documentElement.offsetWidth;
winH = document.documentElement.offsetHeight;
}
if (window.innerWidth && window.innerHeight) {
winW = window.innerWidth;
winH = window.innerHeight;
}
if (winW > 1024) {
location.href = 'index2.htm';
}
</script>
$images = json_decode($images, true);
$imagepath = '';
$imagepath .= "<FILE FILEPATH=\"http://blabla.ru/$element/".$image['name']."\" />";
перед равно добавить точку