
//var message="Contents of this website are copyrighted and are not to be //duplicated without express permission of site owner.";
//function click(e) { 
//if (document.all) {
//if (event.button==2||event.button==3) { 
//alert(message);
//return false;} 
//} 
//if (document.layers) {
//if (e.which == 3) {
//alert(message); 
//return false; 
//} 
//} 
//} 
//if (document.layers) {
//document.captureEvents(Event.MOUSEDOWN);
//}document.onmousedown=click; 

// Speaking of Java, this particular script is (C) Copyright 2002 Jim Tucek
// If you wish to use my Email Encryption script, these comments must be left
// alone!  That is all.

// Visit www.jracademy.com/~jtucek/ for script information and a bit of help
// setting it up, or www.jracademy.com/~jtucek/email.html for contact
// information.

// A brief history of this script can be found (and it's rather entertaining)
// at www.jracademy.com/~jtucek/eencrypt.html

function goForth(c,n,d) {
c += ' ';
var length = c.length;
var number = 0;
var bar = 0;
var answer = '';
for(var i = 0; i < length; i++) {
number = 0;
bar = 0;
while(c.charCodeAt(i) != 32) {
number = number * 10;
number = number + c.charCodeAt(i)-48;
i++;
}
answer += String.fromCharCode(decrypt(number,n,d));
}
// Updated security feature
parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+answer;
}

function showText(c,n,d) {
c += ' ';
var length = c.length;
var number = 0;
var bar = 0;
var answer = '';
for(var i = 0; i < length; i++) {
number = 0;
bar = 0;
while(c.charCodeAt(i) != 32) {
number = number * 10;
number = number + c.charCodeAt(i)-48;
i++;
}
document.write('&');
document.write('#');
document.write(decrypt(number,n,d));
}
}

function decrypt(c,n,d) {
// Split exponents up
if (d % 2== 0) {
bar = 1;
for(var i = 1; i <= d/2; i++) {
foo = (c*c) % n;
bar = (foo*bar) % n;
}
} else {
bar = c;
for(var i = 1; i <= d/2; i++) {
foo = (c*c) % n;
bar = (foo*bar) % n;
}
}
return bar;
}

function getcopyrightdate() {
	var mydate=new Date()
	var year=mydate.getYear()
	if (year < 1000)
	year+=1900
	var day=mydate.getDay()
	var month=mydate.getMonth()+1
	if (month<10)
	month="0"+month
	var daym=mydate.getDate()
	if (daym<10)
	daym="0"+daym
	var showDate=("<small><font color='000000' face='Arial'><b>"+year+"</b></font></small>")
   	return(showDate);}

function getlastdate(){
   var modiDate = new Date(document.lastModified)
   var month = modiDate.getMonth()+1
   var day = modiDate.getDate()
   var year = modiDate.getYear()-100
        year = "0" + year
   var showDate = month + "/" + day + "/" + year
   	return(showDate);}

function CAPACITY() {
	this.mLiter=1
	this.mMilliliter=.001
	this.mDrachm=.000281569
	this.uslGallon=3.785
	this.uslQuart=0.94625
	this.uslPint=0.473125
	this.uslFluid_ounce=.0295703
	this.uslFluid_dram=.0036962875
	this.biGallon=4.546
	this.biQuart=1.136
	this.biPint=.56826
	this.cCup=0.2365625
	this.cTable_spoon=0.014785156
	this.cTea_spoon=0.004928385
}

data = new CAPACITY();

function checkNum(str) {
	for (var i=0; i<str.length; i++) {
	var ch = str.substring(i, i + 1)
	if (ch!="." && (ch < "0" || ch > "9")) {
		alert("Please enter a valid number.");
		return false
		}
	}
	return true
}

function rnd(what) {
	what=Math.round(what*1000)/1000
	var str=""+what;
	
	return str;
}

function compute(obj,val) {
	if (obj[val].value) {
		var uval=0;
		uval = obj[val].value*data[val];
		for (var i in data)
			obj[i].value=rnd(uval/data[i]);
	}
}

function WEIGHT() {
   this.Kilogram1=1.0;
   this.Gram1=.001;
   this.Milligram1=.000001;
   this.Pound2=0.453592;
   this.Ounce2=.02835;
   this.Dram2=.001771875;
   this.Grain2=.000064799;
}
data = new WEIGHT();
function checkNum(str) {
	for (var i=0; i<str.length; i++) {
	var ch = str.substring(i, i + 1)
	if (ch!="." && (ch < "0" || ch > "9")) {
		alert("Please enter a valid number.");
		return false
		}
	}
	return true
}

