function swapSelected(){for(var i=0;i<this.elements.length;i++){if(this.elements[i].type=='checkbox'&&!this.elements[i].disabled){this.elements[i].checked=!this.elements[i].checked;}}}
function selectAll(){for(var i=0;i<this.elements.length;i++){if(this.elements[i].type=='checkbox'&&!this.elements[i].disabled){this.elements[i].checked=true;}}}
function doBulkDelete(){if(confirm('Hiermee verwijdert u de geslecteerde items.')){this.sub.value='dobulkdelete';return true;}else{return false;}}
function setListBox(leftList){var where=(navigator.appName=="Microsoft Internet Explorer")?-1:null;if(leftList.length==0){option=document.createElement("option");option.text='-------- Geen --------';option.value='0';leftList.add(option,where);}}
function moveOptionLeft(leftList,rightList){var where=(navigator.appName=="Microsoft Internet Explorer")?-1:null;if(leftList.options[0].value==0){leftList.remove(0);}
for(var i=0;i<rightList.length;i++){if(rightList.options[i].selected&&(rightList.options[i].value!=0)){option=document.createElement("option");option.text=rightList.options[i].text;option.value=rightList.options[i].value;option.className='newSelected';leftList.add(option,where);rightList.remove(i);i--;}}
rightList.selectedIndex=-1;rightList.blur();}
function moveOptionRight(leftList,rightList){var where=(navigator.appName=="Microsoft Internet Explorer")?-1:null;for(var i=0;i<leftList.length;i++){if(leftList.options[i].selected&&(leftList.options[i].value!=0)){option=document.createElement("option");option.text=leftList.options[i].text;option.value=leftList.options[i].value;option.className='newDeselected';rightList.add(option,where);leftList.remove(i);i--;}}
leftList.selectedIndex=-1;leftList.blur();setListBox(leftList);}
function initSwapBox(leftList,rightList){var where=(navigator.appName=="Microsoft Internet Explorer")?-1:null;for(var i=0;i<leftList.options.length;i++){if((!leftList.options[i].selected)&&(leftList.options[i].value!=0)){option=document.createElement("option");option.text=leftList.options[i].text;option.value=leftList.options[i].value;rightList.add(option,where);leftList.remove(i);i--;}}
leftList.selectedIndex=-1;setListBox(leftList);}
function jumpNext(currentElement,nextElement){if(currentElement.value.length==currentElement.maxLength){}}
function toggleFileInput(element,hide){if(hide){element.style.display='none';}else{element.style.display='block';}}
function toggleImageInput(element,hide){element.disabled=hide;var img=document.getElementById(element.name+'_PREVIEW');if(hide){img.src='#';}
setImage(img);}
function showPreview(element){var img=document.getElementById(element.name+'_PREVIEW');img.style.display='block';img.src='file://'+element.value;img.width=100;}
function setImage(img){if(img.src=='#'){img.style.display='none';img.width=10;}else{img.style.display='block';}}
function setValue(obj,value){try{switch(obj.type){case'select-one':var opts=obj.options;var l=opts.length;for(var x=0;x<l;x++){if(opts[x].value==value){opts[x].selected=true;break;}}
break;case'select':case'select-multiple':var opts=obj.options;var l=opts.length;for(var x=0;x<l;x++){if(opts[x].value==value){opts[x].selected=true;}}
break;case'text':case'textarea':case'password':case'file':case'radio':default:obj.value=value;break;}}
catch(e){}}
function getRadioValue(obj){try{var l=obj.length;var x;if(!l){if(obj.checked){return obj.value;}else{return false;}}else{for(x=0;x<l;x++){if(obj[x].checked)
return obj[x].value;}}}
catch(e){}}
function getValue(obj){try{switch(obj.type){case'select-one':break;case'select':case'select-multiple':break;case'text':case'textarea':case'password':case'file':case'radio':default:obj.value=value;break;}}
catch(e){}}
function openFileDialog(configname,filename){var windowFeatures="height=370, width=520px, toolbar=no";window.open('index.php?page=serverfile&current_path='+filename+'&config='+configname,'dialog',windowFeatures);}
function openServerFile(configname,filename){document.serverfile=document.frmImport.importfile.value;var windowFeatures="height=400, width=520px, toolbar=no";window.open('index.php?page=serverfile&current_path='+filename+'&config='+configname,'dialog',windowFeatures);}
function openDirDialog(configname,dirname,target,dialogname){var windowFeatures="height=370, width=520px, toolbar=no";window.open('index.php?page=serverdir&dir='+dirname+'&target='+target+'&config='+configname,dialogname,windowFeatures);}
function setRadioValue(obj,aValue){try{var l=obj.length;var x;for(x=0;x<l;x++){if(obj[x].value==aValue)
return obj[x].checked=true;}}
catch(e){}}