/*<!---
||BEGIN
 
||PAGE NAME||
survey.js.cfm
 
|| AUTHOR ||
Mark Shilliday	
mark.shilliday@biznet-solutions.com
 
||DATE CREATED||
 
 
|| PURPOSE OF PAGE ||
Description:
 
 
 
|| REVISION HISTORY ||
date modified | developer name | Descriptions of modifications made
 
||END
 
--->*/


function buttons (image, id) {
			document.getElementById(id).style.background = 'url(/_admin/imgs/' + image + ')'
}

function moveEm(direction,listname) {
		
		var dfr = document.getElementById(listname)
		
		boxLen = dfr.length;
		currentItem = dfr.selectedIndex;
		
		if ((direction == 'up') && (currentItem > 0)) {
			
			sel = dfr.options[currentItem]
			swap = dfr.options[currentItem-1]
			
			dfr.options[currentItem-1] = new Option(sel.text, sel.value);
			dfr.options[currentItem] = new Option(swap.text, swap.value);
			
			dfr.selectedIndex = currentItem - 1
			
		} else if ((direction == 'down') && (currentItem < boxLen - 1) && (currentItem != -1)) {
			
			sel = dfr.options[currentItem]
			swap = dfr.options[currentItem+1]
			
			dfr.options[currentItem+1] = new Option(sel.text, sel.value);
			dfr.options[currentItem] = new Option(swap.text, swap.value);
			
			dfr.selectedIndex = currentItem + 1;
			
		} 
		
	}

	function selectall (listname){
		var obj = document.getElementById(listname);
		
		for (i=0; i< obj.length; i++){
			obj[i].selected = true;
		}
	}

	
	function show_ele (action, id) {
		var objquest = document.getElementById('quest_' + id);
		var objexpand = document.getElementById('expand_' + id);
		var objhide = document.getElementById('hide_' + id);
		
		if (action == 'show'){
			objquest.style.display = 'block';
			objexpand.style.display = 'none'; 
		}
		else if (action == 'hide'){
			objquest.style.display = 'none';
			objexpand.style.display = 'block'; 
		}
	}