// This function displays the current time, hours and minutes.
// Is used in the View Live Adverts psge.
function showTime()
{
	var d = new Date();
	
	var curr_hour = d.getHours();
	var curr_min = d.getMinutes();
	
	document.write(curr_hour + ":" + curr_min);
}

// This function is used on load by all pages to set which menus, tabs, qpl mode etc should be displayed on page load. 
function setDefaults(defaultNo)
{
	switch (defaultNo)
	{
	case 0:
	  setTab(5);
//	  QPLChooser(3);
	  break;
	case 1:
	  changeImgAuto();
	  setTab(1);
	  setCarousel(1);
	//  QPLChooser(3);
	  break;
	case 2:
	  setTab(2);
	  //QPLChooser(3);
	  break;
	case 3:
	  setTab(3);
	  //QPLChooser(3);
	  break;
	case 4:
	  setTab(4);
	  //QPLChooser(3);
	  break;
	case 5:
	  //QPLChooser(2);
	  setSTab(1);
	  break;
	case 6:
	  //QPLChooser(2);
	  setSTab(2);
	  break;
	case 7:
	  //QPLChooser(2);
	  setSTab(3);
	  break;
	case 8:
	  //QPLChooser(2);
	  setSTab(4);
	  break;
	case 9:
	  //QPLChooser(2);
	  setSTab(5);
	  break;
	case 10:
	  //QPLChooser(2);
	  setSTab(6);
	  break;
	case 11:
	  //QPLChooser(2);
	  showLinks(0);
	  newsTabs(0);
	  break;
	case 12:
	  //QPLChooser(2);
	  break;
	default:
	  document.write("Shouldn't see this!");
	}	
}



// Preload service message and ind news tabs in subscribed homepage
function subhImgPreload()
{	
	if (document.images)
	{
	  pic1= new Image(162,33); 
	  pic1.src="/DealerPortal3/images/tabs/n_mess1.gif"; 
	
	  pic2= new Image(162,33); 
	  pic2.src="/DealerPortal3/images/tabs/n_mess2.gif"; 
	
	  pic3= new Image(163,33); 
	  pic3.src="/DealerPortal3/images/tabs/n_ind1.gif"; 
	  
	  pic4= new Image(163,33);
	  pic4.src="/DealerPortal3/images/tabs/n_ind2.gif";
	}
}


// This function is used on the news and message box in the subscribed homepage to switch the 
// contents and tab graphics when either of the tabs are clicked.
function newsTabs(messOrNews)
{

	switch (messOrNews)
	{
	case 0:	
	  document.getElementById("n_t1").style.background = "url(/DealerPortal3/images/tabs/n_mess1.gif)";
	  document.getElementById("n_t2").style.background = "url(/DealerPortal3/images/tabs/n_ind2.gif)";
	  document.getElementById("messages_news").style.background = "url(/DealerPortal3/images/watermarks/w_message.gif) no-repeat 90% 0%";
	  document.getElementById("news_items").style.visibility = "hidden";
	  document.getElementById("news_bot").style.visibility = "hidden";
	  document.getElementById("service_messages").style.visibility = "visible";
	  document.getElementById("mess_bot").style.visibility = "visible";
	  break;
	case 1:
	  document.getElementById("n_t1").style.background = "url(/DealerPortal3/images/tabs/n_mess2.gif)";
	  document.getElementById("n_t2").style.background = "url(/DealerPortal3/images/tabs/n_ind1.gif)";
	  document.getElementById("messages_news").style.background = "url(/DealerPortal3/images/watermarks/w_news.gif) no-repeat 90% 0%";
	  document.getElementById("news_items").style.visibility = "visible";
	  document.getElementById("news_bot").style.visibility = "visible";
	  document.getElementById("service_messages").style.visibility = "hidden";
	  document.getElementById("mess_bot").style.visibility = "hidden";
	  break;
	default:
	  document.write("Shouldn't see this!");
	}
}

