dimImageNumberOnPage = 0;
imageNumberOnPage = 1;
extraImgs = 0;
thumbsPerPage = 5;
thumbImgHeight = 80;
speed = 1;
allowClick = true;
doChange = true;
slide = false;
stopSlide = false;
slideThumb = true;
toNum = 0;
subMenuCount = 0;

function alter(fNum,imgNum){
	elem = document.getElementById("mainImg");
	elem.style.background = "";
	allowClick = false;
	curImg = imgNum;
	curF = fNum;
	if(stopSlide == true){
		stopSlide = false;
		allowClick = true;
		return false;
	}
	wready = true;
	hready = true;
	f = imgList[fNum][0];
	img = imgList[fNum][1][imgNum];
	elem = document.getElementById("dimImg");
	elem.innerHTML = "<img src='"+f+"/"+img+"'>";
	newW = window.document.images[dimImageNumberOnPage].width;
	newH = window.document.images[dimImageNumberOnPage].height;
	if(newH < 40 || newW < 40){
		setTimeout("alter("+fNum+","+imgNum+")",1000);
		return;
	}
	oldW = window.document.images[imageNumberOnPage].width;
	oldH = window.document.images[imageNumberOnPage].height;
	if(parseInt(newW) > parseInt(oldW)){
		wready = false;
		oldW = parseInt(oldW) + 1;
		elem = document.getElementById("mainImg");
		elem.innerHTML = "<img src='images/spacer.gif' width='"+oldW+"' height='"+oldH+"'>";
	}
	if(parseInt(newH) > parseInt(oldH)){
		hready = false;
		oldH = parseInt(oldH) + 1;
		elem = document.getElementById("mainImg");
		elem.innerHTML = "<img src='images/spacer.gif' width='"+oldW+"' height='"+oldH+"'>";
	}
	if(parseInt(newW) < parseInt(oldW)){
		wready = false;
		oldW = parseInt(oldW) - 1;
		elem = document.getElementById("mainImg");
		elem.innerHTML = "<img src='images/spacer.gif' width='"+oldW+"' height='"+oldH+"'>";
	}
	if(parseInt(newH) < parseInt(oldH)){
		hready = false;
		oldH = parseInt(oldH) - 1;
		elem = document.getElementById("mainImg");
		elem.innerHTML = "<img src='images/spacer.gif' width='"+oldW+"' height='"+oldH+"'>";
	}
	if(wready == true && hready == true){
		clearTimeout(delay);
		allowClick = true;
		elem = document.getElementById("mainImg");
		elem.innerHTML = "<img src='"+f+"/"+img+"'>";
		elem = document.getElementById("imgTitle");
		iT = img.split(".");
		elem.innerHTML = iT[0];
		if(slide == true){
			buildThumbs(fNum,imgNum,imgNum);
			if(imgNum+1 > imgList[fNum][1].length-1){
				toNum = 0;
			}else{				
				toNum = parseInt(imgNum)+1;
			}
			delay = setTimeout("alter("+fNum+","+toNum+")",5000);
		}
	}else{
		allowClick = false;
		elem = document.getElementById("imgTitle");
		elem.innerHTML = "<img src='images/spacer.gif' width='1' height='12'>";
		newW = window.document.images[dimImageNumberOnPage].width;
		newH = window.document.images[dimImageNumberOnPage].height;
		oldW = window.document.images[imageNumberOnPage].width;
		oldH = window.document.images[imageNumberOnPage].height;
		if(parseInt(newH) < parseInt(oldH)){
			oldH = parseInt(oldH) - 1;
		}
		if(parseInt(newH) > parseInt(oldH)){
			oldH = parseInt(oldH) + 1;
		}
		if(parseInt(newW) < parseInt(oldW)){
			oldW = parseInt(oldW) - 1;
		}
		if(parseInt(newW) > parseInt(oldW)){
			oldW = parseInt(oldW) + 1;
		}
		elem = document.getElementById("mainImg");
		elem.innerHTML = "<img src='images/spacer.gif' width='"+oldW+"' height='"+oldH+"'>";
		newW = window.document.images[dimImageNumberOnPage].width;
		newH = window.document.images[dimImageNumberOnPage].height;
		oldW = window.document.images[imageNumberOnPage].width;
		oldH = window.document.images[imageNumberOnPage].height;
		if(parseInt(newH) < parseInt(oldH)){
			oldH = parseInt(oldH) - 1;
		}
		if(parseInt(newH) > parseInt(oldH)){
			oldH = parseInt(oldH) + 1;
		}
		if(parseInt(newW) < parseInt(oldW)){
			oldW = parseInt(oldW) - 1;
		}
		if(parseInt(newW) > parseInt(oldW)){
			oldW = parseInt(oldW) + 1;
		}
		elem = document.getElementById("mainImg");
		elem.innerHTML = "<img src='images/spacer.gif' width='"+oldW+"' height='"+oldH+"'>";
		delay = setTimeout("alter("+fNum+","+imgNum+")",speed);
	}
}

