function getCookie(NameOfCookie){
    if (document.cookie.length > 0) {              
    begin = document.cookie.indexOf(NameOfCookie+"=");       
    if (begin != -1) {           
      begin += NameOfCookie.length+1;       
      end = document.cookie.indexOf(";", begin);
      if (end == -1) end = document.cookie.length;
        return unescape(document.cookie.substring(begin, end));
    }} return null;}
function timerSet()
{
			username=getCookie('username');
		if (username==null || username ==0)
				{
					setTimeout("document.getElementById('feedback').style.display='block';", 240000 );
					setTimeout(setCookie,120000); 
					document.getElementById('feedbackOpen').style.background = 'url(http://www.abcgatwick.co.uk/images/feedbackClose.png)';					
				}
				else
				{
					document.getElementById('feedback').style.display='block';
					document.getElementById('feedback').style.left = '-250px';
				}
					
function setCookie() {
					function setCookie(NameOfCookie, value, expiredays) {
					var ExpireDate = new Date ();
					ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 20 * 60 ));//15 mins
				 	document.cookie = NameOfCookie + "=" + escape(value) + 
				 	((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());}
					username=getCookie('username');
					username=1;
					setCookie('username',username,365);
					}
					
};

function feedback(){if(document.getElementById('feedback').style.left == '0px')
{
document.getElementById('feedback').style.left = '-250px';
document.getElementById('feedbackOpen').style.background = 'url(http://www.abcgatwick.co.uk/images/feedbackOpen.png)';}
else
{document.getElementById('feedback').style.left = '0px';
document.getElementById('feedbackOpen').style.background = 'url(http://www.abcgatwick.co.uk/images/feedbackClose.png)';}};
function validateForm()
{	
		var q1=document.forms["myform"]["comment"].value
		if (q1==null || q1=="")
		  {
			alert("Please enter a message");
			document.myform.comment.focus();
			return false;
		  }  
		  
		var q2=document.forms["myform"]["validate"].value  
		if (q2 != 4)
		{
			alert("Ooops... your answer is wrong. Please enter the total of 2 + 2 in the box provided");
			return false;
			}  
			
			


		  
}



function clear() {
document.getElementById('feedback').style.display='none';
	}

