BARABANTEMO,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript">
function setCookie(name, value, days) {
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
}
else var expires = "";
document.cookie = name + "=" + value + expires + "; path=/";
}
function getCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
function eraseCookie(name) {
setCookie(name, "", -1);
}
</script>
<div id="apoback"></div><input type="text" id="apoinput" placeholder="Ссылка на картинку" style="width:100%" /><input id="ok" name="" type="button" value="ok">
<script>
$(window).load(function() {
$('#ok').click(function(apo) {
var apoval = $('#apoinput').val();
var aposub = apoval.substr(-4, 4);
if(aposub=='.gif' || aposub=='.png' || aposub=='.jpg' || aposub=='jpeg') {
setCookie('apoimg', apoval, 365);
$('#apoback').html('<img src="'+getCookie('apoimg')+'" width="100%" height="100%" style="position:fixed;z-index:-1;top:0px;left:0px;" />');
} else {
_uWnd.alert('Неправильный формат изображения', 'Ошибка', {w:250, h:65});
};
});
if(getCookie('apoimg')) {
$('#apoback').html('<img src="'+getCookie('apoimg')+'" width="100%" height="100%" style="position:fixed;z-index:-1;top:0px;left:0px;" />');
};
});
</script>
</body>
</html>