			function selectUnselectMatchingOptions(obj,regex,which,only){if(window.RegExp){if(which == "select"){var selected1=true;var selected2=false;}else if(which == "unselect"){var selected1=false;var selected2=true;}else{return;}var re = new RegExp(regex);for(var i=0;i<obj.options.length;i++){if(re.test(obj.options[i].text)){obj.options[i].selected = selected1;}else{if(only == true){obj.options[i].selected = selected2;}}}}}
			function selectMatchingOptions(obj,regex){selectUnselectMatchingOptions(obj,regex,"select",false);}
			function selectOnlyMatchingOptions(obj,regex){selectUnselectMatchingOptions(obj,regex,"select",true);}
			function unSelectMatchingOptions(obj,regex){selectUnselectMatchingOptions(obj,regex,"unselect",false);}
			function sortSelect(obj){var o = new Array();if(obj.options==null){return;}for(var i=0;i<obj.options.length;i++){o[o.length] = new Option( obj.options[i].text, obj.options[i].value, obj.options[i].defaultSelected, obj.options[i].selected) ;}if(o.length==0){return;}o = o.sort(
			function(a,b){if((a.text+"") <(b.text+"")){return -1;}if((a.text+"") >(b.text+"")){return 1;}return 0;});for(var i=0;i<o.length;i++){obj.options[i] = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);}}
			function selectAllOptions(obj){for(var i=0;i<obj.options.length;i++){obj.options[i].selected = true;}}
			function moveSelectedOptions(from,to){if(arguments.length>3){var regex = arguments[3];if(regex != ""){unSelectMatchingOptions(from,regex);}}for(var i=0;i<from.options.length;i++){var o = from.options[i];if(o.selected){to.options[to.options.length] = new Option( o.text, o.value, false, false);}}for(var i=(from.options.length-1);i>=0;i--){var o = from.options[i];if(o.selected){from.options[i] = null;}}if((arguments.length<3) ||(arguments[2]==true)){sortSelect(from);sortSelect(to);}from.selectedIndex = -1;to.selectedIndex = -1;}
			function copySelectedOptions(from,to){var options = new Object();for(var i=0;i<to.options.length;i++){options[to.options[i].text] = true;}for(var i=0;i<from.options.length;i++){var o = from.options[i];if(o.selected){if(options[o.text] == null || options[o.text] == "undefined"){to.options[to.options.length] = new Option( o.text, o.value, false, false);}}}if((arguments.length<3) ||(arguments[2]==true)){sortSelect(to);}from.selectedIndex = -1;to.selectedIndex = -1;}
			function moveAllOptions(from,to){selectAllOptions(from);if(arguments.length==2){moveSelectedOptions(from,to);}else if(arguments.length==3){moveSelectedOptions(from,to,arguments[2]);}else if(arguments.length==4){moveSelectedOptions(from,to,arguments[2],arguments[3]);}}
			function copyAllOptions(from,to){selectAllOptions(from);if(arguments.length==2){copySelectedOptions(from,to);}else if(arguments.length==3){copySelectedOptions(from,to,arguments[2]);}}
			function swapOptions(obj,i,j){var o = obj.options;var i_selected = o[i].selected;var j_selected = o[j].selected;var temp = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);var temp2= new Option(o[j].text, o[j].value, o[j].defaultSelected, o[j].selected);o[i] = temp2;o[j] = temp;o[i].selected = j_selected;o[j].selected = i_selected;}
			function moveOptionUp(obj){var selectedCount=0;for(i=0;i<obj.options.length;i++){if(obj.options[i].selected){selectedCount++;}}if(selectedCount > 1){return;}var i = obj.selectedIndex;if(i == 0){return;}swapOptions(obj,i,i-1);obj.options[i-1].selected = true;}
			function moveOptionDown(obj){var selectedCount=0;for(i=0;i<obj.options.length;i++){if(obj.options[i].selected){selectedCount++;}}if(selectedCount > 1){return;}var i = obj.selectedIndex;if(i ==(obj.options.length-1)){return;}swapOptions(obj,i,i+1);obj.options[i+1].selected = true;}
			function removeSelectedOptions(from){for(var i=(from.options.length-1);i>=0;i--){var o=from.options[i];if(o.selected){from.options[i] = null;}}from.selectedIndex = -1;}

			function moveSelectedOptionsWithAsterix(from,to){
				if(arguments.length>3){
					var regex = arguments[3];
					if(regex != ""){
						unSelectMatchingOptions(from,regex);
					}
				}
				for(var i=0;i<from.options.length;i++)
				{
					var o = from.options[i];
					// if isDesc is selected, put * at then end of the text of option
					
					if(o.selected ){
						if(from == document.Form1.ListBox1){
						  if(document.Form1.isDesc.checked) {
							to.options[to.options.length] = new Option( o.text + "*", o.value, false, false);
							} else {
							to.options[to.options.length] = new Option( o.text, o.value, false, false);
							}
						}
						if(from == document.Form1.ListBox2) {
							if(o.text.charAt(o.text.length-1) == '*') {
								to.options[to.options.length] = new Option( o.text.substring(0,o.text.length-1), o.value, false, false);
							} else {
								to.options[to.options.length] = new Option( o.text, o.value, false, false);
							}
						}
						
						
					}
				}
				for(var i=(from.options.length-1);i>=0;i--){
					var o = from.options[i];if(o.selected){from.options[i] = null;}
				}
				if((arguments.length<3) ||(arguments[2]==true)){
					sortSelect(from);
					sortSelect(to);}
					from.selectedIndex = -1;
					to.selectedIndex = -1;
				}


			
			function SendSelectedItems(listObj){
				var cont = document.Form1.hdSelectedItems ;
				cont.value='';
				for(var i=0; i<listObj.options.length; i++)
				{
					cont.value += listObj.options[i].value + ",";
				}
				
				if(cont.value.length>0) {
					cont.value = cont.value.substring(0,cont.value.length-1);
				}
				
				document.Form1.submit();
				
			}
			function SendSelectedItemsGen(listObj,Obje,opt){
				var cont ;
				cont='';
				
				for(var i=0; i<listObj.options.length; i++)
				{
					if (opt==0)
					{
						cont+= listObj.options[i].value + ",";
					}
					else
					{
						cont+= listObj.options[i].text + ",";
					}
				}
				
				if(cont.length>0) {
					cont= cont.substring(0,cont.length-1);
				}
				
				
				Obje.value=cont;
				
				document.Form1.submit();
				
			}

			
