
var url=document.location;
var title=document.title;

function trackBookmark(type)
{

	var jax = new AJAX();

	switch (type)
	{
		case "IE":
			//alert("IE");
			jax.init('true', 'GET', 'XML','/cgi-bin/tooltrack.pl?type=IE','',CreateBookmark());
			break;
		case "NN":
			//alert("NN");
			jax.init('true', 'GET', 'XML','/cgi-bin/tooltrack.pl?type=NN','',CreateBookmark());
			break;
		case "FF":
			//alert("FF");
			jax.init('true', 'GET', 'XML','/cgi-bin/tooltrack.pl?type=FF','',CreateBookmark());
			break;

		case "OP":
			//alert("OP");
			jax.init('true', 'GET', 'XML','/cgi-bin/tooltrack.pl?type=OPERA','',CreateBookmark());
			break;

		case "DEL":
			//alert("DEL");
			jax.init('true', 'GET', 'XML','/cgi-bin/tooltrack.pl?type=DELICIOUS','',addToDelicious());
			break;

		case "DIG":
			//alert("DIG");
			jax.init('true', 'GET', 'XML','/cgi-bin/tooltrack.pl?type=DIGGIT','',addToDiggit());
			break;

		case "GOO":
			//alert("GOO");
			jax.init('true', 'GET', 'XML','/cgi-bin/tooltrack.pl?type=GOOGLE','',addToGoogle());
			break;

		case "SIM":
			//alert("SIM");
			jax.init('true', 'GET', 'XML','/cgi-bin/tooltrack.pl?type=SIMPY','',addToSimpy());
			break;

		case "FUR":
			//alert("SIM");
			jax.init('true', 'GET', 'XML','/cgi-bin/tooltrack.pl?type=Furl','',addToFurl());
			break;

		case "YAH":
			//alert("SIM");
			jax.init('true', 'GET', 'XML','/cgi-bin/tooltrack.pl?type=Yah','',addToYahoo());
			break;


	}

}

function CreateBookmark() {

	

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	
	}else if( window.external ){// IE Favorite	

		window.external.AddFavorite( url, title);

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

	} 
} 


function addToDelicious()
{
	
	var loc = "http://del.icio.us/post?url="+ escape(url) + "&title=" + escape(title);
	
	window.location.href = loc;

}

function addToDiggit()
{
	
	var loc = "http://digg.com/submit?phase=2&url=" + escape(url) + "&title=" + escape(title) + "&bodytext=Free E-Cards for the Planet&topic=Animation";
	window.location.href = loc;

}

function addToGoogle()
{
	
	var loc = "http://google.com/bookmarks/mark?op=edit&bkmk=" + escape(url) + "&title=" + escape(title) + "/";
	window.location.href = loc;
}

function addToSimpy()
{
	
	var loc = "http://www.simpy.com/simpy/LinkAdd.do?href=" + escape(url) + "&title=" + escape(title);
	window.location.href = loc;
}

function addToFurl()
{
	
	var loc = "http://furl.net/storeIt.jsp?t=" + escape(title) + "&u=" + escape(url);
	window.location.href = loc;
}

function addToYahoo()
{
	
	var loc = "http://myweb2.search.yahoo.com/myresults/bookmarklet?t=" + escape(title) + "&u=" + escape(url);
	window.location.href = loc;
}
