	
	
		/* FOR TESTING ONLY */ //alert ('javascript.js is loading...');
	
	
//	VARS
	
	// No vars yet
	
	
	
	
//	FUNCTIONS
	
//	NOTE : 	THESE FUNCTIONS ARE LISTED IN ALPHABETICAL ORDER (with the exception of all that nasty validator code).

//	   >>>	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 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 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 prepare_elements () {
		
			/* FOR TESTING ONLY */ //alert ('Preparing elements...');
		
		
	//	Assign an ID to any element with a name but no ID
		var divs = document.getElementsByTagName('div');
				
			/* FOR TESTING ONLY */ //alert ('divs = ' + divs);
		
		for (var i=0; i<divs.length; i++) {
			
			if (divs[i].name != '' && divs[i].id == '') {
				
					/* FOR TESTING ONLY */ //alert ('name = ' + divs[i].name);
				
				divs[i].id = divs[i].name;
			}
		}
				
		var forms = document.getElementsByTagName('form');
				
			/* FOR TESTING ONLY */ //alert ('forms = ' + forms);
		
		for (var i=0; i<forms.length; i++) {
			
			if (forms[i].name != '' && forms[i].id == '') {
				
					/* FOR TESTING ONLY */ //alert ('name = ' + forms[i].name);
				
				forms[i].id = forms[i].name;
			}
		}
				
		var inputs = document.getElementsByTagName('input');
				
			/* FOR TESTING ONLY */ //alert ('inputs = ' + inputs);
		
		for (var i=0; i<inputs.length; i++) {
			
			if (inputs[i].name != '' && inputs[i].id == '') {
				
					/* FOR TESTING ONLY */ //alert ('name = ' + inputs[i].name);
				
				inputs[i].id = inputs[i].name;
			}
		}
				
		var selects = document.getElementsByTagName('select');
				
			/* FOR TESTING ONLY */ //alert ('selects = ' + selects);
		
		for (var i=0; i<selects.length; i++) {
			
			if (selects[i].name != '' && selects[i].id == '') {
				
					/* FOR TESTING ONLY */ //alert ('name = ' + selects[i].name);
				
				selects[i].id = selects[i].name;
			}
		}
		
		
		
		
	//	Attach popup functionality to link with a popup CLASS (popup IDs are handled below)
		var links = document.getElementsByTagName('a');
		
		for (var i=0; i<links.length; i++) {
			
			if (links[i].getAttribute("class") == "popup" || links[i].getAttribute("className") == "popup") {
				
				links[i].onclick = function () {
					
					popup(this,'popup','650','500','scrollbars=auto,resizable=yes');
					
					return false;
				}
			}
			
			if (links[i].getAttribute("class") == "popup_banners" || links[i].getAttribute("className") == "popup_banners") {
				
				links[i].onclick = function () {
					
					popup(this,'popup','830','600','scrollbars=yes,resizable=yes');
					
					return false;
				}
			}
		}
				
		
	/*
	//	Build rollovers for any clickable album, film or video covers 
		var cover_clicks = getElementsByClass("img", "cover_click");
		
		for (var i=0; i<cover_clicks.length; i++) {
			
			the_pic_id				= cover_clicks[i].getAttribute("id");
			the_pic					= document.getElementById(the_pic_id);
				
			the_pic.onmouseover = function () {
				the_original_pic_src	= this.getAttribute("src");
				the_new_pic_src 		= the_original_pic_src.replace("small_dim", "small");
				
				this.setAttribute("src", the_new_pic_src);		
			}
			
			the_pic.onmouseout = function () {
				the_original_pic_src	= this.getAttribute("src");
				the_new_pic_src 		= the_original_pic_src.replace("small", "small_dim");
				
				this.setAttribute("src", the_new_pic_src);		
			}
		}
	*/
		
		
		
		
	//	Wire form elements
		if (document.getElementById('form_registration_person')) {
			
			document.getElementById('person_msri_other').onfocus = function () {
				
				if (this.value == 'Other') { this.value = null; }
				
				document.getElementById('checkbox_other_msri').checked = true;
			}
			
			document.getElementById('person_genre_other').onfocus = function () {
				
				if (this.value == 'Other') { this.value = null; }
				
				document.getElementById('checkbox_other_genre').checked = true;
			}
		}
		
		if (document.getElementById('form_registration_band')) {
			
			document.getElementById('band_genre_other').onfocus = function () {
				
				if (this.value == 'Other') { this.value = null; }
				
				document.getElementById('checkbox_other_genre').checked = true;
			}
			
			document.getElementById('bandmates_count').onchange = function () {
				
				if (this.options[this.selectedIndex].value == 'None' || this.options[this.selectedIndex].value == 'Select One:') {
					
					document.getElementById('hr_bandmate_subscriptions').style.display 	= 'none';
					document.getElementById('tbl_bandmate_subscriptions').style.display = 'none';
					
				} else {
					
						/* FOR TESTING ONLY */ //alert (this.options[this.selectedIndex].value + ' bandmates');
					
					document.getElementById('hr_bandmate_subscriptions').style.display 	= 'block';
					document.getElementById('tbl_bandmate_subscriptions').style.display = 'table';
					
				//	Create any needed tables
				//	var i = 1 because table 0 is the template we'll be duplicating
					for (var i=1; i<this.options[this.selectedIndex].value; i++) {
						
						if (!document.getElementById('tbl_bandmate_subscriptions_info_maybe_'+i)) {
							
						//	Note the last table
							var new_maybe 	= document.getElementById('tbl_bandmate_subscriptions_info_maybe_'+(i-1));
							var new_yes1 	= document.getElementById('tbl_bandmate_subscriptions_info_yes1_' +(i-1));
							var new_yes2 	= document.getElementById('tbl_bandmate_subscriptions_info_yes2_' +(i-1));
							
						//	Clone the last table
							var new_maybe_clone	= new_maybe.cloneNode(true);
							var new_yes1_clone 	= new_yes1.cloneNode(true);
							var new_yes2_clone	= new_yes2.cloneNode(true);
								
						//	Loop through the rows of the cloned tables..
							for (var z=0; z<new_maybe_clone.rows.length; z++) {
								
									/* FOR TESTING ONLY */ //alert ('z = ' + z);
								
							//	For each cell in the row...
								for (var y=0; y<new_maybe_clone.rows[z].cells.length; y++) {
									
										/* FOR TESTING ONLY */ //alert ('y = ' + y);
									
								//	If there are nodes inside the TD...
									if (new_maybe_clone.rows[z].cells[y].hasChildNodes()) {
										
									//	For each node in the cell...
										for (var x=0; x<new_maybe_clone.rows[z].cells[y].childNodes.length; x++) {
											
										//	If the node is an input, select or textfield...
											if (new_maybe_clone.rows[z].cells[y].childNodes[x].nodeName == "INPUT" || new_maybe_clone.rows[z].cells[y].childNodes[x].nodeName == "SELECT" || new_maybe_clone.rows[z].cells[y].childNodes[x].nodeName == "TEXTAREA") {
												
													/* FOR TESTING ONLY */ //alert ('got a form element...');
												
											//	Change the name & ID +1
												new_maybe_clone.rows[z].cells[y].childNodes[x].name = new_maybe_clone.rows[z].cells[y].childNodes[x].name.substr(0,15) 	+ i + new_maybe_clone.rows[z].cells[y].childNodes[x].name.substr(16);
												new_maybe_clone.rows[z].cells[y].childNodes[x].id 	= new_maybe_clone.rows[z].cells[y].childNodes[x].id.substr(0,15) 	+ i + new_maybe_clone.rows[z].cells[y].childNodes[x].id.substr(16);
												
													/* FOR TESTING ONLY */ //alert ('ID = ' + new_maybe_clone.rows[z].cells[y].childNodes[x].id);
											}
										}
									}
								}
							}
							
							for (var z=0; z<new_yes1_clone.rows.length; z++) {
								
								for (var y=0; y<new_yes1_clone.rows[z].cells.length; y++) {
									
								//	If there are nodes inside the TD...
									if (new_yes1_clone.rows[z].cells[y].hasChildNodes()) {
										
									//	For each node in the cell...
										for (var x=0; x<new_yes1_clone.rows[z].cells[y].childNodes.length; x++) {
											
										//	If the node is an input, select or textfield...
											if (new_yes1_clone.rows[z].cells[y].childNodes[x].nodeName == "INPUT" || new_yes1_clone.rows[z].cells[y].childNodes[x].nodeName == "SELECT" || new_yes1_clone.rows[z].cells[y].childNodes[x].nodeName == "TEXTAREA") {
												
											//	Change the name & ID +1
												new_yes1_clone.rows[z].cells[y].childNodes[x].name	= new_yes1_clone.rows[z].cells[y].childNodes[x].name.substr(0,14)	+ i + new_yes1_clone.rows[z].cells[y].childNodes[x].name.substr(15);
												new_yes1_clone.rows[z].cells[y].childNodes[x].id	= new_yes1_clone.rows[z].cells[y].childNodes[x].id.substr(0,14)		+ i + new_yes1_clone.rows[z].cells[y].childNodes[x].id.substr(15);
												
													/* FOR TESTING ONLY */ //alert ('ID = ' + new_yes1_clone.rows[z].cells[y].childNodes[x].id);
											}
										}
									}
								}
							}
							
							for (var z=0; z<new_yes2_clone.rows.length; z++) {
								
								for (var y=0; y<new_yes2_clone.rows[z].cells.length; y++) {
									
								//	If there are nodes inside the TD...
									if (new_yes2_clone.rows[z].cells[y].hasChildNodes()) {
										
									//	For each node in the cell...
										for (var x=0; x<new_yes2_clone.rows[z].cells[y].childNodes.length; x++) {
											
										//	If the node is an input, select or textfield...
											if (new_yes2_clone.rows[z].cells[y].childNodes[x].nodeName == "INPUT" || new_yes2_clone.rows[z].cells[y].childNodes[x].nodeName == "SELECT" || new_yes2_clone.rows[z].cells[y].childNodes[x].nodeName == "TEXTAREA") {
												
											//	Change the name & ID +1
												new_yes2_clone.rows[z].cells[y].childNodes[x].name	= new_yes2_clone.rows[z].cells[y].childNodes[x].name.substr(0,14)	+ i + new_yes2_clone.rows[z].cells[y].childNodes[x].name.substr(15);
												new_yes2_clone.rows[z].cells[y].childNodes[x].id	= new_yes2_clone.rows[z].cells[y].childNodes[x].id.substr(0,14)		+ i + new_yes2_clone.rows[z].cells[y].childNodes[x].id.substr(15);
												
													/* FOR TESTING ONLY */ //alert ('ID = ' + new_yes2_clone.rows[z].cells[y].childNodes[x].id);
											}
										}
									}
								}
							}
		
						//	Insert the clone as a new table
							var new_maybe 	= insert_after(new_maybe_clone, new_maybe);
							var new_yes1 	= insert_after(new_yes1_clone,  new_yes1);
							var new_yes2 	= insert_after(new_yes2_clone,  new_yes2);
							
						//	Give the table a unique name + id
							new_maybe.name	= 'tbl_bandmate_subscriptions_info_maybe_'+i;
							new_maybe.id 	= 'tbl_bandmate_subscriptions_info_maybe_'+i;
							
							new_yes1.name	= 'tbl_bandmate_subscriptions_info_yes1_' +i;
							new_yes1.id 	= 'tbl_bandmate_subscriptions_info_yes1_' +i;
							
							new_yes2.name	= 'tbl_bandmate_subscriptions_info_yes2_' +i;
							new_yes2.id 	= 'tbl_bandmate_subscriptions_info_yes2_' +i;
							
								/* FOR TESTING ONLY */ //alert ('i = ' + i + '; add_loc = ' + add_loc + '; add_loc_clone = ' + add_loc_clone + '; new_add_loc = ' + new_add_loc);
						}
					}
					
				//	Destroy any unneeded tables
					for (var i=this.options[this.selectedIndex].value; i<9; i++) {
						
						document.getElementById('tbl_bandmate_subscriptions_info_maybe_' + i).parentNode.removeChild(document.getElementById('tbl_bandmate_subscriptions_info_maybe_' + i));
						document.getElementById('tbl_bandmate_subscriptions_info_yes1_'  + i).parentNode.removeChild(document.getElementById('tbl_bandmate_subscriptions_info_yes1_'  + i));
						document.getElementById('tbl_bandmate_subscriptions_info_yes2_'  + i).parentNode.removeChild(document.getElementById('tbl_bandmate_subscriptions_info_yes2_'  + i));
					}
				}
			}
			
			document.getElementById('bandmate_subscriptions_no').onclick = function () {
				document.getElementById('tr_bandmate_subscriptions_info_maybe').style.display 	= 'none';
				document.getElementById('tr_bandmate_subscriptions_info_yes1').style.display 	= 'none';
				document.getElementById('tr_bandmate_subscriptions_info_yes2').style.display 	= 'none';
			}
			
			document.getElementById('bandmate_subscriptions_maybe').onclick = function () {
				document.getElementById('tr_bandmate_subscriptions_info_maybe').style.display 	= 'table-row';
				document.getElementById('tr_bandmate_subscriptions_info_yes1').style.display 	= 'none';
				document.getElementById('tr_bandmate_subscriptions_info_yes2').style.display 	= 'none';
			}
			
			document.getElementById('bandmate_subscriptions_yes1').onclick = function () {
				document.getElementById('tr_bandmate_subscriptions_info_maybe').style.display 	= 'none';
				document.getElementById('tr_bandmate_subscriptions_info_yes1').style.display 	= 'table-row';
				document.getElementById('tr_bandmate_subscriptions_info_yes2').style.display 	= 'none';
			}
			
			document.getElementById('bandmate_subscriptions_yes2').onclick = function () {
				document.getElementById('tr_bandmate_subscriptions_info_maybe').style.display 	= 'none';
				document.getElementById('tr_bandmate_subscriptions_info_yes1').style.display 	= 'none';
				document.getElementById('tr_bandmate_subscriptions_info_yes2').style.display 	= 'table-row';
			}
		}
		
		
		
		
	//	Validate forms
		if (document.getElementById('form_registration_qualify')) {
			
			document.getElementById('form_registration_qualify').onsubmit = function () {
				
					/* FOR TESTING ONLY */ //alert ('Validating a Qualify form...');
				
				if (
					
					(document.getElementById('qualify_musician_yes').checked == false && document.getElementById('qualify_musician_no').checked == false)
					
						||
					
					(document.getElementById('qualify_industry_yes').checked == false && document.getElementById('qualify_industry_no').checked == false)
					
						||
					
					(document.getElementById('qualify_us_mailing_address_yes').checked == false && document.getElementById('qualify_us_mailing_address_no').checked == false)
				) {
					
					alert ('You must answer all four questions to proceed...');
					
					return false;
				}
			
					/* FOR TESTING ONLY */ //alert ('Qualify form validated.');
			}
		}
		
		if (document.getElementById('form_registration_person')) {
			
			document.getElementById('form_registration_person').onsubmit = function () {
				
					/* FOR TESTING ONLY */ //alert ('Validating a Person form...');
				
				if (
					
					(document.getElementById('non_musician') || document.getElementById('non_us_mailing_address'))
					
						&&
					
					document.getElementById('person_name_first').value == ''
				) {
					
					alert ('Please provide at least a first name for our records...');
					
					return false;
				}
				
				if (
					
					!document.getElementById('non_musician')
					
						&&
					
					!document.getElementById('non_us_mailing_address')
					
						&&
					
					(
						document.getElementById('person_name_first').value == '' ||
						document.getElementById('person_name_last').value == ''
					)
				) {
					
					alert ('You must provide a complete name for mailing purposes...');
					
					return false;
				}
				
				if (
					
					!document.getElementById('non_musician')
					
						&&
					
					(
						(document.getElementById('person_address1')	&& document.getElementById('person_address1').value == '') 	||
						(document.getElementById('person_city') 	&& document.getElementById('person_city').value == '')		||
						(document.getElementById('person_state') 	&& document.getElementById('person_state').value == '')		||
						(document.getElementById('person_zip')		&& document.getElementById('person_zip').value.length < 5)
					)
				) {
					
					alert ('You must provide a complete address...');
					
					return false;
					
				}
				
				if (document.getElementById('person_country') && document.getElementById('person_country').value == '') {
					
					alert ('Please let us know what country you\'re in...');
					
					return false;
					
				}
				
				if (
					(
						document.getElementById('person_phone_area_code').value != '' ||
						document.getElementById('person_phone_prefix').value != '' ||
						document.getElementById('person_phone_number').value != ''
					)
						&&
					(
						document.getElementById('person_phone_area_code').value.length < 3	||
						document.getElementById('person_phone_prefix').value.length < 3		||
						document.getElementById('person_phone_number').value.length < 4
					)
				) {
					
					alert ('Your telephone number is incomplete...');
					
					return false;
				}
				
				if (document.getElementById('person_email').value == '' || !validate_email(document.getElementById('person_email').value)) {
					
					alert ('You must provide a valid Email address...');
					
					return false;
				}
				
					/* FOR TESTING ONLY */ //alert ('Person form validated.');
			}
		}
		
		if (document.getElementById('form_registration_user')) {
			
			document.getElementById('form_registration_user').onsubmit = function () {
						
					/* FOR TESTING ONLY */ //alert ('Validating a User form...');
				
				if (document.getElementById('user_desired_username').value == '') {
				
					alert ("You must provide a Username...");
					
					return false;
				}
				
				if (document.getElementById('user_password1').value == '' || document.getElementById('user_password2').value == '') {
				
					alert ("You must provide a Password, then retype it to assure it was correctly entered the first time...");
					
					return false;
				}
				
				if (document.getElementById('user_password1').value != document.getElementById('user_password2').value) {
				
					alert ("The two passwords you entered did not match each other...");
					
					return false;
				}
				
					/* FOR TESTING ONLY */ //alert ('User form validated.');
			}
		}
		
		if (document.getElementById('form_registration_band')) {
			
			document.getElementById('form_registration_band').onsubmit = function () {
						
					/* FOR TESTING ONLY */ //alert ('Validating a Band form...');
				
				if (document.getElementById('band_name').value == '') {
					
					alert ('You must provide a Band Name...');
					
					return false;
				}
				
				if (document.getElementById('band_email').value == '') {
					
					alert ('You must provide an Email address...');
					
					return false;
					
				} else if (!validate_email(document.getElementById('band_email').value)) {
					
					alert ('You must provide a valid Email address...');
					
					return false;
				}
				
				if (document.getElementById('bandmates_count').options[document.getElementById('bandmates_count').selectedIndex].value == 'Select One:') {
					
					alert ('How many bandmates do you have...');
					
					return false;
				}
				
				if (document.getElementById('bandmate_subscriptions_maybe').checked == true) {
					
						//alert ('maybe for ' + document.getElementById('bandmates_count').options[document.getElementById('bandmates_count').selectedIndex].value + ' bandmates.');
					
					for (var q=0; q<document.getElementById('bandmates_count').options[document.getElementById('bandmates_count').selectedIndex].value; q++) {
						
						if (
							
							document.getElementById('maybe_bandmate_' + q + '_name_first').value == '' ||
							document.getElementById('maybe_bandmate_' + q + '_name_last').value == ''
							
						) {
							
							alert ('You must provide your bandmate\'s names so we can mail the magazine...');
							
							return false;
						}
					}
					
					for (var q=0; q<document.getElementById('bandmates_count').options[document.getElementById('bandmates_count').selectedIndex].value; q++) {
						
						if (!validate_email(document.getElementById('maybe_bandmate_' + q + '_email').value)) {
							
							alert ('You must provide a valid Email address for each of your bandmates...');
							
							return false;
						}
					}
				}
				
				if (document.getElementById('bandmate_subscriptions_yes1').checked == true) {
					
					for (var q=0; q<document.getElementById('bandmates_count').options[document.getElementById('bandmates_count').selectedIndex].value; q++) {
						
						if (
							
							document.getElementById('yes1_bandmate_' + q + '_name_first').value == '' ||
							document.getElementById('yes1_bandmate_' + q + '_name_last').value == ''
							
						) {
							
							alert ('You must provide each bandmate\'s name so we can mail the magazine...');
							
							return false;
						}
					}
					
					for (var q=0; q<document.getElementById('bandmates_count').options[document.getElementById('bandmates_count').selectedIndex].value; q++) {
						
						if (
							document.getElementById('yes1_bandmate_' + q + '_address1').value == '' ||
							document.getElementById('yes1_bandmate_' + q + '_city').value == '' 	||
							document.getElementById('yes1_bandmate_' + q + '_state').value == ''	||
							document.getElementById('yes1_bandmate_' + q + '_zip').value == ''
						) {
							
							alert ('You must provide a complete mailing address for each of your bandmates...');
							
							return false;
						}
					}
					
					for (var q=0; q<document.getElementById('bandmates_count').options[document.getElementById('bandmates_count').selectedIndex].value; q++) {
						
						if (!validate_email(document.getElementById('yes1_bandmate_' + q + '_email').value)) {
							
							alert ('You must provide a valid Email address for each of your bandmates...');
							
							return false;
						}
					}
				}
				
				if (document.getElementById('bandmate_subscriptions_yes2').checked == true) {
					
					for (var q=0; q<document.getElementById('bandmates_count').options[document.getElementById('bandmates_count').selectedIndex].value; q++) {
						
						if (
							
							document.getElementById('yes2_bandmate_' + q + '_name_first').value == '' ||
							document.getElementById('yes2_bandmate_' + q + '_name_last').value == ''
							
						) {
							
							alert ('You must provide your bandmate\'s names so we can mail the magazine...');
							
							return false;
						}
					}
					
					if (
						document.getElementById('band_address1').value 	== '' ||
						document.getElementById('band_city').value 		== '' ||
						document.getElementById('band_state').value 	== '' ||
						document.getElementById('band_zip').value 		== ''
					) {
					
						alert ('You must provide a complete band address if you wish your bandmates\' magazines sent there.');
						
						return false;
					}
					
					for (var q=0; q<document.getElementById('bandmates_count').options[document.getElementById('bandmates_count').selectedIndex].value; q++) {
						
						if (!validate_email(document.getElementById('yes2_bandmate_' + q + '_email').value)) {
							
							alert ('You must provide a valid Email address for each of your bandmates...');
							
							return false;
						}
					}
				}
				
					/* FOR TESTING ONLY */ //alert ('Band form validated.');
			}
		}
		
		if (document.getElementById('form_registration_friends')) {
			
			document.getElementById('form_registration_friends').onsubmit = function () {
				
					/* FOR TESTING ONLY */ //alert ('Validating a Friends form...');
				
				for (var i=0; i<10; i++) { // we have inputs for 10 friends on the form
					
					if (document.getElementById('friend_'+i+'_name').value != '' || document.getElementById('friend_'+i+'_email').value != '') {
						
						if (document.getElementById('friend_'+i+'_name').value == '') {
							
							alert ('You must provide a first name for each of your friends (friend #'+(i+1)+'\'s is missing)...');
							
							return false;
						
						} else if (document.getElementById('friend_'+i+'_email').value == '') {
							
							alert ('You must provide a valid Email for each of your friends (friend #'+(i+1)+'\'s is missing)...');
							
							return false;
						
						} else if (!validate_email(document.getElementById('friend_'+i+'_email').value)) {
							
							alert ('You must provide a valid Email for all friends (friend #'+(i+1)+'\'s is funky)...');
							
							return false;
						}
					}
				}
				
					/* FOR TESTING ONLY */ //alert ('Friends form validated.');
			}
		}
		
			
			
			
			/* FOR TESTING ONLY */ //alert ('...elements prepared.');
	}	
	
	
	
	
	function popup (link, name, width, height, features) {
		
			//alert ('popup');
		
		window.open(link, name, "width="+width+","+"height="+height+","+features);
	}
	
	
	
	
	function toggle (id, state) {
	
			//alert ("toggling " + id + " to " + state);
	
		document.getElementById(id).style.display = state;
	}
	
	
	
	
	function validate_email (email) {
		
			/* FOR TESTING ONLY */ //alert ('Validating email address (' + email + ')');
		
	    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;
	
	} // END VALIDATE EMAIL
	
	
	
	
//	ACTIONS		

//	Add prepare_elements to the list of functions executed after the page loads
	add_onload_event(prepare_elements);
	

	
		/* FOR TESTING ONLY */ //alert ('javascript.js has loaded.');
	
	
	
	