function uploadPop(inDir,obj)
	{
		window.open('showFolder.aspx?obj='+obj+'&uploadFolder=' + inDir,'Upload','width=250,height=100,toolbar=0,status=0,scrollbars=0,resizable=0,menubar=0,location=0,fullscreen=0,directories=0');
	}
function uploadPopmp3(inDir,djID,obj)
	{
		window.open('showFoldermp3.aspx?djID='+djID+'&uploadFolder=' + inDir+'&obj='+obj,'Upload','width=250,height=100,toolbar=0,status=0,scrollbars=0,resizable=0,menubar=0,location=0,fullscreen=0,directories=0');
	}
function uploadPop2(inDir,obj)
	{
		window.open('showFolder2.aspx?obj='+obj+'&uploadFolder=' + inDir,'Upload','width=250,height=200,toolbar=0,status=0,scrollbars=1,resizable=0,menubar=0,location=0,fullscreen=0,directories=0');
	}
function addDj()
{
	window.open('editDj.aspx?pop=1','addDj','width=400,height=400,toolbar=0,status=0,scrollbars=0,resizable=0,menubar=0,location=0,fullscreen=0,directories=0');
}
function AddItem(lbxSelection,sDisplay,sKey)
	{
		iIndex=lbxSelection.options.length;
		lbxSelection.options[iIndex]=new Option(sDisplay,iIndex+1);
		lbxSelection.options[iIndex].value=sKey;
	}

function delPop(inDir,obj,objName)
	{
		window.open('showFolder.aspx?objName='+objName+'&del=1&uploadFolder=' + inDir + '&fName=' + obj.options[obj.selectedIndex].text,'Upload','width=1,height=1,toolbar=0,status=1,scrollbars=0,resizable=0,menubar=0,location=0,fullscreen=0,directories=0');
	}
function delPopMP3(inDir,djID)
	{
		window.open('showFoldermp3.aspx?&del=1&uploadFolder=' + inDir + '&djID=' + djID,'Upload','width=1,height=1,toolbar=0,status=1,scrollbars=0,resizable=0,menubar=0,location=0,fullscreen=0,directories=0');
	}

function RemoveItem(lbxSelection,sKey)
{
	var srcLen = lbxSelection.options.length;
	for (var x=srcLen-1; x>=0; x--)
   	if (lbxSelection.options[x].value == sKey) 
    	{
		lbxSelection.options[x]=null;
	}
}

function photoEditor(albId)
{
	window.open('editPhotos.aspx?albumId=' + albId ,'editPhotos','width=500,height=400,toolbar=0,status=0,scrollbars=1,resizable=0,menubar=0,location=0,fullscreen=0,directories=0');
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}