function newWindow(url,name,features) {
   var newWin = window.open(url,name,features);
}

function corpWindow(url){
   var newWin = window.open(url);
}

//added Oct 3rd
function openMaintenanceCalc(lang) {
	var strMaintURL = "/Acura2006/Maintenance/MaintenanceDefault.asp?L=" + lang

	newWindow(strMaintURL,'calc','width=750,height=580,status=0,directories=0,scrollbars=0');
}

/*
	Date:	2007 11 12
	Desc:	Added this javascript to open the internal 360 QTVR popups
*/
function openInterior360(url) {
	var w = 480;
	var h = 395;
	var left = (screen.width - w) / 2;
	var top = (screen.height - h) / 2;
	newWindow(url,'internal360','width='+w+',height='+h+',top='+top+',left='+left+'scrollbars=no,resizable=no,menubar=no');
}


function openInterior360SWF(url) {
	var w = 1010;
	var h = 532;
	var left = (screen.width - w) / 2;
	var top = (screen.height - h) / 2;
	newWindow(url,'internal360','width='+w+',height='+h+',top='+top+',left='+left+'scrollbars=no,resizable=no,menubar=no');
}

/*
	Date:	2007 06 29
	Desc:	AT1695 - Added this javascript to open the current offers page
*/
function openCurrentOffers( pLang )
{
	var m_strCurrentOffersURL = "/Acura2006/CurrentOffers/Search.asp?L=" + pLang
	
	newWindow( m_strCurrentOffersURL, 'offers', 'width=970,height=615,scrollbars=yes,resizable=yes' );
} // openCurrentOffers

function openWarr(lang) {
	var strLang
	
	if( lang.toUpperCase() == "F" )
		strLang = "Fre"
	else
		strLang = "Eng"
		
	newWindow('/Acura' + strLang + '/Owners/Warranties/Warranty.htm','calc','width=750,height=580,status=0,directories=0,scrollbars=0');
}

function openBuildIt(url) {
	//newWindow(url,'build','width=750,height=580,status=0,directories=0,scrollbars=0');
	//var winprop02 = "width=" + screen.availWidth + ",height=" + screen.availHeight; 
    openwin = window.open(url,'', ''); 
}

function openTestDrive(modelname_en, modelname_fr, language, modelyear) {
	newWindow('html/testdrive/index.html?modelyear='+modelyear+'&modelname_en='+modelname_en+'&modelname_fr='+modelname_fr+'&language='+language,'testdrive','width=740,height=650,status=0,directories=0,scrollbars=1');
}

function openAccessories(lang) {
	newWindow('/Acura2006/PartsAndAccessories/Accessories.asp?L='+lang,'access','width=894,height=650,left=75,top=75,location=0,status=0,directories=0,scrollbars=0');
}

function openAccessoriesModel(url) {
	newWindow(url,'accessmodel','width=894,height=620,left=75,top=75,location=0,status=0,directories=0,scrollbars=0');
}

function openFinanceCalc(lang) {
	newWindow('/Acura2006/Financing/LeaseCalculator?L='+lang,'calc','width=750,height=580,status=0,directories=0,scrollbars=0');
}

function openBudgetCalc(lang) {
	newWindow('/Acura2006/Financing/BudgetCalculator?L='+lang,'calc','width=750,height=580,status=0,directories=0,scrollbars=0');
}

function openDealerLocator(PC,lang) {
	newWindow('/Acura2006/DealerLocator/SearchResults?SearchType=PC&PostalCode='+PC+'&L='+lang,'locator','width=800,height=600,scrollbars=yes,resizable=yes');
}

function openPreowned(lang) {
	newWindow('/Acura2006/PreOwned/CertifiedBenefits.htm?L='+lang,'preowned','width=800,height=600,scrollbars=yes,resizable=yes');
}

function openSiteMap(lang) {
	newWindow('map.html?L='+lang,'popup','width=755,height=580,scrollbars=yes');
}

function openGradProgram(id, path, lang) {
	newWindow('html/gradprogram/index.asp?id='+id+"&path=../../"+path+"&L="+lang,'grad','width=800,height=600,scrollbars=yes,resizable=yes,menubar=yes');
}

function openPressAwards(id, path, lang) {
	newWindow('html/pressawards/index.asp?id='+id+"&path="+path+"&L2="+lang,'press','width=800,height=600,scrollbars=yes,resizable=yes,menubar=yes');
}

function newFullScreenWin(url){
  var winprop = "width=" + screen.availWidth + ",height=" + screen.availHeight + ",scrollbars=0"; 
  openwin = window.open(url,'',winprop); 
} 


function openTrackMan(url) {
	newWindow(url,'trackMan','width=508,height=400,location=0,status=0,directories=0,scrollbars=0');
} 

// js from index.html head tag

// variables
var q_str = new String(window.location.search).substr(1);
var flashMovie;

// wait for the page to fully load before initializing
window.onload = init;

function parseQuery(q_str) {
	var pairHalves;
	var queryVars = {};
	var N_V_pairs = q_str.split("&");
	var l = N_V_pairs.length;
	
	for(i=0; i<l; i++){
		pairHalves = N_V_pairs[i].split("=");
		queryVars[pairHalves[0]] = pairHalves[1];
	}
	
	return queryVars;
}

function getObject(name){
	return document.getElementById ? document.getElementById(name) : document.all ? document.all[name] : null;
}

function init() { flashMovie = getObject( "acura" ); }

function csyncnav(fileId) { flashMovie.syncnav(fileId); }
