//Copyright (©) 2011 - Written by:Kevin Montgomery
/*
     /\       | | (_)          
    /  \   ___| |_ ___   _____ 
   / /\ \ / __| __| \ \ / / _ \
  / ____ \ (__| |_| |\ V /  __/
 /_/    \_\___|\__|_| \_/ \___|
Development by Kevin Montgomery
*/
var posStr = 0;
var started = false;
var iterations = new Number(0);
var currentBillboard = 1;
var manSearch = "";
var modelSearch = "";
var yearSearch = "";
var searchURL = "";
var preloadImage = new Image(64,64);
preloadImage.src = "http://activeradiator.com/images/load64.gif";
function initLoad() {
	if(ge('map_canvas')) { initialize(4); }
	/*
	if(location.search == "?id=23") { initialize(4); }
	if(location.search == "?id=0") { initialize(2); }
	if(location.search == "?id=49") { loadStats(); }
	if(location.search.indexOf("?id=3") != -1) {
		prod="";
		if(location.search.indexOf("p=r")!=-1) { prod = "Radiator"; }
		if(location.search.indexOf("p=c")!=-1) { prod = "Charge Air Cooler"; }
		if(location.search.indexOf("p=n")!=-1) { prod = "Condenser"; }
		if(prod!="") {
			for(i=0; i<ge("product_line").length; i++) {
				if(ge("product_line").options[i].text == prod) {
					ge("product_line").selectedIndex = i;
				}
			}
		}
		loadPage(0);
	}
	if(location.search == "?id=45" && ge("loader")) { getCore(); }
	*/
}
function nextBillboard() { slideTo(currentBillboard+1); }
function lastBillboard() { slideTo(currentBillboard-1); }
function slideTo(b) {
	if(b!=currentBillboard) {
		if(!started) { // we're starting
			if(b>7) { b = 1; }
			if(b<1) { b = 7; }
			iterations = 0;
			t = window.setInterval("slideTo("+b+")", 10);
			barScale = ((b - currentBillboard) * 120 ) / 100;
			billScale = ((b - currentBillboard) * 593 ) / 100;
			started = true;
		}
		iterations = iterations + 5;
		posStr = Math.pow(iterations/10,2);
		if (iterations <=100) {
			ge("billboardSlider").style.left = Math.round(-((currentBillboard-1) * 593) - (posStr * billScale)) + "px";
			ge("info"+currentBillboard).style.opacity = 1-(Math.abs(iterations)/100);
			ge("info"+currentBillboard).style.filter = "alpha(opacity=" + (100-Math.abs(iterations)) + ")";
			ge("info"+b).style.top = 100-posStr + "px";
			ge("info"+b).style.opacity = Math.abs(iterations/100);
			ge("info"+b).style.filter = "alpha(opacity=" + Math.abs(iterations) + ")";
			ge("highlightBar").style.left = Math.round(((currentBillboard-1) * 120) + (posStr * barScale))+5 + "px";
		}
		else { //done, change things
			for(i=1; i<=7; i++) {
				if(i!=b) {
					ge("info"+i).style.opacity = 0;
					ge("info"+i).style.filter = "alpha(opacity=0)";
				}
			}
			t = window.clearInterval(t);
			started = false;
			currentBillboard = b;
		}
	}
}
function loadStats() {
	//ge("textLoad").style.backgroundImage = "URL('images/loading.gif')";
	ge("imageLoad").style.opacity = "0.5";
	//ge("textLoad").style.opacity = "0.5";
	ge("imageLoad").src = "images/blank.gif";
	size = ge("loady").options[ge("loady").selectedIndex].value;
	var URL = 'admin/trend20.php?size='+size;
	ge("imageLoad").src = URL;
	var URL = 'admin/toptext.php?size='+size;
	callback = function(response) {
		ge("textLoad").innerHTML = response;
		ge("imageLoad").style.opacity = "1";
		ge("textLoad").style.opacity = "1";
		ge("textLoad").style.backgroundImage = "";
	}
	ajax(URL,"",callback);
}
function showTrend(t) {
	ge("trendLoad").src = 'admin/trend1.php?prod='+t;
}
function updateMan() {
	ge("modelHolder").innerHTML=ge("modelHolder").innerHTML+'<img style="position:absolute; top:40px; left:16px;" src="images/dot.gif">';
	getVars();
	searchURL = "/code/fetch.php?manufacturer=" + manSearch;
	callback = function(response) {
		ge("modelHolder").innerHTML='<select id="model" onchange="updateMod('+"'model'"+');" style="width:200px;"><option selected></option>' + response+"</select>";
		ge("yearHolder").innerHTML='<select id="year" onchange="showResult();" style="width:75px;"><option selected></option></select>';
		ge("output").innerHTML="";
	}
	ajax(searchURL,"",callback);
}
function updateMod() {
	ge("yearHolder").innerHTML=ge("yearHolder").innerHTML+'<img style="position:absolute; top:40px; left:16px;" src="images/dot.gif">';
	getVars();
	searchURL = "/code/fetch.php?manufacturer=" + manSearch;
	searchURL += "&model=" + modelSearch;
	callback = function(response) {
		ge("yearHolder").innerHTML='<select id="year" onchange="showResult();" style="width:75px;"><option selected></option>' + response+"</select>";
	}
	ajax(searchURL,"",callback);
}
function showResult() {
	getVars();
	if(manSearch!="" && modelSearch!="" && yearSearch!="") {
		searchURL = "/code/fetch.php?manufacturer=" + manSearch;
		searchURL += "&model=" + modelSearch;
		searchURL += "&year=" + yearSearch;
		callback = function(response) {
			ge("output").innerHTML = response;
		}
		ajax(searchURL,"",callback);
	}
}
function clearApp() {
	ge("manufacturer").selectedIndex=0;
	ge("model").selectedIndex=0;
	ge("year").selectedIndex=0;
	ge("modelHolder").innerHTML='<select id="model" onchange="updateMod('+"'model'"+');" style="width:200px;"><option selected></option></select>';
	ge("yearHolder").innerHTML='<select id="year" onchange="showResult();" style="width:75px;"><option selected></option></select>';
	ge("output").innerHTML="";
}
function loadItem(URL) {
	ge("loader").innerHTML = '<div style="margin:auto; text-align:center; padding:10px;"><img src="images/loading.gif"><br>Getting Data</div>';
	callback = function(response) {
		ge("loader").innerHTML = response;
	}
	ajax(URL,"",callback);
}
function getCore() { //this might be an old function, should probably be deleted
	ge("loader").innerHTML = '<div style="margin:auto; text-align:center; padding:10px;"><img src="images/loading.gif"><br>Getting Data</div>';
	URL = "http://activeradiator.com/development/cbrcalc2/corecalc.php";
	callback = function(response) {
		ge("loader").innerHTML = response;
	}
	ajax(URL,"",callback);
}
function getVars() {
	manSearch = ge("manufacturer").options[ge("manufacturer").selectedIndex].text;
	modelSearch = ge("model").options[ge("model").selectedIndex].text;
	yearSearch = ge("year").options[ge("year").selectedIndex].text;
	ge("output").innerHTML="";
	ge("loader").innerHTML="";
}