function normalize(what) {
	what=Math.round(what*1000)/1000	
	var str=""+what;
	return str;
}

function compute(obj,val) {
	if (obj[val].value) {
		var uval=0;
		uval = obj[val].value*data[val];
		for (var i in data)
			obj[i].value=normalize(uval/data[i]);
	}
}

function gotoindex(){
if (top.location == self.location){self.location.replace('index.htm')}
}

function Dollar (val) {  // force to valid dollar amount
var str,pos,rnd=0;
  if (val < .995) rnd = 1;  // for old Netscape browsers
  str = escape (val*1.0 + 0.005001 + rnd);  // float, round, escape
  pos = str.indexOf (".");
  if (pos > 0) str = str.substring (rnd, pos + 3);
  return str;
}

function ReadForm (obj1, tst) { // process radio and checkbox
var i,amt,des,obj,pos,val;
  amt = obj1.baseamt.value*1.0;    // base amount
  des = obj1.basedes.value;        // base description
  for (i=0; i<obj1.length; i++) {  // run entire form
    obj = obj1.elements[i];        // a form element
    if (obj.type == "checkbox" ||  // checkboxes
        obj.type == "radio") {     //  and radios
      if (obj.checked) {           // did user check it?
        val = obj.value;           // the value of the selection
        pos  = val.indexOf ("@");  // price set?
        if (pos >= 0) amt = val.substring (pos + 1)*1.0;
        pos  = val.indexOf ("+");  // price increment?
        if (pos >= 0) amt = amt + val.substring (pos + 1)*1.0;
        pos  = val.indexOf ("%");  // percent change?
        if (pos >= 0) amt = amt + (amt * val.substring (pos + 1)/100.0);
        if (des.length == 0) des = val;
        else des = des + ", " + val;  // accumulate value
      }
    }
  }
  obj1.item_name.value = des;
  obj1.amount.value = Dollar (amt);
  if (obj1.tot) obj1.tot.value = "$" + Dollar (amt);
}

// global variables to form MY addresses
var at1 = "@";
var dot = ".";
var typ = "biz";
var id1 = "pastor";    // real id1
var id2 = "john";    // real id2
var url = "thepenshop";       // real URL
var fid1 = "contact";      // fake id1
var fid2 = "me"    // fake id2
var furl = "yawhoo";    // fake URL

function FixBusi (obj1) {  // PayPal FORM business value
var tmp;
  if (obj1.business) {     // see what is in this form 
    tmp = obj1.business.value;
    obj1.business.value = id1 + id2 + at1 + url + dot + typ;
    //alert ("Fake business was ... \n   " + tmp + "\n\n\n" +
    //       "Real business is  ... \n   " + obj1.business.value);
  }
  return true;             // make it work...
}

function FixLink (obj1) {  // fix any PayPal link in calling FORM
var tmp,org,ary=new Array();
  if (obj1.cancel_return) {  // start checking those links
    org = obj1.cancel_return.value;
    tmp = org;  // place holder
    ary = tmp.split (furl);  // do we have a fake
    if (ary.length > 1) {    // still a fake
      tmp = ary.join ("" + url);
      obj1.cancel_return.value = tmp;
     // alert("Fix URL... \n\n" +
     //       "cancel_return value was ... \n   " + org + "\n\n\n" +
     //       "cancel_return value IS  ... \n   " + tmp);
    }
    org = tmp;  // any more stuff to fix?
    ary = tmp.split (fid1 + fid2);  // have a fake ID here?
    if (ary.length > 1) {    // still a fake
      tmp = ary.join (id1 + id2);
      obj1.cancel_return.value = tmp;
     // alert("Fix ID... \n\n" +
     //       "cancel_return value was ... \n   " + org + "\n\n\n" +
     //       "cancel_return value IS  ... \n   " + tmp);
    }
  }
}

function FixMail (obj1) {  // fix a hyperlink mail addr
var tmp;
  tmp = obj1.href;
  obj1.href = "mailto:" + id1 + id2 + at1 + url + dot + typ;
//  alert ("Fake E-mail address was ... \n   " + tmp + "\n\n\n" +
//         "Real E-mail address is  ... \n   " + obj1.href);
  return true;             // make it work...
}

