if (self.parent.frames.length != 0)self.parent.location="http://www.dowedo.co.uk";
var frmObjt;
var payWind;
var illegalChars= /[\<\>\'\\\|\+\=\-\@\#\~\`\{\}\,\/\[\]]/;var strIllChars = "< > { } , + = - @ # ~ | [ ] ' / ` \\"; 
var illegalChars2= /[\"]/;var strIllChars2 = '"'; 
var frmObjt;

function val(){ 
frmObjt = document.findform;
trimInputValues()
if (testInput())frmObjt.submit();

}
function testInput(){ 
if (frmObjt.inputword.value.length < 2) fail ("The word must be at least two characters long.",frmObjt.inputword);
else if (!chkCharacters(frmObjt.inputword.value)) fail ("Your word can not contain these characters. "+strIllChars+" "+strIllChars2,frmObjt.inputword);
else return true;
}

function fail(msg,fld){
alert("Please check your information:"+ dropline +dropline +msg);
fld.focus();
return false
}
if (navigator.appVersion.lastIndexOf('Win') != -1) {
      dropline = "\r\n"  } else { dropline = "\n" }

function trimInputValues(){
	for (i = 0;i<frmObjt.elements.length;i++ ){
		frmObjt.elements[i].value = trimSpaces(frmObjt.elements[i].value)
	} 

}
function trimSpaces(strInput) { 
    
    while (strInput.substring(0,1) == ' ') 
        strInput = strInput.substring(1, strInput.length);

    while (strInput.substring(strInput.length-1,strInput.length) == ' ')
        strInput = strInput.substring(0, strInput.length-1);

   return strInput;
} 
function chkCharacters(thsValue){

if (thsValue.match(illegalChars))return false;
if (thsValue.match(illegalChars2))return false;

return true; 
}

function openPop(){
if (payWind)payWind.close();
payWind = window.open("http://www.dowedo.co.uk/donationpage.php","payWind","top=10,left=10,height=450,width=600,resizable,status,toolbar,scrollbars")
}
function chkRet(evt){
evt = (evt) ? evt : event
  if (navigator.appName == "Netscape"){
   if (evt.which == 13) {
   val();
   return false;
  }
  }
  if (navigator.appName == "Microsoft Internet Explorer"){
   	if (event.keyCode == 13){
   	val();
	return false;    
	}
	}
	
}
document.onkeydown = chkRet;

