// JavaScript Document
function plain2link(text){
	if(!text) return text;
	text = text.replace(/((https?\:\/\/|ftp\:\/\/)|(www\.))?(\S+)(\w{2,6})(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/gi, function(url){
		nice = url;
		if(!url.match('^https?:\/\/')){
			url = 'http://'+url;
		}
		return '<a target="_blank" rel="nofollow" style="color:#449900 !important;text-decoration:underline !important;" href="'+ url +'">'+ nice +'</a>';
	});
	return text;
}

$(function(){
	$(".result li").hover(function(){
		$(this).addClass("listyle");
	},function(){
		$(this).removeClass("listyle");
	});
	$(".result li").click(function(){
		var url=$(this).find("a").eq(0).attr('href');
		window.open(url);
	});

	if($(".website").length>0)
	{
		$(".website").each(function(){
			$(this).html(plain2link($(this).html()));
		});
	}
	
	
	$(".categories ul").eq(0).before('<div><a href="http://www.qeecoo.com" target="_blank"><img src="/res/img/ads.jpg" /></a></div>');
});

function goqeecoo(str)
{
	var tmp=window.open('http://www.qeecoo.com/'+str);
	tmp.moveTo(0,0);
	tmp.focus();
}
function delcompany(id)
{
	var tmp2=window.open('http://www.gsdpw.com/index.php?r=site/del&id='+id);
	tmp2.moveTo(0,0);
	tmp2.focus();
}
