﻿// JScript File
// 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 setPaymentMessage(theText) {
    var theSpan = document.getElementById("paymentMessage");
    theSpan.innerHTML = theText;
}

function resetPaymentMessageLabel() {
    var theSpan = document.getElementById("ctl00_body_Receipt1_lblError");
    theSpan.innerHTML = "";
}

function printPage() {
    window.print();
}


function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
   window.external.AddFavorite(location.href, title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}

function toggleDisplay(elementId, state) {
    var ele = document.getElementById(elementId);
    if (!ele) {
        alert("ERROR - Element ID " + elementId + " Not Found On Page!")
        return false;
    }
    
    ele.style.display = state;
}