<!--

// password protected client access

function gotoURL(){
	var pcode = document.passcodeForm.passcode.value;
	if ( pcode ) {
		var newURL = "../clients/" + sha1Hash(pcode) + "/";
		if ( fileExists(newURL) ) {
			document.location.href = newURL;
		}
		else {
			alert("Could not find your photographs. Please check the passcode you entered.");
			// document.write(newURL);
		}
	}
}

function fileExists(strURL)
{
	var xmlhttp = null, exists = false;
	
	xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
	
	if ( xmlhttp != null ) {
		xmlhttp.open("HEAD", strURL, false);
		xmlhttp.send(null);
		exists = ( xmlhttp.status == 404 ) ? false : true;
	}
	else {
		alert("Your browser does not support XMLHTTP.");
	}
	
	return exists;
}

//-->
