// ==UserScript==
// @name          	Gray Visited Links
// @author	  	abc@home
// @description   	Turn visited links to light gray for easier recognition
// @description0x0804  	把已访问连接改为浅灰色方便辨认
// @include       	*
// @injectframes  	1
// @run-at	  	document_start
// ==/UserScript==

(function(){
	MS_addStyle(':visited, .draggedlink{color:#bbbbbb!important}');
	document.attachEvent('onmousedown', dragLink);
	function dragLink(){
		var oElem=event.srcElement;
		while(oElem.tagName!='A' && oElem.tagName!='AREA' && oElem.parentElement){
			oElem=oElem.parentElement;
			if(oElem.tagName=='BODY') break;
		}
		if(oElem.tagName=='A'||oElem.tagName=='AREA') oElem.attachEvent('ondragend', dropLink);
	}
	function dropLink(){
		var sData=event.dataTransfer.getData('Text');
		if(sData.indexOf('http://')==0) event.srcElement.className='draggedlink';
	}
})();
