function bookmarksite(title, url){

if (window.sidebar) {
			window.sidebar.addPanel(title, url, "");

		} else if(window.opera && window.print) {
			var elem = document.createElement('a');
			elem.setAttribute('href',url);
			elem.setAttribute('title',title);
			elem.setAttribute('rel','sidebar');
			elem.click();

		} else if(document.all) {
			window.external.AddFavorite(url, title);
		}
}

function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {
  var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
  var int_windowTop = (screen.height - a_int_windowHeight) / 2;
  var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=' + a_bool_scrollbars + ',resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';
  var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
    if (parseInt(navigator.appVersion) >= 4) {
      obj_window.window.focus();
    }
}

function highlightLink()
{
	//Get filename from the URL
	thisPage = document.URL.substring(document.URL.lastIndexOf(":")+1 ,document.URL.length);
	//alert(thisPage);
	//Loop through all the links
	for (i=0; i<document.links.length; i++ )
	{
		//Get only the filename from the href of navigation link
		pageLink = document.links[i].href.substring(document.links[i].href.lastIndexOf(":")+1 ,document.links[i].href.length);
		// alert(pageLink);
		//if the current filename & the link-ed file name are the same, change the background color of that link
		if (thisPage == pageLink) { document.links[i].className = "BG"; }
		
	}
}


function loadPage(site, pageTitle, pageDescription) {
		var rawURL = window.location.href;
		var currentURL = encodeURIComponent(rawURL);
		var title = encodeURIComponent(pageTitle);
		var bodytext = encodeURIComponent(pageDescription);
		var newURL;
		var go = true;

		switch (site) {
			case "del.icio.us":
				newURL = "http://del.icio.us/post?v=4"
				+ ";url=" + currentURL
				+ ";title=" + title;
			break;
			case "digg":
				newURL = "http://digg.com/submit?phase=2&"

				+ "url=" + currentURL

				+ "&title=" + title

				+ "&bodytext=" + bodytext

				+ "&topic=tech_deals";

			break;
			case "reddit":
				newURL = "http://reddit.com/submit?"
				+ "url=" + currentURL
				+ "&title=" + title;
			break;
			case "furl":
				newURL = "http://www.furl.net/savedialog.jsp?"
				+ "t=" + title
				+ "&u=" + currentURL;
			break;
			case "rawsugar":
				newURL = "http://www.rawsugar.com/home/extensiontagit/?turl=" + currentURL
				+ "&tttl=" + title;
			break;
			case "stumbleupon":
				newURL= "http://www.stumbleupon.com/submit?url=" + currentURL
				+ "&title=" + title;
			break;
			case "blogmarks":
				
			break;
			case "facebook":
				newURL = "http://www.facebook.com/share.php?src=bm&v=4" 
				+ "&u=" + currentURL
				+ "&t=" + title;
			break;
			case "technorati":
				newURL = "http://technorati.com/faves?sub=favthis&add=" + currentURL;
			break;
			case "spurl":
				newURL = "http://www.spurl.net/spurl.php?v=3"
				+ "&title=" + title
				+ "&url=" + currentURL;
			break;
			case "simpy":
				newURL= "http://www.simpy.com/simpy/LinkAdd.do?title=" + title
				+"&href=" + currentURL;
			break;
			case "ask":
				
			break;
			case "google":
				newURL = "http://www.google.com/bookmarks/mark?op=edit&output=popup"
				+ "&bkmk=" + currentURL
				+ "&title=" + title;
			break;
			case "netscape":
				newURL = "http://www.netscape.com/submit/?U=" + currentURL
				+ "&T=" + title + "&C=" + bodytext;
			break;
			case "fark":
				
			break;
			case "slashdot":
				newURL = "http://slashdot.org/bookmark.pl?url=" + rawURL + "&title=" + title;
			break;
			case "backflip":
				newURL= "http://www.backflip.com/add_page_pop.ihtml?" 
				+ "title=" + title
				+ "&url=" + currentURL;
			break;
			case "wink":
				
			break;
			case "bluedot":
				newURL = "http://bluedot.us/Authoring.aspx?"
				+ "u=" + currentURL
				+ "&t=" + title;
			break;
			case "browser":
				bookmarksite(pageTitle, rawURL);
				go = false;
			break;
		}

		if (go == true) {
			window.open(newURL, "_blank");
		}
	}

	var title = window.document.title;
	var description = "";
