function MM_preloadImages() {
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function changePic(title,image) {
		var theimg = document.getElementById('theimg');
		theimg.innerHTML = "<img src=\"./files/gallery/"+ image +"\" alt=\""+ title +"\" />\n<p class=\"text\">\""+ title +"\"</p>";
}

var theFormError = new Array();

function chkTheForm(theform) {
	var hidden = theform.private;
	var errordiv = document.getElementById("error");
	var email = theform.email.value;
	var who = theform.who.value;
	var temail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

	if(email.search(temail) == -1){
		settheFormError("Please enter a valid e-mail address.");
	}
	if(who.length == 0 || email.length == 0){
		settheFormError("Please fill in the required fields.");
	}

	if(theFormError.length == 0){
		hidden.value = "privatevar";
		return true;
	} else {
		errordiv.style.display = "block";
		for(i=0;i<theFormError.length;i++){
			errordiv.innerHTML = "<p><small>* "+ theFormError[i] + "</small></p>";
		}
		theFormError.length = 0;
		return false;
	}
}

function settheFormError(y) {
	theFormError.splice(theFormError.length,0,y);
}

var lastid;

function showExtra(id) {
	Effect.toggle(id,'slide');
	if(!(lastid)){
		lastid = id;
		return false;
	}
	if(lastid != id){
		Effect.toggle(lastid,'slide');
		lastid = id;
	} else {
		lastid = "";
	}
	return false;
}

//-->

