<!--

var bookmarkurl="http://ozpeopletrace.com.au"
var bookmarktitle="Ozpeopletrace"

function addbookmark()
{
  if (document.all) {window.external.AddFavorite(bookmarkurl,bookmarktitle);}
}

function pollwin1(name)
{
  pollwindow1=window.open(name,"pollwindow1","status=no,resize=no,toolbar=no,scrollbars=yes,width=430,height=400,maximize=null");
}

function MM_swapImgRestore() 
{ //v3.0
  var i,x,a=document.MM_sr; 
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) {x.src=x.oSrc;}
}

function MM_preloadImages() 
{ //v3.0
  var d=document; 
  if(d.images)
  { 
    if(!d.MM_p) {d.MM_p=new Array();}
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
    for(i=0; i<a.length; i++)
    {
      if (a[i].indexOf("#")!=0) {d.MM_p[j]=new Image;}
      d.MM_p[j++].src=a[i];
    }
  }
}

function MM_swapImage() 
{ //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; 
  document.MM_sr=new Array; 
  for(i=0;i<(a.length-2);i+=3)
  {
    if ((x=MM_findObj(a[i]))!=null)
    {
      document.MM_sr[j++]=x; 
      if(!x.oSrc) {x.oSrc=x.src;}
      x.src=a[i+2];
    }
  }
}

function MM_findObj(n, d) 
{ //v4.01
  var p,i,x;  
  if(!d) {d=document;}
  if((p=n.indexOf("?"))>0&&parent.frames.length) 
  {
    d=parent.frames[n.substring(p+1)].document; 
    n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) {x=d.all[n];}
  for (i=0;!x&&i<d.forms.length;i++) {x=d.forms[i][n];}
  for (i=0;!x&&d.layers&&i<d.layers.length;i++) {x=MM_findObj(n,d.layers[i].document);}
  if(!x && d.getElementById) {x=d.getElementById(n);}
  return x;
}

