<!-- // Begin

// This function returns a reference to a form element
// Since we're using skinning software we aren't able to reference form elements
// using the simple javascript method. We have to search for them using this function.
function findByServerSideId(elementName) {

  // assumes we want the first form on the page.
  var form = document.forms[0]

  for (var i = 0; i < form.elements.length; i++) { 
    if (form.elements[i].name.search(elementName) >= 0) { 
      return form.elements[i];
    }
  }
}

function openWindow(theURL,winName,features) {
  var windowHandle = window.open(theURL,winName,features);
  windowHandle.focus();
}


// This function automatically tabs to the next form entry element if the maxlength of the
// current element has been reached. 
function tabToNext(thisControl, nextControlName) {
	var val = thisControl.value; 
	
	if ((val.length) == thisControl.maxLength) {
	  var nextControl = findByServerSideId(nextControlName);
	  nextControl.focus(); 
  }
} 

// This function hides the submit button and displays
// some "Processing..." text contained in a <div>. It uses the global "controlToHide" var, seen below.
function showProcessingText() {
  controlToHide.style.display='none';
  document.getElementById('processingText').style.display='block';
}
// This "controlToHide" var is a hack resorted to after 4 hours of trying to get this showProcessingText
// method working in Netscape. NN doesn't submit the form if we hide the button too soon, so have
// to use setTimeout before calling this method, which means we can't pass parameters, so have to set
// controlToHide value from server side code because it's of the form "ctl10_blah_btnSubmit" and we only
// have real access to the value on server-side.
var controlToHide;

// NOT USED - This function creates the "validate feed" pop-up
function doValidate()
{
feedUrl = document.Form1.txtFeedUrl.value;
validateUrl = "http://www.feedvalidator.org/check.cgi?url="+feedUrl;
popwin = openWindow(validateUrl, 'validateWindow', 'menubar=no, resizable=yes, scrollbars=yes, toolbar=no,width=650,height=550,top=25,left=10');
return false;
}

//  End -->