// JavaScript Document



function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		navHome_o = newImage("../img/navHome_o.gif");
		navLatestAdvertising_o = newImage("../img/navLatestAdvertising_o.gif");
		navModels_o = newImage("../img/navModels_o.gif");
		navUsedCars_o = newImage("../img/navUsedCars_o.gif");
		navParts_o = newImage("../img/navParts_o.gif");
		navAccessories_o = newImage("../img/navAccessories_o.gif");
		navService_o = newImage("../img/navService_o.gif");
		navFinance_o = newImage("../img/navFinance_o.gif");
		navContacts_o = newImage("../img/navContacts_o.gif");
		navNews_o = newImage("../img/navNews_o.gif");
		hmnavPolo_o = newImage("../img/hmnavPolo_o.gif");
		hmnavGolf_o = newImage("../img/hmnavGolf_o.gif");
		hmnavNewBeetle_o = newImage("../img/hmnavNewBeetle_o.gif");
		hmnavTouran_o = newImage("../img/hmnavTouran_o.gif");
		hmnavPassat_o = newImage("../img/hmnavPassat_o.gif");
		hmnavTouareg_o = newImage("../img/hmnavTouareg_o.gif");
		hmnavPhaeton_o = newImage("../img/hmnavPhaeton_o.gif");
		preloadFlag = true;
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function openPolo()
	{
		width = 768;
		height = 443;
		var left = ( screen.width-width)/2 ;
		var top = ( screen.height-height)/2 ;
		var features = 'scrollbars=0,status=0,resizable=0'
		features += ( features != '' ) ? ',':'' ;
		features += ',left=' + left + ',top=' + top ;
		
		window.open( "http://www.vwcentres.co.nz/minisites/Polo", "Image", features + ( ( features != ''  ) ? ',' : '') + 'width=' + width + ',height=' + height ) ;	
	}
function openHelp()
	{
		width = 500;
		height = 400;
		var left = ( screen.width-width)/2 ;
		var top = ( screen.height-height)/2 ;
		var features = 'scrollbars=0,status=0,resizable=0'
		features += ( features != '' ) ? ',':'' ;
		features += ',left=' + left + ',top=' + top ;
		
		window.open( "../help.asp", "Image", features + ( ( features != ''  ) ? ',' : '') + 'width=' + width + ',height=' + height ) ;	
	}
function openHelp2()
	{
		width = 500;
		height = 400;
		var left = ( screen.width-width)/2 ;
		var top = ( screen.height-height)/2 ;
		var features = 'scrollbars=0,status=0,resizable=0'
		features += ( features != '' ) ? ',':'' ;
		features += ',left=' + left + ',top=' + top ;
		
		window.open( "../help.asp", "Image", features + ( ( features != ''  ) ? ',' : '') + 'width=' + width + ',height=' + height ) ;	
	}
	function openLegal()
	{
		width = 500;
		height = 400;
		var left = ( screen.width-width)/2 ;
		var top = ( screen.height-height)/2 ;
		var features = 'scrollbars=1,status=0,resizable=0'
		features += ( features != '' ) ? ',':'' ;
		features += ',left=' + left + ',top=' + top ;
		
		window.open( "../Legal.asp", "Image", features + ( ( features != ''  ) ? ',' : '') + 'width=' + width + ',height=' + height ) ;	
	}
	
	
	
	
	
	imageLink = '';
function openPopup(imgLink) 
{
    lrgewin = window.open("about:blank","","resizable=1,scrollbars=1,HEIGHT=200,WIDTH=200,screenX=0,screenY=0,left=0,top=0");
    imageLink = imgLink;
    setTimeout('update()',500);
}
function FitPic() 
{ 
	   doc = lrgewin.document;	
       iWidth = (NS)?window.innerWidth:document.body.clientWidth; 
       iHeight = (NS)?window.innerHeight:document.body.clientHeight; 
       iWidth = document.images[0].width - iWidth + 10;
       iHeight = document.images[0].height - iHeight + 10; 
       window.resizeBy(iWidth, iHeight); 
       self.focus(); 
}
function update() 
{
    doc = lrgewin.document;
    doc.open('text/html');
    doc.write('<HTML><HEAD><TITLE>Volkswagen Image<\/TITLE>');
	doc.write('<script type="text/javascript">');
    doc.write('var NS = (navigator.appName=="Netscape")?true:false;');
	doc.write('function FitPic() { ');
	doc.write('iWidth = (NS)?window.innerWidth:document.body.clientWidth; ');
	doc.write('iHeight = (NS)?window.innerHeight:document.body.clientHeight; ');
	doc.write('iWidth = document.images[0].width - iWidth + 10;');
	doc.write('iHeight = document.images[0].height - iHeight + 10; ');
	doc.write('window.resizeBy(iWidth, iHeight); ');
	doc.write('self.focus(); ');
	doc.write('}');
	doc.write('</script>');
	doc.write('<\/HEAD>');
	doc.write('<BODY topmargin="5" bottommargin="5" rightmargin="5" leftmargin="5" onload="FitPic();">');
    doc.write('<a href="javascript:window.close();"><img src="' + imageLink + '" border=0 alt=\"Click to close image\"></a>'); 
    doc.write('<\/BODY><\/HTML>');
    doc.close();
}

	

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-12084819-1");
pageTracker._trackPageview();
} catch(err) {}
	
	
	