window.history.forward(1);
//************************************
//ported from prototype_js.aspx
//************************************
String.prototype.endsWith = function(str)
{
return (this.match(str+"$")==str)
}
String.prototype.truncRight = function(int)
{
return (this.substr(0,this.length-int))
}
String.prototype.truncLeft = function(int)
{
return (this.substr(int,this.length-int))
}
String.prototype.rightTrim = function()
{
return( this.replace(new RegExp("[\\s]+$", "gm"), "") );
}
String.prototype.startsWith = function(str)
{
return (this.indexOf(str)==0)
}
String.prototype.trim = function()
{
return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""))
}
String.prototype.leftTrim = function()
{
return( this.replace(new RegExp("^[\\s]+", "gm"), "") );
}
String.prototype.isEmpty = function()
{
return(this.trim().length == 0);
}
HTMLElement.prototype.__defineGetter__("outerHTML", function() {
var span = document.createElement("span"); span.appendChild(this.cloneNode(true));
return span.innerHTML;
});
HTMLElement.prototype.__defineSetter__("outerHTML", function(html) {
var range = document.createRange();
this.innerHTML = html;
range.selectNodeContents(this);
var frag = range.extractContents();
this.parentNode.insertBefore(frag, this);
this.parentNode.removeChild(this);
});
//************************************
//ported from no_hotkeys.js
//************************************
// 04/28/2006 - MA - Disables control N and Control R Hotkeys (MSIE Only)
// 05/23/2006 - MA - fixed disabling of n & r after ctrl is hit
// 05/23/2006 - MA - 13161 - time out ctrl key after 15 seconds in case of a off window release
var ctrlTimer
var manufacturer=navigator.appName.toLowerCase();
if (manufacturer.indexOf('microsoft') >= 0)
{
document.onkeydown = keyDown;
document.onkeyup = keyUp;
}
var lastKeyDown = '';
var ctrlDown = false;
function keyUp()
{
try
{
if(window.event && window.event.keyCode == 17)
{
resetCtrl();
return false;
}
}
catch(e)
{
}
}
function resetCtrl()
{
ctrlDown = false;
if (ctrlTimer == null)
{
try
{
clearTimeout(ctrlTimer);
}
catch(e){}
}
}
function disableBackButton()
{
window.history.forward()
}
disableBackButton();
function keyDown()
{
try
{
if (window.event.keyCode == 8)
{
disableBackButton();
//alert(document.focused)
//return false;
}
if(window.event && window.event.keyCode == 17)
{
ctrlDown = true;
setTimeout('resetCtrl()',15000)
return false;
}
if(ctrlDown == true)
{
//R
if(window.event && window.event.keyCode == 82)
{
return false;
}
//N
if(window.event && window.event.keyCode == 78)
{
return false;
}
}
else
{
}
}
catch(e)
{
}
}
//************************************
//ported from mousover_mod_js.aspx
//************************************
var mod_height = 16;
var mod_width = 140;
var bln_mod_initialized = false;
var mod_html= '';
var date_format_html = '
Date Format: ';
var mod_oPopup;
try{mod_oPopup = window.createPopup();}catch(e){}
var mod2_oPopup;
try{mod2_oPopup = window.createPopup();}catch(e){}
function alter_mouseovers(form,prefix,event_1,event_call_1,event_2,event_call_2)
{
if (mod_oPopup)
{
var str_type = '';
var obj,att
for (var x = 0;x= prefix.length)
{
if (form.elements[x].name.substr(0,prefix.length).toLowerCase() == prefix.toLowerCase())
{
obj = form.elements[x]
att = obj.attributes.getNamedItem("onchange").value;
addEvent( obj, event_1, function(){eval(event_call_1)});
addEvent( obj, event_2, function(){eval(event_call_2)});
}
}
}
}
}
}
function add_obj_event(obj,event,event_call)
{
addEvent( obj, event, function(){eval(event_call)});
}
var bln_date_format_has_been_set = false;
function show_date_format_tooltip(el)
{
if (bln_date_format_has_been_set == false)
{
document.getElementById('did_date_format_display_field').innerHTML = '';
bln_date_format_has_been_set = true;
}
menuLayers.showUnderElement('did_date_format_menu',el,true)
//show_chromeless_html_by_element(innerHTML,140,16,el)
}
function hide_date_format_tooltip()
{
menuLayers.hideDelayed('did_date_format_menu',100)
}
function initialize_mod()
{
if (bln_mod_initialized == false)
{
if (!mod_oPopup)
{
try{mod_oPopup = window.createPopup();}catch(e){}
}
var doc = mod_oPopup.document;
var html = '';
doc.open();
doc.write(html);
doc.close();
if (!mod2_oPopup)
{
try{mod2_oPopup = window.createPopup();}catch(e){}
}
doc = mod2_oPopup.document;
var html = '';
doc.open();
doc.write(html);
doc.close();
bln_mod_initialized = true;
}
}
function set_mod(html_snippit,w,h)
{
initialize_mod();
mod_html = html_snippit;
mod_width = w;
mod_height = h;
}
function show_chromeless_html_by_element(html_snippit,w,h,element,topDisplay)
{
set_mod(html_snippit,w,h)
show_ie_note(element,topDisplay);
}
function show_chromeless_html_by_xy(html_snippit,w,h,x,y)
{
set_mod(html_snippit,w,h)
show_ie_note_xy(x,y)
}
function hide_chromeless()
{
mod_oPopup.hide();
mod2_oPopup.hide();
}
function show_ie_note(el,topDisplay)
{
var topshow = false
if (arguments.length > 1)
{
topshow = topDisplay;
}
var positions = findPos(el)
var x = positions[0]
var y = event.screenY
if (topshow == true)
{
y = y - window.screenTop
y = y - (el.offsetHeight + window.event.offsetY)
}
else
y = y - window.screenTop + (el.offsetHeight - window.event.offsetY)
show_ie_note_xy(x,y);
}
function show_ie_note_xy(x,y)
{
var oPopBody = mod_oPopup.document.body;
oPopBody.innerHTML = mod_html
mod_oPopup.show(x, y, mod_width, mod_height, document.body);
}
function addEvent( obj, type, fn )
{
if ( obj.attachEvent )
{
obj['e'+type+fn] = fn;
obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
obj.attachEvent( 'on'+type, obj[type+fn] );
}
else
{
obj.addEventListener( type, fn, false );
}
}
function removeEvent( obj, type, fn )
{
if ( obj.detachEvent )
{
obj.detachEvent( 'on'+type, obj[type+fn] );
obj[type+fn] = null;
}
else
{
obj.removeEventListener( type, fn, false );
}
}
function findPos(obj)
{
var curleft = curtop = 0;
if (obj.offsetParent)
{
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent)
{
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop];
}
function limitText(field,maxlength)
{
try
{
if (field.value.length <= maxlength) return ;
field.value = field.value.substring(0,maxlength)
alert('Maximum Length Exceeded')
}
catch(e){}
}
function attach_counter(formname,maxlength)
{
itemType = item.type;
if (itemType == null)
itemType = item[0].type;
if ((itemType == "text" ) || (itemType == "textarea"))
{
}
}
function show_chromeless_processing(text)
{
var width = 301
var height = 45
var x=350
var y= 200;
var html = ''
html += ' | '
html += ' |
'
html += ' | '
html += '' + text + ' | '
html += ' | '
html += ' |
'
html += ' | '
html += ' | '
html += ' | '
html += ' | '
html += '
 | '
html += ' | '
html += '
 | '
html += ' |
'
set_mod(html,width,height)
var oPopBody = mod2_oPopup.document.body;
oPopBody.innerHTML = mod_html
mod2_oPopup.show(x, y, mod_width, mod_height, document.body);
}
//************************************
//ported from memu_pop.js
//************************************
viewport = {
getWinWidth: function () {
this.width = 0;
if (window.innerWidth) this.width = window.innerWidth - 18;
else if (document.documentElement && document.documentElement.clientWidth)
this.width = document.documentElement.clientWidth;
else if (document.body && document.body.clientWidth)
this.width = document.body.clientWidth;
},
getWinHeight: function () {
this.height = 0;
if (window.innerHeight) this.height = window.innerHeight - 18;
else if (document.documentElement && document.documentElement.clientHeight)
this.height = document.documentElement.clientHeight;
else if (document.body && document.body.clientHeight)
this.height = document.body.clientHeight;
},
getScrollX: function () {
this.scrollX = 0;
if (typeof window.pageXOffset == "number") this.scrollX = window.pageXOffset;
else if (document.documentElement && document.documentElement.scrollLeft)
this.scrollX = document.documentElement.scrollLeft;
else if (document.body && document.body.scrollLeft)
this.scrollX = document.body.scrollLeft;
else if (window.scrollX) this.scrollX = window.scrollX;
},
getScrollY: function () {
this.scrollY = 0;
if (typeof window.pageYOffset == "number") this.scrollY = window.pageYOffset;
else if (document.documentElement && document.documentElement.scrollTop)
this.scrollY = document.documentElement.scrollTop;
else if (document.body && document.body.scrollTop)
this.scrollY = document.body.scrollTop;
else if (window.scrollY) this.scrollY = window.scrollY;
},
getAll: function () {
this.getWinWidth(); this.getWinHeight();
this.getScrollX(); this.getScrollY();
}
}
var menuLayers = new menuLayer();
function menuLayer()
{
this.timer=null;
this.activeMenuID= null;
this.offX= 19;
this.offY= -11;
this.reset_row_id= null;
this.close_script = '';
this.findPos = function(obj)
{
var curleft = curtop = 0;
if (obj.offsetParent)
{
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent)
{
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop];
}
this.showUnderElement = function (id,el,keepVisible)
{
var positions = this.findPos(el);
var x = positions[0] +1;
var y = positions[1] + el.offsetHeight + 1;
this.showXY(id,x,y,keepVisible)
}
this.show = function(id, e)
{
var mnu = document.getElementById? document.getElementById(id): null;
if (!mnu) return;
this.prep_show(mnu,id,false)
viewport.getAll();
this.position(mnu,e);
}
this.showXY = function(id, x,y,keepVisible)
{
var mnu = document.getElementById? document.getElementById(id): null;
if (!mnu) return;
this.prep_show(mnu,id,keepVisible)
viewport.getAll();
mnu.style.left = x + "px";
mnu.style.top = y + "px";
this.timer = setTimeout("menuLayers.set_visible(" + x + ")", 0);
}
this.set_visible = function(x)
{
var mnu = document.getElementById? document.getElementById(this.activeMenuID): null;
menuLayers.setStyle(this.activeMenuID,'visible')
if (x + mnu.offsetWidth > viewport.width)
{
mnu.style.left = viewport.width-mnu.offsetWidth -5
}
}
this.prep_show = function(mnu,id,keepVisible)
{
if (this.activeMenuID != null)
{
this.clearTimer();
if (this.activeMenuID != id)
{
//document.getElementById(this.activeMenuID).style.visibility='hidden';
this.setStyle(this.activeMenuID ,'hidden');
}
}
this.activeMenuID = id;
if ( mnu.onmouseover == null ) mnu.onmouseover = this.clearTimer;
if (keepVisible != true)
{
if ( mnu.onmouseout == null ) mnu.onmouseout = this.mouseoutCheck;
}
else
{
this.clearTimer();
}
}
this.hideDelayed = function(id,ms_delay)
{
this.clearTimer();
if (id && document.getElementById(id))
{
this.timer = setTimeout("menuLayers.setStyle('" + id + "','hidden');menuLayers.reset_row();menuLayers.exec_close_script();", ms_delay);
}
}
this.hideQuick = function()
{
this.hideDelayed(this.activeMenuID,10);
}
this.hideMenu = function(id)
{
this.hideDelayed(id,500);
}
this.hide = function()
{
this.hideMenu(this.activeMenuID);
}
this.exec_close_script = function()
{
if (this.close_script != '')
{
eval(this.close_script);
this.close_script = '';
}
}
this.position = function(mnu, e)
{
var x = e.pageX? e.pageX: e.clientX + viewport.scrollX;
var y = e.pageY? e.pageY: e.clientY + viewport.scrollY;
if ( x + mnu.offsetWidth + this.offX > viewport.width + viewport.scrollX )
x = x - mnu.offsetWidth - this.offX;
else x = x + this.offX;
if ( y + mnu.offsetHeight + this.offY > viewport.height + viewport.scrollY )
{
//on bottom of screen, display upward
y = ( y - mnu.offsetHeight - this.offY > viewport.scrollY )? y - mnu.offsetHeight - this.offY : viewport.height + viewport.scrollY - mnu.offsetHeight;
}
else
{
//display downward
y = y + this.offY;
}
mnu.style.left = x + "px";
mnu.style.top = y + "px";
this.timer = setTimeout("menuLayers.setStyle('" + menuLayers.activeMenuID + "','visible')", 250);
}
this.mouseoutCheck = function(e)
{
e = e? e: window.event;
var mnu = document.getElementById(menuLayers.activeMenuID);
var toEl = e.relatedTarget? e.relatedTarget: e.toElement;
if ( mnu != toEl && !menuLayers.contained(toEl, mnu) ) menuLayers.hide();
}
this.contained = function(oNode, oCont)
{
if (!oNode) return;
while ( oNode = oNode.parentNode )
if ( oNode == oCont ) return true;
return false;
}
this.clearTimer = function()
{
if (menuLayers.timer) clearTimeout(menuLayers.timer);
}
this.setStyle = function(menuname,visibility)
{
var el = document.getElementById(menuname);
try{el.filters[0].Apply();}catch(e){}
if (visibility == "visible")
{
el.style.visibility = "visible";
try{el.filters.revealTrans.transition=5; }catch(e){}
}
else
{
el.style.visibility = "hidden";
try{el.filters[0].transition=4; }catch(e){}
}
try{el.filters[0].Play(); }catch(e){}
}
this.set_row_height = function(row_id, int_height)
{
row_id.height = int_height;
this.reset_row_id = row_id;
}
this.reset_row = function ()
{
if (this.reset_row_id != null)
this.reset_row_id.height = '';
}
}
//************************************
//end porting. New code below
//************************************
function set_date_hovers(type) {
var fields = get_date_fields()
if (fields.length > 0) {
for (var xc = 0; xc < fields.length; xc++) {
addEvent(fields[xc], 'focus', function() { eval('show_date_format_tooltip(this);') });
addEvent(fields[xc], 'blur', function() { eval('hide_date_format_tooltip();') });
}
}
}
function get_date_fields() {
var retVal = new Array();
var elems = document.getElementsByTagName("input");
var starts_with_regex = new RegExp('^dt_', 'i');
var ends_with_regex = new RegExp('_dt$', 'i');
var starts_with_regex2 = new RegExp('^date_', 'i');
var ends_with_regex2 = new RegExp('_date$', 'i');
var mid_regex = new RegExp('_date_', 'gi');
var mid_regex2 = new RegExp('_dt_', 'gi');
for (var i = 0; i < elems.length; i++) {
var str_field_name = elems[i].getAttribute('name');
if (str_field_name != null) {
if (str_field_name.match(starts_with_regex) != null ||
str_field_name.match(ends_with_regex) != null ||
str_field_name.match(starts_with_regex2) != null ||
str_field_name.match(ends_with_regex2) != null ||
str_field_name.match(mid_regex) != null ||
str_field_name.match(mid_regex2) != null)
{
retVal.push(elems[i]);
}
}
}
return retVal;
}
//************************************
//ported from bg_submit_js.aspx
//************************************
//usage:
//function process_return(txt)
//{
// alert(txt);
//}
//var x=new js_data('test.aspx',true,'process_return')
function replace_ddlb_options(ddlb, options)
{
var outer = ddlb.outerHTML;
var spot = outer.indexOf('>');
outer = outer.substr(0,spot+1);
outer = outer + options + '';
ddlb.outerHTML = outer;
}
function js_data(target_url,use_async,returnScript)
{
var xmlhttp=null;
var async = use_async;
var url = target_url;
var returnscript = returnScript;
var internalRequestComplete = function()
{
var STATE_COMPLETED = 4;
var STATUS_200 = 200;
if (xmlhttp.readyState == STATE_COMPLETED)
{
if (xmlhttp.status == STATUS_200 || xmlhttp.statusText == 'OK')
{
inProgress = false;
isComplete = true;
//alert(returnscript + '(\'' + xmlhttp.responseText.replace('\\','\\\\').replace('\'','\\\'') + '\');')
eval(returnscript + '(\'' + xmlhttp.responseText.replace(/[\n|\r|\f]/g,'').replace(/\\/g,'\\\\').replace(/\'/g,'\\\'') + '\');')
}
}
}
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
if (xmlhttp!=null)
{
xmlhttp.onreadystatechange=internalRequestComplete;
xmlhttp.open("GET",url,async);
xmlhttp.setRequestHeader('Cookie', 'first call bug workaround');
xmlhttp.setRequestHeader('Cookie', 'ASP.NET_SessionId=k44bklreu2fmmx450qu3c4np');
xmlhttp.send(null);
//alert('sent')
}
else
{
alert("Your browser does not support AJAX.");
}
}