//Images
var tImage=new Array()
tImage["svm"]="/images/news/thumb_locator.jpg";
tImage["fae"]="/images/news/thumb_account.jpg";
tImage["vehicleInf"]="/images/news/thumb_FPO.jpg";
tImage["FPO"]="/images/news/thumb_FPO.jpg";
tImage["PPV"]="/images/news/thumb_police.jpg";
tImage["ambulance"]="/images/news/thumb_ambulance.jpg";
tImage["svConversionVan"]="/images/news/thumb_pacer_ls.jpg";
tImage["platform"]="/images/news/thumb_platform_stake.jpg";
tImage["utility"]="/images/news/thumb_utility_service.jpg";
tImage["vanBody"]="/images/news/thumb_van_body.jpg";
tImage["police"]="/images/news/promotitle_police.jpg";
tImage["gmnews"]="/images/news/thumb_gm.jpg";
tImage["VanSafety"]="/images/news/thumb_van_safety.jpg";
tImage["TechnicalTips"]="/images/news/thumb_tech.jpg";
tImage["onstar"]="/images/news/thumb_onstar.jpg";
tImage["fvx"]="/images/news/thumb_purchase.jpg";
tImage["AstroBody"]="/images/news/thumb_astro.jpg";
tImage["MidBox"]="/images/news/thumb_midbox.jpg";
tImage["businessChoice"]="/images/news/thumb_choice.jpg";
tImage["businessChoicePromo"]="/images/news/thumb_choice.jpg";
tImage["findDealer"]="/images/news/thumb_dealers_chevy_gmc.jpg";
tImage["SilveradoHD"]="/images/news/thumb_promo_silverado.jpg";
tImage["SilveradoHD2012"]="/images/news/thumb_promo_silverado.jpg";
tImage["SierraHD"]="/images/news/thumb_promo_sierra.jpg";
tImage["SierraHD2012"]="/images/news/thumb_promo_sierra.jpg";
tImage["StabiliTrak"]="/images/news/StabiliTrak_tile_only.jpg";
tImage["AltFuels"]="/images/news/Alt_Fuels_promotile.jpg";
tImage["AltFuelsNew"]="/images/news/Alt_Fuels_promotile.jpg";
tImage["AltFuelsBrochure"]="/images/news/Alt_Fuels_promotile.jpg";
tImage["volt"]="/images/news/thumb_volt.jpg";
tImage["vans"]="/images/news/thumb_vans.jpg";
tImage["cng"]="/images/news/thumb_cng.jpg";
tImage["cddl"]="/images/news/thumb_cddl.jpg";
tImage["businessChoice2"]="/images/news/thumb_choice.jpg";

//Titles
var tTitle=new Array()
tTitle["svm"]="SVM Locator";
tTitle["fae"]="Government Sales";
tTitle["vehicleInf"]="Vehicle Information";
tTitle["FPO"]="Lorem ipsum dolor sit";
tTitle["PPV"]="All-New 2011 Chevrolet Caprice PPV";
tTitle["ambulance"]="Specialty Vehicles ";
tTitle["svConversionVan"]="Specialty Vehicles ";
tTitle["platform"]="Specialty Vehicles ";
tTitle["utility"]="Specialty Vehicles ";
tTitle["vanBody"]="Specialty Vehicles ";
tTitle["police"]="Police Vehicles";
tTitle["gmnews"]="GM News";
tTitle["VanSafety"]="Passenger Van Safety";
tTitle["TechnicalTips"]="Technical Tips";
tTitle["onstar"]="OnStar";
tTitle["fvx"]="Fleet Purchase Program (FVX)";
tTitle["AstroBody"]="AstroBody";
tTitle["MidBox"]="MidBox";
tTitle["businessChoice"]="Valuable Offers For Business Owners";
tTitle["businessChoicePromo"]="Valuable Offers For Business Owners";
tTitle["findDealer"]="Business Central Dealers";
tTitle["SilveradoHD"]="NEW 2011 Chevrolet Silverado HD";
tTitle["SilveradoHD2012"]="NEW 2012 Chevrolet Silverado HD";
tTitle["SierraHD"]="NEW 2011 GMC Sierra HD";
tTitle["SierraHD2012"]="NEW 2012 GMC Sierra HD";
tTitle["StabiliTrak"]="Electronic Stability Control";
tTitle["AltFuels"]="GM Advanced Technology";
tTitle["AltFuelsNew"]="GM Advanced Technology";
tTitle["AltFuelsBrochure"]="OUR VEHICLES, OUR MISSION";
tTitle["volt"]="Get Plugged In";
tTitle["vans"]="Cargo, Passenger & Cutaway";
tTitle["cng"]="CNG Option for GM Vans";
tTitle["cddl"]="Courtesy Delivery Dealer List";
tTitle["businessChoice2"]="Valuable Offers For Business Owners";

