//writes needed hidden form inputs to work with Google CSE
/*set hidden to text for debugging*/


function toggleCSE() {

if (document.getElementById("cx") == null) {
var inputCX = document.createElement("input");
inputCX.setAttribute("type", "hidden"); 
inputCX.setAttribute("name", "cx");
inputCX.setAttribute("id", "cx");
inputCX.setAttribute("value", "009970132313812636067:myo01bpcdws");
}

if (document.getElementById("cof") == null) {
var inputCOF = document.createElement("input");
inputCOF.setAttribute("type", "hidden"); 
inputCOF.setAttribute("name", "cof");
inputCOF.setAttribute("id", "cof");
inputCOF.setAttribute("value", "FORID:11");
}

document.getElementById("searchForm").appendChild(inputCX);
document.getElementById("searchForm").appendChild(inputCOF);

//if search emory inputs exist, delete them... 
if (document.getElementById('output')) {
	
  var element = document.getElementById('output');
  element.parentNode.removeChild(element);
}
if (document.getElementById('client')) {
	
  var element = document.getElementById('client');
  element.parentNode.removeChild(element);
}
if (document.getElementById('proxystylesheet')) {
	
  var element = document.getElementById('proxystylesheet');
  element.parentNode.removeChild(element);
}
if (document.getElementById('site')) {
	
  var element = document.getElementById('site');
  element.parentNode.removeChild(element);
}

}

//remove inputClient, inputProxy, inputSite, inputOutput

function toggleEmory() {
	//write the inputs needed for default emory search
	
if (document.getElementById("client") == null) {
	var inputClient = document.createElement("input");
	inputClient.setAttribute("type","hidden");
	inputClient.setAttribute("name","client");
	inputClient.setAttribute("id","client");
	inputClient.setAttribute("value","default_frontend");
}
	//
if (document.getElementById("proxystylesheet") == null) {
	var inputProxy = document.createElement("input");
	inputProxy.setAttribute("type","hidden");
	inputProxy.setAttribute("name","proxystylesheet");
	inputProxy.setAttribute("id","proxystylesheet");
	inputProxy.setAttribute("value","homepage");
}
	//
if (document.getElementById("site") == null) {
	var inputSite = document.createElement("input");
	inputSite.setAttribute("type","hidden");
	inputSite.setAttribute("name","site");
	inputSite.setAttribute("id","site");
	inputSite.setAttribute("value","default_collection");
}

if (document.getElementById("output") == null) {
	
	var inputOutput = document.createElement("input");
	inputOutput.setAttribute("type","hidden");
	inputOutput.setAttribute("name","output");
	inputOutput.setAttribute("id","output");
	inputOutput.setAttribute("value","xml_no_dtd");
}
	
	document.getElementById("searchForm").appendChild(inputClient);
	document.getElementById("searchForm").appendChild(inputProxy);
	document.getElementById("searchForm").appendChild(inputSite);
	document.getElementById("searchForm").appendChild(inputOutput);
	

//removeChild('searchForm', 'cof');
//removeChild('searchForm', 'cx');

	//REMOVE inputCX; inputCOF
if (document.getElementById('cx')) {
  var element = document.getElementById('cx');
  element.parentNode.removeChild(element);
}
	
if (document.getElementById('cof')) {
  var element = document.getElementById('cof');
  element.parentNode.removeChild(element);
	}
}


function togglePeople() {
	//MAKE SURE THESE EXIST FIRST! OTHERWISE IT CREATES DUPLICATES
}
	
