/***

Print view application for iapetus .co .uk

this script generates a link that sends the (innerHTML ) contents of any tag
to print_view.asp

this is a pop up windows that displays the html

you need to add this div around where ever you want to print

<div id="dProduct"  >

<script src="http://sean.example.nitrosell.com/store/print_view.js"   >
</script>

***/

var pageOutput= ' No info defined !';
var siteRoot =  'http://sean.example.nitrosell.com/';  //  'http://www.iapetus.co.uk';
var divId='dProduct';
var theURL = document.location.href;

var divStyle = ' padding:9px; border: #cc3399 1px solid; ';
var linkStyle = '  ';

///////////////////////////////
// re writes the body tag
function setBody( stuff ) 	{

	var dBody = '<div align="center" style=" width:700px ; background-color: #ffffff; border: #000000 1px solid;">  ';


 	dBody += getInnerHtml('headerImgLeft');

 	dBody += '<table cellpadding="0" cellapscing="0" border="0" > <tr> <td> ';
 	dBody += stuff ;
 	dBody += '</tr> </td>  </table>' ;
	//dBody += getInnerHtml('sitefooter');
	dBody += ' Iapetus Gallery, 32 Belle Vue Terrace, Great Malvern, Worcs WR14 4PZ, <br /> ';
	dBody += ' Telephone: 01684 566929  Fax: VAT 896748151 <a href="www.iapetus.co.uk">';
	dBody += ' www.iapetus.co.uk</a>. ';

 	dBody += '   &nbsp; </div> ';
	// remove tell a friend link
	//alert( getInnerHtml('tell-a-friend-link') );
	aBody = dBody.replace( getInnerHtml('tell-a-friend-link') , '');
	wBody = aBody.replace( '<img src="/themes/store_images/btn-click-to-enlarge.gif" alt="" border="0">' , '' );






	document.body.innerHTML = wBody ;


}


///////////////////////////////////
/// get inner HTML of atag
function getInnerHtml(tagId)	{
	var dProduct  = document.getElementById(tagId) ;
 	var dProductHTML =   dProduct.innerHTML   ;
	return dProductHTML;


}

// alert(dProductHTML  );
  function printIt()	{

var it = getInnerHtml(divId);


it += ' <div align="right"  style="' + linkStyle + ' "    > <a style="' + linkStyle + ' "    ';
it += ' href="'+ theURL + '" >Back</a> &nbsp; | &nbsp; <a href="javascript:window.print()" ><img hspace="5" border="0" src="/themes/store_images/btn-printpage.gif"  /> </a> </div> ';
setBody ( it);



 }


  //document.write('<a  style=" ' +  linkStyle    +' " href="javascript:printIt()" ><img align="right"  vspace="25" hspace="0" border="0" src="/themes/store_images/btn-printpage.gif"  />   </a>'	);
