	var Class = {
	  create: function() {
	    return function() {
	      //this.initialize.apply(this, arguments);
	    }
	  }
	}
	
	var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	@end @*/

	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	
	//object check / browser validation
	if (!xmlhttp) {
		alert("Your browswer does not support some functionality required for this site to run!\n\nPlease download and install the latest version of FireFox or Internet Explorer.");
	}
	
	function xmlhttp_trans(serverPage, obj, butobj, callback, post_str) 
	{
		if (typeof obj == 'string') {
			obj = document.getElementById(obj);
		}
		
		var req_type = "GET";
		if (typeof post_str == 'string') {
			if (post_str != '') {
				req_type = "POST";				
			}
		}
		
		if (req_type == "POST") {
			xmlhttp.open("POST", serverPage, true);
			xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=ISO-8859-1");
		} else {
			xmlhttp.open("GET", serverPage);
		}
		
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
				//obj.innerHTML = xmlhttp.responseText;
				
				toggleButton(butobj);
				
				//butobj.form.reset();
				t = butobj;
				o = obj;
				
				myfunc = new Function(callback + "(xmlhttp.responseText, o);");
				myfunc();
			}
		}
		if (req_type == "POST") {
			xmlhttp.send(post_str);
		} else {
			xmlhttp.send(null);
		}
	}
	
	function submitForm(fobj, retobj, butobj, callback)
	{
		if (typeof tinyMCE != 'undefined') {
			if (tinyMCE) {
				tinyMCE.triggerSave();
			}
		}
		
		if (typeof fobj == 'string') {
			fobj = document.getElementById(fobj);
		}				
		
		query_string = '';
				
		for(var i = 0; i < fobj.elements.length; i++) {
			elem = fobj.elements[i];
			if (elem) {
				if (elem.type != undefined) {
					if (elem.type == 'checkbox' || elem.type == 'radio') {
						if (elem.checked) {
							query_string = appendQueryString(elem, query_string);
						} 
					} else if (elem.type != 'button') {
						query_string = appendQueryString(elem, query_string);
					}
				}				
			}
		}
				
		if (fobj.action != '') {
			if (retobj != '') {
				obj = document.getElementById(retobj);
				if (obj) {
					
					toggleButton(butobj);
					
					xmlhttp_trans(fobj.action + "?" + query_string, obj, butobj, callback);					
				} else {
					alert('could not locate return object!');
				}
			} else {
				alert('return object name not provided!');
			}
		} else {
			alert('no form action provided!');
		}
	}
	
	function appendQueryString(elem, qstring) 
	{
		if (elem.value != '' && elem.name != '') {
			return qstring += "&" + elem.name + "=" + elem.value;
		} else {
			return qstring;
		}
	}
	
	var previous_button_code = '';
	function toggleButton(butobj) {
		if (typeof butobj == 'string') {
			butobj = document.getElementById(butobj);
		}
		
		if (butobj) {			
			if (previous_button_code == '') {
				previous_button_code = butobj.innerHTML;
				butobj.innerHTML = 'Processing, please wait...';
			} else {
				butobj.innerHTML = previous_button_code;
				previous_button_code = '';
			}
		}
	}		
	
	function parseRetval(retval, doclear)
	{
		val_reg = new RegExp("<[^>]+>[^<]*<\/[^>]+>", "g");
		
		results = retval.match(val_reg);
		
		for(var i =0; i < results.length; i++)
		{
			line = results[i];
			
			open_tag_reg = new RegExp("<[^>]+>");
			close_tag_reg = new RegExp("<\/[^>]+>");
			
			matches = line.match(open_tag_reg);
			
			k = matches[0];
			k = k.replace("<", "");
			k = k.replace(">", "");
			
			//remove key from line and just leave value
			val = line.replace(open_tag_reg, "");
			val = val.replace(close_tag_reg, "");
			
			val = unescape(val);
			val = val.replace("+", " ");
			
			//execute them * create them as variables
			if (doclear) {
				val = '';
			}//alert(k + " = '" + val + "';");
			try {
				eval(k + " = '" + val + "';");
			} catch (er) {
				//possible cause: attempted to eval a reserved keyword
				alert(er.message);
			}
		}
	}				
	
	function showHide(objid)
	{
		obj = document.getElementById(objid);
		
		if (obj) {
			if (obj.style.display == 'block' || obj.style.display == '') {
				obj.style.display = 'none';				
			} else {
				obj.style.display = 'block';	
			}
		}				
	}
	
	function arrayPush(v_array, v_obj)
	{
		if (typeof v_array == 'undefined') {
			v_array = new Array();
		}
		if (typeof v_array == 'object') {
			v_array[v_array.length] = v_obj;			
		} 
		
		return v_array;
	}
	
	