function validate()
{	
  if (document.forms(0).fname.value =='')
  {
    alert("Please Enter your first name"); 			   
    document.forms(0).fname.focus();
    return false;
  }
  if (document.forms(0).lname.value =='')
  {
    alert("Please Enter your last name"); 			   
    document.forms(0).lname.focus();
    return false;
  }
  if (document.forms(0).email.value =='')
  {
    alert("Please Enter your email address"); 			   
    document.forms(0).email.focus();
    return false;
  }
  if (document.forms(0).email.value !='')
  {
    if (document.forms(0).email.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
    {
      alert("Please Enter valid email address"); 			   
      document.forms(0).email.focus();
      return false;			
    }
  }	
  if (document.forms(0).address.value =='')
  {
    alert("Please Enter your postal address"); 			   
    document.forms(0).address.focus();
    return false;		
  }	
  if (document.forms(0).phone.value =='')
  {
    alert("Please Enter your phone number"); 			   
    document.forms(0).phone.focus();
    return false;		
  }			
  if (document.forms(0).m_fname.value =='')
  {
    alert("Please Enter the Missing Person's First name"); 			   
    document.forms(0).m_fname.focus();
    return false;		
  }				
  if (document.forms(0).age.value =='')
  {
    alert("Please Enter the Missing Person's  age or date of birth"); 			   
    document.forms(0).age.focus();
    return false;		
  }					
  if (document.forms(0).maddress.value =='')
  {
    alert("Please Enter the Missing Person's last known address in Australia"); 			   
    document.forms(0).maddress.focus();
    return false;		
  }						
  return true;
}

function emailvalidate() {

  if (document.tellafriend.friendmail1.value.length==0) 
  {
    alert("please enter your friend's email address");
    document.forms(0).friendmail1.focus();
    return false;
  }

  if (document.tellafriend.email.value.length==0) 
  {
    alert("please enter your email address");
    document.forms(0).email.focus();
    return false;
  }

  if (document.tellafriend.name.value.length==0) 
  {
    alert("please enter your name");
    document.forms(0).name.focus();
    return false;
  }

  document.tellafriend.submit()
  return true;
}

function checkradios() 
{
  var el = document.forms[0].elements;
  for(var i = 0 ; i < el.length ; ++i) 
  {
    if(el[i].type == "radio") 
    {
      var radiogroup = el[el[i].name]; // get the whole set of radio buttons.
      var itemchecked = false;
      for(var j = 0 ; j < radiogroup.length ; ++j) 
      {
        if(radiogroup[j].checked) 
        {
	  itemchecked = true;
	  break;
	}
      }
      if(!itemchecked) 
      {
        alert("Please select the Credit Card type...");
        //alert("Please choose an answer for "+el[i].name+".");
        if(el[i].focus) el[i].focus();
        return false;
      }
    }
  }
  //return true;

  //else if (document.ccpayform.ccard.value == '') { alert('You need to enter the Credit Card Type...'); document.ccpayform.ccard.focus(); return false; }
  if (document.ccpayform.ccnumber.value == '') 
  { 
    alert('You need to enter the Credit Card Number...'); 
    document.ccpayform.ccnumber.focus(); 
    return false; 
  }
  else if (document.ccpayform.ccxdate.value == '') 
  {
    alert('You need to enter the Credit Card Expiry Date...'); 
    document.ccpayform.ccxdate.focus(); 
    return false; 
  }
  else if (document.ccpayform.cvc.value == '') 
  {
    alert('You need to enter the Card Verification Code...'); 
    document.ccpayform.cvc.focus(); 
    return false; 
  }
  else if (document.ccpayform.amount.value == '')
  {
    alert('You need to enter the Amount you are paying (in Australian Dollars)...'); 
    document.ccpayform.amount.focus(); 
    return false; 
  }
  else if (document.ccpayform.email.value == '') 
  {
    alert('You need to enter your Email Address...'); 
    document.ccpayform.email.focus(); 
    return false; 
  }
  else 
  {
    return true;
  }
}

function ccvalidate() 
{
  if (!document.ccpayform.tac.checked) 
  {
    alert('You need to read Ozpeopletrace\'s Terms & Conditions\nand agree to these terms before making a payment...'); 
    document.ccpayform.tac.focus(); 
    return false; 
  }
  else if (document.ccpayform.name.value == '') 
  {
    alert('You need to enter the Name on the Credit Card...'); 
    document.ccpayform.name.focus(); 
    return false; 
  }
  else if (document.ccpayform.address1.value == '') 
  {
    alert('You need to enter the Billing Street Address (as it appears on Statement)...'); 
    document.ccpayform.address1.focus(); 
    return false; 
  }
  else if (document.ccpayform.city.value == '') 
  {
    alert('You need to enter the City / Town...'); 
    document.ccpayform.city.focus(); 
    return false; 
  }
  else if (document.ccpayform.state.value == '') 
  {
    alert('You need to enter the State / Territory / Province...'); 
    document.ccpayform.state.focus(); 
    return false; 
  }
  else if (document.ccpayform.pcode.value == '') 
  {
    alert('You need to enter the Post / Zip Code...'); 
    document.ccpayform.pcode.focus(); 
    return false; 
  }
  else if (document.ccpayform.country.selectedIndex == '0' || document.ccpayform.country.selectedIndex == '2') 
  {
    alert('You need to select the Country...'); 
    document.ccpayform.country.focus(); 
    return false; 
  }
  else if (document.ccpayform.phone.value == '') 
  {
    alert('You need to enter the Phone Number...'); 
    document.ccpayform.phone.focus(); 
    return false; 
  }
  else 
  {
    var result = false;
    var emailvalue = document.ccpayform.email.value;
    var theStr = new String(emailvalue);
    var index = theStr.indexOf("@");
    if (index > 0) 
    {
      var pindex = theStr.indexOf(".",index);
      if ((pindex > index+1) && (theStr.length > pindex+1))
      result = true;
    }
    if (result == false) 
    {
      alert('Please enter a valid Email Address...'); 
      document.ccpayform.email.focus(); 
    }
    else if (result == true) 
    {
      return checkradios(); 
    }
    return result;
  }
}

//-->
