function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function pviiClassNew(obj, new_style) {
    obj.className = new_style;
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}


function Close(){
 close()
}

function Print(){
  window.print()
}

       Today=new Date();
       var Monname=new
       Array("January","February","March","April","May","June", "July","August","September","October","November","December");
       var Dayname=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
       var d=Today.getDay();
       var m=Today.getMonth();
       var dd=Today.getDate();
       var yy=Today.getFullYear();
       var showday=Dayname[d]+", "+dd+" "+Monname[m]+" "+yy;


function validlogin(){

var firstname=document.userlogin.macousername
 if(firstname.value.length==""){
  alert("Please input your user name")
  firstname.focus();
  return false;
 }

var password=document.userlogin.macopassword
 if(password.value.length==""){
  alert("Please input your password")
  password.focus();
  return false;
 }

}

function validregister(){

var firstname=document.userregister.newusername
 if(firstname.value.length==""){
  alert("Please input your user name")
  firstname.focus();
  return false;
 }

var password=document.userregister.newpassword
 if(password.value.length==""){
  alert("Please input your password")
  password.focus();
  return false;
 }

var toEmail=document.userregister.email
var Found=toEmail.value.indexOf("@",0)
var Found2=toEmail.value.indexOf(".",0)
 if(toEmail.value.length=="" || Found<1 || Found2<1){
  alert("Please input your contact email address")
  toEmail.focus();
  return false;
 }

var Telephone=document.userregister.phone
 if(Telephone.value.length==""){
  alert("Please input your contact phone number")
  Telephone.focus();
  return false;
 }
 var invachars = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
 for (i=0; i<invachars.length; i++) {
   var badchar = invachars[i];
   var badchar1=Telephone.value.indexOf(badchar,0);
   if (badchar1 > -1) {
     alert("Please input your contact phone number")
     Telephone.focus();
     return false;
   }
 }

var addr=document.userregister.street
 if(addr.value.length==""){
  alert("Please input your local street name")
  addr.focus();
  return false;
 }

var city=document.userregister.city
 if(city.value.length==""){
  alert("Please input your local suburb or city name")
  city.focus();
  return false;
 }

var Pcode=document.userregister.postcode
 if(Pcode.value.length==""||isNaN(Pcode.value)){
  alert("Please input your local postcode number")
  Pcode.focus();
  return false;
 }

}



function validcheckout(){

var toEmail=document.checkout.email
var Found=toEmail.value.indexOf("@",0)
var Found2=toEmail.value.indexOf(".",0)
 if(toEmail.value.length=="" || Found<1 || Found2<1){
  alert("Please input your contact email address")
  toEmail.focus();
  return false;
 }

var Telephone=document.checkout.phone
 if(Telephone.value.length==""){
  alert("Please input your contact phone number")
  Telephone.focus();
  return false;
 }
 var invachars = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
 for (i=0; i<invachars.length; i++) {
   var badchar = invachars[i];
   var badchar1=Telephone.value.indexOf(badchar,0);
   if (badchar1 > -1) {
     alert("Please input your contact phone number")
     Telephone.focus();
     return false;
   }
 }

var firstname=document.checkout.receiver
 if(firstname.value.length==""){
  alert("Please input the receiver name")
  firstname.focus();
  return false;
 }

var addr=document.checkout.street
 if(addr.value.length==""){
  alert("Please input the street name")
  addr.focus();
  return false;
 }

var city=document.checkout.city
 if(city.value.length==""){
  alert("Please input the suburb or city name")
  city.focus();
  return false;
 }

var Pcode=document.checkout.postcode
 if(Pcode.value.length==""||isNaN(Pcode.value)){
  alert("Please input the postcode number")
  Pcode.focus();
  return false;
 }

var paymethod=document.checkout.paymethod
 genderOption=-1
 for(i=0; i<paymethod.length; i++)
 if (paymethod[i].checked){
  genderOption=i
 }
 if(genderOption==-1){
  alert("Please select a payment method");
  return false;
 }

var delivery=document.checkout.delivery
 genderOption=-1
 for(i=0; i<delivery.length; i++)
 if (delivery[i].checked){
  genderOption=i
 }
 if(genderOption==-1){
  alert("Please select a delivery method");
  return false;
 }
}


function validra(){

var firstname=document.ra.name
 if(firstname.value.length==""){
  alert("Please input your name")
  firstname.focus();
  return false;
 }

var toEmail=document.ra.email
var Found=toEmail.value.indexOf("@",0)
var Found2=toEmail.value.indexOf(".",0)
 if(toEmail.value.length=="" || Found<1 || Found2<1){
  alert("Please input your contact email address")
  toEmail.focus();
  return false;
 }

var Telephone=document.ra.phone
 if(Telephone.value.length==""){
  alert("Please input your contact phone number")
  Telephone.focus();
  return false;
 }
 var invachars = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
 for (i=0; i<invachars.length; i++) {
   var badchar = invachars[i];
   var badchar1=Telephone.value.indexOf(badchar,0);
   if (badchar1 > -1) {
     alert("Please input your contact phone number")
     Telephone.focus();
     return false;
   }
 }

var addr=document.ra.street
 if(addr.value.length==""){
  alert("Please input the street name")
  addr.focus();
  return false;
 }

var city=document.ra.city
 if(city.value.length==""){
  alert("Please input the suburb or city name")
  city.focus();
  return false;
 }

var Pcode=document.ra.postcode
 if(Pcode.value.length==""||isNaN(Pcode.value)){
  alert("Please input the postcode number")
  Pcode.focus();
  return false;
 }

var invoiceno=document.ra.invoiceno
 if(invoiceno.value.length==""){
  alert("Please input the invoice number")
  invoiceno.focus();
  return false;
 }
var modelno=document.ra.modelno
 if(modelno.value.length==""){
  alert("Please input the product model or name")
  modelno.focus();
  return false;
 }
var serialno=document.ra.serialno
 if(serialno.value.length==""){
  alert("Please input the product serial number")
  serialno.focus();
  return false;
 }
var manufacturer=document.ra.manufacturer
 if(manufacturer.value.length==""){
  alert("Please input the product manufacturer name")
  manufacturer.focus();
  return false;
 }
var comments=document.ra.comments
 if(comments.value.length==""){
  alert("Please input as much information about the fault as possible")
  comments.focus();
  return false;
 }
}


function webprice(){
var webprice=window.open('webprice.asp', 'webwindow', 'width="700", height="400", scrollbars=yes, menubar=no, toolbar=yes, resizable=yes, status=no');
webprice.focus();
}

function webquote(){
var webquote=window.open('webquote.asp', 'webwindow', 'width="700", height="500", scrollbars=yes, menubar=no, toolbar=yes, resizable=yes, status=no');
webquote.focus();
}

function webportf(){
var webportf=window.open('webportfolio.asp', 'webwindow', 'width="700", height="500", scrollbars=yes, menubar=no, toolbar=yes, resizable=yes, status=no');
webportf.focus();
}


function validrtpwd(){

var firstname=document.rtpwd.username
 if(firstname.value.length==""){
  alert("Please input your user name")
  firstname.focus();
  return false;
 }

var toEmail=document.rtpwd.rtemail
var Found=toEmail.value.indexOf("@",0)
var Found2=toEmail.value.indexOf(".",0)
 if(toEmail.value.length=="" || Found<1 || Found2<1){
  alert("Please input your email address")
  toEmail.focus();
  return false;
 }

}


function ppage(purl){
var conwin=window.open(purl, 'popupwindow', 'width=700, height=503, scrollbars=yes, menubar=no, toolbar=yes, resizable=yes, status=no');
conwin.focus();
}





