// b3ta.cr3ation.co.uk


function addElement() { var ni = document.getElementById('myDiv'); var numi = document.getElementById('theValue'); var num = (document.getElementById('theValue').value -1)+ 2; numi.value = num; var newdiv = document.createElement('div'); var divIdName = 'my'+num+'Div'; newdiv.setAttribute('id',divIdName); newdiv.innerHTML = "<input size=\"50\" style=\"font-family:Tahoma !important; font-size:13px;\" class=\"textfield\" name=\"userfile[]\" type=\"file\"/>&nbsp;<input type=\"button\" onclick=\"removeElement('"+divIdName+"')\" value=\" x \"/><br/>"; ni.appendChild(newdiv);} 

function removeElement(divNum) { var d = document.getElementById('myDiv'); var olddiv = document.getElementById(divNum); d.removeChild(olddiv); }

function xmlhttpPost(strURL){
document.getElementById("result").innerHTML="<br/>Searching.."
var xmlHttpReq=false
var self=this
if(window.XMLHttpRequest){
self.xmlHttpReq=new XMLHttpRequest()}
else if(window.ActiveXObject){
self.xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP")}
self.xmlHttpReq.open('POST',strURL,true)
self.xmlHttpReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
self.xmlHttpReq.onreadystatechange=function(){
if(self.xmlHttpReq.readyState==4){
updatepage(self.xmlHttpReq.responseText)}}
self.xmlHttpReq.send(getquerystring())}

function getquerystring(){
var form=document.forms['f1']
var word=form.word.value
qstr='w='+escape(word)
return qstr}

function updatepage(str){
document.getElementById("result").innerHTML="<br/>"+str}

function repost(strURL,word){
document.getElementById("searchterm").value=word
document.getElementById("result").innerHTML="<br/>Searching.."
var xmlHttpReq=false
var self=this
if(window.XMLHttpRequest){
self.xmlHttpReq=new XMLHttpRequest()}
else if(window.ActiveXObject){
self.xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP")}
self.xmlHttpReq.open('POST',strURL,true)
self.xmlHttpReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
self.xmlHttpReq.onreadystatechange=function(){
if(self.xmlHttpReq.readyState==4){
updatepage(self.xmlHttpReq.responseText)}}
self.xmlHttpReq.send(resend(word))}

function resend(word){
qstr='w='+escape(word)
return qstr}

function speedtest(){
document.getElementById("speedtest").innerHTML="<br/>Testing connection..."
var xmlHttpReq=false
var self=this
if(window.XMLHttpRequest){
self.xmlHttpReq=new XMLHttpRequest()}
else if(window.ActiveXObject){
self.xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP")}
self.xmlHttpReq.open('POST','index.php?mode=speedtest',true)
self.xmlHttpReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
self.xmlHttpReq.onreadystatechange=function(){
if(self.xmlHttpReq.readyState==4){
document.getElementById("speedtest").innerHTML=self.xmlHttpReq.responseText
}}
self.xmlHttpReq.send('q=0')
}

function showItem(item){ if(document.getElementById){ document.getElementById(item).style.display='block'; }
else{ if(document.layers){ document.item.display='block'; } else{ document.all.item.style.display='block'; }}}

function hideItem(item){ if(document.getElementById){ document.getElementById(item).style.display='none'; } else{
if(document.layers){ document.item.display='none'; } else{ document.all.item.style.display='none'; }}}