// prevent this site from being displayed within some other site's frameset
if(self!=self.top) self.parent.location="/";

// provide the function responsible for opening the email popup window 
// a call to this function is written into an aspx page via server-side scripting whenever mail is available for the popup
function ShowPopupEmail(){
  var objDate=new Date();
  var EmailPopup=window.open('/aspx/tools/EmailTools/EmailPopup.aspx?t='+objDate.valueOf(),'EmailPopUp','scrollbars=yes,resizable=yes,menubar=no,toolbar=no,left=0,width=720px,height=500px');
  EmailPopup.focus();
  }
  
// disable Internet Explorer form submission via the enter key 
if (navigator.appName.indexOf("Microsoft")!=-1){
  document.onkeypress=function(){
    var tagAttr=event.srcElement.getAttribute("type");
    if (event.keyCode==13 && tagAttr!="textarea"){
      return false;
      }
    }
  }

// disable Netscape 6+ form submission via the enter key 
var bAllowFormSubmission=false;
if (window.Event && document.getElementById){
  window.captureEvents(Event.SUBMIT);
  window.onsubmit = NetscapeEventHandler_Submit;

  window.captureEvents(Event.CLICK);
  window.onclick = NetscapeEventHandler_Click;
  }
  
function NetscapeEventHandler_Submit(e) {
  if(!bAllowFormSubmission) return false;
  }

function NetscapeEventHandler_Click(e) {
  if(e.target.getAttribute("type")){
    var sTarget=e.target.getAttribute("type");
    if(sTarget=="image" || sTarget=="submit"){
      // mouse click occured on a tag with an attribute 'type' set to 'image' or 'submit'
      // this can only be an input tag
      // if the click on the button was simulated by the browser, the x and y coordinates of the click will be (0,0); do not allow form submission
      // after text has been entered in a textbox, if the user hits the enter key, netscape simulates a mouse click on a submit button
      if (e.screenX>0 && e.screenY>0) bAllowFormSubmission=true;
      }
    }
  }
  
// function to spawn email client
// pass comma separated strings
// useage: <a href="javascript:js_mail('somesite.com?subject=Website Inquiry','username')">username@somesite.com</a>
var domain;
var id;
function js_mail(domain, id) {
  location.href = "mailto:" + id + "@" + domain;
  }

// function to popup the text translator form
function OpenTranslatorForm(iLabelNumber,sPlaceholderText){
  var objDate=new Date();
  var LabelTranslatorPopup=window.open('/SiteManager/sm_Secure/Utilities/LabelTranslatorPopup.aspx?t='+objDate.valueOf()+'&num='+iLabelNumber+'&txt='+sPlaceholderText,'LabelTranslatorPopup','scrollbars=yes,resizable=yes,menubar=no,toolbar=no,left=0,width=400px,height=300px');
  LabelTranslatorPopup.focus();
  }
  
// generic verification prompt for delete icons
// sample usage: objImageButton.Attributes.Add("onclick", "return DeleteVerificationPrompt();")
function DeleteVerificationPrompt(){
  return window.confirm("You are about to delete this item. Continue?");
  }
