function doForm()
{
carryOn = true;

if(document.getElementById('fld1').value==""){carryOn = false}
if(document.getElementById('fld2').value==""){carryOn = false}
if(document.getElementById('fld3').value==""){carryOn = false}

if(carryOn)
	{
	doCook('pdfset');
	document.getElementById('form1').submit();
	}

else
	{
	doCook('notset');
	alert("Please make sure that you complete all of the fields.");
	}
}




function checkCook(ip)
{
readCook();

if(cook==true)
	{
	document.getElementById('specLink').style.display = "block";
	document.getElementById('specForm').style.display = "none";
	}

else
	{
	if(ip==1)
		{
		document.getElementById('specLink').style.display = "none";
		document.getElementById('specForm').style.display = "block";
		}

	else
		{
		window.location.href = "http://www.fairoakwindows.co.uk/index.html";
		}
	}
}



function doSpec()
{
window.location.href = "products-specifications.html";
}



function readCook()
{
var tstr = "";

var allcookies = document.cookie;
var pos = allcookies.indexOf("corstng=")

if(pos != -1)
	{
	var start = pos + 8;
	var end = allcookies.indexOf(";",start);
	if(end == -1){end = allcookies.length;}
	var corstng = allcookies.substring(start,end);
	corstng = unescape(corstng)
	cstr = corstng;
	}

else
	{
	cstr = "notset";
	}

if(cstr=="pdfset"){cook = true;}
else{cook = false;}
}


function doCook(id)
{
var cstr = id;
var end_date = new Date("December 31, 2017");
document.cookie = "corstng=" + escape(cstr) + "; expires=" + end_date;
}
