function move(box,index,to) { //index is a dummy parameter from the old version of move. Now, we get it directly from box.selectedIndex
	var copyText, copyValue, si;
	si = box.selectedIndex;
	if(si == -1)
		return;
	if( si + to > box.options.length - 1 )
		{ to = 0; }
	if( si + to < 0 )
		{ to = 0; }
	copyText = box.options[si+to].text;
	copyValue = box.options[si+to].value;
	box.options[si+to].text = box.options[si].text;
	box.options[si+to].value = box.options[si].value;
	box.options[si].text = copyText;
	box.options[si].value = copyValue;
	box.selectedIndex = si + to;
	box.focus();
}

function orderList(listBox, outList){   
	var theOtherList = ""; //An empty list that will contain the CatIDs.
	var list = document.getElementById(listBox); //The list box we're looking at. Now, it's the one with children.
	//Loop through each of the items and add its value to the list.
	for (i = 0; i <= list.options.length-1; i++) { 
		//Add the value of each option to the list.
		theOtherList += list.options[i].value;
		if(i != list.options.length-1) theOtherList += ","; //Add a comma if we need it.
	}
	document.getElementById(outList).value = theOtherList;
}
var popupwin = null;
function pop(loc, width, height, resizable) {  

  if (popupwin == null || popupwin.closed) {
  	settings = "menubar=0,status=0,location=0,titlebar=0,toolbar=0,top=141,left=400,width=" + width + ",height=" + height + ",resizable=1";
    popupwin = window.open (loc, 'popupwin', settings);
  
  } else {
    popupwin.focus();
    popupwin.location.href = loc;
  }
}

function fileBrowser (id, target_form_element, type, prefix){
		//alert(document.getElementById('src').value);
		//javascript:openBrower('srcbrowser','src', 'image','advimage_image_browser_callback');
		//document.getElementById(id).value = 'pics/8.jpeg';
		//var option = prefix + "_" + type + "_browser_callback";
		//var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback"));
		//alert(cb);
		//alert(cb.getElementById(id).value);
		//return('pics/8.jpeg');
		//insertURL('http://tinymce.moxiecode.com/imagemanager/images/moxie_cans.jpg');
		pop('../../../admin/popimages.cfm', 400, 300, 1);
}
