var isNN = (navigator.appName.indexOf("Netscape")!=-1);
document.oncontextmenu = function (evt) {
    var srcElement;
    if (evt && evt.target) {
        srcElement = evt.target;
    } else if (window.event) {
        srcElement = window.event.srcElement;
    }
    if (srcElement.id == "hacker") {
        alert("Copying Prohibited by Law - HACKER SAFE is a Trademark of ScanAlert.");
        return false;
    }
}
function order(id) {
var F = document.forms[0];
for(i=0; i<k.length; i++) if (id == k[i]) { id = i; break;}
F.action = o_url + 'order' + p[id] + '.php';
F.o_id.value = o_id[id]; F.t_id.value = t_id[id]; F.a_id.value = a_id[id]; F.m_id.value = m_id[id]; F.q_id.value = q_id[id]; F.s_id.value = s_id[id]; F.submit();
}
function openpopup(u, h, w) {
var l = 'no'; if (h == 'l') { l = 'yes'; h = 600;}
if (h == undefined) h = 600; if (w == undefined) w = 620; var cH=(screen.height/2)-(h/2); var cW=(screen.width/2)-(w/2); 
window.open(u, "","height="+h+",width="+w+",top="+cH+",left="+cW+",location="+l+",menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,directories=no");
}
function checkRadio(forma) {
for(var i=0; i<forma.elements.length; i++) if (forma.elements[i].type == 'radio' && forma.elements[i].checked) return true;
alert('Please select one suggested address');
return false;
}
function checknoph() {
var e = ''; var z = document.getElementById('zip').value; 
if (!document.getElementById('address').value.length) e = "An address is required\n";
if (!document.getElementById('city').value.length) e += "A city is required\n";
if (!document.getElementById('state').selectedIndex) e += "A state is required\n";
if (!z.length) e += "A zip code is required\n";
else if (z.length < 5 || isNaN(z)) e += "A valid zip code is required\n";
if (e.length) { alert(e); return false; }
return true;
}
function cT(F, a) {
	var e='Please enter your Service telephone number'; 
	var c=F.code; var f=F.first; var l=F.last; //var m=F.shopper_email;
	if(isNaN(c.value)||c.value.length<3) {
		alert(e);c.focus();return false;
	}
	if(isNaN(f.value)||f.value.length<3){
		alert(e);f.focus();
		return false;
	}

	if(isNaN(l.value)||l.value.length<4){
		alert(e);l.focus();
		return false;
	}
	e=''; 
	if (a == 1) {
		c=F.zip.value; 
		if (!F.address.value.length) 
			e="Plese enter Street Address\n"; 
		if (isNaN(c) || c.length < 5) 
			e+="Please enter valid Zip Code\n"; 
		if(!F.city.value.length) 
			e+="Please enter City\n"; 
		if (!F.state.selectedIndex) 
			e+="Please select State\n";
	}

	if(!chE(F.email.value)){
		e+='Please enter a valid Email Address';
		F.email.focus();
	}

	if(e.length){
		alert(e); 
		return false;
	}

	document.forms[0].phone.value = document.forms[0].code.value + document.forms[0].first.value + document.forms[0].last.value;
	return true;
}

function showHide(el) {var oTr = document.getElementById(el); if (oTr.style.display == 'none') oTr.style.display = ''; else oTr.style.display = 'none';}
function aT(input, len, sec_i) {if(input.value.length == len) document.getElementById('p'+sec_i).focus();}

function chE(e) { 
	var r = /^([a-zA-Z0-9_'+*$%\^&!\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9:]{2,4})+$/;
	return r.test(e);
}

function initAntispam() {
   document.getElementById('validation_field').value = 58;
   document.getElementById('contact_us_form').submit();
   return true;
}
