function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } function autosubmit() { window.document.adlink.submit(); } function getPhoto(pid) { // alert(pid); // return; new Ajax.Request('getphoto.php', { method:'get', parameters: {next: pid}, onSuccess: function(transport) { var response = transport.responseText || "no response text"; $('cyclesystem').innerHTML = response; }, onFailure: function() { alert('Something went wrong...') } }); }