var TIP = function() {
   
   function getTip()
	{
		var tipText = new Array ();
		
		tipText[0] = "Always read and follow instructions in the Owner/Operator Manual before loading and firing the firearm. Follow all instructions on the proper handling and safe use of the firearm.";
		tipText[1] = "Always familiarize yourself with any firearm before firing, and make sure the bore has been cleaned to remove any excess oil.";
		tipText[2] = "If the firearm is carelessly or improperly handled, unintentional discharge could result and could cause injury, death or damage to property";
		tipText[3] = "Always treat any firearm as if it was loaded. If someone hands you a firearm, always check to see if it is loaded with the muzzle pointed in a safe direction";
		tipText[4] = "Use only clean, dry, high quality commercially manufactured ammunition in good condition of the correct caliber for the firearm. Bushmaster does not recommend the use of remanufactured or hand loaded ammunition because it may damage your firearm";
		tipText[5] = "Always keep the muzzle pointed in a safe direction. Never point the muzzle at anything you do not intend to shoot.";
		tipText[6] = "Never load a firearm until ready for use";
		tipText[7] = "The Bushmaster 9mm Upper Receiver / Barrel Assembly cannot be used with ANY .223 / 5.56mm Lower Receiver. Attempts to do so will cause bodily 		injury to the user, and damage or destruction to the components. The 9mm Upper Receiver / Barrel Assembly MUST be used with Bushmaster's proprietary 9mm Carbon Fiber Lower Receiver";

		var i = Math.floor(Math.random()*tipText.length);
		
		return tipText[i];
	}
	
	return {
      loadtip : function() 
		{
			var tip = getTip();
			$('<p>' + tip + '</p>').appendTo("#tip");
		}      
      	         
   };
}();

var SEARCH = function() {
	
   return {
      init : function() 
		{
			
			
			
			/*$("div#header_nav p:first").append(' | <a href="/include_search.asp" id="search_click">Search</a>');
			$("div#header_nav").append('<div id="search_box"><div id="search_form"></div><div id="search_close"></div></div>');
			$("div#search_close").append('<p style="margin:0;padding:0;"><a href="/mysearch.asp">Close Search</a></p>');
			$("div#search_form").load("/mysearch.asp");*/
			
			
			
			
			
			
			$("a#search_click").click(function(){ 
				$("div#search_box").slideToggle("slow",function(){
					$("input#zoom_query").focus();
				});
				return false;
			});
			
			$("div#search_close").click(function(){ 
				$("div#search_box").slideUp("slow");
				return false;
			});
		}
		
   };
	
}();

$(document).ready(function() {
	TIP.loadtip();	
	SEARCH.init();
});