//Copies
var tCopy=new Array()
tCopy["svm"]="GM Special Vehicle Manufacturers provide quality upfit products to enhance your GM chassis and vans.";
tCopy["fae"]="Get support for your government vehicle needs.";
tCopy["vehicleInf"]="Get information about our full van portfolio, vocational applications, and van safety. ";
tCopy["FPO"]="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed";
tCopy["PPV"]="Investigate the powerful, intelligent and spacious police patrol vehicle.";
tCopy["ambulance"]="View upfit options available for<br />this chassis. ";
tCopy["svConversionVan"]="View upfit options available for<br />this chassis.";
tCopy["platform"]="View upfit options available for<br />this chassis.";
tCopy["utility"]="View upfit options available for<br />this chassis.";
tCopy["vanBody"]="View upfit options available for<br />this chassis.";
tCopy["police"]="View all police and special<br />service vehicles.";
tCopy["gmnews"]="Get the latest news and current offers.";
tCopy["VanSafety"]="The most comprehensive standard safety package ever offered on a GM full-size van.";
tCopy["TechnicalTips"]="Discover ways to lower your fleet maintenance and repair expenses.";
tCopy["onstar"]="Gain greater productivity and efficiency by using OnStar features like Turn-by-Turn Navigation.";
tCopy["fvx"]="Get allowances on select GM models for varied uses (for qualified fleet customers).";
tCopy["AstroBody"]="Learn how to upfit your vehicle with AstroBody features & options.";
tCopy["MidBox"]="Learn how to upfit your vehicle with MidBox features & options.";
tCopy["businessChoice"]="Choose from great benefits &#8212; including upfit packages and gift cards &#8212; when you purchase or lease a new eligible vehicle.";
tCopy["businessChoicePromo"]="Choose from great benefits &#8212; including upfit packages and gift cards &#8212; when you purchase or lease a new eligible vehicle.";
tCopy["findDealer"]="The one-stop shop for business owner's vehicle needs.";
tCopy["SilveradoHD"]="The heavier-duty heavy-duty. More power. More torque. Higher payload.";
tCopy["SilveradoHD2012"]="The heavier-duty heavy-duty. More power. More torque. Higher payload.";
tCopy["SierraHD"]="The competition’s got a heavy-duty new opponent. More power. More torque. Higher payload.";
tCopy["SierraHD2012"]="The competition’s got a heavy-duty new opponent. More power. More torque. Higher payload.";
tCopy["StabiliTrak"]="Standard on many GM vehicles, StabiliTrak&#174 offers enhanced safety in adverse driving conditions.";
tCopy["AltFuels"]="Discover our latest fuel solutions-the technology, the vehicles, the emission standards, plus credits and incentives. ";
tCopy["AltFuelsNew"]="Alternative fuel and advanced technology vehicles, plus emissions standards, credits and incentives.";
tCopy["AltFuelsbrochure"]="Read more about our advanced fuel solutions and the technology that's making them happen.";
tCopy["volt"]="ChevroletVoltage.com &mdash; an electric vehicle enthusiast social network.";
tCopy["vans"]="Browse our full lineup of Chevy and GMC vans and find the right one for your business needs.";
tCopy["cng"]="The 2011 Chevrolet Express and GMC Savana vans offer a Compressed Natural Gas (CNG) option for fleet and commercial customers.";
tCopy["cddl"]="Fleet Customers: Use this list to locate Courtesy Delivery Dealers by city and state.";
tCopy["businessChoice2"]="GM Business Choice offers four great options to equip your eligible new Chevy or GMC vehicles.";

