/* Preload images */

if (document.images)
	{
    preload_image_object = new Image();
    // set image url
    image_url = new Array();
    image_url[0] = "http://www.thegospelcoalition.org/images/ui_new/main-menu.hov.gif";
    image_url[1] = "http://www.thegospelcoalition.org/images/ui_new/youtube.ft.o.gif";
    image_url[2] = "http://www.thegospelcoalition.org/images/ui_new/facebook.ft.o.gif";
    image_url[3] = "http://www.thegospelcoalition.org/images/ui_new/twitter.ft.o.gif";
    image_url[3] = "http://www.thegospelcoalition.org/images/ui_new/itunes.ft.o.gif";
  
    var i = 0;
    for(i=0; i<=3; i++) 
        preload_image_object.src = image_url[i];
}



/* Selected menu item shadow 
$(document).ready(function() {
	$("a.selected span").addClass("highContrast");
});
*/



	function submitSearch(mediaPath) {
		var keywords = $("#resourcesearch").val();
		window.location= mediaPath + keywords;	
	}
		
	function checkEnter(e, mediaPath) {
		
		var characterCode;

		if(e && e.which){ 
		e = e;
		characterCode = e.which;
		}
		else{
		e = event;
		characterCode = e.keyCode;
		}
		
		if(characterCode == 13){ 
			submitSearch(mediaPath);
		return false;
		}
		else{
		return true;
		}
		submitSearch(mediaPath);
	}