// This function is used on the contact and feedback tabs in the contact us page to switch the 
// contents and tab graphics when either of the tabs are clicked.
function contactTabs(contOrFeed)
{

	switch (contOrFeed)
	{
	case 0:	
	  document.getElementById("c_t1").style.background = "url(/DealerPortal3/images/tabs/n_mess1.gif)";
	  document.getElementById("c_t2").style.background = "url(/DealerPortal3/images/tabs/n_ind2.gif)";
	  document.getElementById("feedback_form").style.display = "block";
	  document.getElementById("contact_form").style.display = "none";
	  document.forms.contact_form.productname.style.visibility = "hidden";
	  document.forms.contact_form.title.style.visibility = "hidden";
	  document.forms.feedback_form.productname.style.visibility = "visible";
	  document.forms.feedback_form.title.style.visibility = "visible";
	  break;
	case 1:
	  document.getElementById("c_t1").style.background = "url(/DealerPortal3/images/tabs/n_mess2.gif)";
	  document.getElementById("c_t2").style.background = "url(/DealerPortal3/images/tabs/n_ind1.gif)";
	  document.getElementById("feedback_form").style.display = "none";
	  document.getElementById("contact_form").style.display = "block";
	  document.forms.feedback_form.productname.style.visibility = "hidden";
	  document.forms.feedback_form.title.style.visibility = "hidden";
	  document.forms.contact_form.productname.style.visibility = "visible";
	  document.forms.contact_form.title.style.visibility = "visible";
	  break;
	default:
	  document.write("Shouldn't see this!");
	}
}

// This function is used on the products or packages box in the psm pages to switch the 
// contents and tab graphics when either of the tabs are clicked.
function prodpackTabs(prodOrPack)
{

	switch (prodOrPack)
	{
	case 0:	
	  document.getElementById("pp_t1").style.background = "url(/DealerPortal3/images/psm/sidetab_on.gif)";
	  document.getElementById("pp_t2").style.background = "url(/DealerPortal3/images/psm/sidetab_off.gif)";
	  document.getElementById("prod_bot").style.display = "block";
	  document.getElementById("pack_bot").style.display = "none";
	  break;
	case 1:
	  document.getElementById("pp_t1").style.background = "url(/DealerPortal3/images/psm/sidetab_off.gif)";
	  document.getElementById("pp_t2").style.background = "url(/DealerPortal3/images/psm/sidetab_on.gif)";
	  document.getElementById("prod_bot").style.display = "none";
	  document.getElementById("pack_bot").style.display = "block";
	  break;
	default:
	  document.write("Shouldn't see this!");
	}
}

// This function is used to pop open a window when a pdf link is clicked in the industry news/dealer update section of the website.
function showPDF(PDFName)
{
	if(PDFName== null || PDFName=="" || PDFName=="-1")
	return;
	PDFWindow= window.open (getRedDotUrl()+"/dealerportal_08/news/pdf/" + PDFName +".pdf", "mywindow","location=1,status=1,scrollbars=1");
	PDFWindow.moveTo(0,0);
}

// This is a generic pop-up window function
function naviTo(goToURL)
{
	window.open (goToURL, "mywindow","location=1,status=1,scrollbars=1");
}

// This pop-up window function is used to open the dealer portal help section of the website
function newWindow()
{
	window.open("/help/faq/faq.jsp?loggedIn=","help","width=788px,height=610px,scrollbars=no,menubar=no,status=no,toolbar=no,resizable=no");
}

// This pop-up window function is used to open the dealer portal help section of the website if clicked from the subscribed area
function newWindow_s()
{
	window.open("/help/faq/faq.jsp?loggedIn=y","help","width=788px,height=610px,scrollbars=no,menubar=no,status=no,toolbar=no,resizable=no");
}

