function MusicNetEasyAjax(url,displayid,requestMethod,form,fieldList,statusText,action){
	
	xmlHttp=GetXmlHttpObject();

	if((!statusText) || (statusText=='')) statusText=loadstatustext;
	if(!action) action = void(0);
	
	if (xmlHttp==null) {
		  alert ("Your browser does not support AJAX!");
		  return;
	} 
		
	
	if (url.indexOf("?")=='-1')
		url=url+"?sid="+Math.random();
	else
		url=url+"&sid="+Math.random();
	
	if (requestMethod!='POST')
	{
		if(displayid !='')
			document.getElementById(displayid).innerHTML=statusText;
	}
		
	xmlHttp.onreadystatechange=stateChanged;
	
	if (!requestMethod) 
		requestMethod='GET';
		
	
	if (requestMethod=='POST')
	{
		xmlHttp.open("POST", url, true);		
		var params ="";
		var frm= document.forms[form];
		
		if (fieldList)
		{			
			valueArray = fieldList.split(",");		
			
			for(var i=0; i<valueArray.length; i++){
				var fldtemp=valueArray[i];
				currentfield=frm[fldtemp];				
				if (currentfield) 
				{	
					if (params=='')					
				 		params=valueArray[i]+"="+currentfield.value;
					else
						params=params+"&"+valueArray[i]+"="+currentfield.value;
				}							
			}	
		}	
		
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
	}
	else
	{
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	
	
	function stateChanged() {
		
		if (xmlHttp.readyState==4) {
			if(displayid !='')
				setAndExecute(displayid, xmlHttp.responseText);
		}
	}

	params=encodeURI(params);
	
	if (requestMethod=='POST')
	{
		xmlHttp.send(params);
		if(displayid !='')
			document.getElementById(displayid).innerHTML=loadstatustext;
	}
}

function UpdateVal(id,val){
	document.getElementById(id).value=val;
}

function show1(id, id2) {
	obj = document.getElementById(id);
	obj.style.display = "block";
	obj2 = document.getElementById(id2);
	obj2.style.display = "block";
}

function hide1(id, id2) {
	obj = document.getElementById(id);
	obj.style.display = "none";
	obj2 = document.getElementById(id2);
	obj2.style.display = "none";
}

function resetTabs (selectedid, id1, id2, id3) {
	
	if (document.getElementById(selectedid).className == 'titleTabEnd' || document.getElementById(selectedid).className == 'titleTabSelectedEnd')
		document.getElementById(selectedid).className = 'titleTabSelectedEnd';
	else
		document.getElementById(selectedid).className = 'titleTabSelected';
	
	
	
	for (i=1; i<4; i++){
		if (document.getElementById(eval("id"+i)).className == 'titleTabSelectedEnd' || document.getElementById(eval("id"+i)).className == 'titleTabEnd')
			document.getElementById(eval("id"+i)).className = 'titleTabEnd';
		else 
			document.getElementById(eval("id"+i)).className = 'titleTab';
		
	}
}

function resetMatchTitles (selectedid, id1, id2, id3, id4) {
	
	
	document.getElementById(selectedid).className = 'selected';
	
	for (i=1; i<=4; i++)
	{
		document.getElementById(eval("id"+i)).className = 'default';
	}
}

function restoreClass(selectedid,  id1, id2, id3, id4) {
	var tmp = 0;
	
	for (i=1; i<=4; i++)
	{
		if (document.getElementById(eval("id"+i)).className == 'selected')
			tmp = 1;
	}
	
	if (tmp == 1)
		document.getElementById(selectedid).className = 'default';
	else
		document.getElementById(selectedid).className = 'selected';
}

/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

/*------------------------------------------------------------
	Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
	Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
	Web Site: http://txkang.com
	Script featured on Dynamic Drive (http://www.dynamicdrive.com)
	
	Please retain this copyright notice in the script.
	License is granted to user to reuse this code on 
	their own website if, and only if, 
	this entire copyright notice is included.
--------------------------------------------------------------*/

//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div','td','tr');

//Specify spectrum of different font sizes:
var szs = new Array( '10px','11px','12px','13px','14px','15px','16px' );
var startSz = 1;

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	
	sz += inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > 6 ) sz = 6;
	startSz = sz;
		
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
}

function sendMailPopup(URL, width, height) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=0,width='+width+',height='+height+',left = 640,top = 375');");
}

function articleComments (id) {
	TopDistance = (screen.height/2)-300;
	LeftDistance = (screen.width/2)-200;
	wn=window.open('/easyconsole.cfm/page/article_comments/article_id/'+id,'ArticleComments','scrollbars=1, width=570,height=450,left='+LeftDistance+',top='+TopDistance);
}

