function checkQty(quan) {
	var workQty;
	workQty = quan.value;
	if (workQty.length < 1) {
		alert('Please enter the Quantity you wish to purchase');
     		return false;
	}
	for(var j = 0; j < workQty.length; j++) {
		if  ((workQty.substr(j, 1) == '0') || (workQty.substr(j, 1) == '1') ||
			(workQty.substr(j, 1) == '2') || (workQty.substr(j, 1) == '3') ||
			(workQty.substr(j, 1) == '4') || (workQty.substr(j, 1) == '5') ||
			(workQty.substr(j, 1) == '6') || (workQty.substr(j, 1) == '7') ||
			(workQty.substr(j, 1) == '8') || (workQty.substr(j, 1) == '9')) { 
		} else {
     		alert('Please enter a numeric value for the Quantity you wish to purchase');
          	return false;
    		}
	}
//	form.submit();
	return true;
}
//
// All slideshow Logic
//

var currentDiv;

// Set initial (load) value 
var slideShowSpeed = 500;

// Switch to tell whether or not all images have been loaded
var isLoaded = false;

// Duration of crossfade (seconds)
var crossFadeDuration = 3;

// Specify the default image file
var dfltImage = new Image();
dfltImage.src = 'images/formenwomenc.jpg';

// Specify the image files
var Pic = new Array(); 
Pic[0] = 'images/formenwomena.jpg';
Pic[1] = 'images/formenwomenb.jpg';
Pic[2] = 'images/formenwomenc.jpg';

var t;
var i = 0;
var j = 0;
var k = 1;
var p = Pic.length;
var q = 100 / p;
var r = 0;

// Start PreLoad
var preLoad = new Array();
preLoad[i] = new Image();
preLoad[i].src = Pic[i];

// Save Page Id
var thisPageId
function runSlideShow(pageId){
   thisPageId = pageId;
   if (thisPageId == 'cyberhairpage1') {
	currentDiv = "divMen";
   	loadSlides();		
   }	
   if (thisPageId == 'cyberhairpage2') {
	currentDiv = "divSoulEssence";
   	loadSlides();		
   }	
}
function loadSlides(){
   if (isLoaded) {			
	self.status='Cyberhair slideshow';
	switchImage();
   	j = j + 1;
   	if (j > (p-1)) 
		j=0;
   } else if (preLoad[i].complete) {
	if (i < p){ 
		r = r + q;
		self.status='Image load : '  + preLoad[i].src + ', ' + Math.round(r) + '% completed' ;
		j=i;
		i=i + 1;
		preLoad[i] = new Image();
		preLoad[i].src = Pic[i];
	} 
	if (i == p) {
		self.status='Begin slideshow';
		isLoaded = true;
		j=0;
		slideShowSpeed = 2500;
	}	
  } else if (i > 3) {
	k = k + 1;
	if (k > 5) {
		k = 1;
		j = j + 1;
   		if (j > (i-2)) 
			j=0;
		switchImage();
	}
   }	
   t = setTimeout('loadSlides()', slideShowSpeed);
}
function switchImage(){
	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();
   	}
}
function expandCategory(aTag) {
	if (aTag != currentDiv){
		if ((typeof currentDiv) != 'undefined') {
			document.all(currentDiv).style.visibility='hidden';
		}
		document.all(aTag).style.visibility='visible';
		currentDiv = aTag;
	}
}
