<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs 
	title="National Science Digital Library" 
	title_url="http://nsdl.org/?app=googlegadget"
	description="Search for high quality science resources at NSDL, the Nation's online library for education and research in
Science, Technology, Engineering, and Mathematics.  Funded by the National Science Foundation."
	category="tools" 
    scrolling="false"
	author="S Clark"
	author_email="sclark+coolgadget@ucar.edu" 
	author_location="Colorado, USA"
	author_affiliation="National Science Digital Library"
	screenshot="http://nsdl.org/gadget/nsdl_screenshot.jpg"
	thumbnail="http://nsdl.org/gadget/nsdl_thumb.jpg" 
	height="150" >
	<Require feature="dynamic-height"/>
	<Require feature="com.google.gadgets.analytics" />
	<MayRequire type="browser" value="firefox" min_version="1.06"/>
</ModulePrefs>
<UserPref name="mynum" display_name="Number of Results to Display" default_value="10" datatype="enum" >
   <EnumValue value="10" />
   <EnumValue value="20" />
   <EnumValue value="50" />
</UserPref> 
<UserPref name="expandAud" display_name="Always Expand Audience?" default_value="10" datatype="bool" ></UserPref> 
<UserPref name="expandGradeLevel" display_name="Always Expand Grade Level?" default_value="10" datatype="bool" ></UserPref> 
<UserPref name="expandResourceFormat" display_name="Always Expand Resource Format?" default_value="10" datatype="bool" ></UserPref>
<UserPref name="expandSubject" display_name="Always Expand Subject?" default_value="10" datatype="bool" ></UserPref> 
<UserPref name="expandPW" display_name="Always Expand Pathways?" default_value="10" datatype="bool" ></UserPref> 
   <Content type="html">
     <![CDATA[
<style type="text/css">
<!--//
#nsdl_submit {
    background-color: #96A800;
    color: #FFFFFF
}
img {
    border: none;
}
#q {
    width:99%;
}
.nsdl_options {
    font-size: 12px;
    width: 99%;
    border: none;
    padding: 2px;
}
#nsdl_audience_values, #nsdl_gradelevel_values, #nsdl_resourceformat_values, #nsdl_subject_values, #nsdl_pathway_values {
    background-color: #FEECBC;
    padding-bottom: 10px;
    font-size: 12px;
}
.nsdl_options_header {
    background-color: #FFE085;
    text-align: left;
    font-weight: bold;
    font-size: 12px;
    margin-top: 2px;
}
#show_link {
	font-size: 12px;
}
#hide_link {
	font-size: 12px;
}
.hidden {
	display:none;
}
#help_dialog {
	font-size: 12px;
}

