/**
  * Function for opening the product features window, and
  * possibly the print window
  */

/*********************************************************
   funcOpenWindow()
   strURL - String, URL that the window opens initially
   strWindowName - String, name of the window 
   intWindowHeight - Int, initial window height
   intWindowWidth - Int, initial window width
   blnCanResize - Boolean, can the user resize the window
   Andy Millard, 8th January 2002
**********************************************************/
function funcOpenWindow(strURL, strWindowName, intWindowHeight, intWindowWidth, blnCanResize)
{
   if (blnCanResize)
   {
      return window.open(strURL, strWindowName, "width=" + intWindowHeight + ",height=" + intWindowWidth + ",scrollbars=yes,screenX=0,screenY=0,top=0,left=0,marginheight=0, marginwidth=0,resizable=yes");
   }
   else
   {
      return window.open(strURL, strWindowName, "width=" + intWindowHeight + ",height=" + intWindowWidth + ",scrollbars=yes,screenX=0,screenY=0,top=0,left=0,marginheight=0, marginwidth=0,resizable=no");
   }
}


/***********************************************
	funcSubmitComparisonForm()
	This function opens a new window using the
	function above (with no initial page loaded)
	, then posts a form to it, and finally
	focuses on the new window. We use it for the
	product comparison window stuff.
	It is here as it is called from both the 
	product and dimensions pages
	Andy Millard, 13 February 2002
************************************************/
function funcSubmitComparisonForm()
{
    var theWindow;
    theWindow = funcOpenWindow('', 'CompareWindow', 600, 600, 1);
    document.forms.compare.submit();
	theWindow.focus();
}


/*
 * Note by MR: I have no idea what this is used for, it looks pretty
 * Useless and daft to me, but I'm leaving it here on the basis
 * that someone probably uses it somewhere.
 */
function funcOpenCloseTR(){
	document.write ('</tr>');
	document.write ('<tr>');
}

/**
  * Image swap function used on the products details/ dimensions nav
  */
function imgswap(name, type)  
{
	var objImg;
        objImg = document.images[name];
        objImg.src = "images/nav/product/" + type + ".gif";
}


function PrintPage(){  
	if (window.print) {
    	window.print() ;  
	} else {
	    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    	WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
	}
}

/*
 * Some more image swap functions. I don't think they're used so 
 * I've commented them out.
 */

/* * NOT USED *
var objCount = 0; 
    
function on(name){
     document.images["changeable"].src = name;
 }
 
 function off(){
     on("images/blank.gif"); 
}
*/