function buildThumbs(fNum,imgNum,offset){
	elem = document.getElementById("slideBtn")
	if(elem.innerHTML == ""){
		elem.innerHTML = "<a href='' onClick='if(allowClick == true){triggerSlide();}return false;'><img src='images/slideshow.gif' border='0' id='slideImg'></a>";
	}
	if(allowClick != true){
		return;
	}
	f = imgList[fNum][0];
	offset = parseInt(offset);
	thumbList = "<table cellpadding='0' cellspacing='0' border='0'><tr>";
	if(offset == 0){
		thumbList = thumbList + "<td><img src='images/arrowLeftGrey.gif'><img src='images/spacer.gif' width='10'></td>";
	}else{
		p = offset-thumbsPerPage;
		if((p-thumbsPerPage)+thumbsPerPage < 0){
			p = 0;
		}
		thumbList = thumbList + "<td><a href='' onClick='doChange=false;buildThumbs("+fNum+","+imgNum+","+p+");return false;'><img src='images/arrowLeft.gif' border='0'></a><img src='images/spacer.gif' width='10'></td>";
	}
	thumbList = thumbList + "<td><table cellpadding='0' cellspacing='0' border='0' width='500'><tr>";
	if(slide != true){
		if(thumbsPerPage < imgList[fNum][1].length){
			for(i=offset;i<offset+thumbsPerPage;i++){
				img = imgList[fNum][1][i];
				iN = img.split(".");
				thumbList = thumbList + "<td align='center'><a href='' onClick='if(allowClick == true){if(slide == true){stopSlideThumbandMenu("+fNum+","+i+");alter("+fNum+","+i+");return false;}else{alter("+fNum+","+i+");return false;}}else{return false;}'><img src='"+f+"/"+img+"' height='"+thumbImgHeight+"' border='2' style='border-color:#000000;' alt='"+iN[0]+"'></a><img src='images/spacer.gif' width='10'></td>";
			}
		}else{
			for(i=0;i<imgList[fNum][1].length;i++){
				img = imgList[fNum][1][i];
				iN = img.split(".");
				thumbList = thumbList + "<td align='center'><a href='' onClick='if(allowClick == true){if(slide == true){stopSlideThumbandMenu("+fNum+","+i+");alter("+fNum+","+i+");return false;}else{alter("+fNum+","+i+");return false;}}else{return false;}'><img src='"+f+"/"+img+"' height='"+thumbImgHeight+"' border='2' style='border-color:#000000;' alt='"+iN[0]+"'></a><img src='images/spacer.gif' width='10'></td>";
			}
		}
	}else{
		if(thumbsPerPage > imgList[fNum][1].length){
			numThumbs = imgList[fNum][1].length;
		}else{
			numThumbs = thumbsPerPage;
		}
		if(offset+numThumbs > imgList[fNum][1].length){
			diff = (offset+numThumbs)-imgList[fNum][1].length;
			for(i=offset;i<imgList[fNum][1].length;i++){
				img = imgList[fNum][1][i];
				iN = img.split(".");
				thumbList = thumbList + "<td align='center'><a href='' onClick='if(allowClick == true){if(slide == true){stopSlideThumbandMenu("+fNum+","+i+");alter("+fNum+","+i+");return false;}else{alter("+fNum+","+i+");return false;}}else{return false;}'><img src='"+f+"/"+img+"' height='"+thumbImgHeight+"' border='2' style='border-color:#000000;' alt='"+iN[0]+"'></a><img src='images/spacer.gif' width='10'></td>";
			}
			for(i=0;i<diff;i++){
				img = imgList[fNum][1][i];
				iN = img.split(".");
				thumbList = thumbList + "<td align='center'><a href='' onClick='if(allowClick == true){if(slide == true){stopSlideThumbandMenu("+fNum+","+i+");alter("+fNum+","+i+");return false;}else{alter("+fNum+","+i+");return false;}}else{return false;}'><img src='"+f+"/"+img+"' height='"+thumbImgHeight+"' border='2' style='border-color:#000000;' alt='"+iN[0]+"'></a><img src='images/spacer.gif' width='10'></td>";
			}
		}else{
			for(i=offset;i<offset+numThumbs;i++){
				img = imgList[fNum][1][i];
				iN = img.split(".");
				thumbList = thumbList + "<td align='center'><a href='' onClick='if(allowClick == true){if(slide == true){stopSlideThumbandMenu("+fNum+","+i+");alter("+fNum+","+i+");return false;}else{alter("+fNum+","+i+");return false;}}else{return false;}'><img src='"+f+"/"+img+"' height='"+thumbImgHeight+"' border='2' style='border-color:#000000;' alt='"+iN[0]+"'></a><img src='images/spacer.gif' width='10'></td>";
			}
		}
	}
	thumbList = thumbList + "</tr></table></td>";
	thumbList = thumbList + "<td><img src='images/spacer.gif' width='2' height='1'></td>";
	if(offset+thumbsPerPage < imgList[fNum][1].length){
		n = offset+thumbsPerPage;
		if(n+thumbsPerPage > imgList[fNum][1].length){
			diffToEnd = (n+thumbsPerPage)-imgList[fNum][1].length;
			n = (offset+thumbsPerPage)-diffToEnd;
		}
		thumbList = thumbList + "<td><a href='' onClick='doChange=false;buildThumbs("+fNum+","+imgNum+","+n+");return false;'><img src='images/arrow.gif' border='0'></a></td>";
	}else{
		thumbList = thumbList + "<td><img src='images/arrowGrey.gif'></td>";
	}
	thumbList = thumbList + "</tr></table>"
	elem = document.getElementById("thumbs");
	elem.innerHTML = thumbList;
	if(slide != true){
		if(doChange != false){
			alter(fNum,0);
		}else{
			doChange = true;
		}
	}
}

