// Listing of shared scripts across the global pwc.com layer

// .pdf link auto tracking code:
$(function(){
	$("a[href$=.pdf]>img").parent().each(function(){
		if(this.onclick && this.onclick !="")
			{this.onclick="";}
	}).click(function(){
		var ti, x;
		if (this.title && this.title != "")
			{ti = this.title;} 
		else{
			x=$(this).children("img:first")[0];
			if(x.alt && x.alt !="") {ti = x.alt;}
			else {ti = document.title;}
		}
		x=this.pathname+"_img"; 
		
		wrs_trackclick('DCS.dcsuri=' + x, 'WT.ti='+ti);
	});
	
	$("a[href$=.pdf]:not(:has(img))").each(function(){
		if(this.onclick && this.onclick != "")
			{this.onclick = "";}
	}).click(function(){
		var ti,uri;
		if (this.title && this.title != "")
			{ti = this.title;} 
		else{
			ti = $(this).text();}
		uri = this.pathname;
		wrs_trackclick('DCS.dcsuri=' + uri, 'WT.ti='+ti);
	});
});
