function windowOpen (src, name, w, h){
	popWin = window.open(src, name, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width='+w+', height='+h+',top=20,left=30');
}

function numTextTable (obj) {
	//num tab
	if (obj.value == 'YES'){
		var element = document.getElementById('text-tab');
		element.style.display="none";
		
		var element = document.getElementById('num-tab');
		element.style.display="block";
	}
	else if (obj.value == 'NO'){
		var element = document.getElementById('text-tab');
		element.style.display="block";
		
		var element = document.getElementById('num-tab');
		element.style.display="none";
	}
}

function inputEnable (theInput, theSet) {
	var elt = document.getElementById (theInput);
	elt.disabled = theSet;
}

function inputHideShow (theInput, theSet) {
	var elt = document.getElementById (theInput);
	elt.style.display = theSet;
}

function correctionFileActive (){
	var elt = document.getElementById ('type-file');
	var elt2 = document.getElementById ('source-for');
	if (elt.value == 'sources'){
		elt2.disabled = false;
	} else {
		elt2.disabled = true;
	}
}

function submitForm (theForm){
	var elt = document.getElementById (theForm);
	if (elt != undefined){
		elt.submit();
	}
}

function toggleAll (theForm){
	for (var i = 0; i < document.forms[theForm].elements.length; i++) {
    	if(document.forms[theForm].elements[i].type == 'checkbox'){
	      document.forms[theForm].elements[i].checked = !(document.forms[theForm].elements[i].checked);
	    }
	}
}

function checkAll (theForm, theAction){
	if (theAction == 'false') {
		theAction = false;
	}
	for (var i = 0; i < document.forms[theForm].elements.length; i++) {
    	if(document.forms[theForm].elements[i].type == 'checkbox'){
	      document.forms[theForm].elements[i].checked = theAction;
	    }
	}
}


function requestListShow (theId){
		var elt1 = document.getElementById ('address-'+theId); 
		if (elt1 != undefined){
			elt1.style.height="auto";
			elt1.style.overflow="visible";
		}
		
		var elt1 = document.getElementById ('info-'+theId); 
		if (elt1 != undefined){
			elt1.style.height="auto";
			elt1.style.overflow="visible";
		}
		
		var elt1 = document.getElementById ('list-'+theId); 
		if (elt1 != undefined){
			elt1.style.height="auto";
			elt1.style.overflow="visible";
		}
	}
//---- change icon - only for admintool ----
//---------------------------------------------------------
//---- change icons ----
function iconChangeAdm (theImg, theAction){
	if (theImg == 'undefined') {
        return false;
    }
	
	if (theAction == 'ASC'){ 
		var img_src = 'arrow_up.gif';
	}
	else if (theAction == 'DESC'){
		var img_src = 'arrow_down.gif';
	}
	else {
		var img_src = 'arrow_no.gif';
	}
	
	theImg.src = '../template/design/'+img_src;
	
}
