﻿// JScript File
// new window centered on screen function
function NewWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

// quick new window centered on screen function
function NewWindowQuick(theURL, myWidth, myHeight) { 
	var winName = "newWindowQuick";
	var isCenter = 'true';
	var features = 'toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes';
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/4;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

function disableMe(theItem) {
  theItem.disabled = true
  GetPostBackEventReference(theItem);
}

function confirmIt(theMessage) {
    var doIt = confirm(theMessage);
    if (doIt) { 
        return true;
    } else {
        return false;
    }
}

function ToggleElementDisplay(theElementID) {
	//alert(theElementID);

	var theElement = document.getElementById(theElementID);
	//theElement.setAttribute("style", "display:block;");
	//alert(theElement.getAttribute("style"));
	
	var displayStyle = theElement.style.display

	if (displayStyle == '') {
		theElement.style.display = "none";
	}
	else {
		theElement.style.display = "";
	}
}

function EnableElementDisplay(theElementID) {
	//alert(theElementID);

	var theElement = document.getElementById(theElementID);
	//theElement.setAttribute("style", "display:block;");
	//alert(theElement.getAttribute("style"));
	
	theElement.style.display = "";
}

function logOut(sleepInterval) {
	bodyTags = document.getElementsByTagName("body");
	bodyTags[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	var agree = confirm("Are you sure you wish to logout?");
	if (agree) {
		return true;
	} else {
		bodyTags[0].style.filter = "";
		return false;
	}
}


function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
function submitform()
{
  document.myform.submit();
}
function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		LUBECTR_03_over = newImage("/images/LUBECTR_03-over.gif");
		LUBECTR_07_over = newImage("/images/LUBECTR_07-over.gif");
		LUBECTR_08_over = newImage("/images/LUBECTR_08-over.gif");
		LUBECTR_09_over = newImage("/images/LUBECTR_09-over.gif");
		LUBECTR_10_over = newImage("/images/LUBECTR_10-over.gif");
		LUBECTR_11_over = newImage("/images/LUBECTR_11-over.gif");
		preloadFlag = true;
	}
}

 function pop_window(url) {
 var popit = window.open(url,'console','scrollbars,resizable,width=650,height=380');
 }
 
  function pop_window2(url) {
 var popit = window.open(url,'console','scrollbars,resizable,width=450,height=400');
 }
