function addDealership(map,lat,long,text,iconImage,showWindow) {
    	if (GBrowserIsCompatible()) {
    	
    		var icon = new GIcon();
				icon.image = iconImage;
				icon.iconSize = new GSize(70, 70);
						
				var offsetPoint = mapIconOffset(iconImage);
				icon.iconAnchor = offsetPoint;
							
				icon.infoWindowAnchor = new GPoint(35,35);
				    	
				var point = new GLatLng(lat,long);
		        var marker = new GMarker(point,icon);
       			map.setCenter(point,10);
       			
				if (showWindow) {
					GEvent.addListener(marker, "click", function() {
						marker.openInfoWindowHtml(text);
					});
				}
        		map.addOverlay(marker);
       
      }
    }
    
    function mapIconOffset(iconImage) { 
    	
    	if (iconImage.endsWith('chevy.gif')) { return new GPoint(35,71); }
    	if (iconImage.endsWith('citroen.gif')) { return new GPoint(71,35); }
    	if (iconImage.endsWith('fiat.gif')) { return new GPoint(-1,35); }
    	if (iconImage.endsWith('honda.gif')) { return new GPoint(35,-1); }
    	if (iconImage.endsWith('kia.gif')) { return new GPoint(35,-1); }
    	if (iconImage.endsWith('mazda.gif')) { return new GPoint(35,-1); }
    	if (iconImage.endsWith('mitsubishi.gif')) { return new GPoint(35,-1); }
    	if (iconImage.endsWith('nissan.gif')) { return new GPoint(-1,35); }
    	if (iconImage.endsWith('default.gif')) { return new GPoint(-1,35); }
    	if (iconImage.endsWith('saab.gif')) { return new GPoint(35,-1); }
    	if (iconImage.endsWith('vauxhall.gif')) { return new GPoint(35,71); }
    	
    	return new GPoint(0,0);
    	    
    }
    
    
    
function populateModels(existingModel, includeUsed)
	{
		var man = $F('manufacturer');
		
		if (man) {
		
		var callback =
		{
		  success:populateModelsSuccess,
		  failure: populateModelsFailure,
		  argument: {"existingModel":existingModel}
		};
	
		var request = YAHOO.util.Connect.asyncRequest('GET', '/dealersys/ajax/models.htm?manufacturer=' + man + '&includeUsed=' + includeUsed, callback); 
		
		} else { 
			$('model').options.length = 0;			
		}
		
	}
	
	function clearModels() {
		
		$('model').options.length = 0;
			
		$('model').options[0] = new Option("Any Model","");
			
	}
	
	
	function populateModelsSuccess(response) {
			var models = eval("(" + response.responseText + ")");
			
			clearModels();
			$('model').options[0] = new Option("Any Model","");
			for(i=1;i<models.length+1;i++) {
					var model = models[i-1];
					$('model').options[i] = new Option(model.name,model.id);	
					if (response.argument.existingModel && response.argument.existingModel == model.id) {
						$('model').selectedIndex = i;
					}
			}
				
	}
	function populateModelsFailure(response) {
		// alert("Couldn't get models!");
	}
	
	
	YAHOO.util.Event.onDOMReady(roundCorners);
	
	function roundCorners() {
		settingsLeft = {
	          tl: { radius: 1 },
	          tr: { radius: 15 },
	          bl: { radius: 1 },
	          br: { radius: 15 },
	          antiAlias: true,
	          autoPad: true
		}
	
	      new curvyCorners(settingsLeft, "grayboxleft").applyCornersToAll();
	     	new curvyCorners(settingsLeft, "redboxleft").applyCornersToAll();
	      new curvyCorners(settingsLeft, "darkgrayboxleft").applyCornersToAll();
	      new curvyCorners(settingsLeft, "whiteboxleft").applyCornersToAll();
	      
	 settingsRight = {
	          tl: { radius: 15 },
	          tr: { radius: 1 },
	          bl: { radius: 15 },
	          br: { radius: 1 },
	          antiAlias: true,
	          autoPad: true
		}
		
			new curvyCorners(settingsRight, "grayboxright").applyCornersToAll();
	     	new curvyCorners(settingsRight, "redboxright").applyCornersToAll();
	      new curvyCorners(settingsRight, "darkgrayboxright").applyCornersToAll();
	      new curvyCorners(settingsRight, "whiteboxright").applyCornersToAll();
	      

		var tab2settings = {
	          tl: { radius: 1 },
	          tr: { radius: 1 },
	          bl: { radius: 5 },
	          br: { radius: 5 },
	          antiAlias: true,
	          autoPad: true
		}
		
		var tabs2 = $('tabs2');
		if (tabs2) {
			var tabs2 = new curvyCorners(tab2settings, tabs2);
			tabs2.applyCornersToAll();    
		}
		
	 
  	}