function js_InvokeFlip (o_This, b_MouseOver)
{
   js_ImageFlip(eval(o_This.name+"_caption"), b_MouseOver);
}

function js_ImageFlip(o_Image, b_MouseOver)
{
   if (b_MouseOver)
   {
      o_Image.src=o_Image.src.replace(".gif","_flip.gif");
   }
   else
   {
      o_Image.src=o_Image.src.replace("_flip.gif",".gif");
   }
}

function js_SendMessage()
{
	if ((contact.realname.value.length == 0) ||
		(contact.message.value.length == 0))
	{
		s_Alert = "You have not entered enough information\n\nPlease fill in:\n";
		
		if (contact.realname.value.length == 0)
		{ s_Alert = s_Alert + "- Your name\n"; }
		if (contact.message.value.length == 0)
		{ s_Alert = s_Alert + "- A message\n"; }
	
		alert (s_Alert);
	}
	else
	{
	    contact.submit();
//	    alert("There's nothing running on the server (yet) to handle this, so just pretend...");
//	    document.location.href="contact_thanks.htm";
	}
}

function js_OpenPicture(imgName,imageWidth,imageHeight)
{
    var thisURL="http://www.cyberflotsam.com/redlioncottages/images/";

    PicWin=window.open("","Pic","width=290, height=208, toolbar=no, scrollbars=no, status=no, resizable=no");

    PicWin.document.writeln("<html>");
    PicWin.document.writeln("<head>");
    PicWin.document.writeln("<style>");
    
    
    PicWin.document.writeln("body, { background-color: #CCCCCC; background-image: url(./images/background.gif); margin-top=15px; margin-left=40px; }");
    PicWin.document.writeln("body, input, textarea, select, h1, h2, h3, h4, h5, h6, p, ul, th, td, ol, li {	color: #000000;	font-family: \"Verdana\", \"Arial\", \"Helvetica\", \"Sans-Serif\"; }");
    PicWin.document.writeln("h2, h3, h4, h5, h6 { font-weight: bold; text-align: left; }");
    PicWin.document.writeln("h1 { font-size: 175%; font-weight: bolder; }");
    PicWin.document.writeln("h2 { font-size: 150%; }");
    PicWin.document.writeln("h3 { font-size: 125%; }");
    PicWin.document.writeln("h4 { font-size: 100%; font-style: italic; }");
    PicWin.document.writeln("h5 { font-size: 80%; font-style: italic; }");
    PicWin.document.writeln("h6 { font-size: 60%; font-style: italic; }");

    PicWin.document.writeln("p.copyright { font-size: 80%; font-style: italic; text-align: center;}");
    PicWin.document.writeln("p.typed { font-family: Courier New, Courier; font-size: 80%; }");
    PicWin.document.writeln("p.formtext, th.formtext, td.formtext, input.formtext { font-size: 80%; }");

    PicWin.document.writeln("img {border: 0; }");

    PicWin.document.writeln("p, ul, td, th, link, vlink, alink, ol, li, input, textarea { font-size: 100%; }");

    PicWin.document.writeln("th {font-weight: bold; text-align: left; vertical-align: top; }");

    PicWin.document.writeln("td {text-align: left; vertical-align: top;}");
    PicWin.document.writeln("hr {width: 75% }");
    PicWin.document.writeln("A:link, A:active, A:visited {text-decoration:none;font-weight:bold;color:#7B0808;background:transparent;}");
    PicWin.document.writeln("A:hover {text-decoration:underline;font-weight:bold;color:#FFFFFF;background:transparent;}");

    PicWin.document.writeln("</style>");
    PicWin.document.writeln("<head>");
    PicWin.document.writeln("<title>Red Lion Cottages</title>");
    PicWin.document.writeln("<html><body background=\""+thisURL+"/images/background.gif\" >");
	
	
    PicWin.document.writeln("<p style=\"text-align: center;\"><img lowsrc=\"http://www.redlioncottages.co.uk/images/loading.gif\" name=\"ImageHolder\"></p>");
    PicWin.document.writeln("<p style=\"text-align: center;\"><a href=\"javascript:window.close()\">Close this window</a></p>");
    PicWin.document.writeln("</body></html>");
    PicWin.document.close();
    PicWin.document.ImageHolder.src=thisURL+imgName+".jpg";
    PicWin.focus();
    PicWin.resizeTo(imageWidth + 70, imageHeight + 100);
}

function js_ImagePreload()
{
	var imgHome = new Image(69,16);
	imgHome.src="images/home_flip.gif";
	var imgCottages = new Image(155,21);
	imgCottages.src="images/cottages_flip.gif";
	var imgCompany = new Image(159,20);
	imgCompany.src="images/company_flip.gif";
	var imgVillage = new Image(128,21);
	imgVillage.src="images/village_flip.gif";
	var imgLinks = new Image(56,16);
	imgLinks.src="images/links_flip.gif";
	var imgContact = new Image(129,14);
	imgContact.src="images/contact_flip.gif";
}

