
/* This script can be used FREELY as long as this copyright message is intact: Mail Spam Blocker / Copyright (c) 2004 by www.myvasco.com Internet Marketing Solutions */
function ch1(x){var yy=2;var z=0;var xx="";for(var y=0;y<x.length;y++){z=x.charCodeAt(y);xx+=String.fromCharCode(z-yy);}return xx;}
function msb(x){location.href=ch1(x);}
function msb2(x){x=x.split(",");var y="";for(var z=0;z<x.length;z++){y+=String.fromCharCode(fromHex(x[z]));}location.href=ch1(y);}

/* Using HTTP auth for the time being */
function doLogon(user,password)
{
	var dest="www.guiseleybaptistchurch.co.uk/gbc/userarea/page.jsp?p=userhome";
	var encUser=user;
	var encPass="";
	var i;
	//for(i=0;i<user.length;i++) {
	//	encUser+="%" + toHex(user.charCodeAt(i));
	//}
	for(i=0;i<password.length;i++) {
		encPass+="%" + toHex(password.charCodeAt(i));
	}
	window.open("http://"+encUser+":"+encPass+"@"+dest, "User Area");
}

function fromHex(d)
{
	var h=d.charCodeAt(0);
	var l=d.charCodeAt(1);
	h=(h<65?h-48:h-55);
	l=(l<65?l-48:l-55);
	return (h*16)+l;
}

function toHex(val)
{
	var high=(val&0xF0)/16;
	var low=(val&0xF);
	return ""+getDigit(high)+getDigit(low);
}

function getDigit(d)
{
	switch(d) {
		case 10:return "A";
		case 11:return "B";
		case 12:return "C";
		case 13:return "D";
		case 14:return "E";
		case 15:return "F";
	}
	return ""+d;
}


