// JavaScript Document

function validate()
{
		var today = new Date();
var ent_date = new Date(document.frmWsi.fromYear.value, 12-1, 31);
var one_day=1000*60*60*24;
var x = Math.ceil(today.getTime()/one_day);
var y = Math.ceil(ent_date.getTime()/one_day);

var z = x-y;

if (z < 7665)
{
alert("Sorry, we can\'t let you in.\nYou are under age, we cannot allow you access to our website.");
}	
else
{
document.frmWsi.submit();
}
}
/* function chkDDMMYY_new(txtDDElement,txtMMElement,txtYYElement,fieldName,allowEmpty)*/
function chkDDMMYY_new(txtYYElement,fieldName,allowEmpty)
		{	

			if(allowEmpty == false)
			{
				/*
				if (txtDDElement.value==0)
				{
					alert("Select a Day.")
					txtDDElement.focus()
					return false
				}
				
				if (txtMMElement.value==0)
				{
					alert("Select a Month.")
					txtMMElement.focus()
					return false
				}*/
				
				if (txtYYElement.value==0)
				{
					alert("Select a Year.")
					txtYYElement.focus()
					return false
				}
			}
			return true;
			}
		
			/* if( allowEmpty == true && txtDDElement.selectedIndex==0 && 
				txtMMElement.selectedIndex==0 && txtYYElement.selectedIndex==0)
			{
				//empty value is allowed
				return true;
			}
			else
			{
				var i=0;
				var j=0;
				var strDate = "" + txtMMElement[txtMMElement.selectedIndex].value;
				strDate = strDate + "/" + txtDDElement[txtDDElement.selectedIndex].value;
				strDate = strDate + "/" + txtYYElement[txtYYElement.selectedIndex].value;
		
				j= strDate.indexOf("/",i);
				var strMnth=strDate.substring(i,j);
				
				i=strMnth.length + 1;
				j= strDate.indexOf("/",i);
				var strDay=strDate.substring(i,j);
				
				j=j+3;
				i=strDate.length
				var strYear=strDate.substring(j,i);
		
				strMnth--;
				dtDate=new Date(strYear,strMnth,strDay);
				var dtDay=dtDate.getDate();
				var dtMnth=dtDate.getMonth();
				var dtYear=dtDate.getYear();
		
				if (strYear == "")
				{
					alert("Invalid " + fieldName)
					txtDDElement.focus()
					return false;
				}
				
				if((strDay!=dtDay) || (strMnth!=dtMnth) || (strYear!=dtYear))
				{
					alert("Invalid " + fieldName)
					txtDDElement.focus()
					return false;	
				}
				return true;
			}
		}	*/
		function validateForm(option)
			{
				/*if (!chkDDMMYY_new(document.frmWsi.fromDay,document.frmWsi.fromMonth,document.frmWsi.fromYear,"date.",0)) return false;		
		
				if (!chkDDMMYY_new(document.frmWsi.fromDay,document.frmWsi.fromMonth,document.frmWsi.fromYear,"month.",0)) return false;
		
				if (!chkDDMMYY_new(document.frmWsi.fromDay,document.frmWsi.fromMonth,document.frmWsi.fromYear,"year.",0)) return false;*/
				if (!chkDDMMYY_new(document.frmWsi.fromYear,"year.",0)) return false;
				if (option==1)
				{
				
				validate();
				}

				
			}
function openWinTerms()
{
	var j=window.open("/terms_condition_1.html","ss","top=10,left=10,width=700,height=550s,scrollbars=1")
}

