// -----------------------------------------------------------------------------
// New Window for Brochures/Project Sheets
//
// Copyright (C) 2002 KFP Architects, Inc.
// 
// -----------------------------------------------------------------------------
function openProjectSheet(url){  
	return window.open(url,"Project_Sheet",'width=750,height=560,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1');
}

// The functions banner(), psheetBanner(), & img_name() are used to determine
// which banner image should be used based on the parent document the child
// was launched from.
function banner(img){  
	return document.write("<img src='" + img + "' border='0'>");
}

function findMatch(parent) { 
	for (var i = 0; i < psheetBanners.length; i++) { 
		if (parent.toUpperCase() == psheetBanners[i][0].toUpperCase()) { 
			img = psheetBanners[i][1];
			break
		} 
	} 
	// make sure the i counter hasn't exceeded the max index value
	if (i < psheetBanners.length) { 
		img = img;
	} else {  // loop went all the way with no matches
		img = "bnr-blank.gif";
	} 
	banner(img);
} 
/*	
function psheetBanner(parent){
	if(parent == "kitchens"){
		img = "bnr-kit.gif";
	}
	else if(parent == "familyrms"){
		img = "bnr-great.gif";
	}
	else if(parent == "Colonial"){
		img = "bnr-col.gif";
	}
	else if(parent == "Cape_Cod"){
		img = "bnr-cape.gif";
	}
	else{
		img = "bnr-blank.gif";
	}
	banner(img);
}
*/	
function img_name(){
	myFile = String(self.opener.document.Banner1.src);
	myFile = myFile.slice(myFile.lastIndexOf("/")+1,myFile.lastIndexOf("_"));
	//alert(myFile.toUpperCase());
	//psheetBanner(myFile);
	findMatch(myFile);
}