//urls
var tURL=new Array()
tURL["svm"]="/sitemap/svmlocator_landing.jsp";
tURL["fae"]="/government/ordering/commercial-government-police-sales-managers.jsp";
tURL["vehicleInf"]="#";
tURL["FPO"]="#";
tURL["PPV"]="http://www.chevroletcapriceppv.com";
tURL["ambulance"]="/ambulance-rescue/";
tURL["svConversionVan"]="/conversion-van/";
tURL["platform"]="/platform-stake-body/";
tURL["utility"]="/utility-service-body/";
tURL["vanBody"]="/van-body/";
tURL["police"]="/police/";
tURL["gmnews"]="/sitemap/newsOffers.jsp";
tURL["VanSafety"]="javascript:flashPopUp('/flash/van-safety-video/vansafetyvideo.jsp','Safety','width=420,height=340')";
tURL["TechnicalTips"]="/service-maintenance/maintenance-info/technicaltips.jsp";
tURL["onstar"]="javascript:omniOnstar(\\'promo tile\\'); flashPopUp(\\'http://www.onstar.com/us_english/jsp/services/index.jsp?make=gmFleet&model=gmFleet&deepLink=overview\\',\\'ONSTAR\\',\\'width=897,height=595,top=0,left=0,scrollbars=yes\\')";
tURL["fvx"]="/smallbusiness/incentives/2012fvx.jsp?from=CO";
tURL["AstroBody"]="/pdf/Astro_Body_Hero_Card.pdf";
tURL["MidBox"]="/pdf/Midbox_Storage.pdf";
tURL["businessChoice"]="/businessChoice/gmfleet/index.jsp?cmp=BusChoice_HPPromo";
tURL["businessChoicePromo"]="/businessChoice/gmfleet/index.jsp?cmp=BusChoice_HPPromo";
tURL["findDealer"]="/business-central-dealers/index.jsp";
tURL["SilveradoHD"]="/heavy-duty-trucks/index.jsp";
tURL["SilveradoHD2012"]="/heavy-duty-trucks/index.jsp";
tURL["SierraHD"]="/heavy-duty-trucks/index.jsp";
tURL["SierraHD2012"]="/heavy-duty-trucks/index.jsp";
tURL["StabiliTrak"]="/sitemap/stabiliTrak/stabiliTrak.jsp";
tURL["AltFuels"]="/alternative-fuels";
tURL["AltFuelsNew"]="/alternative-fuels";
tURL["AltFuelsBrochure"]="/pdf/AFVi_Brochure_spreads.pdf";
tURL["volt"]="http://chevroletvoltage.com/?cid=fleetaltfuels";
tURL["vans"]="/vans/index.jsp ";
tURL["cng"]="/compressed-natural-gas-vans/index.jsp";
tURL["cddl"]="/pdf/courtesy-delivery-dealers.pdf";
tURL["businessChoice2"]="/businessChoice/gmfleet/index.jsp?cmp=BusChoice_HPPromo";

//target
var tOpenResult=new Array()
tOpenResult["svm"]="_self";
tOpenResult["fae"]="_self";
tOpenResult["vehicleInf"]="_self";
tOpenResult["sVehicles"]="_self";
tOpenResult["FPO"]="_self";
tOpenResult["PPV"]="_blank";
tOpenResult["ambulance"]="_self";
tOpenResult["svConversionVan"]="_self";
tOpenResult["platform"]="_self";
tOpenResult["utility"]="_self";
tOpenResult["vanBody"]="_self";
tOpenResult["police"]="_self";
tOpenResult["gmnews"]="_self";
tOpenResult["VanSafety"]="";
tOpenResult["TechnicalTips"]="_self";
tOpenResult["onstar"]="";
tOpenResult["fvx"]="_self";
tOpenResult["AstroBody"]="_blank";
tOpenResult["MidBox"]="_blank";
tOpenResult["SilveradoHD"]="_self";
tOpenResult["SilveradoHD2012"]="_self";
tOpenResult["SierraHD"]="_self";
tOpenResult["SierraHD2012"]="_self";
tOpenResult["AltFuelsBrochure"]="_blank";
tOpenResult["volt"]="_blank";
tOpenResult["vans"]="_self";
tOpenResult["cng"]="_self";
tOpenResult["cddl"]="_self";

