// Set bSupportsDHTML to true for Internet Explorer 4 or later
var bDoesDHTML = ( (navigator.userAgent.indexOf("MSIE") >= 0) &&
                   (navigator.appVersion.substring(0,1) >= 4) )

// Only hide menu items if browser supports DHTML
if(bDoesDHTML){document.write("<STYLE>.off{display:none}</STYLE>")}

function doSection(secNum,targetbg,target,targetimg){
  if (bDoesDHTML){
    //display the section if hidden; hide it if it is displayed
    if (secNum.className=="off"){
    	secNum.className="on";
    	if(target!=0){
    		targetbg.style.backgroundColor='#003366';
    		target.style.color='#ffffff';
    		targetimg.src='/images/arror_off.gif';
    	}
    } 
    else{
    	secNum.className="off";
    	if(target!=0){
    		if(target.className=='menu'){
    			targetbg.style.backgroundColor='#99cc33';
    			target.style.color='#000000';
    		}else {targetimg.src='/images/arror_up.gif';}
    	}
    }
  }
}
function killFrames() {
	if (top.frames.length != 0){
		top.location=document.location;
	}
}
function doMouseOver(target_id,img_id){
	if (target_id.style.color!='#ffffff' || target_id.className=='title'){
		if (target_id.className=="menu"){target_id.style.color='ffff00';}
		else {target_id.style.color='#ff9900';}
		if (target_id.className!='title'){img_id.src='/images/arror_down.gif';}
	};
	if (img_id==0) {
		target_id.style.color='#ff9900';
	};
}
function doMouseOut(target_id,img_id){
	if (target_id.style.color!='#ffffff'){
		if (target_id.className=="menu"){target_id.style.color='#000000';}
		else {target_id.style.color='#ffffff';}
		if (target_id.className!='title'){img_id.src='/images/arror.gif';}
	};
	if (img_id==0) {
		target_id.style.color='#0000ff';
	};
}
function OpenMenu(target_1,target_2,target1bg,target1img,target){
	target_1.className='on';
	target1bg.style.backgroundColor='#003366';
    	target.style.color='#ffffff';
    	target1img.src='/images/arror_off.gif';
	if (target_2!=0){target_2.className='on';}
}
function checkError(quantity){
	if (quantity.value>0){
		return 0;
	}
	else if(quantity.value==""){
		return 0;
	}
	else if (quantity.value==0){
		return 0;
	}
	else {
		window.alert('Caution!'+quantity.value+' is NOT a POSITIVE number!!');
		quantity.value="";
		quantity.focus();
	}
}
function doSum(sec) {
	var sum=0,temp=0;
	if(sec.value!=""){
		for(i=0;i < (optionform.length-4);i++){
			temp = parseFloat(optionform.elements[i].value);
			if(temp < 0) {
				alert('Must be a POSITIVE number !');
				optionform.elements[i].value=0;
				optionform.elements[i].focus();
			} else {sum += temp; }
		};
		optionform.totalqty.value = sum;
		optionform.totalqty1.value = sum;
	}
	else {
		sec.value='0';
	};
}
function doClear(sec) {
	if(sec.value=='0') {sec.value="";};
}

