<?xml version="1.0" encoding="UTF-8" ?> 
<Module> 
<ModulePrefs title="ChemAlliance Search - Beta r2" height="90" scaling="false" render_inline="optional" 
description="This is beta version of Module 1 for the ChemAlliance module set i It allows searching of the chemalliance site a variety of ways." author="Nick Myers" 
author_email="wsu423@gmail.com"/> 


<UserPref name="logo_disp" display_name="Display Logo?" datatype="bool" default_value="false"/>


    <Content type="html"> 

        <![CDATA[ 

            <script language="JavaScript">  
            //To Do:
            //Functional News Search
                    
                function search()
                {  
                    switch(document.ChemAllianceSearchModule__MODULE_ID__.searchType.value)
                    {
                        case "CA_Google":               

                            parent.location.href = "http://www.google.com/search?q=site:chemalliance.org+" + document.ChemAllianceSearchModule__MODULE_ID__.searchInput.value;
                            break;
                        case "CA_General":
                            //http://www.chemalliance.org/Help/IISFiles/Search.idq?CiRestriction=
                            //Search Term
                            //&CiScope=%2Fhandbook%2C%2Fhandbook%2Fbackground%2C%2Fhandbook%2Fplant%2C%2Fhandbook%2Fregtour%2C%2Fhelp%2C%2Fcolumns%2C%2Fcolumns%2Fenforcement%2C%2Fcolumns%2Fimproving%2C%2Fcolumns%2Findustry%2C%2Fcolumns%2Fnetworking%2C%2Fcolumns%2Fregulatory&CiMaxRecordsPerPage=10&TemplateName=&CiSort=rank%5Bd%5D%2Cdoctitle%5Ba%5D&HTMLQueryForm=..%2FSearch.htm

                            parent.location.href = "http://www.chemalliance.org/Help/IISFiles/Search.idq?CiRestriction=" + document.ChemAllianceSearchModule__MODULE_ID__.searchInput.value + "&CiScope=%2Fhandbook%2C%2Fhandbook%2Fbackground%2C%2Fhandbook%2Fplant%2C%2Fhandbook%2Fregtour%2C%2Fhelp%2C%2Fcolumns%2C%2Fcolumns%2Fenforcement%2C%2Fcolumns%2Fimproving%2C%2Fcolumns%2Findustry%2C%2Fcolumns%2Fnetworking%2C%2Fcolumns%2Fregulatory&CiMaxRecordsPerPage=10&TemplateName=&CiSort=rank%5Bd%5D%2Cdoctitle%5Ba%5D&HTMLQueryForm=..%2FSearch.htm";
                            break;
                        case "CA_News":
                            alert("News Search not currently available - sorry!");                    
                            break;
                        case "CA_Case":
                            parent.location.href ="http://www.chemalliance.org/Handbook/plant/search_results.asp?SearchPhrase=" +document.ChemAllianceSearchModule__MODULE_ID__.searchInput.value +"&SearchType=Phrase";
                            break;   
                        default:
                            alert("!Error in Switch - Contact Module Admin!");
                            parent.location.href ="http://www.chemalliance.org";
                            break;                                    
                    }            
                    return false;           
                }            
            </script>

            <form name="ChemAllianceSearchModule__MODULE_ID__" onsubmit="search()">

            
            <script language="JavaScript">
                var prefs = new _IG_Prefs(__MODULE_ID__);

                //User wishes to display our nifty logo!
                if (prefs.getBool("logo_disp"))
                {
                    document.write('<img ALIGN="LEFT" src="http://www.wsu.edu/~nwmyers/ChemAlliance/stacks_logo.jpg"/>');

                    document.write('<br><input type="text" id="searchInput" size="23" value="Search String Here"> ');
                    document.write('<br>');

                    document.write('<SELECT id="searchType"> ');
                    document.write('    <OPTION VALUE="CA_Google">Google on CA.org');
                    document.write('    <OPTION VALUE="CA_General">CA.org General   ');    
                    //Comment out the news value as we dnt currently have a query procedure for it.
                    //document.write('    <OPTION VALUE="CA_News">CA.org News/Events');
                    document.write('    <OPTION VALUE="CA_Case">CA.org Case Studies');
                    document.write('</SELECT> ');


                    document.write('<input type="submit" id="btnSearch" size="7" value="Go" onClick="return search()"> ');
                    document.write('<br>');
                }
                //Eh, maybe not - Can't say I blame them.
                else
                {
                    document.write('<input type="text" id="searchInput" size="29" value="Search String Here"> ');
                    document.write('<br>');

                    document.write('<SELECT id="searchType"> ');
                    document.write('    <OPTION VALUE="CA_Google">Google on ChemAlliance');
                    document.write('    <OPTION VALUE="CA_General">ChemAlliance General ');         
                    //Comment out the news value as we dnt currently have a query procedure for it.
                    //document.write('    <OPTION VALUE="CA_News">ChemAlliance News and Events');
                    document.write('    <OPTION VALUE="CA_Case">ChemAlliance Case Studies');
                    document.write('</SELECT> ');


                    document.write('<input type="submit" id="btnSearch" size="7" value="Search" onClick="return search()"> ');
                    document.write('<br>');             
                }
            </script>
            
            </form>
        ]]> 
    </Content> 
</Module> 



