/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

/*var win = null;
var swin = null;  */

function NewSizedWindow(mypage,myname,w,h,scroll){
	LeftPosition=(screen.width)?(screen.width-w)/2 : 0;
	TopPosition=(screen.height)?(screen.height-h)/ 2 : 0;

	settings = 
	    'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll;

	var swin = window.open(mypage,myname,settings);

	if ( swin.window.focus )
	{
		swin.window.focus();
	}
}

function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition=(screen.width)?(screen.width-w)/2 : 0;
	TopPosition=(screen.height)?(screen.height-h)/ 2 : 0;

	settings =
	    'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll;

	var win = window.open(mypage,myname);

	if ( win.window.focus )
	{
		win.window.focus();
	}
}


/*****************************************************************************/
function PreloadImage(imgObj, imgSrc) {
	/*
	 *	Purpose:	Precache the passed image
	 */

	if (document.images) {
		eval(imgObj + ' = new Image()')
		eval(imgObj + '.src = "'+imgSrc+'"')
	}
}

/*****************************************************************************/
function ChangeImage(imgName, imgObj) {
	/*
	 *	Purpose:	Change an image, primarily used for button rollovers.
	 */

	if (document.images) {
		document.images[imgName].src = eval(imgObj+".src")
	}
}

/*
 *	Preload the images used for the header
 */

PreloadImage('Logo',  'it_1x1.jpg');
PreloadImage('Blank', 'it_2x4.jpg');

imageNames = new Array();

imageNames[0] = "Home";
imageNames[1] = "PriceList";
imageNames[2] = "Contact";

headerImgs = new Array();

headerImgs[0] = "2x1";
headerImgs[1] = "2x2";
headerImgs[2] = "2x3";


for ( i = 0 ; i < imageNames.length ; i++ )
{
	PreloadImage(imageNames[i] + 'Off', 'Images/it_' + headerImgs[i] + '.jpg');
	PreloadImage(imageNames[i] + 'On',  'Images/itl_' + headerImgs[i] + '.jpg');
}