// This function shows the appropriate link content on the subscribed homepage, based on the selection made from the drop down list
function showLinks(LinkNo)
{
	switch (LinkNo)
	{
	case 0:
	  // Shows Cars Links
	  document.getElementById("cars").style.display = "block";
	  document.getElementById("bikes").style.display = "none";
	  document.getElementById("vans").style.display = "none";
	  document.getElementById("trucks").style.display = "none";
	  document.getElementById("plant").style.display = "none";
	  document.getElementById("caravans").style.display = "none";
	  break;
	case 1:
	  // Shows Bikes Links
	  document.getElementById("cars").style.display = "none";
	  document.getElementById("bikes").style.display = "block";
	  document.getElementById("vans").style.display = "none";
	  document.getElementById("trucks").style.display = "none";
	  document.getElementById("plant").style.display = "none";
	  document.getElementById("caravans").style.display = "none";
	  break;
	case 2:
	  // Shows Vans Links
	  document.getElementById("cars").style.display = "none";
	  document.getElementById("bikes").style.display = "none";
	  document.getElementById("vans").style.display = "block";
	  document.getElementById("trucks").style.display = "none";
	  document.getElementById("plant").style.display = "none";
	  document.getElementById("caravans").style.display = "none";
	  break;
	case 3:
	  // Shows Trucks Links
	  document.getElementById("cars").style.display = "none";
	  document.getElementById("bikes").style.display = "none";
	  document.getElementById("vans").style.display = "none";
	  document.getElementById("trucks").style.display = "block";
	  document.getElementById("plant").style.display = "none";
	  document.getElementById("caravans").style.display = "none";
	  break;
	case 4:
	  // Shows Plant Links
	  document.getElementById("cars").style.display = "none";
	  document.getElementById("bikes").style.display = "none";
	  document.getElementById("vans").style.display = "none";
	  document.getElementById("trucks").style.display = "none";
	  document.getElementById("plant").style.display = "block";
	  document.getElementById("caravans").style.display = "none";
	  break;
	case 5:
	  // Shows Motorhome and Caravan Links
	  document.getElementById("cars").style.display = "none";
	  document.getElementById("bikes").style.display = "none";
	  document.getElementById("vans").style.display = "none";
	  document.getElementById("trucks").style.display = "none";
	  document.getElementById("plant").style.display = "none";
	  document.getElementById("caravans").style.display = "block";
	  break;
	default:
	  document.write("Shouldn't see this!");
	}
}


// Sets the active tab image based on the tab number passed into the function
function setTab(tabNumber)
{
	switch (tabNumber)
	{
	case 1:
	  // Highlights the Home Tab
	  document.getElementById('u_t1').style.background = 'url(/DealerPortal3/images/tabs/t_home_2.gif)';
	  document.getElementById('u_t2').style.background = 'url(/DealerPortal3/images/tabs/t_stock_1.gif)';
	  document.getElementById('u_t3').style.background = 'url(/DealerPortal3/images/tabs/t_dealer_1.gif)';
	  document.getElementById('u_t4').style.background = 'url(/DealerPortal3/images/tabs/t_business_1.gif)';
	  break;
	case 2:
	  // Highlights the Stock Management Tab
	  document.getElementById('u_t1').style.background = 'url(/DealerPortal3/images/tabs/t_home_1.gif)';
	  document.getElementById('u_t2').style.background = 'url(/DealerPortal3/images/tabs/t_stock_2.gif)';
	  document.getElementById('u_t3').style.background = 'url(/DealerPortal3/images/tabs/t_dealer_1.gif)';
	  document.getElementById('u_t4').style.background = 'url(/DealerPortal3/images/tabs/t_business_1.gif)';
	  break;
	case 3:
	  // Highlights the Dealership Marketing Tab
	  document.getElementById('u_t1').style.background = 'url(/DealerPortal3/images/tabs/t_home_1.gif)';
	  document.getElementById('u_t2').style.background = 'url(/DealerPortal3/images/tabs/t_stock_1.gif)';
	  document.getElementById('u_t3').style.background = 'url(/DealerPortal3/images/tabs/t_dealer_2.gif)';
	  document.getElementById('u_t4').style.background = 'url(/DealerPortal3/images/tabs/t_business_1.gif)';
	  break;
	case 4:
	  // Hightlights the Business Intelligence Tab
	  document.getElementById('u_t1').style.background = 'url(/DealerPortal3/images/tabs/t_home_1.gif)';
	  document.getElementById('u_t2').style.background = 'url(/DealerPortal3/images/tabs/t_stock_1.gif)';
	  document.getElementById('u_t3').style.background = 'url(/DealerPortal3/images/tabs/t_dealer_1.gif)';
	  document.getElementById('u_t4').style.background = 'url(/DealerPortal3/images/tabs/t_business_2.gif)';
	  break;
	case 5:
	  // Highlights none of the tabs
	  document.getElementById('u_t1').style.background = 'url(/DealerPortal3/images/tabs/t_home_1.gif)';
	  document.getElementById('u_t2').style.background = 'url(/DealerPortal3/images/tabs/t_stock_1.gif)';
	  document.getElementById('u_t3').style.background = 'url(/DealerPortal3/images/tabs/t_dealer_1.gif)';
	  document.getElementById('u_t4').style.background = 'url(/DealerPortal3/images/tabs/t_business_1.gif)';
	  break;
	default:
	  document.write("Shouldn't see this!");
	}
}