//additional information
var tAdditional=new Array()
tAdditional["svm"]="Learn More &gt;&gt;";
tAdditional["fae"]="Learn More &gt;&gt;";
tAdditional["vehicleInf"]="Learn More &gt;&gt;";
tAdditional["sVehicles"]="Learn More &gt;&gt;";
tAdditional["FPO"]="Learn More &gt;&gt;";
tAdditional["PPV"]="Learn More &gt;&gt;";
tAdditional["ambulance"]="Learn More &gt;&gt;";
tAdditional["svConversionVan"]="Learn More &gt;&gt;";
tAdditional["platform"]="Learn More &gt;&gt;";
tAdditional["utility"]="Learn More &gt;&gt;";
tAdditional["vanBody"]="Learn More &gt;&gt;";
tAdditional["police"]="Learn More &gt;&gt;";
tAdditional["gmnews"]="Learn More &gt;&gt;";
tAdditional["VanSafety"]="Watch the Video &gt;&gt;";
tAdditional["TechnicalTips"]="Learn More &gt;&gt;";
tAdditional["onstar"]="Learn More &gt;&gt;";
tAdditional["fvx"]="Learn More &gt;&gt;";
tAdditional["AstroBody"]="Learn More &gt;&gt;";
tAdditional["MidBox"]="Learn More &gt;&gt;";
tAdditional["businessChoice"]="Learn More &gt;&gt;";
tAdditional["businessChoicePromo"]="Learn More &gt;&gt;";
tAdditional["findDealer"]="Learn More &gt;&gt;";
tAdditional["SilveradoHD"]="Learn More &gt;&gt;";
tAdditional["SilveradoHD2012"]="Learn More &gt;&gt;";
tAdditional["SierraHD"]="Learn More &gt;&gt;";
tAdditional["SierraHD2012"]="Learn More &gt;&gt;";
tAdditional["StabiliTrak"]="Learn More &gt;&gt;";
tAdditional["AltFuels"]="Learn More &gt;&gt;";
tAdditional["AltFuelsNew"]="Learn More &gt;&gt;";
tAdditional["AltFuelsBrochure"]="Download the Brochure (PDF) &gt;&gt;";
tAdditional["volt"]="Join Now";
tAdditional["vans"]="Learn More &gt;&gt;";
tAdditional["cng"]="Learn More &gt;&gt;";
tAdditional["cddl"]="Download the List &gt;&gt;";
tAdditional["businessChoice2"]="Learn More &gt;&gt;";

//Promotiles Omnitures

var tRel=new Array()
tRel["svm"]="";
tRel["fae"]="omni-FAEPROMOTILE";
tRel["gmnews"]="";
tRel["VanSafety"]="";
tRel["TechnicalTips"]="";
tRel["onstar"]="";
tRel["fvx"]="";
tRel["AstroBody"]="";
tRel["MidBox"]="";
tRel["businessChoice"]="";
tRel["businessChoicePromo"]="";
tRel["findDealer"]="";
tRel["SilveradoHD"]="";
tRel["SilveradoHD2012"]="";
tRel["SierraHD"]="";
tRel["SierraHD2012"]="";
tRel["AltFuelsBrochure"]="";
tRel["volt"]="";
tRel["businessChoice2"]="";

function overviewTile(){
	this.tImages=tImage;
	this.tTitles=tTitle;
	this.tTexts=tCopy;
	this.tURLs=tURL;	
	this.getPageTilesOverview=getPageTilesOverview;
	this.tOpenResult=tOpenResult;
	this.tAdditional=tAdditional;
	this.tRel=tRel;
}

