function setStyle(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

 function setCSS() {
 cssToUse = window.location.search.substr(1).split('&'); 
 cssToUse = cssToUse[0].substr(4); 
 if (cssToUse != "") { 
    setStyle(cssToUse);
 } else { 
    setStyle("default");
   }  
 } 

function callSearch() {
  var AdvQueryText;
  var QueryText;
  QueryText = document.s_form.QueryText.value;
  //document.s_form.AdvQueryText.value = document.s_form.QueryText.value;
  //document.s_form.action = "http://nindssearch.ninds.nih.gov/verity_web/templates/jsp/pages/search/public_graphical_internal_advanced.jsp";document.s_form.submit();
  document.s_form.action = "http://nindssearch.ninds.nih.gov/PublicSearch/index.jsp";document.s_form.submit();
}

function SearchFunding( form )
    {
	// Funding type is All Announcements
	if (form.funding_type[0].checked) 
	 { 
	 if (form.funding_date[0].checked)
	   { self.location = "allnew.htm";}
	 if (form.funding_date[1].checked)
	   { self.location = "allcurrent.htm";}
	 if (form.funding_date[2].checked)
	   { self.location = "archivedall.htm";}
     }
	 
	// Funding type is Notices	
	if (form.funding_type[1].checked) 
	 { 
	 if (form.funding_date[0].checked)
	   { self.location = "newNot.htm";}
	 if (form.funding_date[1].checked)
	   { self.location = "NOTICE_all.htm";}
	 if (form.funding_date[2].checked)
	   { self.location = "archivednot_all.htm";}
     }
	 
	// Funding type is PAs
	if (form.funding_type[2].checked) 
	 { 
	 if (form.funding_date[0].checked)
	   { self.location = "newpa.htm";}	 
	 if (form.funding_date[1].checked)
	   { self.location = "PA_all.htm";}
	 if (form.funding_date[2].checked)
	   { self.location = "archivedpa_all.htm";}

     }
	 
	// Funding type is RFPs
	if (form.funding_type[3].checked) 
	 { 
	 if (form.funding_date[0].checked)
	   { self.location = "newrfp.htm";}	 
	 if (form.funding_date[1].checked)
	   { self.location = "RFP_all.htm";}
	 if (form.funding_date[2].checked)
	   { self.location = "archivedrfp_all.htm";}

     }
	 
	// Funding type is RFAs
	if (form.funding_type[4].checked) 
	 { 
	 if (form.funding_date[0].checked)
	   { self.location = "newRfa.htm";}
	 if (form.funding_date[1].checked)
	   { self.location = "RFA_all.htm";}
	 if (form.funding_date[2].checked)
	   { self.location = "archivedrfa_all.htm";}
     }
	 
	// Funding type is Supplements
	if (form.funding_type[5].checked) 
	 { 
	 if (form.funding_date[0].checked)
	   { self.location = "newsup.htm";}
	 if (form.funding_date[1].checked)
	   { self.location = "supplements.htm";}
	 if (form.funding_date[2].checked)
	   { self.location = "archivedsup_all.htm";}
     }
    return false;
    }


setCSS();

