function doProdList (par)
{
//if prodlist[selectedIndex].value = 0 {return}
//document.location=prodlist[selectedIndex].value;
}

function printwindow(Model) {
var content="";
content+='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'
content+='<html>'
content+='<head>'
content+='<title>Test Site for Paul - '+Model+' Print Page</title>'
content+='<meta name="description" content="" />'
content+='<meta name="keywords" content="" />'
content+='<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />'
content+='<meta name="generator" content="HTML-Kit" />'
content+='<meta http-equiv="Content-Style-Type" content="text/css" />'
content+='<meta name="Content-Script-Type" content="text/javascript" />'
//content+="<script language='JavaScript' src='fotw.js' type="text/javascript"></script>
content+='<link href="fotw.css" type="text/css" rel="stylesheet" />'
content+='</head>'

content+='<body style="margin-top:0;margin-left:0">'
content+='<form action="#">'
content+='<table cellspacing="0" cellpadding="0" width="750" summary="main table" border="0">'
content+='<tbody>'
content+='<tr>'
//<!--     <td class="heading" colspan="3"><a href="index.html"><img alt="" src="images/furniture-on-the-web_1.jpg" width="800" height="152" border="0"></a></td> -->
content+='<td class="heading" style="font-family:arial;color:#000080; font-size:3em; font-weight:bold;padding-left:1em" colspan="2">Furniture on the Web</td>'
content+='</tr>'
content+='<tr>'
content+='<td width="87%">'
content+='<table width="750" summary="data" border="0">'
content+='<tbody>' 				
content+='<tr>'
content+='<td class="tdclass" width="40%">'					
content+='<img alt="virgini (13K)" src="images/virgini.jpg" height="240" width="320" border="0"><br>'
//<!--            <span class="smalltext">The Virginia</span> -->
content+='</td>'
content+='<td class="tdclass" width="60%">'
content+='<p style="font-size:1.3em;color:#8080ff; background-color:#ffffff">Original Bedstead Company - Virginia</p>'						
//<!-- 					  The Virginia is a simple, understated classic design. A traditional handmade cast metal bed frame. The Virginia is wonderfully proportional and made of quality materials to ensure durability.<br /><br /> -->
content+='<p style="font-size:1.1em">The Virginia is wonderfully proportioned and made of quality materials to ensure durability.<br /></p>'
content+='<p style="font-size:1.3em">'
content+='90 x 190 cm - <span style="font-size:1.2em; color:#ff0000"> &pound;215</span><br />'
content+='135 x 190 cm - <span style="font-size:1.2em; color:#ff0000"> &pound;215</span><br />'
content+='150 x 200 cm - <span style="font-size:1.2em; color:#ff0000"> &pound;289</span><br /></p>'
content+='<br />'	
//<!--						<p class="smalltext" style="cursor:hand" onclick="popup('delivery.html','320','250')">Check the delivery charges for your area</p> -->			 
//<!-- 						<p class="smalltext" style="cursor:hand" onclick="popup('virginia_print.html','750','500')">Print this page</p> -->
content+='</td>'
content+='</tr>'		
content+='<tr>'
content+='<td colspan="2" style="text-align:left;">'
content+='<p style="font-family:arial; font-size:1.4em; color:#555055; cursor:hand; padding-left:1em" onclick="window.print()">Click here or hold down &lsquo;Ctrl&rsquo; and press &lsquo;P&rsquo; to print this page</p>'
content+='<span style="font-family:arial; font-size:2em; color:#555055; padding-left:.6em">Phone us on 0800 123456 to place your order</span>'
content+='</td>'
content+='</tr>'
content+='<tr><td colspan="2" style="text-align:center;padding-right:3em"><br /><br /><input type="button" value="Back" onclick="window.history.back()"><br /><br /></td></tr>'				
content+='</tbody>'
content+='</table>'
content+='</td>'
content+='<td width="1%">&nbsp;</td>'
content+='</tr>'
content+='</tbody>'
content+='</table>'
content+='</form>'
content+='</body>'
content+='</html>'
document.open("blank.html")
document.writeln(content);
}

