function fnProductValidate(f){
	strOptionsValue = '';
	for (var i=0; i<=3; i++){
		oSelect = f.elements['pp_os'+i];
		if (oSelect && oSelect.selectedIndex == 0) {
			strSelectName = f.elements['pp_on'+i].value;
			alert('Please select a '+strSelectName+' to continue.');
			oSelect.focus();
			return false;
		} else if (oSelect){
			strOptionsValue += f.elements['pp_on'+i].value + ': ' + oSelect.options[oSelect.selectedIndex].value + '; ';
		}
	}
	f.elements['os0'].value = strOptionsValue;
	oSelect = f.elements['quantity'];
	if (oSelect && oSelect.selectedIndex == 0) {
		alert('Please select a quantity to continue.');
		oSelect.focus();
		return false;
	}
	return true;
}

function fnProductValidateMals(f){
	strOptionsValue = '';
	for (var i=0; i<=3; i++){
		oSelect = f.elements['pp_os'+i];
		if (oSelect && oSelect.selectedIndex == 0) {
			strSelectName = f.elements['pp_on'+i].value;
			alert('Please select a '+strSelectName+' to continue.');
			oSelect.focus();
			return false;
		} else if (oSelect){
			strOptionsValue += f.elements['pp_on'+i].value + ': ' + oSelect.options[oSelect.selectedIndex].value + '; ';
		}
	}
	oSelect = f.elements['qty'];
	if (oSelect && oSelect.selectedIndex == 0) {
		alert('Please select a quantity to continue.');
		oSelect.focus();
		return false;
	}
	
	f.elements['product'].value += ' - '+strOptionsValue;
	return true;
}



/* drop down nav */

function dropdown(obj,stat) {
	idx=fDOM(obj);
	idx.style.visibility=(stat) ? "visible" : "hidden";
}
function fDOM(obj) {
	if (document.getElementById) return (document.getElementById(obj));
	else return (0);
}

$(document).ready(function(){
	$('#slide-container').cycle({
		height:  '130px',	// container height 
	    fade:     1,		// true for fade, false for slide 
	    speed:    'slow',	// any valid fx speed value 
	    timeout:  4000,		// ms duration for each slide 
	    random:   1,       // true for random, false for sequence 
	    fit:      0,       // force slides to fit container 
	    pause:    1,       // true to enable "pause on hover" 
	    autostop: 0        // true to end slideshow after X slides have been shown (where X == slide count) (note that if random == true not all slides are guaranteed to have been shown) 
	});
	
	$("#mals-cart INPUT[value='RECALCULATE']").before('<a href="#" id="update-quantity">Click Here to Update Quantity</a><br/><br/>');
	$("#mals-cart #update-quantity").click(function(){
		$("#mals-cart INPUT[value='RECALCULATE']").click();
	});
});