function triggerSlide(){
	if(slide == false){
		allowClick = false;
		slide = true;
		elem = document.getElementById("slideImg");
		elem.src = "images/pauseslideshow.gif";
		alter(curF,curImg);
	}else{
		allowClick = true;
		clearTimeout(delay);
		slide = false;
		stopSlide = true;
		elem = document.getElementById("slideImg");
		elem.src = "images/slideshow.gif";
	}
}

function stopSlideThumbandMenu(fNum,imgNum){
	allowClick = true;
	clearTimeout(delay);
	stopSlide = true;
	slide = false;
	elem = document.getElementById("slideImg");
	elem.src = "images/slideshow.gif";
	alter(fNum,imgNum);
}

function setHomeImg(){
	num = Math.floor(Math.random()*(homeImgList.length));
	elem = document.getElementById("dimImg");
	elem.innerHTML = "<img src='images/artwork/"+homeImgList[num]+"'>";
	elem = document.getElementById("mainImg");
	elem.innerHTML = "<img src='images/artwork/"+homeImgList[num]+"'>";
}

function buildMenu(){
	menuArr = [];
	submenuArr = [];
	addMain = 1;
	subCount = 0;
	
	for(i=0;i<imgList.length;i++){
		menuItemArr = [];
		folders = imgList[i][0].split("/");
		if(folders[3] != undefined){
			if(addMain == 1){
				menuArr.push(folders[2]);
				addMain = 0;
			}
			menuArr.push(folders[3]+",isSub");
		}else{
			addMain = 1;
			menuArr.push(folders[2]+",isMain");
		}
	}
	
	menuHTML = "<table cellpadding='0' cellspacing='0' border='0'>";
	
	for(i=0;i<menuArr.length;i++){
		menuItem = "";
		
		findSubArr = menuArr[i].split(",");
		if(findSubArr.length > 1){
			if(findSubArr[1] == "isMain"){
				for(l=0;l<findSubArr[0].length;l++){
					imageNumberOnPage = imageNumberOnPage + 1;
					letters = menuArr[i].substring(l,l+1);
					menuItem = menuItem + "<img src='images/font/"+letters+".jpg' border='0'>";
				}
				menuHTML = menuHTML + "<tr><td align='right' height='15'><a href='' onClick='if(allowClick == true){if(slide == true){stopSlideThumbandMenu("+(i-subCount)+",0);buildThumbs("+(i-subCount)+",1,0);return false;}else{buildThumbs("+(i-subCount)+",1,0);return false;}}else{return false;}'>"+menuItem+"</a></td></tr>";
			}else{
				for(l=0;l<findSubArr[0].length;l++){
					letters = menuArr[i].substring(l,l+1);
					menuItem = menuItem + "<img src=images/font/"+letters+".jpg height='15' border=0>";
				}
				submenuArr[subCount-1].push("<tr><td align='right' height='15'><a href='' onClick='if(allowClick == true){if(slide == true){stopSlideThumbandMenu("+(i-subCount)+",0);buildThumbs("+(i-subCount)+",1,0);return false;}else{buildThumbs("+(i-subCount)+",1,0);return false;}}else{return false;}'>"+menuItem+"</a></td></tr>");
			}
		}else{
			submenuArr[subCount] = [];
			subCount++;
			for(l=0;l<menuArr[i].length;l++){
				imageNumberOnPage = imageNumberOnPage + 1;
				letters = menuArr[i].substring(l,l+1);
				menuItem = menuItem + "<img src=images/font/"+letters+".jpg border=0>";
			}
			menuHTML = menuHTML + "<tr><td align='right' height='15'><a href='' onClick='triggerMenu("+(subCount-1)+");return false;'>"+menuItem+"</a></td></tr>";
			menuHTML = menuHTML + "<tr><td align='right'><div id='sub"+(subCount-1)+"'></div></td></tr>";
		}		
	}
	
	menuHTML = menuHTML + "<tr><td height='15'><img src=images/spacer.gif width=1 height=15></td></tr>"
	menuHTML = menuHTML + "<tr><td align='right' height='15'><a href='' onClick='triggerContact();return false;'><img src=images/font/c.jpg border=0><img src=images/font/o.jpg border=0><img src=images/font/n.jpg border=0><img src=images/font/t.jpg border=0><img src=images/font/a.jpg border=0><img src=images/font/c.jpg border=0><img src=images/font/t.jpg border=0></a></td></tr>";
	imageNumberOnPage = imageNumberOnPage + 8;
	menuHTML = menuHTML + "</table>";
	elem = document.getElementById("menu");
	elem.innerHTML = menuHTML;
}

