function PrintPage()
{ 
  var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
      disp_setting+="scrollbars=yes,resizable=yes"; 
  var content_value = document.getElementById("page_content").innerHTML; 
  
  var docprint=window.open("","",disp_setting); 
   docprint.document.open(); 
   docprint.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" />'); 
   docprint.document.write('<html>'); 
   docprint.document.write('<head>'); 
   docprint.document.write('<title> RYERSON UNIVERSITY - Toronto, Ontario, Canada </title>'); 
   docprint.document.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'); 
   docprint.document.write('<meta name="keywords" content="">'); 
   docprint.document.write('<meta name="description" content="">'); 
   docprint.document.write('<link href="http://www.ryerson.ca/inc/main-print.css" rel="stylesheet" type="text/css" />'); 
   docprint.document.write('<link rel="shortcut icon" href="http://www.ryerson.ca/favicon.ico.jpg" type="image/x-icon" />'); 
   docprint.document.write('</head>'); 
   docprint.document.write('<body>'); 
   docprint.document.write('<div id="viewport">'); 
   docprint.document.write('<div id="siteframe">'); 
   docprint.document.write('<div id="bannernav">'); 
   docprint.document.write('<div id="bannerlogo"><a href="http://www.ryerson.ca/index.html"><img src="http://www.ryerson.ca/images/new/logo_ryerson.gif" alt="RYERSON UNIVERSITY" width="273" height="48" border="0"></a></div>'); 
   docprint.document.write('</div>'); 
   docprint.document.write('<div id="contentarea">'); 
   docprint.document.write('<div id="main_content_panel">'); 
   docprint.document.write(content_value);          
   docprint.document.write('</div>'); 
   docprint.document.write('<BR clear="all">'); 
   docprint.document.write('<div id="footer_area">'); 
   docprint.document.write('<div id="footer_blurb">'); 
   docprint.document.write('© Ryerson University    '); 
   docprint.document.write('</div>'); 
   docprint.document.write('</div>'); 
   docprint.document.write('</div>'); 
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 
}


function getContent(myUrl){
		var page_request = false;
		if (window.XMLHttpRequest) // if Mozilla, Safari etc
		{		
			page_request = new XMLHttpRequest();
		}
		else if (window.ActiveXObject){ // if IE
					try {
							page_request = new ActiveXObject("Msxml2.XMLHTTP");
					} 
					catch (e){
							try{
							page_request = new ActiveXObject("Microsoft.XMLHTTP");
							}
							catch (e){
								}
					}
		}
		else{
				return false;
		}
		
			page_request.open('GET', myUrl, false); //get page synchronously 
			page_request.send(null);
			
			if (page_request.readyState == 4){
					if(page_request.status==200){
						       document.write("<div id=\"temparea\" style=\"display: none;\">"+page_request.responseText+"</div><!--end of display:none-->");
					}
				  else{
				  	alert("page_request.status==200 has problem");
				  }
				  	
			}
			else{
				  	alert("page_request.readyState == 4 has problem");
			}
	}
	
function displayContent(myID){
									 var contents = document.getElementById(myID).innerHTML;
				           document.write("<div>"+contents+"</div>");
	}
	
function cleanTemp(){
document.getElementById("temparea").innerHTML="";
	}


function verification() {
var themessage = "You are required to complete the following Contact Form items:\n";

document.emailThisPage.mailformToEmail.className='form_nohilite';
document.emailThisPage.mailformFromEmail.className='form_nohilite';
document.emailThisPage.mailformFromName.className='form_nohilite';

if (document.emailThisPage.mailformToEmail.value=="") {
themessage = themessage + "- To: Email Address\n";
document.emailThisPage.mailformToEmail.className='form_hilite';
}

if (document.emailThisPage.mailformFromEmail.value=="") {
themessage = themessage + "- From: Email Address\n";
document.emailThisPage.mailformFromEmail.className='form_hilite';
}

if (document.emailThisPage.mailformFromName.value=="") {
themessage = themessage + "- From: Name\n";
document.emailThisPage.mailformFromName.className='form_hilite';
}

//alert if fields are empty and cancel form submit
if (themessage == "You are required to complete the following Contact Form items:\n") {
setContent();
}
else {
alert(themessage);
//return false;
   }
}

