// JavaScript Document

//pop up wind0w
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no, menubar=yes, scrollbars, resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+'');
}//end pop ip window

//check email feild
var testresults 

function checkemail(){ 
var str=document.validation.emailcheck.value 
var filter=/^.+@.+\..{2,3}$/ 

if (filter.test(str)) 
testresults=true 
else { 
alert("Please enter a valid email address!") 
testresults=false 
} 
return (testresults) 
} //end check email filed

function checkbae(){ 
if (document.layers||document.all) 
return checkemail() 
else 
return true 
} 

//move coursor to next tab

function autotab(original,destination){
    // every time a key is released, it checks to see if that text box has the maximum chars
    if 
(original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
        destination.focus()
    }
//end moive coursor

//chars counter in text area
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
	{
	field.value = field.value.substring(0, maxlimit);
	}
else 
	{
	countfield.value = maxlimit - field.value.length;
	}
}
//end chars counter in text area