﻿// JScript File

function BookmarkCurrentPage() {
    if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(document.title, document.location.href,"");
	} else if(window.external) { // IE Favorite
		window.external.AddFavorite(document.location.href, document.title);
	} else {
	    alert('Sorry, this feature is not currently available for your browser');
	}
}

function SetIFramedPollDimensions(txtIFrameID) {
    var objIFrame = document.getElementById(txtIFrameID);

    if (objIFrame != null) {
        var objBody = null;
        if (objIFrame.contentDocument != null) {
            objBody = objIFrame.contentDocument.body;
        } else {
            objBody = objIFrame.contentWindow.document.body;
        }
        
        if (objBody != null) {
            objIFrame.setAttribute('height', objBody.clientHeight + 40);
            objIFrame.setAttribute('scrolling', 'no');
        }
    }
}        

/* Ektron */
function EkFmValidate(formObj){ 
	var strError=''; var e=null;
if (strError=='' && 'function' == typeof design_validateHtmlForm) {
 e = design_validateHtmlForm(formObj);
 if (e) { strError = e.title; }
}
	if (strError==''){return true;}
	else {
		alert(strError);
		if ('function' == typeof e.scrollIntoView || 'object' == typeof e.scrollIntoView) e.scrollIntoView();
		if ('function' == typeof design_canElementReceiveFocus) {
         if (design_canElementReceiveFocus(e)) e.focus();
     } else { e.focus(); }
		return false;
	}
}

/* IE/Firefox compatibility */
function addEvent(obj, evType, fn)
{
  if (obj.addEventListener)
  {
    obj.addEventListener(evType, fn, false);
    return true;
  }
  else if (obj.attachEvent)
  {
  var r = obj.attachEvent("on"+evType, fn);
    return r;
  }
  else
  {
    return false;
  }
}