// ----------------------------------------------------------------------
// Javascript form validation routines.
// Author: Stephen Poley
//
// Simple routines to quickly pick up obvious typos.
// All validation routines return true if executed by an older browser:
// in this case validation must be left to the server.
//
// Update Jun 2005: discovered that reason IE wasn't setting focus was
// due to an IE timing bug. Added 0.1 sec delay to fix.
//
// Update Oct 2005: minor tidy-up: unused parameter removed
//
// Update Jun 2006: minor improvements to variable names and layout
// ----------------------------------------------------------------------

var nbsp = 160;		// non-breaking space char
var node_text = 3;	// DOM text node-type
var emptyString = /^\s*$/ ;
var global_valfield;	// retain valfield for timer thread

// --------------------------------------------
//                  trim
// Trim leading/trailing whitespace off string
// --------------------------------------------

function trim(str)
{
  return str.replace(/^\s+|\s+$/g, '');
}


// --------------------------------------------
//                  setfocus
// Delayed focus setting to get around IE bug
// --------------------------------------------

function setFocusDelayed()
{
  global_valfield.focus();
}

function setfocus(valfield)
{
  // save valfield in global variable so value retained when routine exits
  global_valfield = valfield;
  setTimeout( 'setFocusDelayed()', 100 );
}


// --------------------------------------------
//                  msg
// Display warn/error message in HTML element.
// commonCheck routine must have previously been called
// --------------------------------------------

function msg(fld,     // id of element to display message in
             msgtype, // class to give element ("warn" or "error")
             message) // string to display
{
  // setting an empty string can give problems if later set to a 
  // non-empty string, so ensure a space present. (For Mozilla and Opera one could 
  // simply use a space, but IE demands something more, like a non-breaking space.)
  var dispmessage;
  if (emptyString.test(message)) 
    dispmessage = String.fromCharCode(nbsp);    
  else  
    dispmessage = message;

  var elem = document.getElementById(fld);
  elem.firstChild.nodeValue = dispmessage;  
  
  elem.className = msgtype;   // set the CSS class to adjust appearance of message
}

// --------------------------------------------
//            commonCheck
// Common code for all validation routines to:
// (a) check for older / less-equipped browsers
// (b) check if empty fields are required
// Returns true (validation passed), 
//         false (validation failed) or 
//         proceed (don't know yet)
// --------------------------------------------

var proceed = 2;  

function commonCheck    (valfield,   // element to be validated
                         infofield,  // id of element to receive info/error msg
                         required)   // true if required
{
  if (!document.getElementById) 
    return true;  // not available on this browser - leave validation to the server
  var elem = document.getElementById(infofield);
  if (!elem.firstChild) return true;  // not available on this browser 
  if (elem.firstChild.nodeType != node_text) return true;  // infofield is wrong type of node  

  if (emptyString.test(valfield.value)) {
    if (required) {
      msg (infofield, "error", "ERROR: required");  
      setfocus(valfield);
      return false;
    }
    else {
      msg (infofield, "warn", "");   // OK
      return true;  
    }
  }
  return proceed;
}

// --------------------------------------------
//            validatePresent
// Validate if something has been entered
// Returns true if so 
// --------------------------------------------

function validatePresent(valfield,   // element to be validated
                         infofield ) // id of element to receive info/error msg
{
  var stat = commonCheck (valfield, infofield, true);
  if (stat != proceed) return stat;

  msg (infofield, "warn", "");  
  return true;
}

// --------------------------------------------
//               validateEmail
// Validate if e-mail address
// Returns true if so (and also if could not be executed because of old browser)
// --------------------------------------------

function validateEmail  (valfield,   // element to be validated
                         infofield,  // id of element to receive info/error msg
                         required)   // true if required
{
  var stat = commonCheck (valfield, infofield, required);
  if (stat != proceed) return stat;

  var tfld = trim(valfield.value);  // value of field with whitespace trimmed off
  var email = /^[^@]+@[^@.]+\.[^@]*\w\w$/  ;
  if (!email.test(tfld)) {
    msg (infofield, "error", "ERROR: not a valid e-mail address");
    setfocus(valfield);
    return false;
  }

  var email2 = /^[A-Za-z][\w.-]+@\w[\w.-]+\.[\w.-]*[A-Za-z][A-Za-z]$/  ;
  if (!email2.test(tfld)) 
    msg (infofield, "warn", "Unusual e-mail address - check if correct");
  else
    msg (infofield, "warn", "");
  return true;
}

function validateMessage ()
{
	var error = 0;
	
	
	if (document.forms['messageForm'].user_comment.value == '') {
		alert('Message is required!');
		error = 1;
	}

	if (document.forms['messageForm'].user_fullname.value.length > 30) {
		alert('Please enter a shorter name');
		error = 1;
	}
	
	if (error == 0) {
		document.forms['messageForm'].submit();
	}
}