/* <SCRIPT Language="JavaScript">
<!-- Hide Script
*/	
function opennewwin(maker, model, spec, picture)
{
var w=screen.width*0.75
var h=screen.height*0.75
var str1 = "Contact InHome Furniture for a photograph"
var xpic = picture
if(picture!="nophoto.gif")	
{
str1 = "<IMG SRC=" + xpic + ">"
}
var ok = 0
var str
str = "<HTML>" +
"<HEAD>" +
"<TITLE>" + maker + ' ' +model + "</TITLE>" +
"<STYLE TYPE='text/css'><!--" +
"#style1 { color: '#990000'; font-family: comic sans ms, times new roman; font-size: 12pt; font-weight: normal; text-align: center; }" +
"#style2 { color: black; font-family: comic sans ms, times new roman; font-size: 10pt; margin-top: 2pt; }" +
"#style3 { color: blue; font-family: comic sans ms, times new roman; font-size: 12pt; font-weight: normal; }-->" +
"</STYLE>" +
"</HEAD>" +
"<BODY BGCOLOR='#FFFFFF'>" +	
"<CENTER>" +
"<TABLE CELLSPACING='4' CELLPADDING='4' WIDTH='100%' BORDER='0' summary=''>" +
"<TR>" +
"<TD ALIGN=CENTER VALIGN=MIDDLE>" +
"<BR>" +
str1 +	
"</TD></TR>" +
"<TR>" +
"<TD><HR SIZE=1 COLOR='#525168'></TD>" +
"</TR>" +
"<TR>" +
"<TD align=CENTER>" +
"<P ID='style1'>" + maker + " " + model + "<BR>" +
spec + "</P><BR>" +
"</TD>" +
"</TR>" +
"</TABLE>" +
"<HR SIZE=2 COLOR='#525168'><BR>" +
"<FORM NAME='popup1' ACTION='#'>" +
"<INPUT NAME='closebtn' TYPE=BUTTON Value=' Close this page ' onclick = 'window.close()'>" +
"</FORM>" +
"<HR SIZE=2 COLOR='#525168'><BR>" +
"</CENTER>" +
"</BODY>" +
"</HTML>"
newWin = window.open("", "newWin", "top=0,left=0,height="+h+",width="+w+",status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes")
if(navigator.appName == "Netscape")
{
newWin.document.clear();
}
else		
{
newWin.document.location="ablank.htm";
for(var x=0; x<=200000; x++){}
}
newWin.document.write(str);
newWin.focus();
newWin.document.close();
}	
/* // End script hiding -->
</SCRIPT>
*/



function CheckBrowser() {

var standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes

  var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0;

/*  function DHTML_init() { */

   if (window.opera) {
       OP = 1;
   }
   if(document.getElementById) {
     DHTML = 1;
     DOM = 1;
   }
   if(document.all && !OP) {
     DHTML = 1;
     MS = 1;
   }
   if(document.layers && !OP) {
     DHTML = 1;
     NS = 1;
   }
}



function WhereWasI()
{
  // Start by storing our search string in a handy place (so we don't
  // need to type as much)
  var handyString = window.location.search;
  // Find the beginning of our special URL variable
  var startOfSource = handyString.indexOf("area=");			 // area was code= in InHome
  // If it's there, find the end of it
  if (startOfSource != -1)
     {
          var endOfSource = handyString.indexOf("&", startOfSource+5);
          var result = handyString.substring(startOfSource+5, endOfSource);
     }
     else
     {
          var result = ""; // Could not find the "code" string  CHANGED FROM OTHER FORMS
     }
     return unescape(result);
}

function oldenlarge(theID) {
var newID = new String(theID);
//alert("newID="+newID)
var theObj;
theObj=document.getElementById(newID);
var myString = new String();
//alert("theObj.value"+theObj.attributes[0].value)
//alert("theObj"+theObj.value)
myString = theObj.attributes[0].value
var mySubString = myString.substring(0,4)
var temp =newID.substring(0,4)
if(mySubString != "base" && temp != "base"){
   theObj.style.visibility='visible';
 }	 
}