function triggerMenu(subID){
	elem = document.getElementById("sub"+subID);
	if(elem.innerHTML == ""){
		s = "<table cellpadding='0' cellspacing='0' border='0'>";
		for(i=0;i<submenuArr[subID].length;i++){
			s = s + submenuArr[subID][i];
			subImageArr = submenuArr[subID][i].split("img src");
			imageNumberOnPage = imageNumberOnPage + (subImageArr.length-1);
		}
		s = s + "</table>";
		elem.innerHTML = s;
	}else{
		for(i=0;i<submenuArr[subID].length;i++){
			subImageArr = submenuArr[subID][i].split("img src");
			imageNumberOnPage = imageNumberOnPage - (subImageArr.length-1);
		}
		elem.innerHTML = "";
	}
}

function triggerContactSuccess(){
	elem = document.getElementById("mainImg");
	cForm = "<table cellpadding='0' cellspacing='0' border='0'>";
	cForm = cForm + "<tr><td><img src='images/spacer.gif' width='563' height='1'></td></tr>";
	cForm = cForm + "<tr><td align='center'><input name='Message' style='font-weight:bold; width:561; height:450px; text-align:center;' value='Thank You. Your message has been sent.' readonly></td></tr>";
	cForm = cForm + "</table>";
	elem.innerHTML = cForm;
	num = Math.floor(Math.random()*(homeImgList.length));
	elem.style.background = "url(images/artwork/"+homeImgList[num]+")";
	elem = document.getElementById("imgTitle");
	elem.innerHTML = "";
	elem = document.getElementById("thumbs");
	elem.innerHTML = "";
	elem = document.getElementById("slideBtn");
	elem.innerHTML = "";
}

