//Rollover functions -----------------------------------------------------------------------------------------
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//------------------------------------------------------------------------------------------------------------

//Jump menu function -----------------------------------------------------------------------------------------
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//------------------------------------------------------------------------------------------------------------

//start delete db item ---------------------------------------------------------------------------------------
function funcDelete1(thePg)
{
	var where_to= confirm("Are you sure you want to Delete this Item?");
	if (where_to == true)
	{
		location.href = thePg
	  return;
	}
	else
	{
		return (false);
  }
}
//end delete db item -----------------------------------------------------------------------------------------

//start pop up -----------------------------------------------------------------------------------------------
//popUp('EnterVIN.asp?carID=" & conn("carID") & "',400,205,'no')
var scrWidth = screen.width			//the user's screen width
var scrHeight = screen.height		//the user's screen height
var winWidth			//window width
var winHeight			//window height
var leftEdge			//left edge of window for upper left corner starting x coordinate
var topEdge				//top edge of window for upper left corner starting y coordinate
var winProperties	//the window's properties in string form
var scrlbrs				//yes/no
var theFile				//file name to open

function popUp(theFile,winWidth,winHeight,scrlbrs){
	leftEdge = (scrWidth - winWidth)/2		//used to horizontally center window
	topEdge = (scrHeight - winHeight)/2		//used to vertically center window
	winProperties = "'personalbar=no,toolbar=no,location=no,scrollbars=" + scrlbrs + ",width=" + winWidth + ",height=" + winHeight + ",left=" + leftEdge + ",top=" + topEdge + "'"
	libWindow = window.open(theFile, 'libWin', winProperties)
}
//end pop up -------------------------------------------------------------------------------------------------

//start view pop up ------------------------------------------------------------------------------------------
var scrWidth = screen.width
var scrHeight = screen.height
var winlgw
var winlgh
var getLeft
var getTop
var lgwinprop

function viewImg(AspFileName,ImgPath,ImgFileName){
	TheImg = new Image()
	TheImg.src = ImgPath + "/" + ImgFileName
	winlgw = TheImg.width
	winlgh = TheImg.height + 30
	if (winlgw < 100)
	{
		winlgw = 100
	}
	getLeft = (scrWidth - winlgw)/2
	getTop = (scrHeight - winlgh)/2
	lgwinprop = "'personalbar=no,toolbar=no,location=no,scrollbars=no,width=" + winlgw + ",height=" + winlgh + ",left=" + getLeft + ",top=" + getTop + "'"
	FileName = AspFileName + "?path=" + ImgPath + "&img=" + ImgFileName

	newWindow = window.open(FileName, 'newWin', lgwinprop)
}
//end view pop up --------------------------------------------------------------------------------------------

//start library pop up ---------------------------------------------------------------------------------------
//popUp('library_image.asp?imgType=1&fname=theDocument')
function libraryPopUp(AspFileName){
	winlgw = 500
	winlgh = 500
	getLeft = (scrWidth - winlgw)/2
	getTop = (scrHeight - winlgh)/2
	lgwinprop = "'personalbar=no,toolbar=no,location=no,scrollbars=yes,width=" + winlgw + ",height=" + winlgh + ",left=" + getLeft + ",top=" + getTop + "'"
	FileName = AspFileName
	libWindow = window.open(FileName, 'libWin', lgwinprop)
}
//end library pop up -----------------------------------------------------------------------------------------

//start close window -----------------------------------------------------------------------------------------
function closeWin()
{
	window.close()
}
//end close window -------------------------------------------------------------------------------------------
