var Bookmarklets = {
	// variables
	display:{
		list:"Bookmarklets"
	},
	
	closure:{
		start:"javascript:(function(){",
		end:"})()"
	},
	
	list:
	{
		qwikr:{
			text:"<img src='http://addons.32teeth.org/bookmarklet/qwikr/images/qwikr.gif' border='0'/>&nbsp;twitter quick post",
			onclick:"window.alert('Drag this link to the toolbar or Right-Click the link and choose Bookmark');return false;",
			href:"var d,b,c,s,a,i,qw,q;d=document;b=d.body;c=function(e){return d.createElement(e);};s=function(e,a,v){e.setAttribute(a,v);};a=function(p,c){p.appendChild(c);};i=function(e,v){e.innerHTML=v;};if(document.getElementById('QA')){document.getElementById('QA').parentNode.removeChild(document.getElementById('QA'));document.getElementById('QAB').parentNode.removeChild(document.getElementById('QAB'));};qw=c('iframe');s(qw,'style','z-index:9000;position:fixed;border:0;left:0;top:0;width:100%;height:80px;background:#F5F5F5;scoll:none;');s(qw, 'src','http://addons.32teeth.org/bookmarklet/qwikr/index.php');s(qw, 'id','QA');q=c('button');i(q, 'x');s(q, 'style','z-index:9001;position:fixed;right:10px;top:28px;');s(q, 'id','QAB');s(q, 'onclick', \"document.getElementById('QA').parentNode.removeChild(document.getElementById('QA'));document.getElementById('QAB').parentNode.removeChild(document.getElementById('QAB'));\");a(b,qw);a(b,q);"			
		},
		translate:{
			text:"translate selected text",
			onclick:"window.alert('Drag this link to the toolbar or Right-Click the link and choose Bookmark');return false;",
			href:"var l='http:'+'//'+'addons.32teeth.org/bookmarklet/translate/Translate.js';var n=document.createElement('script');n.setAttribute('language','JavaScript');n.setAttribute('src',l);document.body.appendChild(n);"
		},
		resizer:{
			text:"window resizer",
			onclick:"window.alert('Drag this link to the toolbar or Right-Click the link and choose Bookmark');return false;",			
			href:"var d,b,c,s,a,ov,bl,di,h1,si,bt,x;d=document;b=d.body;c=function(e){return d.createElement(e);};s=function(e,a,v){e.setAttribute(a,v);};a=function(p,c){p.appendChild(c);};i=function(e,v){e.innerHTML=v;};si=['640x480','800x600','1024x768','1280x1024'];bl=c('div');s(bl,'style','z-index:9000;position:fixed;left:0;top:0;width:100%;height:50px;background:#000000;opacity:.75;filter:alpha(opacity=75);-moz-opacity:0.75;');s(bl,'id','rsB');di=c('div');s(di,'style','z-index:9002;position:fixed;left:0;top:0;width:99%;height:50px;padding:0 10px;');s(di,'id','rsH');h1=c('h1');s(h1,'style','color:#FFFFFF;font-size:24px;font-family:Arial;margin:0;padding:10px;float:left;');i(h1,'Resizer');x=c('button');s(x,'style','float:right;margin:15px 3px;');i(x, 'X');s(x,'onclick','document.getElementById(\"rsB\").parentNode.removeChild(document.getElementById(\"rsB\"));document.getElementById(\"rsH\").parentNode.removeChild(document.getElementById(\"rsH\"));');a(di,x);for(var n in si){bt = c('button');i(bt,si[n]);s(bt,'style','float:right;margin:15px 3px;');s(bt,'onclick','window.resizeTo('+si[n].split('x')[0]+','+si[n].split('x')[1]+')');a(di,bt);};a(b,bl);a(di,h1);a(b,di);"
		},
		mapme:{
			text:"map selected address",
			onclick:"window.alert('Drag this link to the toolbar or Right-Click the link and choose Bookmark');return false;",
			href:"var l='http:'+'//'+'addons.32teeth.org/bookmarklet/maps/MapMe.js';var n=document.createElement('script');n.setAttribute('language','JavaScript');n.setAttribute('src',l);document.body.appendChild(n);"
		},
		validate:{
			text:"quick w3c validate",
			onclick:"window.alert('Drag this link to the toolbar or Right-Click the link and choose Bookmark');return false;",
			href:"var n=document.createElement('script');n.setAttribute('language','JavaScript');n.setAttribute('src','http://addons.32teeth.org/bookmarklet/w3c/QuickValidate.js');document.body.appendChild(n);"
		},		
		external:{
			text:"show external links",
			onclick:"window.alert('Drag this link to the toolbar or Right-Click the link and choose Bookmark');return false;",
			href:"var a=document.getElementsByTagName('a');var l=a.length;var r=new RegExp('(f|ht)tps?:\/\/.+?(\s|$)', 'g');for(i=0;i<l;i++){var h=a[i].getAttribute('href');if(h.match(r)){a[i].setAttribute('style', 'padding-right:10px;background:transparent url(http://addons.32teeth.org/bookmarklet/images/plus.gif) no-repeat right;');}};"
		},		
		images:{
			text:"create gallery from images",
			onclick:"window.alert('Drag this link to the toolbar or Right-Click the link and choose Bookmark');return false;",
			href:"var n=document.createElement('script');n.setAttribute('language','JavaScript');n.setAttribute('src','http://addons.32teeth.org/bookmarklet/images/images.js');document.body.appendChild(n);"
		},		
		hidden:{
			text:"show hidden inputs",
			onclick:"window.alert('Drag this link to the toolbar or Right-Click the link and choose Bookmark');return false;",
			href:"var f,b;f=document.getElementsByTagName('input');b=document.createElement('button');b.innerHTML='x';b.setAttribute('style','padding:5px;margin-left:5px');b.setAttribute('onclick','javascript:(function(p){p.parentNode.removeChild(p);})(this.parentNode);return false;');for(var i in f){if(f[i].type == 'hidden'){var x,c,p,d,b,n;x=f[i];n=!f[i].getAttribute('name')?f[i].getAttribute('id'):f[i].getAttribute('name');p=x.parentNode;c=x.cloneNode(true);c.setAttribute('type','text');d=document.createElement('div');d.setAttribute('style','clear:both;float:left;margin:3px;padding:3px;border:solid 1px #990000;background:#f4f4f4;');d.innerHTML=n+':';d.appendChild(c);d.appendChild(b.cloneNode(true));p.appendChild(d);}}"
		}
	},
	
	//methods
	
	/*
		Assign bookmarklets
	*/
	Assign:function()
	{
		var list	= this.Get(this.display.list);
		for(prop in this.list)
		{
			list.appendChild(this.Item(this.list[prop]))
		}
	},
	
	Item:function(item)
	{
		var li = document.createElement("li");
		li.appendChild(this.Link(item));
		
		return li;
	},
	
	Link:function(item)
	{
		var link = document.createElement("a");
		link.setAttribute("href", this.Closure(item.href));
		link.setAttribute("onclick", item.onclick)
		link.innerHTML = item.text;		
		return link;
	},
	
	Closure:function(link)
	{
		return this.closure.start + link + this.closure.end;
	},
	
	Get:function(id)
	{
		//	retrieve object
		if (document.getElementById){obj = document.getElementById(id);}
		else if (document.all){obj = document.all[id];}
		else if (document.layers){if (document.layers[id]){obj = document.layers[id];}}
		
		//	return object to caller
		return obj;
	}
}