// JavaScript Document


/*
############################################
		Add Multiple Upload boxes.
############################################
*/
function addEvent()
{
var ni = document.getElementById('myDiv');
var numi = document.getElementById('theValue');
var num = (document.getElementById("theValue").value -1)+ 2;
numi.value = num;
	if(num < 10){
		var divIdName = "my"+num+"Div";
		var newdiv = document.createElement('div');
		newdiv.setAttribute("id",divIdName);
		newdiv.innerHTML = "<span class='file_image'>Image "+num+" <input style='padding:4px;' type='file' name='file"+num+"' /> <a href=\"javascript:;\" onclick=\"removeEvent(\'"+divIdName+"\')\">Remove</a></span>";
		ni.appendChild(newdiv);
	}else{
		alert('You can only add 9 images');
	}
}

function removeEvent(divNum)
{
var d = document.getElementById('myDiv');
var olddiv = document.getElementById(divNum);
d.removeChild(olddiv);
}
<!--               END Add Multiple Upload boxes.            -->

/*
############################################
		  Open Pop-Up Window
############################################
*/

function NewWindow(mypage, myname, w, h, scroll, menu, resize, status, toolbar, location) {
	var winl = (screen.width-w)/2;
	var wint = ((screen.height-h)/2);
	w = w + 16;
	h = h + 16;
	var winprops = 'width='+w+',height='+h+',';
	winprops += 'top='+wint+',left='+winl+',';
	winprops += 'scrollbars='+scroll+',';
	winprops += 'menubar='+menu+',';
	winprops += 'resizable='+resize+',';
	winprops += 'status='+status+',';
	winprops += 'toolbar='+toolbar+',';
	winprops += 'location='+location;
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}
<!--               END Open Pop-Up Window            -->
