﻿		//Generating Pop-up Print Preview page
		function getPrint(print_area)
		{	
			//Creating new page
			var pp = window.open();
			//Adding HTML opening tag with <HEAD> … </HEAD> portion 
			pp.document.writeln('<HTML><HEAD><title>Pricefitters Shipping Charges Estimate</title><LINK href=Styles.css  type="text/css" rel="stylesheet">')
			pp.document.writeln('<LINK href="Print.css" type="text/css" rel="stylesheet" media="print"><base target="_self"></HEAD>')
			//Adding Body Tag
			pp.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">');
			//Adding form Tag
			pp.document.writeln('<form  method="post">');
			//Creating two buttons Print and Close within a table
			pp.document.writeln('<TABLE width=100%><TR><TD></TD></TR><TR><TD align=right><INPUT ID="PRINT" type="button" value="Print" onclick="javascript:location.reload(true);window.print();"><INPUT ID="CLOSE" type="button" value="Close" onclick="window.close();"></TD></TR><TR><TD></TD></TR></TABLE>');
			//Writing print area of the calling page
			pp.document.writeln(document.getElementById(print_area).innerHTML);
			//Ending Tag of </form>, </body> and </HTML>
			pp.document.writeln('</form></body></HTML>');			
			
		}	
		
		function getPrintOrder(print_area)
		{	
			//Creating new page
			var pp = window.open();
			//Adding HTML opening tag with <HEAD> … </HEAD> portion 
			pp.document.writeln('<HTML><HEAD><title>Pricefitters Order Summary</title><LINK href=Styles.css  type="text/css" rel="stylesheet">')
			pp.document.writeln('<LINK href="Print.css" type="text/css" rel="stylesheet" media="print"><base target="_self"></HEAD>')
			//Adding Body Tag
			pp.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">');
			//Adding form Tag
			pp.document.writeln('<form  method="post">');
			//Creating two buttons Print and Close within a table
			pp.document.writeln('<TABLE width=100%><TR><TD></TD></TR><TR><TD align=right><INPUT ID="PRINT" type="button" value="Print" onclick="javascript:location.reload(true);window.print();"><INPUT ID="CLOSE" type="button" value="Close" onclick="window.close();"></TD></TR><TR><TD></TD></TR></TABLE>');
			//Writing print area of the calling page
			var code = "<INPUT id=ctl00_ContentPlaceHolder1_Wizard1_btnPrint style=\"WIDTH: 160px\" onclick=\"getPrintOrder('print');__doPostBack('ctl00$ContentPlaceHolder1$Wizard1$btnPrint','')\" type=button value=\"Print Summary\" name=ctl00$ContentPlaceHolder1$Wizard1$btnPrint>";
			pp.document.writeln(remove(document.getElementById(print_area).innerHTML,code));
			//Ending Tag of </form>, </body> and </HTML>
			pp.document.writeln('</form></body></HTML>');
			//pp.document.getElementById("ctl00_ContentPlaceHolder1_Wizard1_btnPrint").style.display = "none";
			
						
			
		}
		
		function remove(s, t) {
  /*
  **  Remove all occurrences of a token in a string
  **    s  string to be processed
  **    t  token to be removed
  **  returns new string
  */
  i = s.indexOf(t);
  r = "";
  if (i == -1) return s;
  r += s.substring(0,i) + remove(s.substring(i + t.length), t);
  return r;
  }
  
  
  


