// JavaScript Document
<!--
var bookmarkurl="http://www.cometaviationsupplies.co.za"
var bookmarktitle="Comet Aviation Supplies"

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = './images/ad1.jpg'
Pic[1] = './images/ad2.jpg'
Pic[2] = './images/ad3.jpg'
Pic[3] = './images/ad4.jpg'
Pic[4] = './images/ad5.jpg'
Pic[5] = './images/ad6.jpg'


// =======================================
// do not edit anything below this line
// =======================================

var t;
var j = 0;
var p = Pic.length;
var tempRanNr=0;
var tempRanNr1=0;
var tempRanNr2=0;
var tempRanNr3=0;
var j=0;
var preLoad = new Array();
for (i = 0; i < p; i++){
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
j=0;

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)";
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.SlideShow.filters.blendTrans.Apply();
   }
   document.images.SlideShow.src = preLoad[j].src;
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play();
   }
   j = j + 1;
   //changed the p to a 3, as we only want 3 slides to show on each page
   if (j > (3-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

function checkAddToMaillist (theForm) {
	if (theForm.name.value=='') {
		alert('Please enter a valid name.');
		return false;
	}
	
	var str=theForm.email.value
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str)) {
	
	} else{
		alert("Please input a valid email address!")
		return false;
	}

	if (str=='') {
		alert('Please input a valid email address');
		return false;
	}

	if (theForm.userCode.value=='') {
		alert('Please enter the numbers shown for spam prevention')
		return false;
	}
	return true;
}

function isNumeric(elem, helperMsg){
	var numericExpression = /^[0-9]+$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}
function chkBlankZero(theform) {
	var thevalue = theform.qty.value;
	if (thevalue == '0') {
		alert("Please enter a correct quantity.")
		return false;
	}
	if (thevalue == '') {
		alert("Please enter a correct quantity.")
		return false;
	}
	var numericExpression = /^[0-9]+$/;
	if(thevalue.match(numericExpression)){
		return true;
	}else{
		alert("Please enter a valid quantity");
		return false;
	}
	return true;
}


function chkBlankZero2(theform) {
	var thevalue = theform.qty.value;
	if (thevalue == '0') {
		alert("Please enter a correct quantity.")
		return false;
	}
	if (thevalue == '') {
		alert("Please enter a correct quantity.")
		return false;
	}
	var numericExpression = /^[0-9]+$/;
	if(thevalue.match(numericExpression)){
		return true;
	}else{
		alert("Please enter a valid quantity");
		return false;
	}
	return true;
}

function statwords(message){
window.status = message;
}

function openAWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

ie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ));
function changeManufInp(newValue) {
  if (ie4){
  		target = document.all('searchManufInp');
		target.value = newValue;
  	} else {
		target = document.getElementById('searchManufInp');
		target.value= newValue;
	}
}
		
function toggleDiv( targetId ){
  if (ie4){
  		target = document.all( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "";
  			} else {
  				target.style.display = "none";
  			}
  	} else {
		target = document.getElementById(targetId);
  			if (target.style.display == "none"){
  				target.style.display = "";
  			} else {
  				target.style.display = "none";
  			}
	}		
}
function toggleDivOn(targetId) {
  if (ie4){
  		target = document.all( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "";
  			}
  	} else {
		target = document.getElementById(targetId);
  			if (target.style.display == "none"){
  				target.style.display = "";
  			}
	}		
}
function toggleDivOff(targetId) {
  if (ie4){
  		target = document.all( targetId );
  			if (target.style.display == ""){
  				target.style.display = "none";
  			}
  	} else {
		target = document.getElementById(targetId);
  			if (target.style.display == ""){
  				target.style.display = "none";
  			}
	}		
}

function toggleBgColor (theRow,theStdColor) {
	if (theRow.style.backgroundColor=="silver") {
		if (theStdColor==1) {
			theRow.style.backgroundColor="#D9EEFB";
		} else {
			theRow.style.backgroundColor="#FFF";
		}
	}else {
		theRow.style.backgroundColor="silver";
	}
}

function changeJoinHeight() {
  if (ie4){
  		target = document.all('join' );
		target.style.height = "220px";
  	} else {
		target = document.getElementById('join');
		target.style.display = "220px";
	}
}

function chkOtherForm(theForm) {
	if (theForm.name.value=='') {
		theForm.name.focus();
		alert('Please enter a valid name.');
		return false;
	}
	
	
	var str=theForm.email.value
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str)) {
	
	} else{
		theForm.email.focus();
		alert("Please input a valid email address!")
		return false;
	}

	if (str=='') {
		theForm.email.focus();	
		alert('Please input a valid email address');
		return false;
	}
	if (theForm.query.value=='') {
		theForm.query.focus();
		alert('Please enter your query.');
		return false;
	}

	if (theForm.userCode.value=='') {
		theForm.userCode.focus();
		alert('Please enter the numbers shown for spam prevention')
		return false;
	}
	return true;
}
//-->