

function search_NIH(){


var userInput = document.getElementById('searchTerm').value;

var radios = document.getElementsByName("Specialization");
var rad;
 for (var i = 0; i < radios.length; i++) {
         if (radios[i].checked) {
             rad = radios[i].value;
                  break;
            }
           }
var criteria = getURL(rad, userInput);
document.getElementById("searchTerm").value = '';
if (userInput != '' && criteria != '')
window.open("http://ncbi.nlm.nih.gov/pmc/?term="  + criteria);

 

}


function search_UTD(){

var userInput = document.getElementById('info').value;


var site = getURL_Info(userInput);
if (site != "")
window.open(site);

else{
	var myWindow = window.open("","MsgWindow",'top=200, left=500, width=450, height=350');
	myWindow.document.write('<p align="center"><strong>Something went wrong! Your search criteria does not match!</strong><br /></p><p align="center">Searchable Terms include:<br />telehealth<br />chf<br />copd<br />pneuomonia<br />mi<br />dm<br />uti<br />wound<br />mental status changes<br />debility<br />falls<br />asthma</p>');
	
}

document.getElementById("info").value = '';
}
function getURL_Info(userInput){

userInput = userInput.toLowerCase();
 site ="";

		 if (userInput =="telehealth")
    			site = "http://www.longtermcarelink.net/eldercare/home_telehealth.htm";
    		
    		else if (userInput =="chf")
    			site = "http://www.uptodate.com/patients/contents/search?search=CHF&sp=3&x=22&y=14";
    		
    		else if (userInput =="copd")
    			site = "http://www.uptodate.com/patients/contents/search?search=COPD&sp=3&x=18&y=11";
    		
    		else if (userInput =="pneuomonia")
    			site = "http://www.uptodate.com/patients/contents/search?search=Pneumonia&sp=3&x=18&y=19";
    		
    		else if (userInput =="mi")
    			site = "http://www.uptodate.com/patients/contents/search?search=myocardial+infarction&sp=3&x=0&y=0";
    		
    		else if (userInput =="dm")
    			site = "http://www.uptodate.com/patients/contents/search?search=diabetes&sp=3&x=19&y=10";
    		
    		else if (userInput =="uti")
    			site = "http://www.uptodate.com/patients/contents/search?search=uti&sp=3&x=0&y=0";
    		
    		else if (userInput =="wound")
    			site = "http://www.webmd.com/skin-problems-and-treatments/tc/pressure-sores-topic-overview";
    		
    		else if (userInput =="mental status changes")
    			site = "http://www.uptodate.com/patients/contents/search?search=mental+status&sp=3&x=21&y=17";
    		
    		else if (userInput =="debility")
    			site = "http://www.webmd.com/a-to-z-guides/weakness-and-fatigue-topic-overview";
    		
    		else if (userInput =="falls")
    			site = "http://www.webmd.com/osteoporosis/guide/fall-prevention-strategies";
    		
    		else if (userInput =="asthma")
    			site = "http://www.uptodate.com/patients/contents/search?search=ASTHMA&sp=3&x=24&y=15";
   
	return site;
	
}




