var j$ = jQuery;

//linklist-three
j$(function(){
	j$(".linklist-three a",this).each(function(){
		if(j$(this).attr("href") != undefined && !j$(this).is(":has('img')")){
			var $this = j$(this);
			if($this.attr("href").match(".pdf$")){
					$this.after("<img src='/imgs/common/ic_pdf.gif' width='11' height='11' class='icon' />");
			}else if($this.attr("href").match(".doc$") || $this.attr("href").match(".docx$")){
					$this.after("<img src='/imgs/common/ic_word.gif' width='11' height='11' class='icon' />");
			}else if($this.attr("href").match(".xls$") || $this.attr("href").match(".xlsx$")){
					$this.after("<img src='/imgs/common/ic_excel.gif' width='13' height='11' class='icon' />");
			}else if($this.attr("target") == "_blank"){
					$this.after("<img src='/imgs/common/ic_newwin.gif' width='13' height='11' class='icon' />");
			}
		}
	});
});



j$(function(){
	j$("#maincontainer a",this).each(function(){
		if(j$(this).attr("href") != undefined && !j$(this).is(":has('img')") && !j$(this).parent().parent().hasClass("linklist-three")){
			var $this = j$(this);
			if($this.attr("href").match(".pdf$")){
				if($this.css("display") == 'block'){
					$this.append("<img src='/imgs/common/ic_pdf.gif' width='11' height='11' class='icon' />");
				}else{
					$this.after("<img src='/imgs/common/ic_pdf.gif' width='11' height='11' class='icon' />");
				}
			}else if($this.attr("href").match(".doc$") || $this.attr("href").match(".docx$")){
				if($this.css("display") == 'block'){
					$this.append("<img src='/imgs/common/ic_word.gif' width='11' height='11' class='icon' />");
				}else{
					$this.after("<img src='/imgs/common/ic_word.gif' width='11' height='11' class='icon' />");
				}
			}else if($this.attr("href").match(".xls$") || $this.attr("href").match(".xlsx$")){
				if($this.css("display") == 'block'){
					$this.append("<img src='/imgs/common/ic_excel.gif' width='13' height='11' class='icon' />");
				}else{
					$this.after("<img src='/imgs/common/ic_excel.gif' width='13' height='11' class='icon' />");
				}
			}else if($this.attr("target") == "_blank"){
				if($this.css("display") == 'block'){
					$this.append("<img src='/imgs/common/ic_newwin.gif' width='13' height='11' class='icon' />");
				}else{
					$this.after("<img src='/imgs/common/ic_newwin.gif' width='13' height='11' class='icon' />");
				}
			}
		}
	});
});
