function ShowHideToolbar()
{
	s = document.getElementById("adm_toolbar_status").value;
	if (s == 1)
	{
		document.getElementById("toolbarAuto").style.display = "block";
		
	}
	else
		document.getElementById("toolbarAuto").style.display = "none";	
}

function ToolbarClick()
{
	s = document.getElementById("adm_toolbar_status").value;
	if (s == 1)
		document.getElementById("adm_toolbar_status").value = 0;
	else
		document.getElementById("adm_toolbar_status").value = 1;
	
	ShowHideToolbar()
}

//File Browser Scripts
function gotoFolder(lnk) {
	window.location.replace(lnk);
}

function DisplayFileManagerPropertyPanes(insertType)
{
	if (insertType == "none")

		document.all["sml_property"].style.display = "none";		
	else
		document.all["sml_property"].style.display = "block";	
}

function displayImage(filename, insertType)
{	
	DisplayFileManagerPropertyPanes(insertType);	
	document.all["img_previw"].innerHTML = "<img name='img_prv' src='" + filename + "'>" ;
}

function displayFlash(filename, insertType)
{
	DisplayFileManagerPropertyPanes(insertType);	
	
	document.all["img_previw"].innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' id='Adver' align='middle' width='450' height='300'>"
				+ "<param name='allowScriptAccess' value='sameDomain' />"
				+ "<param name='movie' value='" + filename + "' />"
				+ "<param name='menu' value='false' />"
				+ "<param name='salign' value='t' />"
				+ "<embed src='" + filename + "' menu='false' name='Adver' salign='t' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' width='550' height='400' />"
				+ "</object>";
}

function displayOther(filename, insertType)
{
	DisplayFileManagerPropertyPanes(insertType);	
	document.all["img_previw"].innerHTML = "";
}

function displayNone()
{
	document.all["sml_property"].style.display = "none";
}


function moveItem(slcFrom, slcTo, slcFromtxt, slcTotxt) 
{
  slcFromSelectedIndex = document.all[slcFrom].selectedIndex;
  slcToLenght = document.all[slcTo].length;
  if (slcFromSelectedIndex != -1 && document.all[slcFrom].options[slcFromSelectedIndex].value > "") {
    fromText = document.all[slcFrom].options[slcFromSelectedIndex].text;
    fromValue = document.all[slcFrom].options[slcFromSelectedIndex].value;
    for(i=0;i<document.all[slcTo].length;i++){ 
		if (document.all[slcTo].options[i].value == fromValue)
			return;
    }
    document.all[slcFrom].options[slcFromSelectedIndex] = null;
    document.all[slcTo].options[slcToLenght] = new Option (fromText, fromValue, false, true);
	// populate hidden fileds for postback
	document.all[slcFromtxt].value = "";
	for(i=0;i<document.all[slcFrom].length;i++){ 
		document.all[slcFromtxt].value += document.all[slcFrom].options[i].value; 
		document.all[slcFromtxt].value += "^"; 			
		document.all[slcFromtxt].value += document.all[slcFrom].options[i].text; 
		document.all[slcFromtxt].value += "&"; 
	} 
	
	document.all[slcTotxt].value = "";
	for(i=0;i<document.all[slcTo].length;i++){ 
		document.all[slcTotxt].value += document.all[slcTo].options[i].value; 
		document.all[slcTotxt].value += "^"; 			
		document.all[slcTotxt].value += document.all[slcTo].options[i].text; 
		document.all[slcTotxt].value += "&"; 
	} 

  } else {
    alert("Please select a module first");
  }
} 

function popUpCalendar(path, x1)
{
	var q = path + "?ctl=" + x1.name;
	q += "&date=" + x1.value;
	if (navigator.appName == "Microsoft Internet Explorer")
		OpenModalWindow(q,240,230,'yes');
	else
		window.open(q,'cal','width=160,height=150,left=270,top=180,dependent=1');
	
}

function OpenLogWindow(target)
{
	if (navigator.appName == "Microsoft Internet Explorer")
		OpenModalWindow(target, 400,300,'yes');
	else
		window.open(target, 'userlog', 'width=400,height=300,left=200,top=180,scrollbars=yes,resizable=yes');
}

function OpenCtlWindow(t, w, h, c)
{
	var q = t + "&v=" + c.value
	if (navigator.appName == "Microsoft Internet Explorer")
		OpenModalWindow(q, w, h, 'yes');
	else
		window.open(q, 'userlog', 'width=' + w + ',height=' + h + ',left=200,top=180,scrollbars=yes,resizable=yes');

}

function OpenModalWindow(t, w, h, r)
{
	var url = t;
	var args = new Array(url);
	var winargs = window.showModalDialog('/modalwindow.htm', args, 'dialogWidth:' + w + 'px; dialogHeight:' + h + 'px; center:yes; status:no; help:no; resizable:' + r);
	if (winargs != null)
	{
		if (winargs.length == 2)
		{
			document.all[winargs[0]].value = winargs[1];
		}
		else if (winargs.length == 1)
		{
			if (winargs[0] != 'dummy')
				window.location.replace(winargs[0]);
			else
				document.forms(0).submit();
		}
	}
}

function ChangeVisibility(ctl)
{
	if (ctl.style.display == 'none')
		ctl.style.display = 'block'
	else
		ctl.style.display = 'none'
}