// window.captureEvents(Event.MOUSEOVER)  

function enlarge(theID, yn) {
var newID = new String(theID);
// alert("newID="+newID)

var standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes

  var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0;

/*  function DHTML_init() { */

   if (window.opera) {
       OP = 1;
   }
   if(document.getElementById) {
     DHTML = 1;
     DOM = 1;
   }
   if(document.all && !OP) {
     DHTML = 1;
     MS = 1;
   }
   if(document.layers && !OP) {
     DHTML = 1;
     NS = 1;
   }
/*  } */

var theObj;

var theTop;
var eTop;
var theLeft;

/* theLeft = screenX; */
/* //theTop = theObj.offsetTop */

theObj=document.getElementById(newID);
/* alert("Height:"+theObj.style.height); */ 
/* theLeft = this.pageXOffset + 100; */ /* + "px";   event.x -350 */
/* theLeft = window.event.x;   theTop = window.event.y; */

if(MS){
/*  theTop = (event.screenY - theObj.offsetHeight) + theObj.offsetHeight -150; */
  theLeft = window.event.screenX;
  theTop = (event.screenY + standardbody.scrollTop - theObj.offsetHeight);
/*  theTop = (event.screenY - theObj.offsetHeight) */
}else{
  theLeft = 100;
  theTop = ((this.pageYOffset)-150 + standardbody.scrollTop) + "px";  /*  + "px"  event.y  -150 */
}
/* theTop = event.pageY; */ /* event.screenY;  */

/* alert("Co-Ordinates: "+ this.pageXOffset);
alert("Co-Ordinates: "+ theLeft+" "+theTop); */

/* theTop = theTop;  */
theObj.style.left = 10   /* theLeft - 600; */   /* window.pageXOffset */
/* theTop = theObj.style.top; */
theObj.style.top = theTop;  /*(event.y - 150) + theObj.offsetHeight;*/  /* theTop - 300; +theObj.offsetTop*/ 
/*eTop = event.y
// alert("Top="+theTop+" eventY="+eTop) */


//theObj.style.top = event.y + theObj.offsetTop;
//theObj.style.top = eTop + theTop;

var theOb = theObj.style.visibility  
// alert(theOb)
theObj.style.visibility = 'visible';

if(yn==1){

}
}

/*    
   //if you have scrollbars, you have to add the scrolled-pixel
    if(MS) {
      mid["top"] = parseInt(mid["top"])+standardbody.scrollTop+'px';
      mid["left"] = parseInt(mid["left"])+standardbody.scrollLeft+'px';
    } else {
      mid["top"] = parseInt(mid["top"])+window.pageYOffset+'px';
      mid["left"] = parseInt(mid["left"])+window.pageXOffset+'px';
    }
		
////////

  var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0;

  function DHTML_init() {

   if (window.opera) {
       OP = 1;
   }
   if(document.getElementById) {
     DHTML = 1;
     DOM = 1;
   }
   if(document.all && !OP) {
     DHTML = 1;
     MS = 1;
   }
   if(document.layers && !OP) {
     DHTML = 1;
     NS = 1;
   }
  }
		
		
		
*/

function shrink(theID) {
var theObj;
theObj = document.getElementById(theID)
theObj.style.visibility='hidden';
}

function delivery(thearea){

var thearea=document.getElementById('postcode').value
var thecharges=document.getElementById('charges')
	switch(thearea) {
		case "0" :
			delcharge = 0;
			thecharges.value = thearea
//			document.pd.charges.value = 0;			
			break;
		case "25" :
			delcharge = 25;
			thecharges.value = thearea
//			document.pd.charges.value = 25;			
			break;
		case "50" :
			delcharge = 50;
			thecharges.value = thearea
//			document.pd.charges.value = 50;
			break;
		case "85" :
			delcharge = 85;
			thecharges.value = thearea			
//			document.pd.charges.value = 85;
			break;
		default:
			delcharge = 0;
			thecharges.value = thearea			
//			document.pd.charges.value = 0;
	}
thecharges.focus();
}

