function doorPreview(doorImage, priceList) {
	var newWindow='';

	if (!newWindow.closed)
	{
		newWindow = window.open( "/inc/popupwindow.htm", "subWind", "left=10,top=10,toolbar=0,scrollbars=0,statusbar=0,menubar=0,width=270,height=470" );
	}
	newWindow.document.clear();
	newWindow.document.write( '<html>');
	newWindow.document.write( '	<head>');
	newWindow.document.write( '		<title>Door Preview Window</title>');
	newWindow.document.write( '		    <style type="text/css">');
	newWindow.document.write( '<!--');
	newWindow.document.write( '.style1 {font-size: xx-small}');
	newWindow.document.write( '.style2 {font-size: 9px}');
	newWindow.document.write( '-->');
	newWindow.document.write( '        </style>');
	newWindow.document.write( '	</head>');
	newWindow.document.write( '');
	newWindow.document.write( '	<body>');

// start door
	newWindow.document.write( "<p align=right><A HREF=" );
	newWindow.document.write( '"javascript:close(); open(' );
	newWindow.document.write( "'" +priceList+ "', 'whatever'); ");
	newWindow.document.write( '">' );
	newWindow.document.write( "<img src='" + doorImage + "'  border=0 alt='Click for Pricelist'>" );
	newWindow.document.write( '</A></P>' );
// end door

	newWindow.document.write( '		<div align="left">' );

	newWindow.document.write( "			<A HREF=" );
	newWindow.document.write( '			"javascript:close(); open(' );
	newWindow.document.write( "			'" +priceList+ "', 'whatever'); ");
	newWindow.document.write( '			">Pricelist</A></div>' );

	newWindow.document.write( '			<div align="right"><A HREF="javascript:close();">Close Window</A></div>');
	newWindow.document.write( '		<div align="left" class="style2">Refer to actual product sample before ordering.</div>');
	newWindow.document.write( '	</body>');
	newWindow.document.write( '</html>');
	newWindow.focus();
}



///////////////////////////////////////////////////////////////////////////////
// handlePreview
// popup a window displaying the tech details - edgr profiles etc.
// popup is planned to resize itself to the different passed images.
///////////////////////////////////////////////////////////////////////////////

function handlePreview(handleImage) {
	var newWindow='';

	// find the location of the extention to retreive to stock code.
	found = handleImage.indexOf(".jpg")
	handleCode= handleImage.substring(0, found);

	if (!newWindow.closed)
	{
		newWindow = window.open( "/inc/popupwindow.htm", "subWind", "left=10,top=10,toolbar=0,scrollbars=3,statusbar=0,menubar=0,width=470,height=370" );
	}
	newWindow.document.clear();
	newWindow.document.write( '<html>');
	newWindow.document.write( '	<head>');
	newWindow.document.write( '		<title>Handle Preview Window</title>');
	newWindow.document.write( '		    <style type="text/css">');
	newWindow.document.write( '<!--');
	newWindow.document.write( '.style1 {font-size: xx-small}');
	newWindow.document.write( '.style2 {font-size: 9px}');
	newWindow.document.write( '-->');
	newWindow.document.write( '        </style>');
	newWindow.document.write( '	</head>');
	newWindow.document.write( '');
	newWindow.document.write( '	<body>');

// start door
	newWindow.document.write( "<img src='/handles/images/Optimized/" + handleImage + "'  border=0 alt='Preview!'>" );
// end door

	newWindow.document.write( '		<div align="left">' );
	newWindow.document.write( '			Handle Number: ' +handleCode+ '.');
	newWindow.document.write( '		</div">' );

	newWindow.document.write( '		<div align="right">' );

	newWindow.document.write( '			<A HREF="javascript:close();">Close Window</A></div>');
	newWindow.document.write( '		<div align="left" class="style2">Refer to actual product sample before ordering.</div>');
	newWindow.document.write( '	</body>');
	newWindow.document.write( '</html>');
	newWindow.focus();
}


///////////////////////////////////////////////////////////////////////////////
// function to implement popup php functionality.
///////////////////////////////////////////////////////////////////////////////

	  var newWin = null;
	  
      function PopupPic(sPicURL) { 
	    if( newWin ){ newWin.close(); }
        newWin=window.open( sPicURL, 'newWin', 'resizable=1,HEIGHT=10,WIDTH=10'); 
        newWin.focus(); 
      } 
	
	
///////////////////////////////////////////////////////////////////////////////
// popupWindowRS
// popup a window displaying the tech details - edgr profiles etc.
// popup is planned to resize itself to the different passed images.
///////////////////////////////////////////////////////////////////////////////

function popupWindowRS(techImage)
{
	var newWindow='';

	if (!newWindow.closed)
	{
		newWindow = window.open( "/inc/popupwindowRS.htm?img="+techImage, "subWind", "left=10,top=10,toolbar=0,scrollbars,statusbar=0,menubar=0,width=10,height=10" );
	}
	
}





///////////////////////////////////////////////////////////////////////////
// DOOR PREVIEW WINDOW VERSION 3 - opens a resized multiple doors html page.
///////////////////////////////////////////////////////////////////////////
function doorPreview3(htmlPage) {
	var newWindow='';

	if (!newWindow.closed)
	{
		newWindow = window.open( htmlPage, "subWind", "left=10,top=10,toolbar=0,scrollbars=0,statusbar=0,menubar=0,width=270,height=525" );
	}
	newWindow.focus();
}



///////////////////////////////////////////////////////////////////////////
// DOOR PREVIEW WINDOW VERSION 2 - added functionality for multiple doors.
// this function has not been completed and is not working, record only.
///////////////////////////////////////////////////////////////////////////
function doorPreview2(doorImage, priceList) {
	var newWindow='';

	if (!newWindow.closed)
	{
		newWindow = window.open( "/inc/popupwindow.htm", "subWind", "left=10,top=10,toolbar=0,scrollbars=0,statusbar=0,menubar=0,width=270,height=470" );
	}
	newWindow.document.clear();
	newWindow.document.write( '<html>');
	newWindow.document.write( '	<head>');
	newWindow.document.write( '		<title>Door Preview Window</title>');
	newWindow.document.write( '		    <style type="text/css">');
	newWindow.document.write( '				<!--');
	newWindow.document.write( '				.style1 {font-size: xx-small}');
	newWindow.document.write( '				.style2 {font-size: 9px}');
	newWindow.document.write( '				-->');
	newWindow.document.write( '        </style>');
	newWindow.document.write( '	</head>');
	newWindow.document.write( '');
	newWindow.document.write( '	<body>');
	newWindow.document.write( '		<div align="center">&lt;Previous&gt;(1 of 5)&lt;Next&gt;</div>');
	newWindow.document.write( '		<DIV class="style1" id=divPopupWindow></DIV>');
	
	// start door
	newWindow.document.write( "<p align=right><A HREF=" );
	newWindow.document.write( '"javascript:close(); open(' );
	newWindow.document.write( "'" +priceList+ "', 'whatever'); ");
	newWindow.document.write( '">' );
	newWindow.document.write( "<img src='" + doorImage + "'  border=0 alt='Click for Pricelist'>" );
	newWindow.document.write( '</A></P>' );
	// end door

	newWindow.document.write( '		<div align="right"><A HREF="javascript:close();">Close Window</A></div>');
	newWindow.document.write( '		<div align="left" class="style2">Refer to actual product sample before ordering.</div>');
	newWindow.document.write( '	</body>');
	newWindow.document.write( '</html>');
	newWindow.focus();
}






function popup(mylink, windowname)
{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	   href=mylink;
	else
	   href=mylink.href;
	window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
	return false;
}
