// Show/Hide Machines
function ShowMachines(cat) {
    
    var cat;
    
    if (cat == "new") {
        document.getElementById("machines_new").style.display = "block";
        document.getElementById("machines_used").style.display = "none";
        document.getElementById("li_new").className = "on";
        document.getElementById("li_used").className = "off";
    }
    else if (cat == "used") {
        document.getElementById("machines_new").style.display = "none";
        document.getElementById("machines_used").style.display = "block";
        document.getElementById("li_new").className = "off";
        document.getElementById("li_used").className = "on";
    }
    
}

// Opacity Onmouseover Images
function AlphaImage(who,state) {
	if(state=="on"){
		who.style.filter = 'alpha(opacity=50)';	
		who.style.opacity = 0.5;
	}
	else{
		who.style.filter = 'alpha(opacity=100)';
		who.style.opacity = 1;	
	}
}

// Popup Image
function PopupPic(sPicURL) {
    window.open("popup.html?"+sPicURL, "","resizable=1,HEIGHT=200,WIDTH=200");
}

// Check if the field is numeric
function IsNumeric(strString) {
	
	var strValidChars = "0123456789+.,-()";
	var strChar;
	var blnResult = true;

	//if (strString.length == 0) return false;
	
	for (i = 0; i < strString.length && blnResult == true; i++)
	  {
	  strChar = strString.charAt(i);
	  if (strValidChars.indexOf(strChar) == -1)
		 {
		 blnResult = false;
		 }
	  }
	return blnResult;
}

// Go Print!
function PrintNow(section,id) {
    var pop = window.open("print.webman?section="+section+"&id="+id+"","","width=930,height=700,toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=no");
    if(pop.focus){ pop.focus(); }
}
