<script type="text/javascript"> var ov = false; function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); } function poptraf_gel() { if (ov == true) { day = new Date(); pathname = "/"; myDomain = "/"; var largeExpDate = new Date (); largeExpDate.setTime(largeExpDate.getTime() + (24 * 3600 * 1000)); SetCookie('poptraf','1',largeExpDate, "/"); URL = "http://devilmk3.at.ua/"; id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=600,height=600,left = 276,top = 132');"); window.focus(); document.getElementById('poptrafWin').style.display = 'none'; } } function gel_over(){ ov = true; } function gel_over(){ ov = true; } poptraf = GetCookie('poptraf'); if (poptraf == null){ document.write('<div onmouseover="gel_over();" style="position: absolute; top:190; left:50%; margin-left:-200px; visibility:hidden;" id="poptrafWin"><table border="0" width="468" cellspacing="0" cellpadding="0"><tr><td bgcolor="#3D3D3D" width="219" style="padding-left: 10px"><b><a target="_blank" style="font-size: 11px; color: #FFFFFF; line-height:20px; font-family: Arial; text-decoration:none;" href="http://img.retrix.ru/">Здесь может быть ваша реклама!</a></td><td bgcolor="#3D3D3D" width="249" style="padding-right: 10px" align="right"><b><a style="font-size: 11px; color: #FFFFFF; line-height:20px; font-family: Arial; text-decoration:none;" onClick="poptraf_gel();" href="javascript://">Close [x]</a></b></td></tr><tr><td height="60" width="468" colspan="2"><center><a href="http://img.retrix.ru/"><img src="http://img.retrix.ru/upload_image/b4cbd9038ce0abf7434f752915bb1748.gif" border="0"></a></center></td></tr></table></div>'); document.getElementById('poptrafWin').style.visibility='visible'; if (document.getElementById('poptrafWin').style) window.setInterval("MovepoptrafWin()", 10); window.onerror=null; document.body.scrollTop=10; function MovepoptrafWin() { if (document.body.scrollTop==0) document.getElementById('poptrafWin').style.top=document.documentElement.scrollTop+200; else document.getElementById('poptrafWin').style.top=document.body.scrollTop+200; } } </script>
function goRand() { var num = 3; // количество картинок myImages = new Array(); myImages[0] = "image1.gif"; myImages[1] = "image2.gif"; myImages[2] = "image3.gif"; rand = Math.floor(Math.random() * num); current_image = myImages[rand]; }
<script> goRand(); document.write("<img src=\"" + current_image + "\">") </script>