	function mw_over(imgId,imgFle){
		document.getElementById(imgId).src = 'images/' + imgFle + '_over.gif';
	}
	function mw_out(imgId,imgFle){
		document.getElementById(imgId).src = 'images/' + imgFle;
	}
	function calc(){
		window.open('http://maxwilly.com/calcu.php','','menubar=0,width=350,height=230,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0');
	}
	function chOrder(o_id){
		if(document.getElementById('cksel_' + o_id).value == 0){
			document.getElementById('id_' + o_id).src = 'images/sel_' + o_id + '.gif';
			document.getElementById('td_' + o_id).style.backgroundColor = '#ededed';
			document.getElementById('prcCon_' + o_id).style.backgroundColor = '#ededed';
			document.getElementById('tr_' + o_id).style.cursor = 'pointer';
		}
		else{
			document.getElementById('tr_' + o_id).style.cursor = 'default';
		}
	}
	function ouOrder(o_id){
		if(document.getElementById('cksel_' + o_id).value == 0){
			document.getElementById('id_' + o_id).src = 'images/dis_' + o_id + '.gif';
			document.getElementById('td_' + o_id).style.backgroundColor = '#f1f1f1';
			document.getElementById('prcCon_' + o_id).style.backgroundColor = '#f1f1f1';
		}
	}
	function dnOrder(o_id){
			document.location.href = 'cart1.php?prodId=' + o_id + '&act=add';
	}
	
		function isValidEmail(email, required) {
		if (required==undefined) {   // if not specified, assume it's required
			required=true;
		}
		if (email==null) {
			if (required) {
				return false;
			}
			return true;
		}
		if (email.length==0) {  
			if (required) {
				return false;
			}
			return true;
		}
		if (! allValidChars(email)) {  // check to make sure all characters are valid
			return false;
		}
		if (email.indexOf("@") < 1) { //  must contain @, and it must not be the first character
			return false;
		} else if (email.lastIndexOf(".") <= email.indexOf("@")) {  // last dot must be after the @
			return false;
		} else if (email.indexOf("@") == email.length) {  // @ must not be the last character
			return false;
		}
		
		return true;
	}

	function allValidChars(email) {
	  var parsed = true;
	  var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@.-";
	  for (var i=0; i < email.length; i++) {
		var letter = email.charAt(i).toLowerCase();
		if (validchars.indexOf(letter) != -1)
		  continue;
		parsed = false;
		break;
	  }
	  return parsed;
	}


	function validateCForm(){

		var t1 = document.getElementById("t1").value;
		var t2 = document.getElementById("t2").value;
		var t3 = document.getElementById("t3").value;

		if (t1 == ""){
			document.getElementById("er_1").style.display = 'block';
			document.getElementById("t1").focus();
			return false;
		}
		else{
			document.getElementById("er_1").style.display = 'none';
		}


		if (t2 == ""){
			document.getElementById("er_2").style.display = 'block';
			document.getElementById("t2").focus();
			return false;
		}
		else{

			if (! isValidEmail(document.getElementById("t2").value)) {
				document.getElementById("er_2").style.display = 'none';
				document.getElementById("er_4").style.display = 'block';
				document.getElementById("t2").focus();
				return false;
			}
			else{
				document.getElementById("er_4").style.display = 'none';
			}

		}

		if (t3 == ""){
			document.getElementById("er_3").style.display = 'block';
			document.getElementById("t3").focus();
			return false;
		}
		else{
			document.getElementById("er_3").style.display = 'none';
		}

	}