function popup(thepage, thewidth, theheight, canresize) {
alert("popup")

/*
//var setdown=Math.round((this.innerHeight/2)-150)
//alert("Setdown="+setdown)
*/
var setdown=0;
var setin=0;
var theparams="height="+theheight+",width="+thewidth+",status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars="+canresize+",resizable="+canresize+",top="+setdown+"px,left="+setin+"px";
var thewin;

alert("popup")
thewin = window.open(thepage, null, theparams)


//  alert("This will be the pop-up")
}

function preload() {
/* alert("Preload");
 debugger; */
  if (!document.images) return;
  var ar = new Array();
  var arguments = document.images.length;		 	/* preload.arguments; */
  for (var i = 0; i < arguments; i++) {
    ar[i] = new Image();
    ar[i].src = document.images[i].src;
  }
self.focus()

/*var x = setsize(100)
var y = setsize(72)
alert("NewW "+x+"  NewH "+y)*/
}

var z=5;
function changelogo() {
/* Setup an array for the logo options  */
var logoarray = new Array();
var logotag = new Array();
logoarray[0] = "images/lewislogo_lucida_blue.jpg";
logoarray[1] = "images/lewislogo_harrington_red.jpg";
logoarray[2] = "images/lewislogo_harlow_red.jpg";
logoarray[3] = "images/lewislogo_hightower_red.jpg";
logoarray[4] = "images/lewislogo_vrinda_red.jpg";
logoarray[5] = "images/lewislogo1.jpg";

logotag[0] = "Lucida";
logotag[1] = "Harrington";
logotag[2] = "Harlow";
logotag[3] = "High Tower";
logotag[4] = "Vrinda";
logotag[5] = "Old Logo";

var elemID;
   elemID = document.getElementById('thelogo');
   elemID.src = logoarray[z];
	 elemID.alt = logotag[z];
	 z--;
	 if (z < 0) {z = 5;}
}

var x = 4;
function swaplogo() {
var elemID;

elemID = document.getElementById('thelogo');

if (x == 3) {
   elemID.src = 'images/furniture-on-the-web_1.jpg';
	 x++;
	return true;	 
}else if(x>9){
   elemID.src = 'images/logo_'+x+'.jpg';
   x++;
	 if(x==13){x=3};
}else{
   elemID.src = 'images/logo_0'+x+'.jpg';
   x++;
	return true;
}	
}

function showit() {
var theid;
theid = document.getElementById('overlay');
theid.visibility = 'visible';
}

function hideit() {
var theid;
theid = document.getElementById('overlay');
theid.visibility = 'hidden';
}

function setsize(thesize) {
/* Resize the picture width and height for screens less than 1280 */
/* This is for the index page only */
var scrsize;
/*alert(thesize)*/
/* scrsize = screen.availWidth; */
scrsize = window.innerWidth
/*scrsize = 1280*/

/* if(scrsize<=800) { */
/*  alert("Dim: "+thesize +" " +Math.round(thesize*0.75)) */
  return Math.round(thesize*0.75);  /* was .75 */
/* } */
/* if(scrsize<=1024) { 
return Math.round(thesize*0.5); */  /* was .75 */
/*  } 
return thesize;  */
}

function setsize2(thesize) {
/* Resize the picture width and height for screens less than or equal to 800 */
/* This is for all Product pages */
var scrsize;
/*alert(thesize)*/
scrsize = screen.availWidth;
/*scrsize = 1280*/
if(scrsize<=800) {
  return Math.round(thesize*0.5);
}
/*
if(scrsize==1024) {
return Math.round(thesize*0.75);
}
*/
return thesize;
}


