//xmlhttp.js //Function to create an XMLHttp Object. function getxmlhttp (){ //Create a boolean variable to check for a valid microsoft active X instance. var xmlhttp = false; //Check if we are using internet explorer. try { //If the javascript version is greater than 5. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { //If not, then use the older active x object. try { //If we are using internet explorer. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { //Else we must be using a non-internet explorer browser. xmlhttp = false; } } //If we are using a non-internet explorer browser, create a javascript instance of the object. if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { xmlhttp = new XMLHttpRequest(); } return xmlhttp; } //Function to process an XMLHttpRequest. function processajax (serverPage, obj, getOrPost, str){ //Get an XMLHttpRequest object for use. xmlhttp = getxmlhttp (); if (getOrPost == "get"){ xmlhttp.open("GET", serverPage); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { obj.innerHTML = xmlhttp.responseText; } } xmlhttp.send(null); } else { xmlhttp.open("POST", serverPage, true); xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { obj.innerHTML = xmlhttp.responseText; } } xmlhttp.send(str); } } function confirmDelete(message,url) { if (confirm(message)) { document.location = url; } } function previewSkin() { document.getElementById('previewskinpic').src = 'http://www.street-edge.com.au/skins/' + document.getElementById('previewskin').options[document.getElementById('previewskin').selectedIndex].value + '/images/thumbnail.jpg'; } function toggledisplay(id) { var element = document.getElementById(id); if (element.style.display == 'none') element.style.display = ''; else element.style.display = 'none'; } function checkdata(length,element,counter,message) { if (element.value.length > length) { element.value = element.value.substring(0, length); alert(message); } else { document.getElementById(counter).innerHTML = length - element.value.length; } } function NewWindow(mypage,myname,w,h) { var win = null; LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=no, scrollbars=no' win = window.open(mypage,myname,settings) } function popupWindow(mypage,myname,w,h,scroll) { var win = null; LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=no, scrollbars='+scroll; win = window.open(mypage,myname,settings) } function toolTip(msg) { } var refreshinterval=15; var displaycountdown="yes"; var starttime; var nowtime; var reloadseconds=0; var secondssinceloaded=0; function starttime() { starttime=new Date(); starttime=starttime.getTime(); refreshinterval = document.getElementById('newrefresh').value; countdown(); } function countdown() { nowtime= new Date(); nowtime=nowtime.getTime(); secondssinceloaded=(nowtime-starttime)/1000; reloadseconds=Math.round(refreshinterval-secondssinceloaded); document.getElementById('newrefresh').value = document.getElementById('newrefresh').value.replace(/[^0-9]/g, ''); if (document.getElementById('newrefresh').value > 0) refreshinterval = Math.round(document.getElementById('newrefresh').value*60); else document.getElementById('newrefresh').value = Math.round(refreshinterval/60) if (refreshinterval>=secondssinceloaded) { var timer=setTimeout("countdown()",1000); if (displaycountdown=="yes") { var seconds = reloadseconds; var hours; var minutes; if (seconds >= 60) { minutes = Math.floor(seconds / 60); seconds -= (minutes * 60); if (minutes >= 60) { hours = Math.floor(minutes / 60); minutes -= (hours * 60); } else hours = 0; } else { hours = 0; minutes = 0; } if (hours < 10) hours = "0"+hours; if (minutes < 10) minutes = "0"+minutes; if (seconds < 10) seconds = "0"+seconds; remaintime = hours + ":" + minutes + ":" + seconds; document.getElementById('refreshin').innerHTML = remaintime; } } else { clearTimeout(timer); window.location.reload(); } } var W3CDOM = (document.createElement && document.getElementsByTagName); function initFileUploads() { if (!W3CDOM) return; var fakeFileUpload = document.createElement('div'); fakeFileUpload.className = 'fakefile'; fakeFileUpload.appendChild(document.createElement('input')); var image = document.createElement('img'); image.src='../skins/admin/images/search.php'; fakeFileUpload.appendChild(image); var x = document.getElementsByTagName('input'); for (var i=0;i