
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 3;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function GP_popupConfirmMsg(msg) { //v1.0
  document.MM_returnValue = confirm(msg);
}

/***********************************************
* Textarea Maxlength script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}


function valNewTest()
{
  var title	= 	trim(document.forms[0].TestTitle.value);
  var tmoni	=	trim(document.forms[0].Testimonial.value);
  
  if ( (title == '') || 
        (tmoni == '') )
  {
    alert("Please complete Both fields");
	return false;
  }

  // return false
 return true;
}


function valEditCopy()
{
  var copy	= 	trim(document.forms[0].BCCopy.value);
  
  if (copy == '')
  {
    alert("The Home Page copy cannot be blank!");
	return false;
  }

  // return false
 return true;
}

///////////////////////////////////
// Trim functions
///////////////////////////////////
function ltrim (s)
{
  return s.replace( /^\s*/, "" );
}

function rtrim (s)
{
  return s.replace( /\s*$/, "" );
}

function trim (s)
{
  return rtrim( ltrim(s) );
}

///////////////////////////////////
// Numerical value function
///////////////////////////////////
function isNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

   for (i = 0; i < sText.length && IsNumber == true; i++) 
   { 
     Char = sText.charAt(i); 
     if (ValidChars.indexOf(Char) == -1) 
     {
       IsNumber = false;
     }
   }
   
   return IsNumber;
}
