/**************************************************************** Checkbox setting function					                   ** 1st Param - Bool indicating checked state                    ** 2nd Param - String indicating class of checkboxes to change. ****************************************************************/function setCboxes(checked, theclass) {	var cboxes = document.getElementsByClassName(theclass);	for (i=0;i<cboxes.length;i++) {		cboxes[i].checked = checked;	}}/**********************************************                                            **		Help Related Functions 				 **                                            **********************************************/function helpTip(o, id) {	var h = $(id);	if (h==null) return 'ERROR: Missing Help Div: '+ id;		if (TOOLTIP_OPTS!=null && typeof(TOOLTIP_OPTS)=='object') {		TOOLTIP_OPTS.each(function(k){eval('o.'+k[0]+'=\''+k[1]+'\';');});	}	if (h.childNodes[0].tagName=='H1' && h.childNodes[1].tagName=='SPAN') {		o.T_TITLE = h.childNodes[0].innerHTML;		return h.childNodes[1].innerHTML;	} else {		return h.innerHTML;	}}/**********************************************                                            **                                            **                                            **   New AJAX Managing Classes and Functions  **                                            **                                            **                                            **********************************************/function saveAjaxForm(formID, divID, post_to_url) {	var pb = Form.serialize(formID);	if (pb=='') return $(formID).submit();	pb += '&ajaxRequest=1';	try {		new Ajax.Updater(divID, post_to_url, {			method:'post',			postBody: pb,			evalScripts:true,			onError: function() { $(formID).submit(); }		});	} catch(e) {		$(formID).submit();	}}var xmlhttp      = null;var ajaxCallback = null;function ajaxCall(page, callback){   try {    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");  }   catch (e) {    try {      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");    }     catch (E) {      xmlhttp = false;    }  }  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {    xmlhttp = new XMLHttpRequest();  }  xmlhttp.open("GET", page, true);  xmlhttp.onreadystatechange=function() {    if (xmlhttp.readyState==4) {      if (callback) {        callback(xmlhttp.responseText);      }    }  }  xmlhttp.send(null);}/**********************************************                                            **                                            **                                            **  New Window Managing Classes and Functions **                                            **                                            **                                            **********************************************//**********************************************  Functions                                 **********************************************/function validateYesNo( theVar ) {  if ( !theVar ) return 'no';  if ( theVar.toLowerCase() == 'no' ) return 'no';  else if ( theVar == true ) return 'yes';  else if ( theVar.toLowerCase() != 'true' ) return 'yes';  else if ( theVar.toLowerCase() != 'yes' ) return 'no';  return 'yes';}function validateInt( theVar ) {  if ( !theVar ) return 0;  return parseInt(theVar);}function openerCheck() {  if ( !windowOpen( window.opener ) ) {    window.close();  }}function windowOpen(win) {   if ( !win || win.closed ) {      return false;   }   return true;}function WindowFormat(name, width, height, scrolling, scroll, scrollbars, resizable, toolbar, fullScreen){  if ( !width )      width      = null;  if ( !height )     height     = null;  if ( !scrolling )  scrolling  = 'yes';  if ( !scroll )     scroll     = 'yes';  if ( !scrollbars ) scrollbars = 'yes';  if ( !resizable )  resizable  = 'yes';  if ( !toolbar )    toolbar    = 'yes';  if ( !fullScreen ) fullScreen = 'no';  if ( !name )       name       = width+height+scrolling+scroll+scrollbars+resizable+toolbar;    this.setWidth( width );  this.setHeight( height );  this.setScrolling( scrolling );  this.setScroll( scroll );  this.setScrollBars( scrollbars );  this.setResizable( resizable );  this.setToolbar( toolbar );  this.setName( name );  this.setFS( fullScreen );}WindowFormat.prototype.setWidth     = function(amt)   { this.width      = validateInt(amt);     }WindowFormat.prototype.setHeight    = function(amt)   { this.height     = validateInt(amt);     }WindowFormat.prototype.setScrolling = function(yesNo) { this.scrolling  = validateYesNo(yesNo); }WindowFormat.prototype.setScroll    = function(yesNo) { this.scroll     = validateYesNo(yesNo); }WindowFormat.prototype.setScrollBars= function(yesNo) { this.scrollbars = validateYesNo(yesNo); }WindowFormat.prototype.setResizable = function(yesNo) { this.resizable  = validateYesNo(yesNo); }WindowFormat.prototype.setToolbar   = function(yesNo) { this.toolbar    = validateYesNo(yesNo); }WindowFormat.prototype.setFS        = function(yesNo) { this.fullscreen = validateYesNo(yesNo); }WindowFormat.prototype.setName      = function(nombre){ this.name       = nombre; }WindowFormat.prototype.getFullString= function() {  return 'width='     +this.width     +','+         'height='    +this.height    +','+         'scrolling=' +this.scrolling +','+         'scroll='    +this.scroll    +','+         'scrollbars='+this.scrollbars+','+         'resizable=' +this.resizable +','+         'toolbar='   +this.toolbar+','+         'fullscreen='+this.fullscreen;}WindowFormat.prototype.getDetails   = function() {  var retStr = "WindowFormat [Object]\n";  retStr += " .name = "       + this.name       + "\n";  retStr += " .width = "      + this.width      + "\n";  retStr += " .height = "     + this.height     + "\n";  retStr += " .scrolling = "  + this.scrolling  + "\n";  retStr += " .scroll = "     + this.scroll     + "\n";  retStr += " .scrollbars = " + this.scrollbars + "\n";  retStr += " .resizable = "  + this.resizable  + "\n";  retStr += " .toolbar = "    + this.toolbar    + "\n";  retStr += " .fullscreen = " + this.fullscreen + "\n";  return retStr;}/**********************************************  WindowManager Class                       **********************************************/function WindowManager() {  this.winArray = new Array();}WindowManager.prototype.getDetails   = function() {  var retStr = "WindowManager [Object]\n";  retStr += " .winArray [Array]\n";  for(var i in this.winArray ) {    retStr += "  '"+this.winArray[i].name+"' [Window Object]\n";  }  return retStr;}WindowManager.prototype.cleanup = function() {  for(var i in this.winArray ) {    if ( !this.winArray[i] || this.winArray[i].closed ) {      this.winArray[i] = null;    }  }}WindowManager.prototype.showBlockedWarn = function() {  alert('Oops! An important window was blocked from showing. Could it be your popupblocker?');}WindowManager.prototype.openWin = function( location, wndFrmtObj ) {  if ( !location )   return;  if ( !wndFrmtObj ) wndFrmtObj = new WindowFormat();  if (location.indexOf('?') == -1) location += '?width='+wndFrmtObj.width+'&height='+wndFrmtObj.height+'&fullscreen='+wndFrmtObj.fullscreen;  else location += '&width='+wndFrmtObj.width+'&height='+wndFrmtObj.height+'&fullscreen='+wndFrmtObj.fullscreen;    if ( this.winArray[wndFrmtObj.name] )   {    if ( !this.winArray[wndFrmtObj.name].closed && this.winArray[wndFrmtObj.name] )     {      if ( this.winArray[wndFrmtObj.name].location == location ) {        this.winArray[wndFrmtObj.name].focus();        return;      }      else {        this.winArray[wndFrmtObj.name].close();      }    }    else {      this.winArray[wndFrmtObj.name] = null;    }  }     this.winArray[wndFrmtObj.name] = window.open(location, wndFrmtObj.name, wndFrmtObj.getFullString());    if ( !this.winArray[wndFrmtObj.name] ) {    this.showBlockedWarn();  }}// Create the window managervar w          = new WindowManager();/**********************************************  OnLoad Framework                          **********************************************/var onLoadList = new Array();var onLoadHash = new Array();function registerOnLoad(func) {  if ( typeof(onLoadHash[func.toString()]) == 'undefined' ) {    onLoadList.push(func);    onLoadHash[func.toString()] = 1;  }}function callOnLoadList() {  for(var i=0; i<onLoadList.length;i++) {    onLoadList[i]();  }}var maxZIndex = 10000;function getZ() {	return ++maxZIndex;}function centerMe(id) {	var o = $(id);	var winsize = getWinSize();	var myd = Element.getDimensions(o);//	[Element.getWidth(o), Element.getHeight(o)];	var winscroll = getWinScroll();	var newl = (winsize[0]-myd.width) / 2 + (winscroll[1]/2);	if (newl < 0) newl = 0;	o.style.left = newl;	var newt = (winsize[1]-myd.height) / 2 + (winscroll[0]/2);	if (newt < 0) newt = 0;	o.style.top = newt;}function getWinSize() {  var myWidth = 0, myHeight = 0;  if( typeof( window.innerWidth ) == 'number' ) {    //Non-IE    myWidth = window.innerWidth;    myHeight = window.innerHeight;  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {    //IE 6+ in 'standards compliant mode'    myWidth = document.documentElement.clientWidth;    myHeight = document.documentElement.clientHeight;  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {    //IE 4 compatible    myWidth = document.body.clientWidth;    myHeight = document.body.clientHeight;  }  return [myWidth, myHeight];}function getWinScroll() {	if (navigator.appName == "Microsoft Internet Explorer")		return [document.body.scrollTop,document.body.scrollLeft];	else			return [window.pageYOffset, window.pageXOffset];}var AJAXATTEMPTS = [];function attemptAjaxSubmit(f, u, id) {	try {		var pb = Form.serialize(f);		pb += '&ajaxRequest=1';		if (AJAXATTEMPTS[id] != null) return true;		AJAXATTEMPTS[id] = 1;		new Ajax.Updater('ajaxdiv',u, {			method:'post',			postBody: pb,			evalScripts:true		});	} catch (e) {		return true;	}	return false;}