// set source
var tempHref, tempLink;
function setSource() {
	//return; // seems can't redirect collectly from 2010.9.9
	var cn = 'dds', cv = '1';
	if($.cookie(cn)) return;
	$('a').click(function(){
		if(this.href.indexOf('http:') == -1 || this.href.indexOf('#') > -1) return;
		if($.cookie(cn)) return;
		if(this.href.indexOf('http://www.dushu123.com/read/') == -1) return;

		$.cookie(cn,cv,{expires: 1, path: '/'});

		if (this.href.indexOf('yiqifa') == -1) {
			tempLink = this;
			tempHref = this.href;
			var newHref = tempHref.replace("http://www.dushu123.com/", "http://www.dangdang.com.tushucheng.com/");
			this.href = 'http://p.yiqifa.com/c?s=cf57c27e&w=63161&c=247&i=159&l=0&e=read_link&t=' + encodeURIComponent(newHref);
			_ga._trackPageview('/link/dds/');
			setTimeout('tempLink.href=tempHref',1000);
		}
	});
}