// This function works the same as the previous function except this is for the subscribed area.
function setSTab(tabNumber)
{
	switch (tabNumber)
	{
	case 1:
	  // Highlights the Advertising tab
	  document.getElementById('s_t1').style.background = 'url(/DealerPortal3/images/tabs/s_tab1_2.gif)';
	  document.getElementById('s_t2').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t3').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t4').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t5').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t6').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  break;
	case 2:
	  // Highlights the Stock Management tab
	  document.getElementById('s_t1').style.background = 'url(/DealerPortal3/images/tabs/s_tab1_1.gif)';
	  document.getElementById('s_t2').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_2.gif)';
	  document.getElementById('s_t3').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t4').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t5').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t6').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  break;
	case 3:
	  // Highlights the Find Stock tab
	  document.getElementById('s_t1').style.background = 'url(/DealerPortal3/images/tabs/s_tab1_1.gif)';
	  document.getElementById('s_t2').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t3').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_2.gif)';
	  document.getElementById('s_t4').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t5').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t6').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  break;
	case 4:
	  // Highlights the Lead Management tab
	  document.getElementById('s_t1').style.background = 'url(/DealerPortal3/images/tabs/s_tab1_1.gif)';
	  document.getElementById('s_t2').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t3').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t4').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_2.gif)';
	  document.getElementById('s_t5').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t6').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  break;
	case 5:
	  // Highlights the Reporting tab
	  document.getElementById('s_t1').style.background = 'url(/DealerPortal3/images/tabs/s_tab1_1.gif)';
	  document.getElementById('s_t2').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t3').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t4').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t5').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_2.gif)';
	  document.getElementById('s_t6').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  break;
	case 6:
	  // Highlights the My Dealership tab
	  document.getElementById('s_t1').style.background = 'url(/DealerPortal3/images/tabs/s_tab1_1.gif)';
	  document.getElementById('s_t2').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t3').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t4').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t5').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_1.gif)';
	  document.getElementById('s_t6').style.background = 'url(/DealerPortal3/images/tabs/s_tab23456_2.gif)';
	  break;
	default:
	  document.write("Shouldn't see this!");
	}
}

