var Win
function textFilter(form) {
    var re_filt = /[^!-~£\s]/g;
   // for(var i = 0; i < form.elements.length; i++) {
    //    form.elements[i].value = form.elements[i].value.replace(re_filt, "");
  //  }
}

function checkURL(aleert) {
 testurl = document.StoryForm.URLe.value;
 if (testurl != "") {
   if ((testurl.indexOf("http://") == -1)&&(testurl.charAt(0)!='/')) {
     testurl = "http://" + testurl;
   }
   document.StoryForm.URLe.value = testurl;
   ccheckURL = true;
 }else{
   ccheckURL = false ;
   if ( aleert ) {
      alert("The URL field is blank - please enter a valid URL");
   }
 }
 return ccheckURL
}

function newURL(){
 if (checkURL(true)) {

 Win = window.open('','newWin',
   'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,locationbar=yes,statusbar=no,width=400,height=300');
 Win.location.href = document.StoryForm.URLe.value;
  if (window.focus) {
    Win.focus();
  }
 }
}

function CheckForm(form){
    textFilter(form)
    checkURL(false);
    return true
 }

function HelpWindow(helpPage, SITESHOME) {

  if (helpPage == helpPage.replace(/.\D/,'')) {
     helpPage = "http://" + SITESHOME + "/" + helpPage; //  28sep01 01oct01
  }else{
     helpPage = "http://" + SITESHOME + "/" + helpPage;
  }


  var small_window = window.open('', 'small_window', 'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,status=no,dependent=no,width=620,height=330');

  small_window.location = helpPage;

  if (window.focus) {
  small_window.focus();
  }
}

function openItNow(url){
	editWin = window.open("","editWin","resizable=yes,location=no,height=480,width=640,scrollbars=yes");
	editWin.location = url
	if(editWin.focus){editWin.focus()}
}