label {
	margin-bottom: -10px;
}
h1{
	font-size: 12px;
}
.image_link:hover {
	cursor: help;
}
#searchStatus {
	
	margin-top:5px;
	margin-bottom:5px;
}
#nsdl_audience_values_link, #nsdl_pathway_values_link, #nsdl_subject_values_link, #nsdl_resourceformat_values_link,#nsdl_gradelevel_values_link {
	text-decoration: underline;
	color: blue;
}
//-->
</style>
<script type="text/JavaScript" language="JavaScript">
	// Track this gadget using Google Analytics.
    // Creates a tracking object and uses reportPageview method to call gadget view
      var ga = new _IG_GA("UA-6259953-2");
   	  ga.reportPageview('/view/searchGadget');
   
   // if they press enter key then search submit is recorded
   	function testkey(e){

		var evtobj=window.event? event : e //distinguish between IE's explicit event object (window.event) and Firefox's implicit.
		var unicode=evtobj.keyCode? evtobj.keyCode : evtobj.charCode
		
		if(unicode == 13){ 
			ga.reportPageview('/ui_click/keypress/search_submit/' + document.getElementById('q').value);
		}
	}
	document.onkeypress = testkey
   
   
   	var prefs = new _IG_Prefs();

	function getUserPrefs(myaudience,initDone){	
		if(initDone != 'false'){
			initDone = 'true';
		}
   		if(myaudience == 2){
   			_gel('audienceGroup').innerHTML = '<input type="checkbox" id="L4" name="grade[]" value="L4" onclick="recordAction(\'grade_level\',\'9-12\',\'L4\');"/><label for="L4">Grades 9-12</label><br /><input type="checkbox" id="L3" name="grade[]" value="L3" onclick="recordAction(\'grade_level\',\'6-8\',\'L3\');"/><label for="L3">Grades 6-8</label><br /><input type="checkbox" id="L2" name="grade[]" value="L2" onclick="recordAction(\'grade_level\',\'3-5\',\'L2\');"/><label for="L2">Grades 3-5</label><br /><input type="checkbox" id="L1" name="grade[]" value="L1" onclick="recordAction(\'grade_level\',\'prek-2\',\'L1\');"/><label for="L1">Grades preK-2</label>';
   			_gel("aud_notice").innerHTML = 'K-12 Search';
   			_gel('pathwaysGroup').innerHTML = '<input type="checkbox" name="pathway[]" id="pathway9" value="BEN" onclick="recordAction(\'pathway\',\'ben\',\'pathway9\');" /><label for="pathway9">BEN - Biological Sciences</label><br /><input type="checkbox" name="pathway[]" id="pathway10" value="CHEMED" onclick="recordAction(\'pathway\',\'chemed\',\'pathway10\');" /><label for="pathway10">ChemEd DL - Chemistry Resources</label><br /><input type="checkbox" name="pathway[]" id="pathway2" value="COMPADRE" onclick="recordAction(\'pathway\',\'compadre\',\'pathway2\');" /><label for="pathway2">comPADRE - Physics and Astronomy</label><br /><input type="checkbox" name="pathway[]" id="pathway3" value="CSERD" onclick="recordAction(\'pathway\',\'cserd\',\'pathway3\');" /><label for="pathway3">CSERD - Computational Science</label><br /><input type="checkbox" name="pathway[]" id="pathway19" value="DLESE" onclick="recordAction(\'pathway\',\'dlese\',\'pathway19\');" /><label for="pathway19">DLESE - Earth System Education</label><br /><input type="checkbox" name="pathway[]" id="pathway4" value="ENGINEERING" onclick="recordAction(\'pathway\',\'engineering\',\'pathway4\');" /><label for="pathway4">Engineering - Engineering Resources</label><br /><input type="checkbox" name="pathway[]" id="pathway7" value="MSP" onclick="recordAction(\'pathway\',\'msp2\',\'pathway7\');" /><label for="pathway7">MSP2 - Science and Math for Middle School Teachers</label><br /><input type="checkbox" name="pathway[]" id="pathway8" value="TEACHERDOMAIN" onclick="recordAction(\'pathway\',\'teachers_domain\',\'pathway8\');" /><label for="pathway8">Teachers\' Domain - Science for K-12 Teachers and Students</label>';
   			ga.reportPageview('/ui_click/select_audience/k-12');
   		} else if(myaudience == 4){
   			_gel('audienceGroup').innerHTML = '<input type="checkbox" id="L6" name="grade[]" value="L6" onclick="recordAction(\'grade_level\',\'graduate\',\'L6\');" /><label for="L6">Graduate</label><br /><input type="checkbox" id="L5" name="grade[]" value="L5" onclick="recordAction(\'grade_level\',\'college\',\'L5\');"  /><label for="L5">College</label><br />';
   			_gel("aud_notice").innerHTML = 'Higher Education and Research Search';
   			_gel('pathwaysGroup').innerHTML = '<input type="checkbox" name="pathway[]" id="pathway1" value="AMSER" onclick="recordAction(\'pathway\',\'amser\',\'pathway1\');" /><label for="pathway1">AMSER - Applied Math and Science for Community Colleges</label><br /><input type="checkbox" name="pathway[]" id="pathway9" value="BEN" onclick="recordAction(\'pathway\',\'ben\',\'pathway9\');" /><label for="pathway9">BEN - Biological Sciences</label><br /><input type="checkbox" name="pathway[]" id="pathway10" value="CHEMED" onclick="recordAction(\'pathway\',\'chemed\',\'pathway10\');" /><label for="pathway10">ChemEd DL - Chemistry Resources</label><br /><input type="checkbox" name="pathway[]" id="pathway2" value="COMPADRE" onclick="recordAction(\'pathway\',\'compadre\',\'pathway2\');" /><label for="pathway2">comPADRE - Physics and Astronomy</label><br /><input type="checkbox" name="pathway[]" id="pathway3" value="CSERD" onclick="recordAction(\'pathway\',\'cserd\',\'pathway3\');" /><label for="pathway3">CSERD - Computational Science</label><br /><input type="checkbox" name="pathway[]" id="pathway6" value="MATDL" onclick="recordAction(\'pathway\',\'matdl\',\'pathway6\');" /><label for="pathway6">MatDL - Materials Science for Higher Education</label><br/><input type="checkbox" name="pathway[]" id="pathway5" value="MATHDL" onclick="recordAction(\'pathway\',\'mathdl\',\'pathway5\');" /><label for="pathway5">MATHDL - Mathematics Resources</label><br /><input type="checkbox" name="pathway[]" id="pathway11" value="SMILE" /><label for="pathway11">SMILE - Informal Learning</label>';
   			ga.reportPageview('/ui_click/select_audience/higher_ed');
   		} else {
   			_gel('audienceGroup').innerHTML = '<input type="checkbox" id="L6" name="grade[]" value="L6" onclick="recordAction(\'grade_level\',\'graduate\',\'L6\');"  /><label for="L6">Graduate</label><br /><input type="checkbox" id="L5" name="grade[]" value="L5" onclick="recordAction(\'grade_level\',\'college\',\'L5\');"  /><label for="L5">College</label><br /><input type="checkbox" id="L4" name="grade[]" value="L4" onclick="recordAction(\'grade_level\',\'9-12\',\'L4\');"  /><label for="L4">Grades 9-12</label><br /><input type="checkbox" id="L3" name="grade[]" value="L3" onclick="recordAction(\'grade_level\',\'6-8\',\'L3\');" /><label for="L3">Grades 6-8</label><br /><input type="checkbox" id="L2" name="grade[]" value="L2" onclick="recordAction(\'grade_level\',\'3-5\',\'L2\');"  /><label for="L2">Grades 3-5</label><br /><input type="checkbox" id="L1" name="grade[]" value="L1" onclick="recordAction(\'grade_level\',\'prek-2\',\'L1\');"  /><label for="L1">Grades preK-2</label>';
   			_gel('pathwaysGroup').innerHTML = '<input type="checkbox" name="pathway[]" id="pathway1" value="AMSER" onclick="recordAction(\'pathway\',\'amser\',\'pathway1\');" /><label for="pathway1">AMSER - Applied Math and Science for Community Colleges</label><br /><input type="checkbox" name="pathway[]" id="pathway9" value="BEN" onclick="recordAction(\'pathway\',\'ben\',\'pathway9\');" /><label for="pathway9">BEN - Biological Sciences</label><br /><input type="checkbox" name="pathway[]" id="pathway10" value="CHEMED" onclick="recordAction(\'pathway\',\'chemed\',\'pathway10\');" /><label for="pathway10">ChemEd DL - Chemistry Resources</label><br /><input type="checkbox" name="pathway[]" id="pathway2" value="COMPADRE" onclick="recordAction(\'pathway\',\'compadre\',\'pathway2\');" /><label for="pathway2">comPADRE - Physics and Astronomy</label><br /><input type="checkbox" name="pathway[]" id="pathway3" value="CSERD" onclick="recordAction(\'pathway\',\'cserd\',\'pathway3\');" /><label for="pathway3">CSERD - Computational Science</label><br /><input type="checkbox" name="pathway[]" id="pathway19" value="DLESE" onclick="recordAction(\'pathway\',\'dlese\',\'pathway19\');" /><label for="pathway19">DLESE - Earth System Education</label><br /><input type="checkbox" name="pathway[]" id="pathway4" value="ENGINEERING" onclick="recordAction(\'pathway\',\'engineering\',\'pathway4\');" /><label for="pathway4">Engineering - Engineering Resources</label><br /><input type="checkbox" name="pathway[]" id="pathway6" value="MATDL" onclick="recordAction(\'pathway\',\'matdl\',\'pathway6\');" /><label for="pathway6">MatDL - Materials Science for Higher Education</label><br /><input type="checkbox" name="pathway[]" id="pathway5" value="MATHDL" onclick="recordAction(\'pathway\',\'mathdl\',\'pathway5\');" /><label for="pathway5">MATHDL - Mathematics Resources</label><br /><input type="checkbox" name="pathway[]" id="pathway7" value="MSP" onclick="recordAction(\'pathway\',\'msp2\',\'pathway7\');" /><label for="pathway7">MSP2 - Science and Math for Middle School Teachers</label><br /><input type="checkbox" name="pathway[]" id="pathway8" value="TEACHERDOMAIN" onclick="recordAction(\'pathway\',\'teachers_domain\',\'pathway8\');" /><label for="pathway8">Teachers\' Domain - K-12 Teachers and Students</label>';
   			
   			if(myaudience == 1){
   				_gel("aud_notice").innerHTML = 'General User Search';
   				if(initDone == 'true'){
   					ga.reportPageview('/ui_click/select_audience/General');
   				}
   			} else {
   				_gel("aud_notice").innerHTML = 'Specialized Search';
   				ga.reportPageview('/ui_click/select_audience/Specialized');
   			}	
   		}
   	}
   	function clickNSDLlogo(){
   		ga.reportPageview('/ui_click/click/logo_link');
   	}
   	function clickSubmit(){
   		ga.reportPageview('/ui_click/click/search_submit/' + document.getElementById('q').value);
   	  
   	}
   	function show(myDiv){
   		if(document.getElementById(myDiv).className == 'hidden'){
   			document.getElementById(myDiv).className = ''
   			document.getElementById(myDiv+'_link').innerHTML = 'Hide Options'
   			
   			ga.reportPageview('/ui_click/toggle/' + myDiv + '/show');
   	  		
   			_IG_AdjustIFrameHeight()
   		} else {
   			document.getElementById(myDiv).className = 'hidden'
   			document.getElementById(myDiv+'_link').innerHTML = 'Show Options'
   			
   			ga.reportPageview('/ui_click/toggle/' + myDiv + '/hide');
   	  		
   			_IG_AdjustIFrameHeight()
   		}
   	}
   	function recordAction(fieldType, fieldName,fieldId){
   	
   		if(document.getElementById(fieldId).checked == 'checked'){
   			var selectionValue = 'checked';
   		} else {
   			var selectionValue = 'unchecked';
   		}
   		
   		ga.reportPageview('/ui_click/select/' + fieldType + '/' + fieldName + '/' + selectionValue);
   	}
   	function init(){
   		getUserPrefs(1,'false');
		_gel('aud1').checked=true;
   		var expandAudience = prefs.getBool("expandAud");
   		var expandGradeLevel = prefs.getBool("expandGradeLevel");
   		var expandResourceFormat = prefs.getBool("expandResourceFormat");
   		var expandSubject = prefs.getBool("expandSubject");
   		var expandPW = prefs.getBool("expandPW");
   		
   		if(expandAudience){
   			show('nsdl_audience_values');
   		}
   		if(expandGradeLevel){
   			show('nsdl_gradelevel_values');
   		}
   		if(expandResourceFormat){
   			show('nsdl_resourceformat_values');
   		}
   		if(expandSubject){
   			show('nsdl_subject_values');
   		}
   		if(expandPW){
   			show('nsdl_pathway_values');
   		}
   	}
   	_IG_RegisterOnloadHandler(init)
