/*************************************************************************
*                         COPYRIGHT NOTICE                               *
*                                                                        *
*   The contents of this file is protected under the United States       *
*   copyright laws as an unpublished work, and is confidential and       *
*   proprietary to Planetography.  Its use or disclosure in whole or in  *
*   part without the expressed written permission of Planetography is    *
*   prohibited.                                                          *
*                                                                        *
*   (c) Copyright 2009 by Planetography. All rights reserved.            *
**************************************************************************/

stored_color = 0;

// Determine which type of objects the browser uses
(document.layers) ? layerobject=true : layerobject=false;
(document.all) ? allobject=true : allobject=false;
(document.getElementById) ? dom=true : dom=false;

function highlight_species (id,image_target,image_path) {
//alert ("highlight_species image_number is "+image_path);
stored_color = id.style.color;
	id.style.color = 'blue';
//	if (image_number == 0) {
//		whole_path_string = "/imagesspecies/no_image.jpg";
//	} else {
		whole_path_string = "/imagesspecies/"+image_path+".jpg";
//	}
//alert (whole_path_string);
	setImagePath (image_target, whole_path_string);
}

function unhighlight_species (id, image_target) {
	id.style.color = stored_color;
	whole_path_string = "/imagesspecies/no_image.jpg"
	setImagePath (image_target, whole_path_string);
}

function validate_form () {
//alert ("validate");
//alert ('value of search string is ('+document.forms[0].SpeciesSearchstring.value+')');
//alert ('length of search string is ('+document.forms[0].SpeciesSearchstring.value.length+')');
	if (document.forms[0].SpeciesSearchstring.value.length == 0) {
		document.forms[0].SpeciesSearchstring.value = "%";
	} else if (document.forms[0].SpeciesSearchstring.value.indexOf ("%") == -1) {
		document.forms[0].SpeciesSearchstring.value += "%";
	}
	return true;;
}