

if (window != window.top)
  top.location.href = location.href;


	function mouseOverWhite(i) {
		i.style.backgroundColor='#F2F2F2';
	}
	function mouseOutWhite(i) {
		i.style.backgroundColor='#FFFFFF';
	}
	
	function mouseOverGray(i) {
		i.style.backgroundColor='#F2F2F2';
	}
	function mouseOutGray(i) {
		i.style.backgroundColor='#F2F2F2';
	}
	

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=yes'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}

function NewWindow2(mypage, myname, w, h, scroll) {
if (page_loaded == false) { return false; }
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=yes'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
return false;
}

/**
* This Object helps in dealing with Radio Groups
*/
function RadioGroup()
{ 
	this.radioNodeElem = null;
	
	/**
	* Initialize
	*
	* @param form_object obj_form
	* @param string group_name
	* @return bool
	*/
	this.init = function(obj_form, group_name)
	{
		try {
			this.radioNodeElem = obj_form.elements[group_name];	
		} catch (e) {
			this.radioNodeElem = null;	
		}
		
		
	}//end init
	
	/**
	* Get the value of the currently checked radio box
	*
	* @return null
	*/
	this.getValue = function()
	{
		if ( this.radioNodeElem == null ) {
			return null;	
		}
		
		for ( var i=0; i<this.radioNodeElem.length; i++ ) {
			if ( this.radioNodeElem[i].checked == true ) {
				return this.radioNodeElem[i].value;	
			}
			
		}//for	
		
		return null;
		
	}//end value

	/**
	* Set the value of the radio group, value must exist in the set
	*
	* @param string new_value
	* @return mixed
	*/
	this.setValue = function(new_value)
	{
		if ( this.radioNodeElem == null ) {
			return null;	
		}
		
		for ( var i=0; i<this.radioNodeElem.length; i++ ) {
			if ( this.radioNodeElem[i].value == new_value ) {
				this.radioNodeElem[i].checked = true;
				return true;
					
			}
		}//for
		
		return false;
		
	}//end setValue
	
}//end radioGroup


	// Requires "onLoad=ready()" in the BODY tag
	// Example: <body onLoad=ready()>
	// Requires form name to match where it reads "form" in script
	// Example: <form name="form">
	// Requires form field name to match where it reads "field" in script
	// Example: <input name="field">

function ready(){document.form.field.focus();}





function modify_attribute(element, attribute_name, additional_value, position)
{	
	if ( element[attribute_name] ) {
		//This should mean that it's not blank
		var str_orig = String(element[attribute_name]);
		
	} else {
		//this should mean that it's blank
		var str_orig = "";
		
	}
	
	if ( str_orig.indexOf("function") != -1 ) {
		var open_curly_pos = str_orig.indexOf('{');
		var end_curly_pos = str_orig.lastIndexOf('}');
		var str_old_stuff = str_orig.slice(open_curly_pos+1, end_curly_pos);
		
		if ( position == "after" ) {
			element[attribute_name] = new Function(str_old_stuff + additional_value);	
			
		} else {
			element[attribute_name] = new Function(additional_value + str_old_stuff);		
			
		}
		
	} else {
		element[attribute_name] = new Function(additional_value);
		
	} 
	
}//end modify_attribute

