function reloadpage(){
	window.location.reload( false );  
}



//survey
function surveyPop(name) {
popwin = this.open(name, "survey", "width=526,height=450, toolbar=no,menubar=no,location=no,resize=no,noresize, scrollbars=yes");
popwin.focus();}

//POPUP SCRIPTS
function page(imagename) {
popwin = this.open(imagename, "page", "width=500,height=450, toolbar=no,menubar=no,location=no,resize=no,noresize");
popwin.focus()}

function photo(imagename) {
popwin = this.open(imagename, "gallery", "width=500,height=375, toolbar=no,menubar=no,location=no,scrollbars=no,resize=no,noresize");
popwin.focus()}

function gallery() {
popwin = this.open("gallery/gallery.html", "gallery", "width=500,height=375, toolbar=no,menubar=no,location=no,scrollbars=no,resize=no,noresize");
popwin.focus()}

function map() {
popwin = this.open("map.html", "map", "width=500,height=375, toolbar=no,menubar=no,location=no,scrollbars=no,resize=no,noresize");
popwin.focus()}


//Amo's choice of pop up script.
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
        newWindow=window.open(URLtoOpen, windowName, windowFeatures);
		newWindow.moveTo((window.screen.availWidth -  200) / 3 , (window.screen.availHeight - 550) / 2 );
							popup.blur();focus();
    }


//DYNAMIC FORM VALUE RESTORE
function Text_Input(elm, onoff){
if (typeof(onoff) == "undefined" ) {
onoff = "blur"; }
if (!elm.base) {
elm.base = elm.value; }
if (elm.value == elm.base && onoff != "blur") {
elm.value = ""; }
else if (elm.value == "" && onoff == "blur") {
elm.value = elm.base; }}
//usage:<input type="text" value="TEXT" onBlur="Text_Input(this, 'blur')" onFocus="Text_Input(this, 'focus')">




//ROLLOVER AND PRELOAD SCRIPTS
function MM_preloadImages() { //v3.0
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 MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}

function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}

//HIDE EMAIL SCRIPT
function hideEmail()
{
 path = 'mailto:info@'
 path += 'winonavineestates'
 path += '.com'
 location.href = path;
}


//PRIVATE FUNCTIONS VALIDATOR
function RequestForm_Validator(theForm){

if (theForm.name1.value == ""){
alert("Please enter a value for the \"Name\" field.");
theForm.name1.focus();
return (false);}

if (theForm.tel.value == ""){
alert("Please enter a value for the \"Telephone\" field.");
theForm.tel.focus();
return (false);}

if (theForm.tel.value.length < 10){
alert("Please include your area code in the \"Telephone\" field.");
theForm.tel.focus();
return (false);}

if (theForm.date_of_event.value == ""){
alert("Please enter a value for the \"Date of Event\" field.");
theForm.date_of_event.focus();
return (false);}

if (theForm.date_of_event.value.length < 6){
alert("Please enter a valid date in the \"Date of Event\" field.");
theForm.date_of_event.focus();
return (false);}

if (theForm.number_of_people.value == ""){
alert("Please enter a value for the \"Number of People\" field.");
theForm.number_of_people.focus();
return (false);}

return (true);}



//TELL A FRIEND VALIDATOR
function TellAFriend_Form_Validator(theForm){

if (theForm.name.value == ""){
alert("Please enter a value for the \"name\" field.");
theForm.name.focus();
return (false);}

if (theForm.name.value.length < 2){
alert("Please enter at least 2 characters in the \"Your Name\" field.");
theForm.name.focus();
return (false);}

if (theForm.emailrecommender.value == ""){
alert("Please enter a value for the \"Your E-mail\" field.");
theForm.emailrecommender.focus();
return (false);}

if (theForm.emailrecommender.value.length < 6){
alert("Please enter at least 6 characters in the \"Your E-mail\" field.");
theForm.emailrecommender.focus();
return (false);}

return (true);}




//RESERVATION VALIDATOR
function ReservationForm_Validator(theForm){

if (theForm.salutation.value == "x"){
alert("Please select a Salutation.");
theForm.salutation.focus();
return (false);}

if (theForm.reserveFirstName.value == "First"){
alert("Please enter your First Name.");
theForm.reserveFirstName.focus();
return (false);}

if (theForm.reserveFirstName.value == ""){
alert("Please enter your First Name.");
theForm.reserveFirstName.focus();
return (false);}

if (theForm.reserveLastName.value == "Last"){
alert("Please enter your Last Name.");
theForm.reserveLastName.focus();
return (false);}

if (theForm.reserveLastName.value == ""){
alert("Please enter your Last Name.");
theForm.reserveLastName.focus();
return (false);}

if (theForm.reserveTelephoneNumber.value == ""){
alert("Please enter your Phone Number.");
theForm.reserveTelephoneNumber.focus();
return (false);}

if (theForm.reserveTelephoneNumber.value.length < 10){
alert("Please include your area code in the \"Phone Number\" field.");
theForm.reserveTelephoneNumber.focus();
return (false);}

if (theForm.reservationDay.value == "x"){
alert("Please specify what Day of the Week your reservation is for.");
theForm.reservationDay.focus();
return (false);}

if (theForm.reservationMonth.value == "x"){
alert("Please specify what Month your reservation is for.");
theForm.reservationMonth.focus();
return (false);}

if (theForm.reservationDate.value == ""){
alert("Please enter the date of your reservation.");
theForm.reservationDate.focus();
return (false);}

if (theForm.reservationTime.value == ""){
alert("Please enter the Time of Reservation.");
theForm.reservationTime.focus();
return (false);}

if (theForm.numberOfPeople.value == ""){
alert("Please enter the Number of People in your party.");
theForm.numberOfPeople.focus();
return (false);}

return (true);}









//RANDOM STUFF
var a = Math.round(9*Math.random()) + ""

randomStuff = new Array

randomStuff[0]  = "1"
randomStuff[1]  = "2"
randomStuff[2]  = "3"
randomStuff[3]  = "4"
randomStuff[4]  = "5"
randomStuff[5]  = "6"
randomStuff[6]  = "7"
randomStuff[7]  = "8"
randomStuff[8]  = "9"
randomStuff[9]  = "10"
/*
randomStuff[10] = "11"
randomStuff[11] = "12"
randomStuff[12] = "13"
randomStuff[13] = "14"
randomStuff[14] = "15"
randomStuff[15] = "16"
randomStuff[16] = "17"
randomStuff[17] = "18"
randomStuff[18] = "19"
randomStuff[19] = "20"
randomStuff[20] = "21"
*/

var randomThing = randomStuff[a]

/*
<script language="JavaScript">
document.write("<p>" + randomThing + "</p>")
</script>
*/







//SCREEN REZ CHECKER
/*
Screen resolution detecter script: By JavaScript Kit (www.javascriptkit.com) More free scripts here! Note: Credit must stay intact for use.
*/
 
var correctwidth=800;
var correctheight=600;
if (screen.width<correctwidth||screen.height<correctheight){
alert("This webpage is bested viewed with screen resolution "+correctwidth+" x "+correctheight+" or above. Your current resolution is "+screen.width+" x "+screen.height+". If possible, please change the resolution!");
}
//END SCREEN REZ CHECKER