function setContent() {

if (document.emailThisPage.fromMessage.value=="") {
var messageString = document.emailThisPage.mailformFromName.value +" (" + document.emailThisPage.mailformFromEmail.value + ") saw this page on Ryerson.ca and thought you might be interested. To view the page, please copy and paste the following address into your web browser's address bar: \n\n" + document.messageTemp.pageURL.value + " \n_________________________________________________________________\n\n"+ document.messageTemp.disclaimer.value;
document.emailThisPage.Message_Text.value=messageString;
document.emailThisPage.submit();
} else {
var messageString = document.emailThisPage.mailformFromName.value +" (" + document.emailThisPage.mailformFromEmail.value + ") saw this page on Ryerson.ca and thought you might be interested. To view the page, please copy and paste the following address into your web browser's address bar: \n\n" + document.messageTemp.pageURL.value + " \n\nMessage from "+document.emailThisPage.mailformFromName.value+": \n"+document.emailThisPage.fromMessage.value+"\n_________________________________________________________________\n\n"+ document.messageTemp.disclaimer.value;
document.emailThisPage.Message_Text.value=messageString;
document.emailThisPage.submit();
}

}


function EmailPage()
{ 
  var mydisp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
      mydisp_setting+="scrollbars=yes,resizable=yes"; 
  var mycurrentUrl=window.location.href; 
  var myinnerHTML='<style type="text/css">';
						myinnerHTML+='.emailBorder {';
						myinnerHTML+='border: 1px solid #ccc;';
						myinnerHTML+='padding: 10px;';
						myinnerHTML+='background-color:#f8fafc;';
						myinnerHTML+='font-size:12px;';
						myinnerHTML+='color:#333333;';
						myinnerHTML+='}';
						
						myinnerHTML+='.form_hilite {';
						myinnerHTML+='background-color:#fff5a3;';
						myinnerHTML+='width: 180px;';
						myinnerHTML+='}';
						
						myinnerHTML+='.form_nohilite {';
						myinnerHTML+='background-color:#ffffff;';
						myinnerHTML+='width: 180px;';
						myinnerHTML+='}';
						
						myinnerHTML+='.form_hilite_textbox {';
						myinnerHTML+='background-color:#fff5a3;';
						myinnerHTML+='width: 300px;';
						myinnerHTML+='}';
						
						myinnerHTML+='.mandatory {';
						myinnerHTML+='color: #FF0000;';
						myinnerHTML+='}';
						
						
						myinnerHTML+='</style>';
						  
						
						myinnerHTML+='  <h2 style="position: relative;">Email This Page:</h2>';
						myinnerHTML+='  <strong style="position: relative;">';
						myinnerHTML+='      <a href="../School of IT Management - Ryerson University_files/'+mycurrentUrl+'">'+mycurrentUrl+'</a>';
						myinnerHTML+='  </strong>';
							 
						myinnerHTML+='<div style="display: none;"> ';
						myinnerHTML+='<FORM name="messageTemp">';
						myinnerHTML+='<textarea name="pageURL">'+mycurrentUrl+'</textarea>';
										 
						myinnerHTML+='  <textarea name="disclaimer" cols="50" rows="3" READONLY>Ryerson University is not responsible for the content of this e-mail and the content included in this e-mail does not reflect Ryerson\'s views or opinions. Please note that neither the e-mail address nor name of the sender have been verified.';
						myinnerHTML+='  </textarea> ';
						
						myinnerHTML+='</FORM>';
						myinnerHTML+='</div>';
						myinnerHTML+='<br><br>';
						myinnerHTML+='<FORM name="emailThisPage" ACTION="http://www.ryerson.ca/webapps-cgi/emailPage" METHOD="POST">';
						 
						myinnerHTML+='  <h2>To: </h2>';
						myinnerHTML+='    <INPUT TYPE="hidden" NAME="mailformSubject" value="A link from Ryerson.ca">';
						myinnerHTML+='	  <INPUT TYPE="hidden" NAME="Message_Text" value="">';
						
						myinnerHTML+='  <div class="emailBorder">';
						myinnerHTML+='    <strong><span class="mandatory">* </span>Email Address</strong><br>';
						myinnerHTML+='      <INPUT NAME="mailformToEmail" TYPE="text" class="form_nohilite" value="">';
						myinnerHTML+='  </div>';
						myinnerHTML+='  <br><br>';
						  
						myinnerHTML+='  <h2> From: </h2>';
						myinnerHTML+=' <div class="emailBorder">';
						myinnerHTML+='   <strong><span class="mandatory">* </span>Email Address</strong><br>';
						myinnerHTML+='  <INPUT NAME="mailformFromEmail" TYPE="text" id="mailformFromEmail" value="" class="form_nohilite">';
						myinnerHTML+='  <br>';
						myinnerHTML+='  <br>';
						myinnerHTML+='  <strong><span class="mandatory">* </span>Name</strong><br>';
						myinnerHTML+='  <INPUT NAME="mailformFromName" TYPE="text" id="mailformFromName" value="" class="form_nohilite">';
						myinnerHTML+='  <br>';
						myinnerHTML+='  <br>';
						myinnerHTML+='  <strong>Message</strong><br>';
						myinnerHTML+='  <textarea name="fromMessage" cols="30" rows="4" id="fromMessage"></textarea>';
						myinnerHTML+='  <br>';
						myinnerHTML+='  <INPUT TYPE="hidden" NAME="ThankYouPage" VALUE="http://www.ryerson.ca/emailReturn/emailPgThy.html">';
						myinnerHTML+='  </div>';
						
						myinnerHTML+=' <br><br>';
						myinnerHTML+='  <INPUT TYPE=button value="Send" onclick="verification();" >';
						myinnerHTML+='  <br>';
						myinnerHTML+='  <br>';
						myinnerHTML+=' The e-mail addresses you enter are used only to send articles and ';
						myinnerHTML+='notify you if an e-mail could not be delivered.  We do not save the ';
						myinnerHTML+='email addresses that you provide to us.';
						myinnerHTML+='</FORM>';  
		var today = new Date();
		var year = today.getFullYear();
	  var myfooter='<div id="footer_area">';
				myfooter+='   <div id="footer_blurb">';
				myfooter+='		© '+ year + ' Ryerson University    ';
				myfooter+='      		<a href="http://www.ryerson.ca/ryerson.ca/webpolicy.html">Web Policy</a>    ';
				myfooter+='      		<a href="http://www.ryerson.ca/ryerson.ca/privacy.html">Privacy Policy</a>    ';
				myfooter+='			<a href="../School of Business Management - Ryerson University_files/administration_studentaffairs/access-plan">Accessibility</a>    ';
				myfooter+='			<a href="http://www.ryerson.ca/ryerson.ca/terms.html">Terms & Conditions</a>';
				myfooter+='			</div>';
				myfooter+='</div>';
	 var toolbar_value = document.getElementById("toolbar").innerHTML; 
	 var content_value = document.getElementById("page_content").innerHTML; 
	 var footer_value = document.getElementById("footer_area").innerHTML; 
	 var first = '';
	 var first1 = '';
	 var first2 = '';
	 var second='';
	 var third='';
	 var myouterHTML='';
	 var browserName=navigator.appName;
	 if (browserName=="Netscape"){
	 	myouterHTML+='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" />'+document.getElementsByTagName("html")[0].innerHTML;
	}
	else{
		myouterHTML+='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" />'+document.documentElement.outerHTML;
	}
	 first += myouterHTML.replace(toolbar_value,'');
	 first1 += first.replace(/<div id="toolbar">[\s]*<\/div>/i,'');
	 first2 += first1.replace(/<div id=toolbar>[\s]*<\/div>/i,'');
	 second += first2.replace(content_value,myinnerHTML);
	 third += second.replace(footer_value,myfooter);
	 var mydocprint=window.open("","",mydisp_setting); 
   mydocprint.document.open(); 
   mydocprint.document.write(third); 
   mydocprint.document.close(); 
   mydocprint.focus(); 
}