function getURL(rad, userInput){

rad = rad.toUpperCase();
userInput = userInput.toLowerCase();
	if (rad == " OTHER " || rad == " NURSING ")
    		{
        		if( userInput == "telehealth")
        			criteria = "HOME+TELEHEALTH+AND+RCT";
        		
        		else if (userInput == "chf")
        			criteria = "HOME+CARE+AND+CHF+AND+RCT";
        		
        		else if (userInput == "copd")
        			criteria = "COPD+AND+RCT+AND+HOME+CARE";
        		
        		else if (userInput =="pneuomonia")
        			criteria = "PNEUMONIA+AND+HOME+CARE+AND+HOSPITALIZATION+AND+RCT";
        		
        		else if (userInput == "mi")
        			criteria = "MYOCARDIAL+INFARCTION+AFTER+CARE+AND+HOME+HEALTH+NURSE+AND+RCT";
        		
        		else if (userInput == "dm")
        			criteria = "HOME+CARE+NURSE+AND+DIABETES+MELLITUS+AND+RCT";
        		
        		else if (userInput =="uti")
        			criteria = "URINARY+TRACT+INFECTION+AND+RCT+AND+HOME+CARE";
        		
        		else if (userInput =="wound")
        			criteria = "HOME+CARE+AND+WOUND+AND+RCT";
        		
        		else if (userInput =="mental status changes")
        			criteria = "ACUTE+CONFUSION+AND+HOME+CARE+AND+RCT";
        		
        		else if (userInput == "debility")
        			criteria = "HOME+NURSING+AND+ADL+FUNCTIONING+AND+RCT";
        		
        		else if (userInput =="falls")
        			criteria = "HOME+HEALTH+NURSING+AND+FALL+PREVENTION+AND+RCT";
        		
        		else if (userInput == "asthma")
        			criteria = "ASTHMA+AND+HOME+CARE+AND+RCT+AND+NURSING";
			else {
			var myWindow = window.open("","MsgWindow",'top=200, left=500, width=500, height=350');
			myWindow.document.write('<p align="center"><strong>Something went wrong! Your search criteria does not match!</strong><br /></p><p align="center">Searchable Terms include:<br />telehealth<br />chf<br />copd<br />pneuomonia<br />mi<br />dm<br />uti<br />wound<br />mental status changes<br />debility<br />falls<br />asthma</p>');
			criteria = '';
				}
        		
        	}
		else if ( rad == " PHYSICAL THERAPY " )
			{
			
			if	(userInput == "telehealth")
        			criteria = "HOME+TELEHEALTH+AND+RCT";
        		
        		else if (userInput == "chf")
        			criteria = "PHYSICAL+THERAPY+OR+OCCUPATIONAL+THERAPY+OR+REHABILITATION+AND+CHF+AND+RCT";
        		
        		else if (userInput == "copd")
        			criteria = "HOME+CARE+AND+PHYSICAL+THERAPY+OR+OCCUPATIONAL+THERAPY+OR+REHABILITATION+AND+COPD+AND+RCT+AND+METANALYSIS";
        		
        		else if (userInput == "pneuomonia")
        			criteria = "HOME+CARE+AND+PHYSICAL+THERAPY+OR+OCCUPATIONAL+THERAPY+OR+REHABILITATION+AND+PNEUMONIA+AND+RCT+AND+SYSTEMATIC+REVIEW";
        		
        		else if (userInput == "mi")
        			criteria = "MYOCARDIAL+INFARCTION+AND+HOME+BASED+REHABILITATION+AND+RCT";
        		
        		else if (userInput == "dm")
        			criteria = "HOME+CARE+AND+PHYSICAL+THERAPY+OR+OCCUPATIONAL+THERAPY+AND+DIABETES+MELLITUS+AND+RCT";
        		
        		else if (userInput == "uti")
        			criteria = "URINARY+TRACT+INFECTION+AND+RCT+AND+HOME+CARE";
        		
        		else if (userInput == "wound")
        			criteria = "WOUND+CARE+AND+HOME+CARE+AND+RCT+AND+PHYSICAL+THERAPY";
        		
        		else if (userInput == "mental status changes")
        			criteria = "ACUTE+CONFUSION+AND+HOME+CARE+AND+RCT";
        		
        		else if (userInput == "debility")
        			criteria = "HOME+CARE+AND+ADL+FUNCTION+AND+RCT";
        		
        		else if (userInput == "falls")
        			criteria = "PHYSICAL+THERAPY+AND+FALL+PREVENTION+AND+RCT";
        		
        		else if (userInput == "asthma")
        			criteria = "ASTHMA+AND+HOME+CARE+AND+RCT+AND+REHABILITATION";
			else {
			var myWindow = window.open("","MsgWindow",'top=200, left=500, width=450, height=350');
			myWindow.document.write('<p align="center"><strong>Something went wrong! Your search criteria does not match!</strong><br /></p><p align="center">Searchable Terms include:<br />telehealth<br />chf<br />copd<br />pneuomonia<br />mi<br />dm<br />uti<br />wound<br />mental status changes<br />debility<br />falls<br />asthma</p>');
			criteria = '';
				}
        	}
			
		else if ( rad == " OCCUPATIONAL THERAPY " )
			{
			
			if(userInput == "telehealth")
			
        			criteria = "HOME+TELEHEALTH+AND+RCT";
        		
        		else if (userInput == "chf")
        			criteria = "PHYSICALTHERAPY+OR+OCCUPATIONAL+THERAPY+OR+REHABILITATION+AND+CHF+AND+RCT";
        		
        		else if (userInput == "copd")
        			criteria = "HOME+CARE+AND+PHYSICAL+THERAPY+OR+OCCUPATIONAL+THERAPY+OR+REHABILITATION+AND+COPD+AND+RCT+AND+METANALYSIS";
        		
        		else if (userInput == "pneuomonia")
        			criteria = "HOME+CARE+AND+PHYSICAL+THERAPY+OR+OCCUPATIONAL+THERAPY+OR+REHABILITATION+AND+PNEUMONIA+AND+RCT+AND+SYSTEMATIC+REVIEW";
        		
        		else if (userInput == "mi")
        			criteria = "MYOCARDIAL+INFARCTION+AND+HOME+BASED+REHABILITATION+AND+RCT";
        		
        		else if (userInput == "dm")
        			criteria = "HOME+CARE+AND+PHYSICAL+THERAPY+OR+OCCUPATIONAL+THERAPY+AND+DIABETES+MELLITUS+AND+RCT";
        		
        		else if (userInput == "uti")
        			criteria = "URINARY+TRACT+INFECTION+AND+RCT+AND+HOME+CARE";
        		
        		else if (userInput == "wound")
        			criteria = "HOME+CARE+AND+WOUND+AND+RCT";
        		
        		else if (userInput == "mental status changes")
        			criteria = "ACUTE+CONFUSION+AND+HOME+CARE+AND+RCT";
        		
        		else if (userInput == "debility")
        			criteria = "HOME+CARE+AND+ADL+FUNCTION+AND+RCT";
        		
        		else if (userInput == "falls")
        			criteria = "OCCUPATIONAL+THERAPY+AND+FALL+PREVENTION+AND+RCT";
        		
        		else if (userInput == "asthma")
        			criteria = "ASTHMA+AND+HOME+CARE+AND+RCT+AND+REHABILITATION";
					else {
			var myWindow = window.open("","MsgWindow",'top=200, left=500, width=450, height=350');
			myWindow.document.write('<p align="center"><strong>Something went wrong! Your search criteria does not match!</strong><br /></p><p align="center">Searchable Terms include:<br />telehealth<br />chf<br />copd<br />pneuomonia<br />mi<br />dm<br />uti<br />wound<br />mental status changes<br />debility<br />falls<br />asthma</p>');
			criteria = '';
				}
        		
			}
			
		else if (rad == " SPEECH LANGUAGE PATHOLOGY ")
    		{
        		if(userInput == "telehealth")
        			criteria = "HOME+TELEHEALTH+AND+RCT";
        		
        		else if (userInput == "chf")
        			criteria = "SPEECH+THERAPY+OR+REHABILITATION+AND+CHF+AND+RCT";
        		
        		else if (userInput == "copd")
        			criteria = "SPEECH+THERAPY+OR+ORAL+REHAB+AND+PULMONARY+DISEASE+AND+RCT";
        		
        		else if (userInput == "pneuomonia")
        			criteria = "SPEECH+LANGUAGE+PATHOLOGY+OR+SPEECH+THERAPY+AND+ASPIRATION+PNEUMONIA+OR+DYSPHAGIA+AND+RCT";
        		
        		else if (userInput == "mi")
        			criteria = "MYOCARDIAL+INFARCTION+AND+HOME+BASED+REHABILITATION+AND+RCT";
        		
        		else if (userInput == "dm" )
        			criteria = "HOME+CARE+SPEECH+THERAPY+AND+DIABETES+MELLITUS+AND+RCT";
        		
        		else if (userInput == "uti")
        			criteria = "URINARY+TRACT+INFECTION+AND+RCT+AND+HOME+CARE";
        		
        		else if (userInput == "wound")
        			criteria = "HOME+CARE+AND+WOUND+AND+RCT";
        		
        		else if (userInput == "mental status changes")
        			criteria = "ACUTE+CONFUSION+AND+HOME+CARE+AND+RCT";
        		
        		else if (userInput == "debility")
        			criteria = "HOME+CARE+AND+ADL+FUNCTION+AND+RCT";
        		
        		else if (userInput == "falls")
        			criteria = "COGNITION+AND+FALL+PREVENTION+AND+RCT";
        		
        		else if (userInput == "asthma")
        			criteria = "ASTHMA+AND+HOME+CARE+AND+RCT+AND+REHABILITATION";	
			else {
			var myWindow = window.open("","MsgWindow",'top=200, left=500, width=450, height=350');
			myWindow.document.write('<p align="center"><strong>Something went wrong! Your search criteria does not match!</strong><br /></p><p align="center">Searchable Terms include:<br />telehealth<br />chf<br />copd<br />pneuomonia<br />mi<br />dm<br />uti<br />wound<br />mental status changes<br />debility<br />falls<br />asthma</p>');
			criteria = '';
				}
			
			}
				
			
return criteria;




}