function getPageTilesOverview(pTile1, pTile2, pTile3, pTile4){
	var cTileHead;
	var cTileEnd;
		cTileHead = "<div id=\"newsOverview\">";
		cTileEnd = "</a>";
	
	if (pTile2 != undefined) {
		if (pTile3 != undefined) {
			if(pTile4 != undefined){
				howMany = 4;
			}else {
				howMany = 3;
			}
		}else {
			howMany = 2;
		}
	}else {
		howMany = 1;
	}
	
	var cTilesContent	=	cTileHead + "<div id=\"toolNewContent\">" +
							"<div class=\"newItemOverview\">"  +
								"<a rel=\"" + this.tRel[pTile1] +"\" name=\"" + pTile1 +"\" href=\"javascript:trackAndGo('s_pageName-GM FLEET | CURRENT OFFERS | HOME*s_prop24-fleet:us:currentoffers: promotile:1."+howMany+":"+this.tTitles[pTile1]+"','"+this.tURLs[pTile1]+"','"+this.tOpenResult[pTile1]+"')\"><img src=\""+ this.tImages[pTile1] +"\"/></a>" +
								"<h3>"+ this.tTitles[pTile1] +"</h3>" +
								"<p>"+ this.tTexts[pTile1] +"</p>" +
								"<a class=\"overviewLink\" rel=\"" + this.tRel[pTile1] +"\" name=\"" + pTile1 +"\" href=\"javascript:trackAndGo('s_pageName-GM FLEET | CURRENT OFFERS | HOME*s_prop24-fleet:us:currentoffers: promotile:1."+howMany+":"+this.tTitles[pTile1]+"','"+this.tURLs[pTile1]+"','"+this.tOpenResult[pTile1]+"')\">"+ this.tAdditional[pTile1] + cTileEnd +
							"</div>"; 
		if (pTile2 != undefined){					
			cTilesContent= cTilesContent + "<div class=\"newItemOverview\">" +
								"<a rel=\"" + this.tRel[pTile2] +"\" name=\"" + pTile2 +"\" href=\"javascript:trackAndGo('s_pageName-GM FLEET | CURRENT OFFERS | HOME*s_prop24-fleet:us:currentoffers: promotile:2."+howMany+":"+this.tTitles[pTile2]+"','"+this.tURLs[pTile2]+"','"+this.tOpenResult[pTile2]+"')\"><img src=\""+ this.tImages[pTile2] +"\"/></a>" +
								"<h3>"+ this.tTitles[pTile2] +"</h3>" +
								"<p>"+ this.tTexts[pTile2] +"</p>" +
								"<a class=\"overviewLink\" rel=\"" + this.tRel[pTile2] +"\" name=\"" + pTile2 +"\" href=\"javascript:trackAndGo('s_pageName-GM FLEET | CURRENT OFFERS | HOME*s_prop24-fleet:us:currentoffers: promotile:2."+howMany+":"+this.tTitles[pTile2]+"','"+this.tURLs[pTile2]+"','"+this.tOpenResult[pTile2]+"')\">"+ this.tAdditional[pTile2] +" </a>" +
							"</div>";	
		}
		if (pTile3 != undefined){					
			cTilesContent= cTilesContent + "<div class=\"newItemOverview\">" +
								"<a rel=\"" + this.tRel[pTile3] +"\" name=\"" + pTile3 +"\" href=\"javascript:trackAndGo('s_pageName-GM FLEET | CURRENT OFFERS | HOME*s_prop24-fleet:us:currentoffers: promotile:3."+howMany+":"+this.tTitles[pTile3]+"','"+this.tURLs[pTile3]+"','"+this.tOpenResult[pTile3]+"')\"><img src=\""+ this.tImages[pTile3] +"\"/></a>" +
								"<h3>"+ this.tTitles[pTile3] +"</h3>" +
								"<p>"+ this.tTexts[pTile3] +"</p>" +
								"<a class=\"overviewLink\" rel=\"" + this.tRel[pTile3] +"\" name=\"" + pTile3 +"\" href=\"javascript:trackAndGo('s_pageName-GM FLEET | CURRENT OFFERS | HOME*s_prop24-fleet:us:currentoffers: promotile:3."+howMany+":"+this.tTitles[pTile3]+"','"+this.tURLs[pTile3]+"','"+this.tOpenResult[pTile3]+"')\">"+ this.tAdditional[pTile3] +" </a>" +
							"</div>";	
		}
		if (pTile4 != undefined){					
			cTilesContent= cTilesContent + "<div class=\"newItemOverview\">" +
								"<a rel=\"" + this.tRel[pTile4] +"\" name=\"" + pTile4 +"\" href=\"javascript:trackAndGo('s_pageName-GM FLEET | CURRENT OFFERS | HOME*s_prop24-fleet:us:currentoffers: promotile:4."+howMany+":"+this.tTitles[pTile4]+"','"+this.tURLs[pTile4]+"','"+this.tOpenResult[pTile4]+"')\"><img src=\""+ this.tImages[pTile4] +"\"/></a>" +
								"<h3>"+ this.tTitles[pTile4] +"</h3>" +
								"<p>"+ this.tTexts[pTile4] +"</p>" +
								"<a class=\"overviewLink\" rel=\"" + this.tRel[pTile4] +"\" name=\"" + pTile4 +"\" href=\"javascript:trackAndGo('s_pageName-GM FLEET | CURRENT OFFERS | HOME*s_prop24-fleet:us:currentoffers: promotile:4."+howMany+":"+this.tTitles[pTile4]+"','"+this.tURLs[pTile4]+"','"+this.tOpenResult[pTile4]+"')\">"+ this.tAdditional[pTile4] +" </a>" +
							"</div>";	
		}
		cTilesContent= cTilesContent + 	"</div>" + 	"</div>" + "<div id=\"toolNewLast\">";			
	return cTilesContent;	
}