function triggerContact(){
	elem = document.getElementById("mainImg");
	cForm = "<table cellpadding='0' cellspacing='0' border='0'>";
	cForm = cForm + "<tr><td><img src='images/spacer.gif' width='563' height='1'></td></tr>";
	cForm = cForm + "<tr><td align='center'><form name='contactJon' action='sendContact.asp' method='post' onSubmit='return checkForm(this);'>";
	cForm = cForm + "<table cellpadding='0' cellspacing='0' border='0'>";
	cForm = cForm + "<tr><td><br><br></td></tr>";
	cForm = cForm + "<tr><td align='center'><textarea name='header' style='height:30px;overflow:hidden;text-align:center;' readonly>Please use this form if you would like to buy prints or the originals of any of the\rartwork on the site or if you would like to commission me for some work.</textarea></td></tr>";
	cForm = cForm + "<tr><td><input name='Name' value='Name' class='validate' onClick='this.value=\"\";' onBlur='if(trim(this.value)==\"\"){this.value=\"Name\";}'></td></tr>";
	cForm = cForm + "<tr><td><input name='Email' value='Email' class='validateEmail' onClick='this.value=\"\";' onBlur='if(trim(this.value)==\"\"){this.value=\"Email\";}'></td></tr>";
	cForm = cForm + "<tr><td><input name='Subject' value='Subject' class='validate' onClick='this.value=\"\";' onBlur='if(trim(this.value)==\"\"){this.value=\"Subject\";}'></td></tr>";
	cForm = cForm + "<tr><td><textarea name='Message' class='validate' onClick='this.value=\"\";' onBlur='if(trim(this.value)==\"\"){this.value=\"Message\";}'>Message</textarea></td></tr>";
	cForm = cForm + "<tr><td><input name='btn' type='submit' value='Send'></td></tr>";
	cForm = cForm + "<tr><td><br><br></td></tr>";
	cForm = cForm + "</table>";
	cForm = cForm + "</form></td></tr>";
	cForm = cForm + "</table>";
	elem.innerHTML = cForm;
	num = Math.floor(Math.random()*(homeImgList.length));
	elem.style.background = "url(images/artwork/"+homeImgList[num]+")";
	elem = document.getElementById("imgTitle");
	elem.innerHTML = "";
	elem = document.getElementById("thumbs");
	elem.innerHTML = "";
	elem = document.getElementById("slideBtn");
	elem.innerHTML = "";
}

function callContactServer(form){
	str = "";
	for(i=0; i<formElements.length; i++){
		str = str + formElements[i].name+"="+formElements[i].value.replace('&','and')+"&";
	}
	var url = "sendContact.asp?" + str;
	//try {
	//	var xmlhttp = new XMLHttpRequest();
	 // 	xmlhttp = new XMLHttpRequest();
		//xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 && xmlhttp.status == 200) BuildXMLResults(xmlhttp.responseText); }
	//	xmlhttp.open("GET", url, true);
    //	xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
	//  	xmlhttp.send(null);
	//  }
	//catch (err)	{
	//	try {	
			var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
			xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
			//xmlhttp.onreadystatechange = function() {	if(xmlhttp.readyState == 4 && xmlhttp.status == 200) BuildXMLResults(xmlhttp.responseText); }
			xmlhttp.open("GET", url, false);
	    	xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
		  	xmlhttp.send(null);
	//		}
	//	catch (err) {
	//		alert("Sorry, there was an error. Please refresh and try again.");
	//		return false;
	//		}
	//	}
		elem = document.getElementById("mainImg");
	cForm = "<table cellpadding='0' cellspacing='0' border='0'>";
	cForm = cForm + "<tr><td><img src='images/spacer.gif' width='563' height='1'></td></tr>";
	cForm = cForm + "<tr><td align='center'><form name='contactJon' action='' method='post' onSubmit='return checkForm(this);'>";
	cForm = cForm + "<table cellpadding='0' cellspacing='0' border='0'>";
	cForm = cForm + "<tr><td><br><br></td></tr>";
	cForm = cForm + "<tr><td align='center'><textarea name='header' style='height:399px;overflow:hidden;text-align:center;' readonly>\r\r\r\rThank You.\rYour message has been sent.</textarea></td></tr>";
	cForm = cForm + "<tr><td><br><br></td></tr>";
	cForm = cForm + "</table>";
	cForm = cForm + "</form></td></tr>";
	cForm = cForm + "</table>";
	elem.innerHTML = cForm;

	/*formElements = form.elements;
	
	//alert(str);
	//return false;
	var g_remoteServer = 'sendContact.asp';
	var head = document.getElementsByTagName('head').item(0);
	var old  = document.getElementById('lastLoadedCmds');
	if (old) head.removeChild(old);
	script = document.createElement('script');
	script.src = g_remoteServer+"?"+str;
	//window.location = g_remoteServer+"?prodID="+ID+"&bc="+btlCase+"&qty="+qty+"&act="+act+"&measID="+mID;
	script.type = 'text/vbscript';
	script.defer = true;
	script.id = 'lastLoadedCmds';
	void(head.appendChild(script));*/
}

