	/*	
 	FILE NAME: bicyclesurplus.js
	CREATED BY: Michael Eisenbraun of Cycle Source Group
	CONTACT: michaele@cyclesg.com
	LAST MODIFIED: July 20, 2007
	
	BICYCLESURPLUS.JS FILE DOES THE FOLLOWING: 
		- DEFINES ALL JAVASCRIPT FUNCTIONS USED BY BICYCLE SURPLUS
*/
	
	//<![CDATA[

		function load() {
			if (GBrowserIsCompatible()) {
				var map = new GMap2(document.getElementById("map"));
				map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
				map.setCenter(new GLatLng(42.0258, -93.6139), 13); 
				
				function createMarker(point)
					{
					var marker = new GMarker(point); 
					GEvent.addListener(marker, "click", function() {
					marker.openInfoWindowHtml("BicycleSurplus: <br /> 411 Kellogg Ave <br /> Ames, IA 50010"); 
					}); 
					return marker; 
					}
					
				var point = new GLatLng(42.0258, -93.6139);
				
				map.addOverlay(createMarker(point)); 
									 
	 
			}
		}

		//]]>
		
		//moreInfo function redirects productinfo.php passing the select bike id to the page. 
	//productinfo.php creates information and buy now page based on the bike id that is passed. 
		
		/*
			FUNCTION MOREINFO
			- REDIRECTS TO PRODUCT.PHP PASSING THE SELECTED BIKE ID TO THE PAGE
			- PRODUCT.PHP CREATES INFOMRATION AND BUY NOW PAGE BASED ON BIKE ID
		*/
		function moreInfo(id)
			{
			window.location = "product.php?id="+id; 
			}
			
			
		function find()
			{
			id = document.findForm.id.value; 
			
			window.location = "update.php?id="+id; 
			}
			
		function logout()
			{	
			window.location = "logout.php"; 
			}
			
			
	//productCloseup function calls a productcloseup.php as a popup window passing the select bike id to the page. 
//productcloseup.php creates a large picture with at most 3 optional rollover pictures.
//Not all bikes will have optional pictures.  
/*	function productCloseup(imgName)
		{
		imgAddress = imgName;
		newwindow = window.open("http://www.cyclesg.com/bicyclesurplus/productcloseup.php?address="+imgAddress, "ProductCloseup", "toolbar=no, location=no, scrollbars=no, width=420, height=420"); 
		}
*/		

//removeBike function calls removebike.php passing the bike id to the page.
//removebike.php calls the bicycleSurplus database and changes the orderable attribute of the bike passed to NO.
//removebike.php popups as a blank 10px by 10px window  
/*	function removeBike(selectedBike)
		{
		bikeid = selectedBike
		newwindow = window.open("http://www.cyclesg.com/bicyclesurplus/removebike.php?bikeid="+bikeid, "removeBike", "toolbar=no, location=no, scrollbars=no, width=10, height=10"); 
		}*/
		