function select(s)
    {
    	//alert(s);
	var theTab=parseInt(document.theForm.tab.value);
	document.theForm.elements[theTab].value=document.theForm.elements[theTab].value+
	","+s;
	document.theForm.submit();	
    }
    function setTab(t)
    {
    	//alert(s);
    	document.theForm.tab.value=t;
    	document.theForm.submit();	
    }

  function propertyNotHere(text)
  {
	    
         var features = 
    'toolbar=no,location=no,directories=no,status=no,menubar=no,' +
    'scrollbars=yes,resizable=yes,width=450,height=400' ;
    //var submitPage="submit.html";
	//alert(submitPage);
 //newPage="";
 submitWindow = window.open('submitPage.html','',features);
 //submitWindow.focus();
   }

function defKeyword(text)
{
 var features = 
    'toolbar=no,location=no,directories=no,status=no,menubar=no,' +
    'scrollbars=yes,resizable=no,width=400,height=400' ;
    //var submitPage="submit.html";
	//alert(submitPage);
 newPage='defineKeyword.php?keyword='+text;
 defWindow = window.open(newPage,'',features);
 //defWindow.focus();

}

var helpOn = false;

function toggleHelp ( )
{
	helpOn = true;
	helpCursorsOn();	
}

function helpCursorsOn ( )
{
	var collection = document.getElementsByTagName("a");
	
	for (var i = 0; i < collection.length; i++)
	{
		if (collection[i].getAttribute("className") == "keyword")
		{
			collection[i].setAttribute("className","keyword helpActive");
		}
		if (collection[i].getAttribute("className") == "keywordChosen")
		{
			collection[i].setAttribute("className","keywordChosen helpActive");
		}
	}
}

function helpCursorsOff ( )
{
	var collection = document.getElementsByTagName("a");
	
	for (var i = 0; i < collection.length; i++)
	{
		if (collection[i].getAttribute("className") == "keyword helpActive")
		{
			collection[i].setAttribute("className","keyword");
		}
		if (collection[i].getAttribute("className") == "keywordChosen helpActive")
		{
			collection[i].setAttribute("className","keywordChosen");
		}
	}
}

function doKeywordClick ( keywordID, keywords, group )
{
	if (helpOn == true)
	{
		defKeyword(keywordID);
		helpOn = false;
		helpCursorsOff();
	}
	else
	{
		var selectorURL = 'selector.php?group=' + group + '&action=add&keywordID=' + keywordID + '&keywords=' + keywords;
		window.location = selectorURL;
	}
}

function doRemoveKeyword ( keywordID, keywords, group )
{
	if (helpOn == true)
	{
		defKeyword(keywordID);
		helpOn = false;
		helpCursorsOff();
	}
	else
	{
		var selectorURL = 'selector.php?group=' + group + '&action=remove&keywordID=' + keywordID + '&keywords=' + keywords;
		window.location = selectorURL;
	}
}

