var d=document;
var picroot="/Gallery/";

function getNext() {
	counter++;
	if(counter >= num_images) counter = 0;
	changeImage();
}
function getPrev() {
	counter--;
	if(counter <= -1) counter = num_images - 1;
	changeImage();
}

function changeTitle() {
	if(document.getElementById) {
	// NN6+
		document.getElementById("countDig").innerHTML = counter + 1;
	} else if(document.all) {
	//IE 6
		document.all.countDig.innerHTML = counter + 1;
	} else {
		// NN4 !!!
		alert("I'm sorry but your browser does not support the features necessary for the changing of images.");
	}
}

function requiredFields() {
	var ErrMess = "";

	if(d.MailingForm.Email.value != ""){
				if (d.MailingForm.Email.value.search("@") == -1 || d.MailingForm.Email.value.search("[.*]") == -1) {
			ErrMess += " - Email address is invalid\n";
		}
	}

	if(d.MailingForm.Email.value == "") {
		ErrMess += " - Email address box is empty\n";
	}	

	if(ErrMess != "") {
		alert("STOP\nPlease give your email address.\n" + ErrMess);
		return false; 
	} else {
		return true;
		//d.subscribe.submit();
	}

}

function clearBox() {
	d.MailingForm.Email.value="";
}