function trim(str){
  return str.replace(/^\s+|\s+$/g, '')
}

function checkForm(form){
	formElements = form.elements;
	err = "";
	
	for(i=0; i<formElements.length; i++){
		if(formElements[i].className == "validate"){
			if(trim(formElements[i].value) == "" || trim(formElements[i].value) == "Name" || trim(formElements[i].value) == "Subject" || trim(formElements[i].value) == "Message"){
				err = err + formElements[i].name + "\n";
			}
		}
		if(formElements[i].className == "validateNum"){
			if(trim(formElements[i].value) == "" || isNaN(formElements[i].value)){
				err = err + "Valid: "+formElements[i].name + "\n";
			}
		}
		if(formElements[i].className == "validateChk"){
			if(!formElements[i].checked){
				err = err + formElements[i].name + "\n";
			}
		}
		if(formElements[i].className == "validatePCode"){
			pcexp = new Array ();
			pcexp.push (/^([a-z]{1,2}[0-9]{1,2})(\s*)([0-9]{1}[abdefghjlnpqrstuwxyz]{2})$/i);
			pcexp.push (/^([a-z]{1,2}[0-9]{1}[a-z]{1})(\s*)([0-9]{1}[abdefghjlnpqrstuwxyz]{2})$/i);
			pcexp.push (/^(GIR)(\s*)(0AA)$/i);
			postCode = formElements[i].value;
			valid = false;
			for(j=0; j<pcexp.length; j++){
				if(pcexp[j].test(postCode)){
				  pcexp[j].exec(postCode);
				  postCode = RegExp.$1.toUpperCase() + " " + RegExp.$3.toUpperCase();
				  valid = true;
				  break;
				}
			}
			if(valid){
			}else{
				err = err + "Valid: "+formElements[i].name + "\n";
			}
		}
		if(formElements[i].className == "validateVerify"){
			if(trim(formElements[i].value) == ""){
				err = err + formElements[i].name + "\n";
			}else{
				if(trim(formElements[i].value) != trim(formElements[i+1].value)){
					err = err + formElements[i].name+"s do not match\n";
				}
			}
		}
		if(formElements[i].className == "validateEmail"){
			email = formElements[i].value;
  			atPos = email.indexOf("@");
			if (atPos > 0){
				dotPos = email.indexOf(".",atPos);
				if ((dotPos < atPos) || (email.length == dotPos+1) || (dotPos == -1) || (dotPos == atPos+1)){
					err = err + "Valid: "+formElements[i].name + "\n";
				}
			}else{
				err = err + "Valid: "+formElements[i].name + "\n";
			}
		}
		if(formElements[i].className == "validateDate"){
			dateStr = formElements[i].value;
			dateValid = true;
			datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;
			matchArray = dateStr.match(datePat);
			if (matchArray == null) {
				dateValid = false;
			}else{
				month = matchArray[3];
				day = matchArray[1];
				year = matchArray[4];
				if (month < 1 || month > 12) {
					dateValid = false;
				}
				if (day < 1 || day > 31) {
					dateValid = false;
				}
				if ((month==4 || month==6 || month==9 || month==11) && day==31) {
					dateValid = false;
				}
				if (month == 2) {
					isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
					if (day>29 || (day==29 && !isleap)) {
						dateValid = false;
					}
				}
				if(year < 1855){
					dateValid = false;
				}
			}
			if(!dateValid){
				err = err + "Valid "+formElements[i].name +": DD/MM/YYYY\n";
			}
		}
	}
	
	if(err == ""){
		form.submit();
		//callContactServer(form);
		return false
	}else{
		alert("Please provide the following:\n\n"+err);
		return false
	}
}

message="Contact me for prints or originals.";

function clickIE4(){
	if(event.button==2){
		alert(message);
		return false;
	}
}

function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all){
		if (e.which==2||e.which==3){
			alert(message);
			return false;
		}
	}
}

if (document.layers){
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS4;
}else if (document.all&&!document.getElementById){
	document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")