// This function is used on the carousel box in the unsubscribed homepage 
// to switch between the What's New, Testimonials and Industry Analysis sections.
function setCarousel(cNumber)
{
	switch (cNumber)
		{
		case 1:
		  // Shows the What's New content and hightlights the tab
		  document.getElementById('whats_new').style.visibility = "visible";
		  document.getElementById('testimonials').style.visibility = "hidden";
		  document.getElementById('industry_analysis').style.visibility = "hidden";
		  document.getElementById('c_t1').style.background = 'url(/DealerPortal3/images/tabs/c_whatsnew_1.gif)';
		  document.getElementById('c_t2').style.background = 'url(/DealerPortal3/images/tabs/c_testimonials_2.gif)';
		  document.getElementById('c_t3').style.background = 'url(/DealerPortal3/images/tabs/c_industryanalysis_2.gif)';
		  break;
		case 2:
		  // Shows the Testimonials content and hightlights the tab
		  document.getElementById('whats_new').style.visibility = "hidden";
		  document.getElementById('testimonials').style.visibility = "visible";
		  document.getElementById('industry_analysis').style.visibility = "hidden";
		  document.getElementById('c_t1').style.background = 'url(/DealerPortal3/images/tabs/c_whatsnew_2.gif)';
		  document.getElementById('c_t2').style.background = 'url(/DealerPortal3/images/tabs/c_testimonials_1.gif)';
		  document.getElementById('c_t3').style.background = 'url(/DealerPortal3/images/tabs/c_industryanalysis_2.gif)';
		  break;
		case 3:
		  // Shows the Industry Analysis content and hightlights the tab
		  document.getElementById('whats_new').style.visibility = "hidden";
		  document.getElementById('testimonials').style.visibility = "hidden";
		  document.getElementById('industry_analysis').style.visibility = "visible";
		  document.getElementById('c_t1').style.background = 'url(/DealerPortal3/images/tabs/c_whatsnew_2.gif)';
		  document.getElementById('c_t2').style.background = 'url(/DealerPortal3/images/tabs/c_testimonials_2.gif)';
		  document.getElementById('c_t3').style.background = 'url(/DealerPortal3/images/tabs/c_industryanalysis_1.gif)';
		  break;
		default:
		  window.alert("Make a selection from the list.");
		}	
}

// This function shows the appropriate contact information on the contact us page when a 
// selection is made from the drop down list and the Show Details button is clicked
function showDept(department)
{
	switch (department)
	{
	case "1":	
	  document.getElementById("t_dept").innerHTML = "Dealer Support Team";
	  document.getElementById("t_phone").innerHTML = "0845 071 2655";
	  document.getElementById("t_email").innerHTML = "<a href='mailto:nlwsalessupport@autotrader.co.uk'>nlwsalessupport@autotrader.co.uk</a>";
	  document.getElementById("t_open").innerHTML = "Open from 9:00am to 5.30pm Monday to Friday.";
	  break;
	case "3":	
	  document.getElementById("t_dept").innerHTML = "Customer Services";
	  document.getElementById("t_phone").innerHTML = "0845 345 3450";
	  document.getElementById("t_email").innerHTML = "<a href='mailto:enquiries@autotrader.co.uk'>enquiries@autotrader.co.uk</a>";
	  document.getElementById("t_open").innerHTML = "Open from 8:00am to 10:00pm Monday, 8:00am to 9:00pm Tuesday to Friday and 9:00am to 5:30pm weekends.";
	  break;
	case "-1":	
	  break;
	default:
	  document.write("Shouldn't see this!");
	}
}

// This function changes the map image on mouse over on the View Draft Adverts page in the View Live Adverts section of the Subscribed area.
function changeMap(region)
{
		switch (region)
	{
	case "UK":	
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/01.gif";
	  break;
	case "Ireland":
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/ireland.gif";
	  break;
	case "NorthernIreland":	
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/northern_ireland.gif";
	  break;
	case "Scotland":
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/scotland.gif";
	  break;
	case "NorthEast":	
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/north_east.gif";
	  break;
	case "NorthWest":
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/north_west.gif";
	  break;
	case "Yorkshire":
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/yorkshire.gif";
	  break;
	case "Midlands":
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/midlands.gif";
	  break;
	  case "Anglia":	
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/anglia.gif";
	  break;
	case "Western":
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/western.gif";
	  break;
	case "SouthWest":	
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/south_west.gif";
	  break;
	case "ThamesValley":
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/thames_valley.gif";
	  break;
	case "NorthLondon":	
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/north_london.gif";
	  break;
	case "CapitalCars":
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/capital_cars.gif";
	  break;
	case "SouthLondon":	
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/south_london.gif";
	  break;
	case "Southern":
	  document.getElementById("UKMap").src = "/DealerPortal3/images/map/southern.gif";
	  break;
	default:
	  document.write("Shouldn't see this!");
	}		
}

