	
		//alert ("core.js is loading");
	
//	FUNCTIONS
	
//	NOTE: THESE ARE LISTED IN ALPHABETICAL ORDER
//	>>>	KEEP IT THAT WAY! <<<<
	
	
	
	
	function add_onload_event (func) {
	
			//alert ('Adding ' + func + ' to window.onload();');
		
	//	When another developer adds rollovers, etc. w/ Dreamweaver, DW adds an onLoad call in the body.
	//	This function allows us to retain those commands while adding our own to the list (ie: prepare_elements())
		
		var old_onload = window.onload;
		
		if (typeof window.onload != 'function') {
			
			window.onload = func;
			
		} else {
			
			window.onload = function () {
				
				old_onload();
				
				func();
			}
		}
		
		//alert ('added ' + func + window.onload);
	}
	
	
	
	
	function clear_field (field, initial_value) {
		
			//alert ("clearing " + field);
		
		if (field.defaultValue == field.value) {
		
			field.value = '';
		}
	}
	
	
	
	
//	getbyIdfix for IE/Opera
//	use getCorrectId('myId') instead of getCorrectId('myId')
	
	var getCorrectId = function (id, doc) {
		if((id)&&((typeof id == "string")||(id instanceof String))){
			if (!doc) { doc = document; }
			var ele = doc.getElementById(id);
			// workaround bug in IE and Opera 8.2 where getElementById returns wrong element
			if (ele && (ele.id != id) && doc.all) {
				ele = null;
				// get all matching elements with this id
				eles = doc.all[id];
				if (eles) {
					// if more than 1, choose first with the correct id
					if (eles.length) {
						for (var i=0; i < eles.length; i++) {
							if (eles[i].id == id) {
								ele = eles[i];
								break;
							}
						}
					// return 1 and only element
					} else { ele = eles; }
				}
			}
			
			return ele;
		}
		
		return id; // assume it's a node
		
	} // End getCorrectId	
	
	
	
	function getElementsByClass(elem, classname){
		
		classes = new Array();
		
		alltags = document.getElementsByTagName(elem);
		
		for (i=0; i<alltags.length; i++) {
			
			if (alltags[i].className == classname) {
				
				classes[classes.length] = alltags[i];
			}
		}
		
		return classes;
	}
	
	
	
	
	function include_js_file (file_name) {
		
			/* FOR TESTING ONLY */ //alert ("including "+file_name);
		
		var th = document.getElementsByTagName('head')[0];
		var s = document.createElement('script');
		s.setAttribute('type','text/javascript');
		s.setAttribute('src',file_name);
		th.appendChild(s);
	}
	
	
	
	
	function insert_after (newElement, targetElement) {
		
		var parent = targetElement.parentNode;
		
		if (parent.lastChild == targetElement) {
			
			insertedElement = parent.appendChild(newElement);
		
		} else {
			
			insertedElement = parent.insertBefore(newElement, targetElement.nextSibling);
		}
		
		return insertedElement;
	}
	
	
	
	
	function popup (link, name, width, height, features) {
		
	//	Example: ('popup.php','popup','650','500','scrollbars=auto,resizable=yes,toolbar=no,directories=no,menubar=no');
		
		if (features == 'default') { features = 'scrollbars=auto,resizable=yes,toolbar=no,directories=no,menubar=no'; }
		
		window.open(link, name, "width="+width+","+"height="+height+","+features);
	}
	
	
	
	
	function rollover (id, src) {
		
			/* FOR TESTING ONLY */ //alert ("rolling over " + id + ", swapping with " + src);
		
		getCorrectId(id).src = src;
	}
	
	
	
	
	function toggle (id, state) {
	
			/* FOR TESTING ONLY */ //alert ("toggling " + id + " to " + state);
	
		getCorrectId(id).style.display = state;
	}
	
	
	
	
	function toggle_auto (id, state) {
		
			/* FOR TESTING ONLY */ //alert ("auto toggling " + id + " to " + state + ". Current state is " + getCorrectId(id).style.display);
		
		if (getCorrectId(id).style.display == 'none') {
			
				/* FOR TESTING ONLY */ //alert ('was none');
			
			getCorrectId(id).style.display = state;
			
		} else {
			
			getCorrectId(id).style.display = 'none';
		}
	}
	
	
	
	
	function validateEmailv2(email) {
	
		/* FOR TESTING ONLY */ //alert ('validating email');
	
	// a very simple email validation checking. 
	// you can add more complex email checking if it helps 
	    var splitted = email.match("^(.+)@(.+)$");
	    if(splitted == null) return false;
	    if(splitted[1] != null )
	    {
	      var regexp_user=/^\"?[\w-_\.]*\"?$/;
	      if(splitted[1].match(regexp_user) == null) return false;
	    }
	    if(splitted[2] != null) {
	      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
	      if(splitted[2].match(regexp_domain) == null) 
	      {
		    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
		    if(splitted[2].match(regexp_ip) == null) return false;
	      }
	      return true;
	    }
		
		return false;
	}
	
	
	
	
//	ACTIONS		

//	Add prepare_elements to the list of functions executed after the page loads
	add_onload_event(prepare_elements);	
	
		//alert ("javascript.js has loaded");