function replaceAll(stext, searchStr, replaceStr) {
	var temp = stext;
	while (temp.indexOf(searchStr) != -1) {
		temp = temp.replace(searchStr, replaceStr);
	}
	return temp;
}

function fn_download(filepath, filename) {
	var url = encodeURI("../common/download.jsp?filepath="+ filepath.replace(/&/g,"%26") +"&filename="+ filename.replace(/&/g,"%26"));
	location.href = url;
}

function fn_download(attachNo, attachSeq, attachDir) {
	var url = encodeURI("/tmaxsoft/common/download.screen?attachNo="+ attachNo +"&attachSeq="+ attachSeq + "&attachDir=" + attachDir);
	//location.href = url;
	window.open(url, "","");
}

function fn_download_old (filepath, filename) {
	var url = encodeURI("../common/download.jsp?filepath="+ replaceAll(filepath,"&","%26") +"&filename="+ replaceAll(filename,"&","%26"));
	location.href = url;
}