// This reads the Makers names from fotw_menu.xml for the static page menus
function readmenu(){

// Create an Array to hold the menu items
mnu = new Array()

url = new Array()

// Load XML 
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("fotw_menu.xml")

// Read the xml file
var root, i
var objAttributes

root = xml.documentElement 
NodeList = root.getElementsByTagName("MAKER");
UrlList = root.getElementsByTagName("URL"); 
n_length = NodeList.length;
 
for(i=0; i < n_length; i++){
   elem = NodeList.item(i);
	 theurl = UrlList.item(i);	 
   mnu[i]=elem.firstChild.nodeValue;
	 url[i]=theurl.firstChild.nodeValue;
//  document.write(root.childNodes.item(i).text)   This writes the entire record 
//   document.write(elem.firstChild.nodeValue + "<br>") // This writes the specified tag 
}
}


var flag=0;

function setflag()
{
var thelist = document.getElementById("prodlist");
 flag = thelist.selectedIndex; 
/* flag = prodlist.selectedIndex; */

}
function checkflag()
{
var  thelist = document.getElementById("prodlist");
  if(flag == thelist.selectedIndex)
  { 
/*	if(event.screenY > 280){
    self.focus(); 
		}  
*/	
  }
focused = true;
return true;
}

function empty(which) {
   var theString = new String(which);
	 var howlong;
/* alert("Runnng empty") */
	 howlong = theString.length;
/*	 alert("Length = " + howlong); */ 
	 if(howlong == 0 || howlong == null || theString == "null" || which == null) {
	   return true;
	 }else{
	 return false;
	 }
}
 
function checkfld(which) {
 var fldContents;
 var anObject;

 if(focused == false) { 
	focused = true;
 }else{
  
	anObject = document.getElementById(which.toLowerCase());
  fldContents = anObject.value;

  if(empty(fldContents)){

   if(which == "realname") {
		 focused = true;
		 document.forms["fotwform"].realname.focus() // The focus() function can cause an endless loop
   }
	 if(which == "firstname"){
		 focused = true;
		 document.forms["fotwform"].firstname.focus() 		
   }
	 if(which == "title"){	
		 document.forms["fotwform"].title.focus()
		 focused = true; 		
   }
	 if(which == "email"){
		 focused = true;
		 document.forms["fotwform"].email.focus()
   }
   focused = false;
	}
	
	if(which == "postcode") {
	 makeupper('postcode');
	 }	 
 }	
}

function makeupper(which) {
 var fldContents;
 var anObject;
 var fieldname;

	anObject = document.getElementById(which);
  fldContents = anObject.value.toUpperCase();

	document.forms["fotwform"].postcode.value = fldContents;
}

/***********************************************
* Disable "Enter" key in Form script- By Nurul Fadilah(nurul@REMOVETHISvolmedia.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
                
function handleEnter (field, event) {
   var fieldArr = new Array();
		    fieldArr.title = "Title";
		    fieldArr.firstname = "Firstname";
				fieldArr.realname = "Surname";
				fieldArr.email = "Email Address";
				
    var fieldStr = "title, firstname, realname, email" 				
				
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
/* alert(fieldStr.indexOf(field.name)) */
      if(empty(field.value)&& fieldStr.indexOf(field.name)>=0){alert("Please enter your "+ fieldArr[field.name] + " in this field"); field.form.elements[i-1].focus(); return false;} 

			field.form.elements[i].focus();
			return false;
			
			
		} 
		else
		return true;
	}


// This is no longer used
function setStylesheet() {
var thescreen = screen.availWidth;
  if(thescreen <= 800) {
    document.writeln("<link href=\"fotw800.css\" type=\"text/css\" rel=\"stylesheet\" \/>")
/*		alert("Use fotw800.css") */
	}else if(thescreen >= 1280){
    document.writeln("<link href=\"fotw1280.css\" type=\"text/css\" rel=\"stylesheet\" \/>")
/*		alert("Use fotw1280.css") */
	}else{  /* default to 1024 */
    document.writeln("<link href=\"fotw1024.css\" type=\"text/css\" rel=\"stylesheet\" \/>")
/*		alert("Use the default fotw1024.css") */		
	}
}


