	//var exts = "dxf|dwg|ai|eps|pdf|art|cdr|cmx|fh|fh3|fh4|fh5|fh6|fh7|fh8|ft8";
	var exts = ".*"; //Use this to accept all Extensions
	var UID,NF=0,cx=0;

	function openStatusWindow() { 
 		if(document.F1.popup.checked == true) {
   			win1 = window.open('http://www.fanddoutdoor.com/cgi-bin/upload_status.cgi?upload_id='+UID,'win1','width=320,height=240,resizable=1');
   			win1.window.focus();
 		}
	}

	function generateSID() {
 		UID = Math.round(10000*Math.random())+'0'+Math.round(10000*Math.random());
 		var f1=document.F1;
 		f1.action = f1.action.split('?')[0]+'?upload_id='+UID;
	}
	
	function showProgress() {
		var ifrm = document.getElementById("ifif");
		ifrm.setAttribute("src", 'http://www.fanddoutdoor.com/cgi-bin/upload_status.cgi?upload_id='+UID,'ifupload','width=320,height=240,resizable=1');
        	document.getElementById("ifupload").style.display = "block";
	}

	function StartUpload() {
    		NF=0;
    		for (var i=0;i<document.F1.length;i++) {
     			current = document.F1.elements[i];
		//alert("name: " + current.name + "type: " + current.type);
     			if(current.type=='file' && current.value!='') {
         			if(!checkExt(current.value)) return false;
         			NF++;
      			}
    		}
    		//if(NF==0){alert('1Select at least one file to upload');return false;};
    		generateSID();
    		showProgress();
	}

	function checkExt(value) {
    		if(value=="") return true;
    		var re = new RegExp("^.+\.("+exts+")$","i");
    		
		if(!re.test(value)) {
        		alert("Extension not allowed for file: \"" + value + "\"\nOnly these extensions are allowed: "+exts.replace(/\|/g,',')+" \n\n");
        		return false;
    		}
    		return true;
	}

