var carPicture;
var carConfiguratorImage;
var nscImage;
var dateAndTime;
var header;
var subheader;
var headerClmn1;
var headerClmn2;
var headerClmn3;
var disclaimer1;
var disclaimer2;
var x;


<!-- initializes the print window, is called by VCOApplet-->
function initPrintWindow(arg) {	    
	x=initPrintWindow.arguments;
}

<!-- opens the print window after initialization, is called by VCOApplet-->
function openPrintWindow() {
    printWindow=open(root+"print.html", "VCOPrintWindow",
                     "toolbar=no,resizable=yes,status=no,dependent=yes," +
                     "directories=no,menubar=no,scrollbars=yes," +
                     "width=535,height=660");
}

<!-- opens the print window after initialization, is called by VCOApplet-->
function openPrintWindow_MI() {
    printWindow=open(root+"print_MI.html", "VCOPrintWindow",
                     "toolbar=no,resizable=yes,status=no,dependent=yes," +
                     "directories=no,menubar=no,scrollbars=yes," +
                     "width=540,height=660");
}

function initJSArgumentsFromVCOApplet(){    
    // start read static variables 
    // numberOfAppletStaticVariables is very important !!!!!!!    
    var numberOfAppletStaticVariables = 11; 
    carPicture = window.opener.x[0];
    carConfiguratorImage  = window.opener.x[1];
    nscImage   = window.opener.x[2];
    dateAndTime= window.opener.x[3];    
    header     = window.opener.x[4];    
    subheader  = window.opener.x[5];    
    headerClmn1= window.opener.x[6];    
    headerClmn2= window.opener.x[7];    
    headerClmn3= window.opener.x[8];    
    disclaimer1= window.opener.x[9];
    disclaimer2= window.opener.x[10];
    // end read static variables 
    var n = (window.opener.x.length-numberOfAppletStaticVariables);
    optionalFeatures = new Array(n);
    var index=1;    
    for(var i=numberOfAppletStaticVariables;i<window.opener.x.length;i++ ){               	
        optionalFeatures[index++] = window.opener.x[i];        
    }               
}

function printText(prefix,variableText,suffix){
window.document.write(prefix);
window.document.write(variableText);
window.document.write(suffix);
}

function printTableCell(argument) {        
 printTableCell(argument,'left','top','',1);
}

function printTableCell(argument,align,valign,cellnotice,cspan) {        
	window.document.write('<td align="'+align+'" valign="'+valign+'" colspan="'+cspan+'"><span class="scopy">');
	window.document.write(argument);
	window.document.write('</span>');    
	if(cellnotice!=null && cellnotice!=""){	
	printExplanationText('</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+cellnotice);	
        }	
	window.document.write('</td>');    
}


function printLine(){
window.document.write('<tr><td></td><td colspan="3"><img src="'+root+'/pics/print/1x1_00000.gif" width="498" height="1" /></td></tr>');
}

function printGap(gap){
window.document.write('<tr><td></td><td colspan="3"><img src="'+root+'/pics/print/1x1_trans.gif" width="498" height="'+gap+'" /></td></tr>');
}


function printExplanationText(explanation){
window.document.write('<span class="skcopy">'+explanation+'</span>');
}

function printExplanationCell(explanation){
window.document.write('<td colspan="3" valign="top">');
printExplanationText(explanation);
window.document.write('</td>');	
}

function printExplanationRow(explanation){
window.document.write('<tr>');
printTableCell(' ');
printExplanationCell(explanation);
window.document.write('</tr>');	
}

function printTableRow(notice,name,cellnotice,code,price){
  printGap(1);
  window.document.write('<tr>');  
  printTableCell(' ');
  if(notice!=null && notice!=""){	
    printExplanationCell(notice);	
  }else{
    printTableCell(name,'left','top',cellnotice);
    if(code!=null && code!="&nbsp;"){
	    printTableCell(code);
    	printTableCell(price,'right');
    }else{
    	// use two columns for the price item. Needed for SF
    	printTableCell(price,'right','top','',2);
    }
    window.document.write('</tr>');            
  }
  printGap(1);
  printLine();
}

function printFeaturesInRows(arguments){       
   for(var i=1;i<arguments.length;i=i+5){                
	printTableRow(plausiCheck(arguments[i]),plausiCheck(arguments[i+1]),plausiCheck(arguments[i+2]),plausiCheck(arguments[i+3]),plausiCheck(arguments[i+4]));		
   }   
}
function insertPicture(imageURL){
printText('<tr><td></td><td colspan="3"><img src="',imageURL,'" width=998 align="middle"></tr>');
}
function printHeaderAndTime(header,time){
window.document.write('<tr>');  
printText('<td></td><td valign="top"><span class="titlegrey">',header,'</span></td>');
printText('<td colspan="2" align="right" valign="top"><span class="scopy">',time,'</span></td>');
window.document.write('</tr>');  
}
function printColumnHeaders(hd1, hd2, hd3){
window.document.write('<tr>');  
printText('<td></td><td valign="top"><span class="titleblack">',hd1,'</span></td>');
printText('<td align="left" valign="top"><span class="titleblack">',hd2,'</span></td>');
printText('<td align="right" valign="top"><span class="titleblack">',hd3,'&nbsp;&nbsp;</span></td>');
window.document.write('</tr>');  
}

function printBMWLogoRow(carConfiguratorImage, nscImage){
window.document.write('<table bgcolor="#9c9c9c" border="0" cellpadding="0" cellspacing="0">');
window.document.write('<tr>');   
printText('<td><img src="',carConfiguratorImage,'" width="306" height="105" border="0" /></td>');
printText('<td><img src="',nscImage,'" border="0" /></td>');
window.document.write('<td><img src="'+root+'/pics/print/45x105_999999.gif" width="30" height="105" border="0"/></td>');
window.document.write('</tr>');
window.document.write('</table>');
}

function plausiCheck(argument){
if(argument==null) return '';
return argument;
}

<!-- MINI only -->
function insertPictureMI(imageURL){
printText('<tr><img src="',imageURL,'" width=800 align="middle"></tr>');
}
function printShadowTableRow(width, height){
window.document.write('<tr><td colspan="3"><img src="'+root+'/pics/print_MI/1x1_666666.gif" width="'+width+'" height="'+height+'" /></tr>');
}

