// Sender is a terrible name for this file, since it does more than send things.  Oh well

//Mailto links
function sendTo(username) {
	var hostname = "DonWood.com";
	var linktext = username + "@" + hostname;
	document.write("<a href=" + "mail" + "to:" + username + "@" + hostname + ">" + linktext + "</a>");
}

// The following code will insert code into the header of any oem model page

	// list the URL, model name, and image location (relative to http://inc.donwoodpolaris.com/asc/images/)
	var models = new Array();
			// Piaggio models
			models[0] = new Array("eshopitems_cat_4797-48548-48429.BV_200.htm","Piaggio BV 200","http://www.athensscooterco.com/piaggio-bv-250.jpg");
			models[1] = new Array("eshopitems_cat_4797-48548-48420.BV_250.htm","Piaggio BV 250","http://www.athensscooterco.com/piaggio-bv-250.jpg");
			models[2] = new Array("eshopitems_cat_4797-48548-48421.BV_500.htm","Piaggio BV 500","http://www.athensscooterco.com/piaggio-bv-500.jpg");
			models[3] = new Array("eshopitems_cat_4797-48548-48423.Fly_150.htm","Piaggio Fly 150","http://www.athensscooterco.com/piaggio-fly-150.jpg");
			models[4] = new Array("eshopitems_cat_4797-48548-48422.Fly_50.htm","Piaggio Fly 50","http://www.athensscooterco.com/piaggio-fly-50.jpg");
			models[5] = new Array("eshopitems_cat_4797-48548-48424.MP3_250.htm","Piaggio MP3 250","http://www.athensscooterco.com/piaggio-mp3-250.jpg");
			models[6] = new Array("eshopitems_cat_4797-48548-48374.MP3_400_IE.htm","Piaggio MP3 400 IE","http://www.athensscooterco.com/piaggio-mp3-400.jpg");
			models[7] = new Array("eshopitems_cat_4797-48548-48426.MP3_500.htm","Piaggio MP3 500","http://www.athensscooterco.com/piaggio-mp3-500.jpg");
			models[8] = new Array("eshopitems_cat_4797-48548-48428.Typhoon.htm","Piaggio Typhoon","http://www.athensscooterco.com/piaggio-typhoon.jpg");
			models[9] = new Array("eshopitems_cat_4797-48548-48427.X9_500_Evolution.htm","Piaggio X9 500 Evolution","http://www.athensscooterco.com/piaggio-x9-500-evolution.jpg");
			//models[] = new Array("","Piaggio ","piaggio-.jpg");
			
			// Vespa models
			models[10] = new Array("eshopitems_cat_4797-48549-48395.2008_Granturismo_200_L.htm","Vespa 2008 Granturismo 200 L","http://www.athensscooterco.com/vespa-gt.jpg");
			models[11] = new Array("eshopitems_cat_4797-48549-48410.ET2.htm","Vespa ET2","http://www.athensscooterco.com/vespa-et2.jpg");
			models[12] = new Array("eshopitems_cat_4797-48549-48411.ET4.htm","Vespa ET4","http://www.athensscooterco.com/vespa-et4.jpg");
			models[13] = new Array("eshopitems_cat_4797-48549-48400.Granturismo_200L_.htm","Vespa Granturismo 200L","http://www.athensscooterco.com/vespa-gt.jpg");
			models[14] = new Array("eshopitems_cat_4797-48549-48412.GT.htm","Vespa GT","http://www.athensscooterco.com/vespa-gt.jpg");
			models[15] = new Array("eshopitems_cat_4797-48549-48401.GT_250_IE_60th_Annv.htm","Vespa GT 250 IE 60th Anniv.","http://www.athensscooterco.com/vespa-gt.jpg");
			models[16] = new Array("eshopitems_cat_4797-48549-48353.GTS_250.htm","Vespa GTS 250","http://www.athensscooterco.com/vespa-gt.jpg");
			models[17] = new Array("eshopitems_cat_4797-48549-48358.GTS_250_IE_Super.htm","Vespa GTS 250 IE Super","http://www.athensscooterco.com/vespa-gt.jpg");
			models[18] = new Array("eshopitems_cat_4797-48549-48414.GTV_250.htm","Vespa GTV 250","http://www.athensscooterco.com/vespa-gt.jpg");
			//models[19] = new Array("eshopitems_cat_4797-48549-48404.LT_150.htm","Vespa ","vespa-.jpg");  <- COULDN'T FIND MODEL
			//models[20] = new Array("eshopitems_cat_4797-48549-48405.LT_50.htm","Vespa ","vespa-.jpg");  <- COULDN'T FIND MODEL
			models[19] = new Array("eshopitems_cat_4797-48549-48406.LX_150.htm","Vespa LX 150","http://www.athensscooterco.com/vespa-lx.jpg");
			models[20] = new Array("eshopitems_cat_4797-48549-48407.LX_50.htm","Vespa LX 50","http://www.athensscooterco.com/vespa-lx.jpg");
			models[21] = new Array("eshopitems_cat_4797-48549-48408.LXV_150.htm","Vespa LXV 150","http://www.athensscooterco.com/vespa-lx.jpg");
			models[22] = new Array("eshopitems_cat_4797-48549-48413.PX_150.htm","Vespa PX 150","http://www.athensscooterco.com/vespa-px.jpg");
			models[23] = new Array("eshopitems_cat_4797-48549-48409.S_150.htm","Vespa S 150","http://www.athensscooterco.com/vespa-s.jpg");
			//models[] = new Array("","Vespa ","vespa-.jpg");
	
	
	// get the path portion of the url, split the path into chunks, and get the last chunk
	var url = window.location.pathname.toString();
	var chunks = url.split("index.html");
	var current_page = chunks[chunks.length-1];
	
	// 
	function printModelInfo()
	{
		for (var i in models) // go through each item in the 'models' array
		{
			if (current_page == models[i][0]) { // if the curent page matches a URL in the array...
				
				// unhide the model image div and give it the right background
				document.getElementById('single-model-image').style.display = "block";
				document.getElementById('single-model-image').style.backgroundImage = "url(http://inc.donwoodpolaris.com/asc/images/"+models[i][2]+")";
				
				// print the model name
				document.getElementById('single-model-name').innerHTML = models[i][1];
			}
		}
	}
