// JavaScript Document
	subNavList = function(){
		if(document.all && document.getElementById){
			var navRoot = document.getElementById("nav-ul");
			var navLen = navRoot.childNodes.length;
			for(i=0;i<navLen;i++){
				var node = navRoot.childNodes[i];
				if(node.nodeName == "LI"){
					node.onmouseover = function(){
						this.className += " over";
					}
					node.onmouseout = function(){
						this.className = this.className.replace(" over","");
					}
				}
			}
		}
	}
	window.onload = subNavList;
	
	
	function createLabel(str){
  	var label=document.createElement("label");
	label.innerHTML=str;
	return label;
}
function createTextbox(id){
  	var textbox = document.createElement("input");
	textbox.id=id;
	return textbox;
}
function createTextarea(id){
  	var textarea = document.createElement("textarea");
	textarea.id=id;
	return textarea;
}

function createDropdown(id){
  	var dropdown = document.createElement("select");
	dropdown.id=id;
	dropdown.options[0] = new Option("French","French")
	dropdown.options[1] = new Option("Spanish","Spanish")
	dropdown.options[2] = new Option("Italian","Italian")
	dropdown.options[3] = new Option("Chinese","Chinese")
	return dropdown;
}

//heard about us dropdown mod
function createHearUsDropdown(id){
  	var dropdown = document.createElement("select");
	dropdown.id=id;	
//	dropdown.onchange="swapOptions(window.document.the_form.choose_category.options[selectedIndex].text);";

	dropdown.options[0] = new Option("Artsy-Smartsy","Artsy-Smartsy")
	dropdown.options[1] = new Option("Baristanet.com","Baristanet.com")
	dropdown.options[2] = new Option("Big Apple, LI, or Queens Family","Big Apple, LI, or Queens Family")
	dropdown.options[3] = new Option("Citibabes","Citibabes")
	dropdown.options[4] = new Option("Family (NJ)","Family (NJ)")
	dropdown.options[5] = new Option("GoCityKids.com","GoCityKids.com")
	dropdown.options[6] = new Option("Google Search","Google Search")
	dropdown.options[7] = new Option("GoToMontclair.com","GoToMontclair.com")
	dropdown.options[8] = new Option("I Walked or Drove By","I Walked or Drove By")
	dropdown.options[9] = new Option("In an Article","In an Article")
	dropdown.options[10] = new Option("Kids Directory","Kids Directory")
	dropdown.options[11] = new Option("Learn4Good","Learn4Good")
	dropdown.options[12] = new Option("LIKidsDirectory.com","LIKidsDirectory.com")
	dropdown.options[13] = new Option("LIParentSource.com","LIParentSource.com")
	dropdown.options[14] = new Option("MeetUp.com","MeetUp.com")
	dropdown.options[15] = new Option("MommyAndMe.com","MommyAndMe.com")
	dropdown.options[16] = new Option("NJFamily.com","NJFamily.com")
	dropdown.options[17] = new Option("NJKidsDirectory.com","NJKidsDirectory.com")
	dropdown.options[18] = new Option("NYFamily.com","NYFamily.com")
	dropdown.options[19] = new Option("NY Family Magazine","NY Family Magazine")
	dropdown.options[20] = new Option("NewYorkLearningGuide.com","NewYorkLearningGuide.com")
	dropdown.options[21] = new Option("NYMetroParents.com","NYMetroParents.com")
	dropdown.options[22] = new Option("Parent Guide","Parent Guide")
	dropdown.options[23] = new Option("ParentGuideNews.com","ParentGuideNews.com")
	dropdown.options[24] = new Option("ParentsKnow.com","ParentsKnow.com")
	dropdown.options[25] = new Option("Parent Paper","Parent Paper")
	dropdown.options[26] = new Option("ProfessorToto.com","ProfessorToto.com")
	dropdown.options[27] = new Option("Suburban Essex or Vicinity Mag","Suburban Essex or Vicinity Mag")
	dropdown.options[28] = new Option("SuzySaid.com","SuzySaid.com")
	dropdown.options[29] = new Option("Someone Told Me","Someone Told Me")
	dropdown.options[30] = new Option("Westchester Parent","Westchester Parent")
	dropdown.options[31] = new Option("WorldLearningGuide.com","WorldLearningGuide.com")
	dropdown.options[32] = new Option("Yahoo Search","Yahoo Search")
	dropdown.options[33] = new Option("Other","Other")
	
	return dropdown;
}

/* from laura's work on july 6 trying to get another drop down going with more specific options-
TO BE CONTINUED!!!
//specifically how did you hear about us
function createHearUs2Dropdown(id){
  	var dropdown = document.createElement("select");
	dropdown.id=id;	
	dropdown.name=the_examples;
	
	dropdown.options[0] = new Option("Please select","select")
	dropdown.options[1] = new Option("In Print","inprint")
	dropdown.options[2] = new Option("Another Way","anotherway")
}

//from web monkey- this is the function that gets called when the drop down menu is changed.
 function swapOptions(the_array_name)
 {
   var numbers_select = window.document.the_form.the_examples;
   var the_array = eval(the_array_name);
   setOptionText(window.document.the_form.the_examples, the_array);
 }
 //webmonkey- this is the function that loops out the old selections and loops in the updated selections
 function setOptionText(the_select, the_array)
 {
   for (loop=0; loop < the_select.options.length; loop++)
   {
     the_select.options[loop].text = the_array[loop];
   }
 }

*/

function ClearInput(value, id){ // This calls our function ClearInput, and the two variables we will need for it to function the original value and the id.
	var input = document.getElementById(id); // Gets the input field based on its id.
	if(value == input.value){ // If the default value is equal to the current value.
			input.value = ''; // Empty It.
	}
	else{ // Else the value is not equal to the current input field value.
			input.value = input.value; // Leave it the same.
	} // End Else.
	input.style.backgroundImage = 'url()';
} // Close Function.
		
    
function FactoryXMLHttpRequest(){
	  if(window.XMLHttpRequest){
		  return new XMLHttpRequest();
	  }else if(window.ActiveXObject){
		  var msxmls = new Array(
				'Msxml2.XMLHTTP.5.0',
				'Msxml2.XMLHTTP.4.0',
				'Msxml2.XMLHTTP.3.0',
				'Msxml2.XMLHTTP',
				'Microsoft.XMLHTTP'
		  );
		  for(var i=0;i<msxmls.length;i++){
			  try{
				  return new ActiveXObject(msxmls[i]);
			  }catch(e){
			  }
		  }
	  }
	  throw new Error("Could not instantiate XMLHttpRequest");
}
function trim(s)
{
    try
    {
        return s.replace(/^\s+|\s+$/g,"");
    }
    catch(e)
    {
        return s;
    }
}