function CheckFile(InputType) { var file; var fname; var ext; if (InputType == "File") { file = document.getElementById('FileSelector'); } else { file = document.getElementById('URLSelector'); file.value = Trim(file.value); } fname = file.value.toLowerCase(); if (InputType == "URL" && !isValidURL(fname)) { alert("Sorry - this is not a valid link. Links should start with HTTP:// and contain a valid file name."); return; } if (fname == "") { alert("Please select a file to continue."); return; } if (fname.lastIndexOf('.') == -1) { alert("Invalid file type. See the info page for a list of valid file types."); return; } else { ext = fname.slice(fname.lastIndexOf('.')); } var TypeGroup = ""; HideDivGroup("conv_"); var TypeList = new Array(4); TypeList [0] = new Array(2); TypeList [0][0] = 'Document'; TypeList [0][1] = '.doc|.docx|.lwp|.odt|.pdf|.rtf|.txt|.wps|'; TypeList [1] = new Array(2); TypeList [1][0] = 'Image'; TypeList [1][1] = '.bmp|.gif|.ico|.jpeg|.jpg|.pcx|.pic|.pict|.png|.psd|.sun|.tga|.tif|.tiff|.wmf|'; TypeList [2] = new Array(2); TypeList [2][0] = 'Music'; TypeList [2][1] = '.aac|.aif|.aiff|.au|.flac|.m4a|.m4r|.mka|.mp2|.mp3|.ogg|.ra|.snd|.voc|.wav|.wma|'; TypeList [3] = new Array(2); TypeList [3][0] = 'Video'; TypeList [3][1] = '.3g2|.3gp|.asf|.avi|.divx|.flv|.mkv|.mov|.mp4|.mpeg|.mpg|.rm|.vob|.wmv|.xvid|'; for (j = 0;j < TypeList.length; j++) { if (TypeList[j][1].lastIndexOf(ext + '|') != -1) { TypeGroup = TypeList[j][0]; } } if (TypeGroup == "") { alert("Sorry - we do not yet support the file type that you selected. See the info page for a list of valid file types."); return; } document.frmmain.InputType.value = InputType; try { document.getElementById('SourceURLFindFiles').innerHTML = "Selected File: " + fname; } catch (err) { } StartConvSelect(TypeGroup); }