function vNav_onmouseover(cObj)
{
    cObj.background="images/nav_h.gif";
}
function vNav_onmouseout(cObj)
{
    cObj.background="images/bkg_navblank.gif";
}
function pagerefresh(ptarget,url)
{
	ptarget.location.replace(url);
	//target.location.href= url;

}
function pageloadnew(ptarget,url)
{
	//alert(document.history(0));
	//target.location.replace(url);
	//alert(ptarget);
    //alert(url);
	if(ptarget=='' || ptarget==null )
		ptarget='_top';
		
	window.open(url,ptarget);
}
function pageloadnewMod(obj)
{
	var path=document.getElementById('path').value;
	var folder = document.getElementById('cfolder');
	
	if(obj.isReset ==1 || obj.isReset ==true)
	{
		path=obj.targetPg;	
		folder.value =obj.targetPg;
	}
	else
	{
		if(path==null || path=='')
			path=obj.targetPg;
		else
			path=path + "/" + obj.targetPg;
	}	
	document.getElementById('path').value=path;
	self.data.submit();
}
function submitEditPage(obj)
{
	var course = document.getElementById('course');
	course.value = obj.targetPg;
	self.data.submit();
}
function addtoSelection(destination,source,toTop)
{
	var index;
	//alert(source.value);
	if(source.value==null || source.value=="")
		return 0;
		
	if(toTop ==true)
	{
		index=0;
	}
	else
	{
		index =destination.options.length;
	}	
	//alert('here');
	destination.options[index]= new Option(source.value,source.value,true);

}

function editCell (cell) {
  if (document.all) {
    cell.innerHTML =
      '<INPUT class=custom3 ' +
      ' ID="editCell"' +
      ' ONCLICK="event.cancelBubble = true;"' +
      ' ONCHANGE="setCell(this.parentElement, this.value)" ' +
      ' ONBLUR="setCell(this.parentElement, this.value)" ' +
      ' VALUE="' + cell.innerText + '"' +
      ' SIZE="' + cell.innerText.length + '"' +
      '>';
    document.all.editCell.focus();
    document.all.editCell.select();
  }
  else if (document.getElementById) {
    cell.normalize();
    var input = document.createElement('INPUT');
    input.setAttribute('value', cell.firstChild.nodeValue);
    input.setAttribute('size', cell.firstChild.nodeValue.length);
    input.onchange = function (evt) { setCell(this.parentNode,
this.value); };
    input.onclick = function (evt) {
      evt.cancelBubble = true;
      if (evt.stopPropagation)
        evt.stopPropagation();
    };
    cell.replaceChild(input, cell.firstChild);
    input.focus();
    input.select();
  }

}
function setCell (cell, value) {
  if (document.all)
    cell.innerText = ' ' +value;
  else if (document.getElementById)
    cell.replaceChild(document.createTextNode(value), cell.firstChild);
}

function DoSave(action)
{
	var dowhat = document.getElementById('action');
	if(action=='SAVE_M')
	{		
		dowhat.value =action;
		self.data.target ="POSTTO";
		self.data.submit();		
	}	
	return 1;
}
function PostDoSave()
{
	var dowhat = document.getElementById('action');
	dowhat.value="mmmmm";
}
