﻿function fillFacadeForm(fileId, textboxId, spanId) { document.getElementById(textboxId).value = document.getElementById(fileId).value; var filename = document.getElementById(fileId).value; if (filename != '' && filename.lastIndexOf("\\") >= 0) { filename = filename.substring(filename.lastIndexOf("\\") + 1); document.getElementById(spanId).innerHTML = filename } else document.getElementById(spanId).innerHTML = '' }; function addFile(obj) { var numi = $(obj + 'Value'); var num = ($(obj + 'Value').value - 1) + 2; numi.value = num; var strFileUploadClass; strFileUploadClass = "fileUpload"; var spnClass; if (browser == "Opera") spnClass = 'browO'; else if (browser == "Safari") spnClass = 'browS'; else spnClass = 'brow'; $("p" + num).style.display = 'block'; if (num >= 2) $(obj + 'Remove').style.display = "inline"; if (num >= 5) $(obj + 'Add').style.display = "none" }; function removeFile(obj) { var num = $(obj + 'Value').value; $("p" + num).style.display = 'none'; $("projectFile" + num).value = ''; $("projectFileimg" + num).src = '/SOCProject/images/spacer.gif'; $(obj + 'Value').value = num - 1; if (num <= 2) $(obj + 'Remove').style.display = "none"; if (num <= 5) $(obj + 'Add').style.display = "inline" }; function alterDisplay(obj) { if ($(obj).style.display == 'none') $(obj).style.display = 'block'; else $(obj).style.display = 'none' } function alterVisibility(obj) { if ($(obj).style.visibility == 'visible') $(obj).style.visibility = 'hidden'; else $(obj).style.visibility = 'visible' } function changeImage(value, obj) { if (value != "") { $(obj).style.display = 'inline'; var ext = value.substring(value.lastIndexOf(".") + 1); if (ext.toLowerCase() == 'doc') $(obj).src = hiddenlocal + '/images/ico-word.gif'; else if (ext.toLowerCase() == 'pdf') $(obj).src = hiddenlocal + '/images/ico-pdf.gif'; else if (ext.toLowerCase() == 'zip' || ext.toLowerCase() == 'rar') $(obj).src = hiddenlocal + '/images/ico-zip.gif'; else if (ext.toLowerCase() == 'rar') $(obj).src = hiddenlocal + '/images/ico-zip.gif'; else if (ext.toLowerCase() == 'xls') $(obj).src = hiddenlocal + '/images/ico-xls.gif'; else if (ext.toLowerCase() == 'jpg' || ext.toLowerCase() == 'jpeg') $(obj).src = hiddenlocal + '/images/ico-jpg.gif'; else if (ext.toLowerCase() == 'gif') $(obj).src = hiddenlocal + '/images/ico-gif.gif'; else if (ext.toLowerCase() == 'txt') $(obj).src = hiddenlocal + '/images/ico-text.gif'; else $(obj).src = hiddenlocal + '/images/ico-file.gif'; $(obj).style.displaY = 'none' } else $ };