function printPage() {
	window.print();  
}

function redirectOutput(myForm) {
alert("in function");
	var w = window.open ('bidform.jsp','Popup_Window','location=0,status=1,scrollbars=1,width=790,height=400,menubar=no,addressbar=no,toolbars=no,resizable=yes');
	myForm.target = 'Popup_Window';
	//return true;
}


function ValidateLogin(){

	if(document.loginForm.email.value == ""){
	   alert("You must enter your email address.")
	   document.loginForm.email.focus();
	   return;
	}
	if(document.loginForm.password.value == ""){
	 	alert("You must enter a password.")
	   document.loginForm.password.focus();
	   return;
	}

	document.loginForm.submit();

}
function ValidateContent(Action){

	if(document.ContentForm.contentName.value == ""){
	   alert("You must enter a name for this content item.")
	   document.ContentForm.contentName.focus();
	   return;
	}
	
	if(document.ContentForm.contentUrl.value == ""){
	   alert("You must enter a link for this content item.")
	   document.ContentForm.contentUrl.focus();
	   return;
	}
	if(Action == 'btnUpdate'){
		document.ContentForm.btnUpdate.value = '1';
	}
	if(Action == 'btnAdd'){
		document.ContentForm.btnAdd.value = '1';
	}
	document.ContentForm.submit();

}

function ValidateRegistration(Action){
		
	if(document.registrationForm.firstname.value == ""){
	   alert("You must enter your firstname.")
	   document.registrationForm.name.focus();
	   return;
	}
	if(document.registrationForm.surname.value == ""){
	   alert("You must enter your surname.")
	   document.registrationForm.surname.focus();
	   return;
	}
		
	document.registrationForm.btnAdd.value = '1';
	
	document.registrationForm.submit();

}

function ValidateUpload(){
		
	if(document.uploadForm.fileUpload.value == ""){
	   alert("You must select a file to upload.")
	   document.uploadForm.fileUpload.focus();
	   return;
	}
		
	document.uploadForm.submit();

}

function ValidateLot(Action){
	
	if(Action != 'btnDelete'){
		if(document.lotForm.lotNumber.value == ""){
		   alert("You must enter a lot number.")
		   document.lotForm.lotNumber.focus();
		   return;
		}
		if(document.lotForm.estimatedPrice.value == ""){
		   alert("You must enter an estimated price.")
		   document.lotForm.estimatedPrice.focus();
		   return;
		}
	}	
	//THEN DECIDE WHAT ACTION TO TAKE WITH THE FORM DATA.
	if(Action == 'btnUpdate'){
		document.lotForm.btnUpdate.value = '1';
	}
	if(Action == 'btnDelete'){
		document.lotForm.btnDelete.value = '1';
	}
	
	if(Action == 'btnAdd'){
		document.lotForm.btnAdd.value = '1';
	}
	
	document.lotForm.submit();

}

function ConfirmDelete() {
				
	selected = false;
	
	if(document.photoManagerForm.deletePhotoId.length == null){
	  	if(document.photoManagerForm.deletePhotoId.checked == true){
	  			selected = true;
	  	}	
	}else{
	  	for(i = 0; i < document.photoManagerForm.deletePhotoId.length; i++){
	  		if(document.photoManagerForm.deletePhotoId[i].checked == true){
	  			selected = true;
	  		}	
	  	}
	  	
	}
					
	if(selected == true){
		if(confirm("Permanently delete this photo[s] from the database?")){
			return true;
		}else{
			return false;
		}
	}
}
			
	
//DUMMY FUNCTION TO ATTACH POP UP WINDOWS TO ANCHOR TAGS.	
function Void(){
	
	
}