function ShowImg(obj, imageID, rootUrl, publishmentSystemUrl){
	if(obj.value==""){
		$(imageID).src = '../../sitefiles/bairong/Icons/empty.gif';
		return false;
	}
	if(obj.value.search(/\.swf$/i) != -1) {
		$(imageID).src = '../../sitefiles/bairong/Icons/flash.jpg';
		return false;
	}
	if(obj.value.search(/\.flv|\.avi|\.mpg|\.mpeg|\.smi|\.mp3|\.mid|\.midi|\.rm|\.wmv|\.wma|\.asf|\.mov$/i) != -1) {
		$(imageID).src = '../../sitefiles/bairong/Icons/player.gif';
		return false;
	}
	if(obj.value.search(/\.bmp|\.jpg|\.jpeg|\.gif|\.png$/i) != -1) {
		var imageUrl = obj.value;
		if (imageUrl){
			if (imageUrl.charAt(0) == '~'){
				imageUrl = imageUrl.replace('~', rootUrl);
			}else if (imageUrl.charAt(0) == '@'){
				imageUrl = imageUrl.replace('@', publishmentSystemUrl);
			}
		}
		if(imageUrl && imageUrl.substr(0,2)=='//'){
			imageUrl = imageUrl.replace('//', '/');
		}
		$(imageID).src=imageUrl;
	}
}

function DeleteAttachment(attributeName)
{
	$("add_" + attributeName).style.display='';
	$("del_" + attributeName).style.display='none';
	$(attributeName).value = '';
}

function SelectAttachment(attributeName, attachmentUrl, fileViewUrl)
{
	$("add_" + attributeName).style.display = 'none';
	$("del_" + attributeName).style.display = '';
	$("del_" + attributeName).innerHTML = "<a href='javascript:undefined;' onclick=\"" + fileViewUrl + "\">²é¿´</a> <a href='javascript:undefined;' onclick=\"DeleteAttachment('" + attributeName + "');\">ÒÆ³ý</a>";
	$(attributeName).value = attachmentUrl;
}