function deltimer(type)
{
	document.getElementById(type).value = "";
}

function addSrcToDestList(valt) {
	var destList = document.getElementById("destList"+valt);
	var srcList  = document.getElementById("srcList");
	var len = destList.length;
	for(var i = 0; i < srcList.length; i++) {
		if ((srcList.options[i] != null) && (srcList.options[i].selected)) {
			var found = false;
			for(var count = 0; count < len; count++)
			{
				if (destList.options[count] != null) {
					if (srcList.options[i].text == destList.options[count].text) {
						found = true;
						break;
					}
				}
			}
			if (found != true) {
				destList.options[len] = new Option(srcList.options[i].text, srcList.options[i].value);
				len++;
			}
    }
  }
}

function deleteFromDestList(valt)
{
	var destList = document.getElementById("destList"+valt);
	var len = destList.options.length;
	for(var i = (len-1); i >= 0; i--)
	{
		if ((destList.options[i] != null) && (destList.options[i].selected == true)) {
			destList.options[i] = null;
		}
  }
}

function searchSelectBox(in_sFormName, in_sInputName, in_sSelectName)
{
	sSearchString = document.forms[in_sFormName].elements[in_sInputName].value.toUpperCase();
	iSearchTextLength = sSearchString.length;
	for (j=0; j < document.forms[in_sFormName].elements[in_sSelectName].options.length; j++)
	{
		sOptionText = document.forms[in_sFormName].elements[in_sSelectName].options[j].text;
		sOptionComp = sOptionText.substr(0, iSearchTextLength).toUpperCase();
		if(sSearchString == sOptionComp) {
			document.forms[in_sFormName].elements[in_sSelectName].selectedIndex = j;
			break;
		}
	}
}

function SelectAll(f)
{
  for(var j = 0; j < 7; j++)
  {
    if (document.getElementById('destList'+j)) {
      var s = f.elements['destList'+j+'[]'];
      for(var i = 0; i < s.options.length; i++)
      {
        s.options[i].selected = true;
      }
    }
  }
  return true;
}

function show_vids(all,act)
{
	for (i = 1; i <= all; i++){
		var viddiv = document.getElementById('vids_'+i);
		if (i == act) {
			if (viddiv.style.display == 'none') {
				viddiv.style.display = '';
			} else {
				viddiv.style.display = 'none';
			}
		} else {
			viddiv.style.display = 'none';
		}
	}
	
	
}

var checkflag = "false";
function doNow()
{
  d=document;
  el=d.getElementsByTagName('INPUT');
  if (checkflag == "false") {
    for(i = 0; i < el.length; i++)
    {
      if (el[i].disabled == 0) el[i].checked = 1;
    }
    checkflag = "true";
  }
  else {
    for(i = 0; i < el.length; i++)
    {
      el[i].checked = 0;
    }
    checkflag = "false";
  }
}
