function print_page() {
	(function($) {

				var header = "<head>" +
											 "<script type='text/javascript'> window.onerror = function() { }; </script>" + 
											 "<link rel='stylesheet' type='text/css' href='/_catalogs/masterpage/styles.css'/>" +
											 "<link rel='stylesheet' type='text/css' href='/_layouts/1033/styles/IEFS/timeline/print/Horizontal.css'/>" + 
											 "<link rel='stylesheet' type='text/css' href='/_layouts/1033/styles/IEFS/timeline/print/timeline.css'/>" + 
											 "<link rel='stylesheet' type='text/css' href='/_layouts/1033/styles/IEFS/timeline/print/Vertical.css'/>" + 
											 "<link rel='stylesheet' type='text/css' href='/_layouts/1033/styles/IEFS/theme1/print/Horizontal.css'/>" +
											 "<link rel='stylesheet' type='text/css' href='/_layouts/1033/styles/IEFS/theme1/print/Vertical.css'/>" +
											 "<style type='text/css'>" + 
											 	"body {background: none !important;} .print_timeline_title {color: #4F81B1; font-size: 16px;} .timeline_table {padding-top: 20px; width: 100%;} .v_tabber ul.v_nav {margin-top: 10px;}" +
											 	".rcorners .rc_content {border: none !important;} .rcorners .cn, .rcorners .cb {background: none !important;}" + 
											 "</style>" +
							 "</head>";
				var html = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" + 
						   "<html>" + header + "<body>";
				
				html += "<div class='allpage'>" + 
						"<div class='page_header'><img src=\"/_layouts/images/IEFS/print_top.png\" alt=\"IEF\" width=\"1000\" height=\"125\"></div>" + 
						"<div class='mainbody'>";
				
				function print_content() {
					var $content = $('.content_placeholder');
					var $columns = $('.columns');
					
					function filter_content(el) {
						el.find(".exclude").css("display", "none");
						var $includes = el.find(".include");
						var content = el.html();
						if ($includes.size() > 0) {
							content = "";
							$includes.each(function() {
								content += $(this).html();
							});
							content = "<div class=\"rcorners  pressroom_info\"><div class=\"cn tl\"></div><div class=\"cn tr\"></div><div class=\"rc_content\" style=\"padding-left:10px;padding-right:10px;\">" +
									  content +
									  "</div><div class=\"cb bl\"></div><div class=\"cb br\"></div></div>";
						}
						el.find(".exclude").css("display", "block");
						return content;
					};

					if ($columns.size() > 0) {
		    			
		    			html += "<table class='content_table'><tr>";
		    		
		    			// ========== BEGIN RENDER CONTENT PLACEHOLDER =======
		    			html += "<td>";
    					$content.each(function() {
							html += "<div>" + filter_content($(this)) + "</div>";
		    			});
		    			html += "</td>";
		    			// ========== END RENDER CONTENT PLACEHOLDER ==========
		    			
		    			// ========== BEGIN RENDER COLUMNS PLACEHOLDER ========
		    			html += "<td width='180px'>";
    					$columns.each(function() {
    						html += "<div>" + filter_content($(this)) + "</div>";
		    			});
		    			html += "</td>";
		    			// ========== END RENDER COLUMNS PLACEHOLDER ========
		    			
		    			html += "</table>";
		    		
					} else {
						// ========== BEGIN RENDER CONTENT PLACEHOLDER =======
						$content.each(function() {
						 	html += "<table class='content_table'>" + "<tr><td>" + filter_content($(this)) + "</tr></td>" + "</table>";
						});
						// ========== END RENDER CONTENT PLACEHOLDER ==========
					}
				};
				
				// =========== BEGIN RENDERING TABS =========
				
				function render_tabs(tabs) {
					if (tabs != null && tabs.size() > 0) {
						html += "<div style='min-height:400px;margin-bottom:15px;'>"
						tabs.each(function(i) {
							var $navigation = $(this).find('.navigation');
							$(this).find('.print_tab').each(function(i) {
								var $label = $($navigation.children().get(i));
								var $active_label = $navigation.find('.active');
								
								
								// Save previous class names of tab and navigation containers.
								var nav_class = $label.attr("class");
								var tab_class = $(this).attr("class");
								var active_nav_class = $active_label.attr("class");
								var tab_display = $(this).css("display");
								
								// Create html content from navigation and tab container.
								$active_label.attr("class","");
								$label.attr("class", "active");
								$(this).attr("class", "activetab print_tab");

								html += "<div class='tab_page'><div class='activetab'><div class='v_tabber'><ul class='v_nav navigation'>" + 
										$navigation.html() + "</ul>" + "<div class='v_tabber_inner'><div class='activetab'>" + $($(this).html()).css('display', 'block').html() + "</div></div><div class='clr' /></div></div></div><br />";
										
								// Restore previous class names of tab and navigation containers.
								$(this).attr("class", tab_class);
//								$(this).css("display", tab_display);
								$label.attr("class", nav_class);
								$active_label.attr("class", active_nav_class);
							});							
						});
						html += "</div>";
					}
				};
				
				function print_tabs() {
					var $tabs = $('.print_top_tab');
					
					render_tabs($tabs);
				};
				
				// =========== END RENDERING TABS =========
						
				// =========== BEGIN RENDERING TIMELINE =========
				function print_timeline() {
				  $labels = $('.print_timeline_label');
				  $contents = $('.print_timeline_content');
								
			  	  $labels.each(function(i) {
			  		  html += "<table class='timeline_table'><tr><td width='100%'><span class='print_timeline_title'>" + this.innerHTML + "</span><br />" + $contents.get(i).innerHTML + "</td></tr></table>";
				  });
				
				  html += "</div></div>";
				};
				
				// =========== END RENDERING TIMELINE ===========
				
				function print_breadcrumb() {
					$('.print_breadcrumb').each(function() {
						var $icon = $(this).find('.print-icon');
						$icon.css('display', 'none');
						html += $(this).html();
						$icon.css('display', 'block');
					});
				};
				
				print_breadcrumb();
				print_content();
				print_tabs();
			    print_timeline();
			    
			    html += "</body></html>";
			    				
								
				var wnd = window.open('','');
				wnd.document.open();
				wnd.document.write(html);
				wnd.document.close();
				wnd.print();
				
				var timer = setTimeout(function() {wnd.close();wnd=null;}, 7000);
	})(jQuery);
}


