function display(page,winname, width, height) 
{ 
    var Win = window.open(page,winname,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes'); 
}

function confirmDelete (url){
	if(confirm("Are you sure you want to delete this item?")){
		document.location.href = url;
	}
}

function emptyCheck(){
	if(document.thisForm.videoTitle.value == "" || document.thisForm.source_file.value == ""){
		alert("Please make sure the form is completely filled out");
	}else{
		document.thisForm.submitbutton.disabled = true;
		document.thisForm.submitbutton.value='Processing...';
		document.thisForm.submit();
	}
}

function formSubmit(f, canNotHaveBlank){
	var theReturn = checkJpg(f, canNotHaveBlank);
	if (theReturn){
		eval(f).btnFinish.disabled = true;
		eval(f).btnFinish.value='Processing...';
		eval(f).submit();
	}else{
		if (canNotHaveBlank){
			alert("The picture you entered needs to have an extension of \'.jpg\'\nFor Example: horse.jpg");
		} else {
			alert("The picture you entered needs to have an extension of \'.jpg\'\nFor Example: horse.jpg\n\n-OR-\n\nLeave the picture box blank.");
		}
	}
}

function checkJpg(f, canNotHaveBlank){
	var theReturn = true;
	var theInput = new String(eval(f).imgfile.value);
	splitString = theInput.split(".")
	myExt = splitString[splitString.length-1];
	if(canNotHaveBlank && theInput == ""){
		theReturn = false;
	} else if (theInput != "" && myExt.toLowerCase() != "jpg"){
		theReturn = false;
	}

	return theReturn;	
}
