	
	window.name = "cpowin";
	self.focus();
	
// javascript functions for cpo flash minisite external links

    function main_window(thisURL) {
	  if (top.opener) {
	    var emsg = " " + top.opener.location ;
		if (emsg == ' ') { 
		  wtmp = window.open(thisURL,'View','');
		  wtmp.focus();
		}
		else {
	      top.opener.location = thisURL ;
          top.opener.focus();
		}
	  }
	  else {
		wtmp = window.open(thisURL,'View','');
		wtmp.focus();
	  }
    }
	
function cpo_link2(id) {   // called from within the flash - passes identifier string which maps to one of those defined below
  //var msg = "cpo_link2: " + id + " passed";  //alert(msg);  // for testing

  switch (id) {

    case "vwhome" : 
        main_window( "http://www.vw.com" );  // VW Logo button
        break;

    case "incentives" :  // "CPO Program" Section - Incentives link
		wtmp = window.open('http://www.vw.com/vwcom/content/apr/incentive.htm?section=cpo', 'apr', 'width=358,height=375,scrollbars=no,resizable=no,toolbar=no,statusbar=no');
        wtmp.focus();
        break;

    case "programs" :  // "CPO Program" Section - College Grad program link
        main_window( "http://www.vw.com/vwcredit/special.htm?car=cpo" );  // "Special Programs" page 
        break;

    case "drivergear" : 
        main_window( "http://drivergear.vw.com/" );  // "CPO Program" Section - DriverGear link
        break;

    case "dealer" : 
        main_window( "http://www.vw.com/dealerLocator/locateEntry" );  // "Find a Dealer" Section - GO button
        break;
        
    case "brochure" :   // this should open in a new browser window
        wtmp = window.open('http://www.vw.com/Brochure/pdfs/cpo.pdf','_blank',''); // brochure PDF
        wtmp.focus();
        break;

    case "adobe" :   // this site should open in new browser window
        wtmp = window.open('http://www.adobe.com/products/acrobat/readstep2.html','_blank',''); // Adobe Acrobat Reader link 
        wtmp.focus();
        break;

    default :
          var msg = "cpo: unrecognized identifier passed: " + id ;
//          alert(msg);
    }
}

// note: "pdf" links in flash should call this via getURL in actionscript
// arguments: year is integer (2003, 2002, 2001...) and model is a string (e.g. "jetta")

function brochure_pdf(year, model) { 
	pdf_url = "PDF/" + year + "/brochures/" + model + ".pdf"; // assumes filename format: ./PDF/2004/brochures/touareg.pdf
	wtmp = window.open(pdf_url,'pdfwin','');
	wtmp.focus();
}

function std_features(year, model) {
	f_url = "PDF/" + year + "/features/" + model + ".pdf"; // assumes filename format: ./PDF/2004/features/touareg.pdf
	wtmp = window.open(f_url,'fwin','');
	wtmp.focus();
}

