function SelTextEmail()
{
	if (document.MailingList.txtEmail.value == "Enter your e-mail")
	{
	document.MailingList.txtEmail.value = "";
	}
}

function qty_change(job){
	num=document.product.qty.value
	if(job=="+") num++
	else num--
	if(num<=0) num=1
	if(num>99) {num=99}
	document.product.qty.value=num
}

function qty_check(obj){
	if(isNaN(obj.value)) obj.value=1
	if(obj.value<1) obj.value=1
}


function OpenCertDetails()
	{
	thewindow = window.open('https://www.thawte.com/core/process?process=public-site-seal-cert-details&public-site-seal-cert-details.referer=http://www.anitec.ca', 'anew', config='height=500,width=450,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=yes');
	}
	
function ShowPic(imageUrl) { 
	var LeftPosition = (screen.width) ? (screen.width-200)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-200)/2 : 0;
	var newwin = window.open("showpic.html?"+imageUrl, "viewpic", "resizable=1,height=200,width=200,top=" + TopPosition + ",left=" + LeftPosition);
	newwin.focus();
}

function OpenWindow(file,window, w, h, scroll) {
	var LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no'
    childWindow=open(file,window,settings);
    if (childWindow.opener == null) childWindow.opener = self;
    childWindow.focus();
    }

//Netscape 4 Resize Fix
function MM_reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_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 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];}
}	


// Copyright © 2001 by Apple Computer, Inc., All Rights Reserved.
//
// You may incorporate this Apple sample code into your own code
// without restriction. This Apple sample code has been provided "AS IS"
// and the responsibility for its operation is yours. You may redistribute
// this code, but you are not permitted to redistribute it as
// "Apple sample code" after having made changes.

// email

function checkEmail (strng) {
var error="";
if (strng == "") {
   error = "You didn't enter an email address.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters.\n";
       }
    }
return error;    
}


// password - between 6-8 chars, uppercase, lowercase, and numeral

function checkPassword (strng) {
var error = "";
if (strng == "") {
   error = "You didn't enter a password.\n";
}

    var illegalChars = /[\W_]/; // allow only letters and numbers
    
    if ((strng.length < 6) || (strng.length > 8)) {
       error = "The password is the wrong length.\n";
    }
    else if (illegalChars.test(strng)) {
      error = "The password contains illegal characters.\n";
    } 
    else if (!((strng.search(/(a-z)+/)) && (strng.search(/(A-Z)+/)) && (strng.search(/(0-9)+/)))) {
       error = "The password must contain at least one uppercase letter, one lowercase letter, and one numeral.\n";
    }  
return error;    
}    


// username - 4-10 chars, uc, lc, and underscore only.

function checkUsername (fe) {
var error = "";
var inputStr = fe.value;
	if (inputStr == "") 
	{
	   error = "You didn't enter a username.\n";
	}

    var illegalChars = /\W/; // allow letters, numbers, and underscores
    if ((inputStr.length < 4) || (inputStr.length > 20)) 
    {
       error = "The username is the wrong length.\n";
    }
    else if (illegalChars.test(inputStr)) 
    {
    	error = "The username contains illegal characters.\n";
    } 

	if (error != "") 
	{
		fe.focus();
		alert(error);  
	}

}       

// username - 4-10 chars, uc, lc, and underscore only.

function checkPhone (fe) {
var error = "";
var inputStr = fe.value;
	if (inputStr == "") 
	{
	   error = "You didn't enter a username.\n";
	}

    var illegalChars = /\W/; // allow letters, numbers, and underscores
    if ((inputStr.length < 4) || (inputStr.length > 20)) 
    {
       error = "The username is the wrong length.\n";
    }
    else if (illegalChars.test(inputStr)) 
    {
    	error = "The username contains illegal characters.\n";
    } 

	if (error != "") 
	{
		fe.focus();
		alert(error);  
	}
}

function ShowSplash(msg) {
		document.getElementById("splash_msg").innerHTML = msg;
		document.getElementById("splash").style.display="block";
		document.getElementById("body").style.display="none";
		window.status= "Loading...";
		return true;
}

function HideSplash() {
		document.getElementById("splash").style.display="none";
		document.getElementById("body").style.display="block";
		return true;
}