// =============== OLD SCRIPT ============

var gAutoPrint = true; // Call print function
function printxt()
{
//alert(document.getElementById("printReadyBody"));

 if (document.getElementById != null)
 {
  var html = '<HTML>\n<HEAD>';
  
/*
  if (document.getElementsByTagName != null)
  {
   var headTags = document.getElementsByTagName("head");
   if (headTags.length > 0)
    html += headTags[0].innerHTML;
  }*/
 
//  html += '\n<link rel="stylesheet" rev=stylesheet href="/Style%20Library/ar-SA/Core%20Styles/Print.css" type="text/css">\n';

  html += '\n</HE' + 'AD>\n<BODY>\n';
  
  html += '\n<table border="0" class="PrintWidth" align="center"><tr><td>\n';
  html += '\n<div STYLE="width:100%;background-color:#F6F9FB;"><img src="/_layouts/images/IEFS/logo.png"/></div><br><br>\n';

  var printReadyElem = document.getElementById("printReady");
  
  if (printReadyElem != null)
  {
    html += printReadyElem.innerHTML;
  }
  else
  {
   alert("There is nothing to Print");
   return;
  }
  html += '\n</td></tr>';
  html += '\n<tr> <td height="5px"> </td> </tr>';
  html += '\n<tr> <td height="100%" width="100%">' +  document.getElementById("printReadyBody").innerHTML    + '</td> </tr></table>';
  html += ' </table>';
  html += '\n<hr style="color:black;">';
  html += '\n<div align="center">Copyright &#174\; International Energy Forum Secretariat, 2008</div>\n';

  html += '\n</BO' + 'DY>\n</HT' + 'ML>';
  
  var printWin = window.open('','');
  printWin.document.open();
  printWin.document.write(html);
  printWin.document.close();
 
  if (gAutoPrint)
   {	
   	//	printWin.focus();
 //  		if(printWin.print())

   			printWin.print()
   			setTimeout(function(){printWin.close();},5000);

   			
   	   		//printWin.close();
   	//	printWin.close();
   }
//   printWin.close
 }
 else
 {
  alert("Your Browser Doesn't Support This Feature");
 }

}
function closewnd(printWin)
{
printWin.close();
}
function printwnd(printWin)
{
printWin.print()
//printWin.close()
}