</script>
<form method="get" action="http://nsdl.org/search/" target="_parent" name="nsdl_search">
	<table border="0">
		<tr>
			<td width="1%">
	    	    <a href="http://www.nsdl.org/?app=googlegadget" title="Go to NSDL.org" target="_blank" onclick="clickNSDLLogo();"><img src="http://nsdl.org/gadget/nsdl_search.jpg" alt="NSDL" width="70" height="19" /></a>
			</td>
			<td width="98%" >
		   		<input type="text" id="q" name="q" value=""/>
			</td>
			<td width="1%">
	    	    <input type="hidden" name="formview" value="searchresults" />
	    	    <input type="hidden" name="verb" value="Search" />
	    	    <input name="s" id="s" type="hidden" value="0" />
	    	    <input name="n" id="n" type="hidden" value="__UP_mynum__" />
	    	    <input name="audience" id="audience" type="hidden" value="" />
	    	    <input type='hidden' name='boost[]' value='compoundTitle' />
	    	    <input type='hidden' name='boost[]' value='compoundDescription' />
	    	    <input type='hidden' name='app' value='googlegadget' />
		    	<input id="nsdl_submit" type="submit" name="submit" value="Search" onclick="clickSubmit();"/>   
			</td>
	    </tr>
	</table>
	<h1 id="searchStatus">You are using: <span id="aud_notice">NSDL Search</span></h1>
	<div id="nsdl_audience_id">
	    <div class="nsdl_options_header">Audience <span id="nsdl_audience_values_link" onclick="show('nsdl_audience_values')">Show Options</span></div>
		<div id="nsdl_audience_values" class="hidden">
			<input type="radio" name="audience" id="aud1" value="1" onclick="getUserPrefs(1);"/><label for="aud1">General User</label><br />
			<input type="radio" name="audience" id="aud2" value="2" onclick="getUserPrefs(2);" /><label for="aud2">K-12</label><br />
			<input type="radio" name="audience" id="aud4" value="4" onclick="getUserPrefs(4);" /><label for="aud3">Higher Education and Research</label><br />
			<input type="radio" name="audience" id="aud3" value="3" onclick="getUserPrefs(3);" /><label for="aud4">Specialized Search</label><br />
		</div>
	</div>
	<div id="nsdl_gradelevel_id">
	    <div class="nsdl_options_header">Grade Level <span id="nsdl_gradelevel_values_link" onclick="show('nsdl_gradelevel_values')">Show Options</span></div>
		<div id="nsdl_gradelevel_values" class="hidden">
			<div id="audienceGroup"></div>
		</div>
	</div>

	<div id="nsdl_resourceformat_id"">
	    <div class="nsdl_options_header">Resource Format <span id="nsdl_resourceformat_values_link" onclick="show('nsdl_resourceformat_values')">Show Options</span></div>
		<div id="nsdl_resourceformat_values" class="hidden">
				<input type="checkbox" name="genre_type[]" id="text" value="text" onclick="recordAction('resource_format','text','text');"/><label for="text">Text</label><br />
				<input type="checkbox" name="genre_type[]" id="image" value="image" onclick="recordAction('resource_format','image','image');"/><label for="image">Image</label><br />
				<input type="checkbox" name="genre_type[]" id="audio" value="audio" onclick="recordAction('resource_format','audio','audio');"/><label for="audio">Audio</label><br />
				<input type="checkbox" name="genre_type[]" id="video" value="video" onclick="recordAction('resource_format','video','video');"/><label for="video">Video</label><br />
				<input type="checkbox" id="InteractiveResource" name="genre_type[]" value="InteractiveResource" onclick="recordAction('resource_format','interactiveResource','interactiveResource');"/><label for="InteractiveResource">Interactive Resource</label><br />
				<input type="checkbox" name="genre_type[]" id="data" value="data" onclick="recordAction('resource_format','data','data');"/><label for="data">Data</label>
		</div>
	</div>
	<div id="nsdl_subject_id">
	    <div class="nsdl_options_header">Subject <span id="nsdl_subject_values_link" onclick="show('nsdl_subject_values')">Show Options</span></div>
		<div id="nsdl_subject_values" class="hidden">
				<input type="checkbox" name="subject[]" id="S1" value="S1" onclick="recordAction('subject','education','S1');"/><label for="S1">Education</label><br />
				<input type="checkbox" name="subject[]" id="S2" value="S2"  onclick="recordAction('subject','health','S2');" /><label for="S2">Health/Medicine</label><br />
				<input type="checkbox" name="subject[]" id="S3" value="S3"  onclick="recordAction('subject','mathematics','S3');" /><label for="S3">Mathematics</label><br />
				<input type="checkbox" name="subject[]" id="S4" value="S4"  onclick="recordAction('subject','science','S4');" /><label for="S4">Science</label><br />
				<input type="checkbox" name="subject[]" id="S5" value="S5"  onclick="recordAction('subject','social_studies','S5');" /><label for="S5">Social Studies</label><br />
				<input type="checkbox" name="subject[]" id="S6" value="S6"  onclick="recordAction('subject','technology','S6');" /><label for="S6">Technology</label><br />
				<input type="checkbox" name="subject[]" id="S7" value="S7"  onclick="recordAction('subject','engineering','S7');" /><label for="S7">Engineering</label>
		</div>
	</div>
	
	<div id="nsdl_pathway_id">
	    <div class="nsdl_options_header">Pathways <span id="nsdl_pathway_values_link" onclick="show('nsdl_pathway_values')">Show Options</span></div>
		<div id="nsdl_pathway_values" class="hidden">
			<div id="pathwaysGroup"></div>
	   	 <br/>
			<div id="help_dialog">
				<h1>* What are Pathways?</h1>
				<p>NSDL Pathways are partners who provide access to audience-specific views of appropriate NSDL resources and services (portals). Pathway audiences may be grouped by grade level, discipline, resource or data type, or some other designation.</p>
			</div>
		</div>
	</div>
</form>
     ]]>
   </Content>
</Module>