
function WindowOpen(secure,load,ref,pass)
{
//Find best size for window
bestwidth=window.screen.availWidth-20;
bestheight=window.screen.availHeight-20;
if (bestwidth<600) bestwidth=600;
if (bestwidth>900) bestwidth=900;
if (bestwidth/1.588>bestheight) bestwidth=bestheight*1.588;
else bestheight=bestwidth/1.588;

//define new window contents with relay form:

contents='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
contents+='<HTML><HEAD><TITLE>Loading</TITLE></HEAD><BODY>';
contents+='<P ALIGN=CENTER><IMG ID="pic1" HEIGHT=176 WIDTH=400 SRC="../assets/images/photologo.jpg" BORDER=0 ALT="Seaholme Marquees" ></P>'
contents+='<P ALIGN=CENTER><B>About to view Planning Guide from our Secure Web Site</B></P>';
contents+='<FORM name="form1" id="IDForm1" action="https://sslrelay.com/plan.seaholmemarquees.co.uk/flashplan.php" method="POST">';
//contents+='<FORM name="form1" id="IDForm1" action="../flashplan.php" method="POST">';
contents+='<INPUT type="HIDDEN" name="secure" value="'+secure+'"><INPUT type="HIDDEN" name="load" value="'+load+'"><INPUT type="HIDDEN" name="ref" value="'+ref+'"><INPUT type="HIDDEN" name="pass" value="'+pass+'">';
contents+='<INPUT type="HIDDEN" name="bestwidth" value="'+bestwidth+'"><INPUT type="HIDDEN" name="bestheight" value="'+bestheight+'">';
contents+='<P ALIGN=CENTER><INPUT type="SUBMIT" name="FB1" value="click here to continue" id="Forms Button1"></P>';
contents+='</FORM>';
contents+='<P ALIGN=CENTER>If this window does not update please click on the above button.<P></P></p></BODY></HTML>';
//<B>What is a Secure Web Site?</B></p>Pages you are about to view will be sent in a secure way using encryption. Information you may provide can’t be read or intercepted by other people. Some browsers may give alerts when entering and leaving a secure site. This is to confirm that your browser is in secure mode. The paddlock button in the status bar at the bottom of the window also allows you to confirm that communications are secure</P></p></BODY></HTML>';

Win1=window.open('','_blank','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width='+bestwidth+',height='+bestheight+',left=5,top=25');

Win1.document.writeln(contents);
Win1.document.getElementById("IDForm1").submit();


}//end of openWindow