function view_onOpen()
{
SearchTerm.value = "";
isDocked = true;
pluginHelper.onDisplayTargetChange = onDisplayTargetChange;
a1.visible = false;
}

function onDisplayTargetChange(displayTarget) {
	if (displayTarget == gddTargetSidebar) {
	debug.trace('Display target changed to docked');
	isDocked = true;
	refresh();
	} else if (displayTarget == gddTargetFloatingView) {
	debug.trace('Display target changed to undocked');
	isDocked = false;
	refresh();
	}
}
function refresh(){
 if (isDocked) {
    // Remove background.
    background.height = '';
		background.x = '1';
		background.y = '1';
    
    // Set appropriate height.
    view.height = '200';

    // Hide the status area.
    quicklinks.visible = false;    
		a1.visible = false; 
		a2.visible = false;    
		a3.visible = false; 
		a4.visible = false; 
		a5.visible = false;    
		a6.visible = false; 
		a7.visible = false; 

  } else {
    // Show the background image.
     // Remove background.
    background.height = '419';
		background.x = '-5';
		background.y = '-29';
    
    // Set appropriate height.
    view.height = '380';

    // Hide the status area.
    quicklinks.visible = true;    
		a1.visible = true; 
		a2.visible = true;    
		a3.visible = true; 
		a4.visible = true; 
		a5.visible = true;    
		a6.visible = true; 
		a7.visible = true; 
  }

}

function openURL(url) {
  try {
    var shell = new ActiveXObject("Shell.Application");
    shell.Open(url);
  } catch (e) {
    return;
  }
}
function GoButton_onclick() 
{
		
		var locationterm = location.value;
		var searchterm = SearchTerm.value;
		
		

			if (locationterm == "One Search")
			openURL("http://aj2vr6xy7z.cs.serialssolutions.com/results?SS_LibHash=AJ2VR6XY7Z&dbIDList=&searchType=basic&action=start&catGroupList=default&searchBy=Category&field=Keyword&term="+searchterm+"&catID=19851");
			if (locationterm == "Library Catalog")
			openURL("http://uclid.uc.edu/search/X?"+searchterm+"&b=&l=&Da=&Db=&m=&s=&v=&c=&SORT=D&searchscope=39)");
			if (locationterm == "Online Journal Titles")
			openURL("http://aj2vr6xy7z.search.serialssolutions.com/?V=1.0&N=100&L=AJ2VR6XY7Z&S=AC_T_B&C="+searchterm);
			if (locationterm == "Electronic Journal Center")
			openURL("http://journals.ohiolink.edu./lsearch/search.do?query="+searchterm+"&field=contents");
			if (locationterm == "OhioLink Catalog")
			openURL("http://olc1.ohiolink.edu/search/~?searchtype=X&searcharg="+searchterm+"&SORT=D");
			if (locationterm == "University Libraries Web Site")
			openURL("http://www.googlesyndicatedsearch.com/u/UCincinnati?q="+searchterm);
			if (locationterm == "Google Scholar")
			openURL("http://scholar.google.com/scholar?q="+searchterm+"&hl=en&lr=");
			if (locationterm == "Hamilton County Public Library")
			openURL("http://catalog.cincinnatilibrary.org/uhtbin/cgisirsi/x/0/0/123?searchdata1="+searchterm+"&srchfield1=GENERAL%5ESUBJECT%5EGENERAL%5E%5Ewords+org+phrase");
			
}

			





