//****************************************************************
//****************************************************************
//	COPYRIGHT 1998-99, Vertex Software
//****************************************************************
//****************************************************************

var gImageList = "";

//****************************************************************
// PreloadImages
//****************************************************************
function PreloadImages( imageDirectory, imageList ) {
	if (!imageList) imageList = gImageList;
	var imageName = imageList.split( "," );
	var index = 0;
	for (index=0; index<imageName.length; index++) {
		document.preloads = new Array();
		document.preloads[index] = new Image();
		document.preloads[index].src = imageDirectory + imageName[index] + "b.gif";
		}
	}


//****************************************************************
// rollover
//****************************************************************
function rollover(name) {
	var pictureObj = eval( "document." + name );
	if (pictureObj) {
		var mouseOutSuffix = "a.gif";
		var mouseInSuffix = "b.gif";
		var sideImgSuffix = "c.gif";
		var defaultSideImg = "/img/default";
		var pictureSource = pictureObj.src;
		if (pictureSource.toLowerCase().indexOf( mouseOutSuffix ) != -1) {
			// ON MOUSEIN
			pictureObj.src = pictureSource.substring( 0, pictureSource.length - mouseOutSuffix.length ) + mouseInSuffix;
			if (document.centerimage){
				document.centerimage.src = "img/" + name + sideImgSuffix;
				}
			} 
		else {
			// ON MOUSEOUT
			pictureObj.src = pictureSource.substring( 0, pictureSource.length - mouseInSuffix.length ) + mouseOutSuffix;
			if (document.centerimage){
				document.centerimage.src = defaultSideImg + sideImgSuffix;
				}
			}
		}
	}


//****************************************************************
//      CreateUniqueID
//****************************************************************
function CreateUniqueID( label ) {
        var todaydate = new Date();
        var ID = "";
        ID = ID + todaydate.getHours();
        ID = ID + todaydate.getMinutes();
        ID = ID + todaydate.getSeconds();
        // this function may be used in form elements
        if ( (label) && (label != "") ) {
                return label + "=" + escape(ID);
                }
        else {
                return escape(ID);
                }
        }




//****************************************************************
// PopupWindow
//****************************************************************
function PopupWindow( URL, name, height, width, noScrollbars, noLocation ) {
	var windowprops = "height=" + height + ",width=" + width + ", menubars=no, toolbars=no, resizable=no";	
	if (noScrollbars) windowprops += ",scrollbars=no";
	else windowprops += ",scrollbars=yes";
	if (noLocation) windowprops += ",location=no";
	else windowprops += ",location=yes";
	window.open(URL, name, windowprops);
	}