// This function is used to swtich between products and packages on the right of the summary and psm screens
function prodPack(switchNo)
{
	switch (switchNo)
		{
		case 1:		  
		  // Shows the content of the packages section
		  document.getElementById('packagesTab').style.background = 'url(/DealerPortal3/images/tabs/prod_pack_tab_1.gif)';
		  document.getElementById('productsTab').style.background = 'url(/DealerPortal3/images/tabs/prod_pack_tab_2.gif)'; 
		  document.getElementById('prodPack_pack').style.display = "block";
		  document.getElementById('prodPack_prod').style.display = "none";
		  break;
		case 2:
		  // Shows the contents of the products section
		  document.getElementById('packagesTab').style.background = 'url(/DealerPortal3/images/tabs/prod_pack_tab_2.gif)';
		  document.getElementById('productsTab').style.background = 'url(/DealerPortal3/images/tabs/prod_pack_tab_1.gif)';
		  document.getElementById('prodPack_pack').style.display = "none";
		  document.getElementById('prodPack_prod').style.display = "block";
		  break;
		default:
		  window.alert("Make a selection from the list.");
		}	
}


// This function is used to swtich between package type on the summary page
function packType(switchNo)
{
	switch (switchNo)
		{
			
			
		case 1:		  
		  // Shows the content of the Bronze package section
		  document.getElementById('packType_Tab1').style.background = 'url(/DealerPortal3/images/tabs/prod_pack_inner_1b.gif)';
		  document.getElementById('packType_Tab2').style.background = 'url(/DealerPortal3/images/tabs/prod_pack_inner_2a.gif)'; 
		  document.getElementById('packType_Tab3').style.background = 'url(/DealerPortal3/images/tabs/prod_pack_inner_3a.gif)'; 
		  document.getElementById('innerPackages_Gold').style.display = "none";
		  document.getElementById('innerPackages_Silver').style.display = "none";
		  document.getElementById('innerPackages_Bronze').style.display = "block";		  
		  break;
		case 2:
		  // Shows the contents of the Silver package section
		  document.getElementById('packType_Tab1').style.background = 'url(/DealerPortal3/images/tabs/prod_pack_inner_1a.gif)';
		  document.getElementById('packType_Tab2').style.background = 'url(/DealerPortal3/images/tabs/prod_pack_inner_2b.gif)'; 
		  document.getElementById('packType_Tab3').style.background = 'url(/DealerPortal3/images/tabs/prod_pack_inner_3a.gif)'; 
		  document.getElementById('innerPackages_Gold').style.display = "none";
		  document.getElementById('innerPackages_Silver').style.display = "block";
		  document.getElementById('innerPackages_Bronze').style.display = "none";
		  break;
		case 3:
		  // Shows the contents of the Gold package section
		  document.getElementById('packType_Tab1').style.background = 'url(/DealerPortal3/images/tabs/prod_pack_inner_1a.gif)';
		  document.getElementById('packType_Tab2').style.background = 'url(/DealerPortal3/images/tabs/prod_pack_inner_2a.gif)'; 
		  document.getElementById('packType_Tab3').style.background = 'url(/DealerPortal3/images/tabs/prod_pack_inner_3b.gif)'; 
		  document.getElementById('innerPackages_Gold').style.display = "block";
		  document.getElementById('innerPackages_Silver').style.display = "none";
		  document.getElementById('innerPackages_Bronze').style.display = "none";
		  break;
		default:
		  window.alert("Make a selection from the list.");
		}	
}