// printPage
// writes a printer-friendly document in a new window based on
// content in current page
//
// Requires div ids for content and section title

function printPage(contentTextId, sectionTitleId, copyright){
  
  //if copyright was omitted, define it now
  if(!copyright && copyright !== '0')
    copyright = '1';
    
  imageLocation = 'imgs/logo.png';
  styleLocation = 'printstyle.css'; // http://www.acu.edu/common/css/
	 url = this.location.href;
  title = this.document.title;
  
  //remove ' - CS BARD University' from title if it's there; this is the in-page title
// doctitle = title.replace(School of Computer Science, Bharathidasan University, Kajamalai,Trichy - 23. , "");
  
  doctitle = " School of Computer Science and Engineering "
  
  doctitle1= " Bharathidasan University, Trichy - 23  TamilNadu ,India "
  content = this.document.getElementById(contentTextId);
  secTitle = this.document.getElementById(sectionTitleId);
  
  content = content.innerHTML;
    
  //open a new, blank window with these parameters
  newWin = window.open('','', 'menubar=1, scrollbars=1,width=550, height=600, resizable=yes');
  
  //write this to the new window
  newWin.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
    +'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'
    +'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'
    //+'<head><title>'+title+'</title>'
    +'<link rel="stylesheet" type="text/css" href="' + styleLocation + '" />'
    +'</head><body>');
  
  if(copyright == '1'){

	  newWin.document.writeln('<table id="image" align="center"> <tr> <td> <img src="'+imageLocation+'" width="70px" height="80px"></td><td><h4>'+doctitle+'</h4> <center ><h4>'+doctitle1+'</center></h4> </td></tr></table>');
  //  newWin.document.writeln('<div id="image" style="float:center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="'+imageLocation+'" width="60px" height="70px"><h4><center>'+doctitle+'</center></h4> <center ><h4>'+doctitle1+'</center></h4></div>'
							
	    //  );

  }
  else{
    newWin.document.writeln('<div class="header" style="height: 35px;">'
      +'<span style="font-size:25px; font-weight:400;">'+doctitle+'</span></div>');
  }
  
  if(document.all||document.getElementById)
  newWin.document.body.style.background="url('imgs/logo-2.gif') white  center no-repeat "
  
  newWin.document.writeln('<div class="outer"><div class="inner"><div class="centerBG"><div class="center">'
    +'<div class="sectionTitle"></div>'
    +'<div class="text"><center>'+content+'</center></div>'
    +'<br /><br />'
    +'</div></div></div>'
    +'<div class="clear"></div>'
    +'<div id="footerText" class="darkLinks centeredText">');
  
  if(copyright == '1'){
    //newWin.document.writeln('<p>Copyright  2005-2008 Department of Computer Science, Bharathidasan University. All rights reserved.</p>');
  }
  else{
    newWin.document.writeln('<p>The opinions expressed on this page may not reflect those of CS BARD.</p>');
  }
  
  newWin.document.writeln('</div>  <!-- /wrapper --></body></html>');
  
  //stop writing to this window
  newWin.document.close();
}
