menu1 = new Image(195, 39);
menu1.src = "images/bt01.gif";
menu1_high = new Image(195, 39);
menu1_high.src = "images/bt01_over.gif";

menu2 = new Image(195, 39);
menu2.src = "images/bt02.gif";
menu2_high = new Image(195, 39);
menu2_high.src = "images/bt02_over.gif";

menu3 = new Image(196, 39);
menu3.src = "images/bt03.gif";
menu3_high = new Image(196, 39);
menu3_high.src = "images/bt03_over.gif";

menu4 = new Image(195, 39);
menu4.src = "images/bt04.gif";
menu4_high = new Image(195, 39);
menu4_high.src = "images/bt04_over.gif";

menu5 = new Image(196, 39);
menu5.src = "images/bt05.gif";
menu5_high = new Image(196, 39);
menu5_high.src = "images/bt05_over.gif";

function glow(x, y) {
document.images[x].src=eval(y+'.src');
}

function url_encode(inputString) {    

//http://www.permadi.com/tutorial/urlEncoding/
               
  var encodedInputString = escape(inputString);
  encodedInputString=encodedInputString.replace("+", "%2B");
  encodedInputString=encodedInputString.replace("/", "%2F");
  return encodedInputString;
}

function title_encode_utf8(inputString) {
	
/**
*
*  URL encode / decode
*  http://www.webtoolkit.info/
*
**/
 
var Url = {
 
	// public method for url encoding
	encode : function (string) {
		return escape(this._utf8_encode(string));
	},
 
	// private method for UTF-8 encoding
	_utf8_encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
 
		for (var n = 0; n < string.length; n++) {
 
			var c = string.charCodeAt(n);
 
			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
 
		}
 
		return utftext;
	}
 
}

return Url.encode(inputString);

}

function sharePage(destination) {

var current_page = url_encode(window.location.href);
var current_title = (window.document.title).replace(/\s/gi,"+"); //replace space with +
var current_title_utf8 = title_encode_utf8(current_title); //utf8 encoding

if (destination == "print") window.print();
else if (destination == "email") window.open("send.php?url=" + current_page + "&title=" + current_title);
else if (destination == "delicious") window.open("http://del.icio.us/post?url=" + current_page + "&title=" + current_title_utf8);
else if (destination == "digg") window.open("http://digg.com/submit?phase=2&url=" + current_page);
else if (destination == "facebook") window.open("http://www.facebook.com/sharer.php?u=" + current_page + "&t=" + current_title_utf8);
else if (destination == "twitter") window.open("http://twitter.com/home?status=" + current_title_utf8 + " " + current_page);

}