function loadPage(i,columnName) {
	if(columnName == "undefined") { columnName = ''; }
	ge("waiting").style.display = "block";
	ge("loadout").style.opacity=0.50;
	ge("loadout").style.filter = "alpha(opacity=50)";
	if(document.documentElement.scrollTop>=document.body.scrollTop) {
		scrollTop = document.documentElement.scrollTop;
	}
	else {
		scrollTop = document.body.scrollTop;
	}
	ge("waiting").style.top = 100 + scrollTop + "px";
	var app = ge("application").options[ge("application").selectedIndex].text;
	var prod = ge("product_line").options[ge("product_line").selectedIndex].text;
	var man = ge("manufacturer").options[ge("manufacturer").selectedIndex].text;
	var ori = ge("orientation").options[ge("orientation").selectedIndex].text;
	var h = ge("height_in").value;
	var w = ge("width_in").value;
	var fill = ge("filler_neck").options[ge("filler_neck").selectedIndex].text;
	var page = i;
	var URL = "/code/qsfetch.php?application=" +app+ "&product_line=" +prod+ "&manufacturer=" +man+ "&orientation=" +ori+ "&height=" +h+ "&width=" +w+ "&filler_neck=" +fill +"&page="+page+ "&sort="+columnName;
	callback = function(response) {
		closeProdPop();
		ge("loadout").innerHTML = response;
	}
	ajax(URL,"",callback);
}
function loadNews(i,type) {
	var URL = "/code/newsfetch.php?p=" +i+ "&t=" +type;
	callback = function(response) {
		ge("content").innerHTML = response;
	}
	ajax(URL,"",callback);
}
function loadOEM(i) {
	ge("waiting").style.display = "block";
	ge("loadout").style.opacity=0.50;
	ge("loadout").style.filter = "alpha(opacity=50)";
	if(document.documentElement.scrollTop>=document.body.scrollTop) {
		scrollTop = document.documentElement.scrollTop;
	}
	else {
		scrollTop = document.body.scrollTop;
	}
	ge("waiting").style.top = 100 + scrollTop + "px";
	var URL = "/code/qsfetch.php?oem="+ge("oem").value+"&page="+i;
	callback = function(response) {
		closeProdPop();
		ge("loadout").innerHTML = response;
		ge("oem").value = '';
	}
	ajax(URL,"",callback);
}
function loadCore() {
	ge("loadout").innerHTML = '<div style="margin:auto; text-align:center; padding:10px;"><img src="images/loading.gif"><br>Getting Data</div>';
	var URL = "/code/corefetch.php?height="+ge("coreH").value;
	callback = function(response) {
		ge("loadout").innerHTML = response;
	}
	ajax(URL,"",callback);
}
function popupProduct(i) { //Request item detail and show box in the scrolled portion of the browser window
	var URL = '/code/view.php?id='+i;
	callback = function(response) {
		createModal(response);
	}
	ajax(URL,"",callback);
}
function closeProdPop() {
	ge("waiting").style.display = "none";
	closeModal();
	ge("loadout").style.opacity=1;
	ge("loadout").style.filter = "alpha(opacity=100)";
}
function toggleResults() {
	if(ge("expandLink").innerHTML == "Show all") {
		ge("searchExpander").style.height = "auto";
		ge("expandLink").innerHTML = "Hide additional results"
	}
	else {
		ge("searchExpander").style.height = "20px";
		ge("expandLink").innerHTML = "Show all"
	}
}
function toggleDetails(section) {
	if(ge("newmodel"+section).style.display == "block") { ge("newmodel"+section).style.display = "none"; }
	else { ge("newmodel"+section).style.display = "block"; }
}
function ajax(getURL,parameters,callback) { //handles AJAX requests
	if(ge('ajaxWait')) { ge('ajaxWait').style.display = "block"; } //Show spinny wait thing
	if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } //Real browsers
	else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } //IE
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {
			if(ge('ajaxWait')) { ge('ajaxWait').style.display = "none"; } //Hide spinny wait thing
			callback(xmlhttp.responseText);
		}
	}
	if (parameters!="") {
		xmlhttp.open("POST",getURL,true);
		xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlhttp.send(parameters);
	}
	else {
		xmlhttp.open("GET",getURL,true);
		xmlhttp.send();
	}
}
function createModal(data,fromURL) {
	if(fromURL) {
		ge("ajaxLoader").innerHTML = '<img src="http://www.activeradiator.com/images/close.png" style="position:absolute; top:-7px; right:-7px; cursor:pointer;" onclick="closeModal();"><img src="http://activeradiator.com/images/load64.gif" style="height:64px; width:64px;">';
		callback = function(response) {
			if(response.indexOf("<script>",0) != -1) {
				js = response.substring(response.indexOf("<script>",0)+8,response.indexOf("</script>",0));
				eval(js);
			}
			ge("ajaxLoader").innerHTML = '<img id="ajaxWait" src="http://www.activeradiator.com/images/loading.gif" style="position:absolute; top:3px; left:3px; display:none;"><img src="http://www.activeradiator.com/images/close.png" style="position:absolute; top:-7px; right:-7px; cursor:pointer;" onclick="closeModal();">'+response;
		}
		ajax(data,"",callback);
	}
	else {
		ge("ajaxLoader").innerHTML = '<img src="http://www.activeradiator.com/images/close.png" style="position:absolute; top:-7px; right:-7px; cursor:pointer;" onclick="closeModal();">'+data;
	}
	ge("ajaxModal").style.display = "block";
}
function closeModal() {
	ge("ajaxLoader").innerHTML = "";
	ge("ajaxModal").style.display = "none";
}
function ge(obj) {
	return document.getElementById(obj);
}
function fuelCalc() {
	if(ge("mpg").value!="" && ge("mpw").value!="" && ge("cost").value!="") {
		oldMPG = Number(ge("mpg").value);
		newMPG = oldMPG + 0.5;
		milesPerWeek = Number(ge("mpw").value);
		oldGPW = milesPerWeek / oldMPG;
		oldGPW = (Math.round(oldGPW*100))/100;
		newGPW = milesPerWeek / newMPG;
		newGPW = (Math.round(newGPW*100))/100;
		savedGPW = oldGPW - newGPW;
		savedGPW = (Math.round(savedGPW*100))/100;
		fuelCost = Number(ge("cost").value);
		oldCost = oldGPW * fuelCost;
		newCost = newGPW * fuelCost;
		savings = oldCost - newCost;
		savings = (Math.round(savings*100))/100;
		out = '<b>O.E. Charge Air Cooler</b><br>';
		out += 'Mileage:<b>' + oldMPG + '</b> miles per gallon<br>';
		out += 'Consumption per week:<b>' + oldGPW + '</b> gallons<br>';
		out += 'Fuel cost per week:<b>$' + oldCost.toFixed(2) + '</b>';
		ge("oeOutput").innerHTML = out;
		out = '<b>Active Charge Air Cooler</b><br>';
		out += 'Mileage:<b>' + newMPG + '</b> miles per gallon<br>';
		out += 'Consumption per week:<b>' + newGPW + '</b> gallons<br>';
		out += 'Fuel cost per week:<b>$' + newCost.toFixed(2) + '</b>';
		ge("activeOutput").innerHTML = out;
		out = '<b>Savings</b><br>';
		out += 'Fuel effeciency:<b>+' + Math.round(newMPG / oldMPG) + '%</b><br>';
		out += 'Fuel Consumption:<b>' + savedGPW + '</b> gallons/week (saved)<br>';
		out += 'Fuel savings per week:<b>$' + savings.toFixed(2) + '</b><br>';
		out += 'Fuel savings per month:<b>$' + (savings*4).toFixed(2) + '</b><br>';
		out += 'Fuel savings per year:<b>$' + (savings*52).toFixed(2) + '</b><br>';
		out += 'Weeks till CAC pays for itself:<b>' + Math.round(700/savings) + '</b><span style="font-size:9px; color:#999999;">*<br>*Assuming CAC costs $700</span><br><b>Fleet Savings</b><br>';
		out += '<span style="float:left; margin:5px;"><u>Week</u><br>10 Trucks:<b>$' + (savings*10).toFixed(2) + '</b><br>';
		out += '25 Trucks:<b>$' + (savings*25).toFixed(2) + '</b><br>';
		out += '50 Trucks:<b>$' + (savings*50).toFixed(2) + '</b><br>';
		out += '100 Trucks:<b>$' + (savings*100).toFixed(2) + '</b></span>';
		out += '<span style="float:left; margin:5px;"><u>Month</u><br>10 Trucks:<b>$' + (savings*10*4).toFixed(2) + '</b><br>';
		out += '25 Trucks:<b>$' + (savings*25*4).toFixed(2) + '</b><br>';
		out += '50 Trucks:<b>$' + (savings*50*4).toFixed(2) + '</b><br>';
		out += '100 Trucks:<b>$' + (savings*100*4).toFixed(2) + '</b></span>';
		out += '<span style="float:left; margin:5px;"><u>Year</u><br>10 Trucks:<b>$' + (savings*10*52).toFixed(2) + '</b><br>';
		out += '25 Trucks:<b>$' + (savings*25*52).toFixed(2) + '</b><br>';
		out += '50 Trucks:<b>$' + (savings*50*52).toFixed(2) + '</b><br>';
		out += '100 Trucks:<b>$' + (savings*100*52).toFixed(2) + '</b></span><br style="clear:both;">';
		ge("saveOutput").innerHTML = out;
	}
}
function initialize(i) {
	if(ge("map_canvas")) {
	var myOptions = {zoom: i,center: new google.maps.LatLng(40,-95),mapTypeId: google.maps.MapTypeId.TERRAIN, disableDefaultUI: true, zoomControl:true}
	var map = new google.maps.Map(ge("map_canvas"),myOptions);

	var image = 'images/a.png';

	var bubble1 = new google.maps.InfoWindow({content: "Active Philadelphia<br>3675 Amber Street<br>Philadelphia, PA 19134"});
	var pos1 = new google.maps.LatLng(39.998087,-75.098687); //philly
	var marker1 = new google.maps.Marker({position:pos1,map: map,icon: image,title: "Active Philadelphia PA"});
	google.maps.event.addListener(marker1, 'click', function() {bubble1.open(map,marker1);});
	
	var bubble2 = new google.maps.InfoWindow({content: "Active Connecticut<br>25 Center Parkway<br>Plainfield, CT 06375"});
	var pos2 = new google.maps.LatLng(41.664721,-71.901595); //plainfield
	var marker2 = new google.maps.Marker({position:pos2,map: map,icon: image,title: "Active Plainfield CT"});
	google.maps.event.addListener(marker2, 'click', function() {bubble2.open(map,marker2);});
	
	var bubble3 = new google.maps.InfoWindow({content: "Active New York City Area<br>Route 9 West<br>Highland, NY 12528"});
	var pos3 = new google.maps.LatLng(41.73736,-73.962708); //highland
	var marker3 = new google.maps.Marker({position:pos3,map: map,icon: image,title: "Active Highland NY"});
	google.maps.event.addListener(marker3, 'click', function() {bubble3.open(map,marker3);});
	
	var bubble4 = new google.maps.InfoWindow({content: "Active Longview Area<br>516 Oak Road<br>Kelso, WA 98626"});
	var pos4 = new google.maps.LatLng(46.143388,-122.907722); //kelso
	var marker4 = new google.maps.Marker({position:pos4,map: map,icon: image,title: "Active Kelso WA"});
	google.maps.event.addListener(marker4, 'click', function() {bubble4.open(map,marker4);});
	
	var bubble5 = new google.maps.InfoWindow({content: "Active Phoenix<br>840 N. 43rd Ave.<br>Phoenix, AZ 85009"});
	var pos5 = new google.maps.LatLng(33.458056,-112.153359); //phoenix
	var marker5 = new google.maps.Marker({position:pos5,map: map,icon: image,title: "Active Phoenix AZ"});
	google.maps.event.addListener(marker5, 'click', function() {bubble5.open(map,marker5);});
	
	var bubble6 = new google.maps.InfoWindow({content: "Active San Antonio<br>1227 Basse Road<br>San Antonio, TX 78212"});
	var pos6 = new google.maps.LatLng(29.488612,-98.503762); //san antonio
	var marker6 = new google.maps.Marker({position:pos6,map: map,icon: image,title: "Active San Antonio TX"});
	google.maps.event.addListener(marker6, 'click', function() {bubble6.open(map,marker6);});
	
	var bubble7 = new google.maps.InfoWindow({content: "Active North Jersey<br>420 Midland Ave<br>Garfield, NJ 07026"});
	var pos7 = new google.maps.LatLng(40.877884,-74.102312); //garield
	var marker7 = new google.maps.Marker({position:pos7,map: map,icon: image,title: "Active Garfield NJ"});
	google.maps.event.addListener(marker7, 'click', function() {bubble7.open(map,marker7);});
	
	var bubble8 = new google.maps.InfoWindow({content: "Active Los Angeles Area<br>12150 Bloomfield Ave<br>Santa Fe Springs, CA 90670"});
	var pos8 = new google.maps.LatLng(33.920798,-118.062562); //santa fe springs
	var marker8 = new google.maps.Marker({position:pos8,map: map,icon: image,title: "Active Santa Fe Springs CA"});
	google.maps.event.addListener(marker8, 'click', function() {bubble8.open(map,marker8);});
	
	var bubble9 = new google.maps.InfoWindow({content: "Active Southern California<br>17635 Arrow Highway<br>Fontana, CA 92335"});
	var pos9 = new google.maps.LatLng(34.098692,-117.419729); //fontana
	var marker9 = new google.maps.Marker({position:pos9,map: map,icon: image,title: "Active Fontana CA"});
	google.maps.event.addListener(marker9, 'click', function() {bubble9.open(map,marker9);});
	
	var bubble10 = new google.maps.InfoWindow({content: "Active Orlando<br>1228 W Robinson Street<br>Orlando, FL 32805"});
	var pos10 = new google.maps.LatLng(28.545666,-81.396379); //orlando
	var marker10 = new google.maps.Marker({position:pos10,map: map,icon: image,title: "Active Orlando FL"});
	google.maps.event.addListener(marker10, 'click', function() {bubble10.open(map,marker10);});
	
	var bubble11 = new google.maps.InfoWindow({content: "Active Tampa Area<br>5001 Gateway Blvd Ste#25<br>Lakeland, FL 33811"});
	var pos11 = new google.maps.LatLng(28.010106,-82.047126); //lakeland
	var marker11 = new google.maps.Marker({position:pos11,map: map,icon: image,title: "Active Lakeland FL"});
	google.maps.event.addListener(marker11, 'click', function() {bubble11.open(map,marker11);});
	
	var bubble12 = new google.maps.InfoWindow({content: "Active Central Pennsylvania<br>980 N Old Trail Road<br>Selinsgrove, PA 17870"});
	var pos12 = new google.maps.LatLng(40.654841,-76.930458); //selinsgrove
	var marker12 = new google.maps.Marker({position:pos12,map: map,icon: image,title: "Active Selinsgrove PA"});
	google.maps.event.addListener(marker12, 'click', function() {bubble12.open(map,marker12);});
	
	/*
	var bubble13 = new google.maps.InfoWindow({content: "Active Philadelphia Area<br>1410 Manning Blvd<br>Levittown, PA 19057"});
	var pos13 = new google.maps.LatLng(40.12372,-74.841894); //levittown
	var marker13 = new google.maps.Marker({position:pos13,map: map,icon: image,title: "Active Levittown PA"});
	google.maps.event.addListener(marker13, 'click', function() {bubble13.open(map,marker13);});
	*/
	
	var bubble14 = new google.maps.InfoWindow({content: "Active Detroit Area<br>24340 Northline<br>Taylor, MI 48180"});
	var pos14 = new google.maps.LatLng(42.21193,-83.271619); //taylor
	var marker14 = new google.maps.Marker({position:pos14,map: map,icon: image,title: "Active Taylor MI"});
	google.maps.event.addListener(marker14, 'click', function() {bubble14.open(map,marker14);});
	
	var bubble15 = new google.maps.InfoWindow({content: "Active Chicago Area<br>52 Belmont Drive<br>Romeoville, IL 60446"});
	var pos15 = new google.maps.LatLng(41.647711,-88.08001); //romeoville
	var marker15 = new google.maps.Marker({position:pos15,map: map,icon: image,title: "Active Romeoville IL"});
	google.maps.event.addListener(marker15, 'click', function() {bubble15.open(map,marker15);});
	
	var bubble16 = new google.maps.InfoWindow({content: "Active Atlanta Area<br>526 Henry Ford II Ave<br>Hapeville, GA 30354"});
	var pos16 = new google.maps.LatLng(33.657106,-84.406773); //hapeville
	var marker16 = new google.maps.Marker({position:pos16,map: map,icon: image,title: "Active Hapeville GA"});
	google.maps.event.addListener(marker16, 'click', function() {bubble16.open(map,marker16);});
	
	var bubble17 = new google.maps.InfoWindow({content: "Active Baltimore<br>3200 Washington Blvd<br>Baltimore, MD 21230"});
	var pos17 = new google.maps.LatLng(39.258342,-76.662855); //baltimore
	var marker17 = new google.maps.Marker({position:pos17,map: map,icon: image,title: "Active Baltimore MD"});
	google.maps.event.addListener(marker17, 'click', function() {bubble17.open(map,marker17);});
	
	var bubble18 = new google.maps.InfoWindow({content: "Active Houston<br>4019 Manitou Drive<br>Houston, TX 77013"});
	var pos18 = new google.maps.LatLng(29.801026,-95.265742); //houston
	var marker18 = new google.maps.Marker({position:pos18,map: map,icon: image,title: "Active Houston TX"});
	google.maps.event.addListener(marker18, 'click', function() {bubble18.open(map,marker18);});
	
	var bubble19 = new google.maps.InfoWindow({content: "Active Albuquerque<br>1701 Aspen NW Unit C<br>Albuquerque, NM 87104"});
	var pos19 = new google.maps.LatLng(35.104757,-106.662885); //albuquerque
	var marker19 = new google.maps.Marker({position:pos19,map: map,icon: image,title: "Active Albuquerque NM"});
	google.maps.event.addListener(marker19, 'click', function() {bubble19.open(map,marker19);});
	
	var bubble20 = new google.maps.InfoWindow({content: "Active Youngstown<br>143 E. Woodlawn Ave<br>Youngstown, OH 44502"});
	var pos20 = new google.maps.LatLng(41.094198,-80.6513); //youngstown
	var marker20 = new google.maps.Marker({position:pos20,map: map,icon: image,title: "Active Youngstown OH"});
	google.maps.event.addListener(marker20, 'click', function() {bubble20.open(map,marker20);});
	
	var bubble215 = new google.maps.InfoWindow({content: "Active Houston 2<br>1521 McCarty Drive<br>Houston, TX 77029"});
	var pos215 = new google.maps.LatLng(29.763409,-95.283706); //houston 2
	var marker215 = new google.maps.Marker({position:pos215,map: map,icon: image,title: "Active Houston TX"});
	google.maps.event.addListener(marker215, 'click', function() {bubble215.open(map,marker215);});
	
	var bubble21 = new google.maps.InfoWindow({content: "Active Dallas Area<br>101 Industrial Street<br>Lancaster, TX 75134"});
	var pos21 = new google.maps.LatLng(32.613555,-96.743555); //lancaster
	var marker21 = new google.maps.Marker({position:pos21,map: map,icon: image,title: "Active Lancaster TX"});
	google.maps.event.addListener(marker21, 'click', function() {bubble21.open(map,marker21);});
	
	var bubble22 = new google.maps.InfoWindow({content: "Active Baltimore Area<br>5859 Washington Blvd<br>Elkridge, MD 21075"});
	var pos22 = new google.maps.LatLng(39.215236,-76.712025); //elkridge
	var marker22 = new google.maps.Marker({position:pos22,map: map,icon: image,title: "Active Elkridge MD"});
	google.maps.event.addListener(marker22, 'click', function() {bubble22.open(map,marker22);});
	
	var bubble23 = new google.maps.InfoWindow({content: "Active Charlotte<br>3719 Scott Futrell Drive<br>Charlotte, NC 28209"});
	var pos23 = new google.maps.LatLng(35.240352,-80.928473); //charlotte
	var marker23 = new google.maps.Marker({position:pos23,map: map,icon: image,title: "Active Charlotte NC"});
	google.maps.event.addListener(marker23, 'click', function() {bubble23.open(map,marker23);});
	
	var bubble24 = new google.maps.InfoWindow({content: "Active Mayfield<br>1111 Fulton Road<br>Mayfield, KY 42066"});
	var pos24 = new google.maps.LatLng(36.732955,-88.65143); //mayfield
	var marker24 = new google.maps.Marker({position:pos24,map: map,icon: image,title: "Active Mayfield KY"});
	google.maps.event.addListener(marker24, 'click', function() {bubble24.open(map,marker24);});
	
	var bubble25 = new google.maps.InfoWindow({content: "Active Cincinnati Area<br>1231 Fourth Ave<br>Dayton, KY 41074"});
	var pos25 = new google.maps.LatLng(39.115179,-84.4625); //dayton
	var marker25 = new google.maps.Marker({position:pos25,map: map,icon: image,title: "Active Dayton KY"});
	google.maps.event.addListener(marker25, 'click', function() {bubble25.open(map,marker25);});
	
	var bubble26 = new google.maps.InfoWindow({content: "Active Spokane<br>824 North Thierman<br>Spokane, WA 99212" });
	var pos26 = new google.maps.LatLng(47.664939,-117.313633); //spokane
	var marker26 = new google.maps.Marker({position:pos26,map: map,icon: image,title: "Active Spokane WA"});
	google.maps.event.addListener(marker26, 'click', function() {bubble26.open(map,marker26);});
	
	var bubble27 = new google.maps.InfoWindow({content: "Active Calgary<br>4420 Blackfoot Trail Southeast<br>Calgary, AL T2G4E6"});
	var pos27 = new google.maps.LatLng(51.01356,-114.048486); //calgary
	var marker27 = new google.maps.Marker({position:pos27,map: map,icon: image,title: "Active Calgary AL"});
	google.maps.event.addListener(marker27, 'click', function() {bubble27.open(map,marker27);});

	}
}