function PageTilesOverview(pTiles1, pTiles2, pTiles3, pTiles4){
	this.overviewTiles1=pTiles1;
	this.overviewTiles2=pTiles2;
	this.overviewTiles3=pTiles3;
	this.overviewTiles4=pTiles4;
}

function getRotationTilesOverview(pfileName, pRotation1, pRotation2, pRotation3, pRotation4){
	var aTiles1,aTiles2,aTiles3,aTiles4,aTilesContainer,pTitles;
	pTitles=overviewInfo[pfileName];
	aTiles1=pTitles.overviewTiles1;
	aTiles2=pTitles.overviewTiles2;	
	aTiles3=pTitles.overviewTiles3;	
	aTiles4=pTitles.overviewTiles4;	
	aTilesContainer = new Array (aTiles1[pRotation1], aTiles2[pRotation2], aTiles3[pRotation3], aTiles4[pRotation4]);
	return aTilesContainer;
}

function getLengthOverview(fileName){
	var cont;
	if(overviewInfo[fileName]){
		var i = new PageTilesOverview(overviewInfo[fileName].overviewTiles1, overviewInfo[fileName].overviewTiles2, overviewInfo[fileName].overviewTiles3, overviewInfo[fileName].overviewTiles4);
		cont = new Array(i.overviewTiles1.length, i.overviewTiles2.length, i.overviewTiles3.length, i.overviewTiles4.length);			
	}
	return cont;
}
function flashPopUp(URL,winName,params){
	//**
	window.open(URL,winName,params);
	//**
}
function showHideNewsDivs(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = 'block';
	}
	var btnDiv = document.getElementById('showAllBtn');
	var linkName = btnDiv.innerHTML;
	if (linkName == "Show All") {
		btnDiv.innerHTML = "Hide Older Entries";
	} else {
		btnDiv.innerHTML = "Show All";
	}
	
}

function trackAndGo (data,url,target) {
	var parameters = data.split("*");
	
	for (x=0;x<parameters.length;x++) {
		var info = parameters[x].split("-");
		if (info[0] == 's_pageName') s_pageName_val = info[1];
		if (info[0] == 's_prop24') s_prop24_val = info[1];
	}
	
	clickTrack2({s_pageName: s_pageName_val, s_prop24: s_prop24_val});
	
	if (target == '_blank') {
		window.open(url,'blank');
	}else {
		setTimeout(function(){trackAndGoUrl(url)},2000);
	}
}

function trackAndGoUrl(url) {
	location.href = url;
}

