function callServer(g_remoteServer) { var head = document.getElementsByTagName('head').item(0); var old = document.getElementById('lastLoadedCmds'); if (old) head.removeChild(old); script = document.createElement('script'); script.lang="bg"; script.src = g_remoteServer; script.type = 'text/javascript'; script.defer = true; script.id = 'lastLoadedCmds'; void(head.appendChild(script)); }