function enab_or_disab(fieldname,eventcount,attendeenum)
{
	
	if(eval("document.form1."+fieldname+"_"+attendeenum+".checked") == true){
		
		for (i=1;i<eventcount;i++){
			eval("document.form1."+fieldname+"_"+i+"_"+attendeenum+".disabled = true");
			
		}
	}
	else{
		for (i=1;i<eventcount;i++){
			eval("document.form1."+fieldname+"_"+i+"_"+attendeenum+".disabled = false");
		}
	}
}

function openinplace(url, e)
{
	
	 w = screen.width-400;
	 h = screen.height-320;
	 
	 x = e.screenX;
	 y = e.screenY;
	 if(x > w){
		 x = x-400
         }
	 if(y > h){
		 y = y-320
         }
	  
	 newWindow=window.open(url,'note','width=400,height=320,top='+y+',left='+x);
	 newWindow.focus();
}

/*--------------------------------------------------------------------------------------*/
/*function : format_number()  
version: 1.0.0  
This function formats a numeric value passed in to it with specified number of  
decimal values. numeric value will not be rounded.  
pnumber : numeric value to be formatted.  
decimals : number of decimal points desired.  

Author: Buddhike de Silva  
Date: 21-Nov-2002 11:16 AM*/  

/*  
revision: 1.1.0  
Author: M. Cassim Farook  
Date: 21-Nov-2002 10:16 PM  
Notes: No offense buddhike...but i had to rewrite the code  
works for ADT (any dam thing)  
usage: x = format_number(123.999, 2)  
*/  

/*  
revision: 1.2.0  
Authors: Buddhike de Silva  
Date: 22-Nov-2002 12:07 PM  
Notes: Optimized for best performence.  
usage: x = format_number(123.999, 2)  
*/  

/* 
  Revision: 1.3 
  Author: Mike Robb (JS-X.com) 
  Date: May 26, 2003 
  Notes:  Changed to deal with negative numbers. 
          Fixed length of final answer. 
          Work-around for javascript internal math problem with rounding negative numbers. 
 */ 

/*
  Revision 1.4
  Author: LeAnn Roberts
  Date: September, 2003
  Note: Modified the if logic: Math.pow()
 */
function format_number(pnumber,decimals) 
{  
  if (isNaN(pnumber)) { return 0};  
  if (pnumber=='') { return 0};  
   
  var IsNegative=(parseInt(pnumber)<0); 
  if(IsNegative)pnumber=-pnumber; 

  var snum = new String(pnumber);  
  var sec = snum.split('.');  
  var whole = parseInt(sec[0]);  
  var result = '';  
  if(sec.length > 1){  
    var dec = new String(sec[1]);  
    dec = parseInt(dec)/Math.pow(10,parseInt(dec.length-decimals-1)); 
Math.round(dec); 
dec = parseInt(dec)/10; 

if(IsNegative) 
{ 
  var x = 0-dec; 
      x = Math.round(x); 
  dec = - x; 
} 
else 
{ 
      dec = Math.round(dec); 
} 

/* 
 * If the number was rounded up from 9 to 10, and it was for 1 'decimal' 
 * then we need to add 1 to the 'whole' and set the dec to 0. 
 */ 
if(dec==Math.pow(10, parseInt(decimals)))
{ 
  whole+=1; 
  dec="0"; 
} 

    dec = String(whole) + "." + String(dec);  
    var dot = dec.indexOf('.');  
    if(dot == -1){  
      dec += '.';  
      dot = dec.indexOf('.');  
    } 
var l=parseInt(dot)+parseInt(decimals); 
    while(dec.length <= l) { dec += '0'; }  
    result = dec;  
  } else{  
    var dot;  
    var dec = new String(whole);  
    dec += '.';  
    dot = dec.indexOf('.');  
var l=parseInt(dot)+parseInt(decimals); 
    while(dec.length <= l) { dec += '0'; }  
    result = dec;  
  }  
  if(IsNegative)result="-"+result; 
  return result;  
}  
/*-----------------------------------------------------------------------------------------*/

function trimAll( strValue ) {
/************************************************
DESCRIPTION: Removes leading and trailing spaces.

PARAMETERS: Source string from which spaces will
  be removed;

RETURNS: Source string with whitespaces removed.
*************************************************/
 var objRegExp = /^(\s*)$/;

    //check for all spaces
    if(objRegExp.test(strValue)) {
       strValue = strValue.replace(objRegExp, '');
       if( strValue.length == 0)
          return strValue;
    }

   //check for leading & trailing spaces
   objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
   if(objRegExp.test(strValue)) {
       //remove leading and trailing whitespace characters
       strValue = strValue.replace(objRegExp, '$2');
    }
  return strValue;
}

function validateNotEmpty( strValue ) {
/************************************************
DESCRIPTION: Validates that a string is not all
  blank (whitespace) characters.

PARAMETERS:
   strValue - String to be tested for validity

RETURNS:
   True if valid, otherwise false.
*************************************************/
   var strTemp = strValue;
   strTemp = trimAll(strTemp);
   if(strTemp.length > 0){
     return true;
   }
   return false;
}



