/*---------------------

PRINT CONTENT written to grab content from a page's content pane
Open it in a new, unstyled window, and print

----------------------*/

//open window function that prevents the "Object Window" message on the parent window
function new_window(url, winwidth, winheight, winleft, wintop) {

parameters = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,width="+winwidth+",height="+winheight+",left="+winleft+",top="+wintop;


link = window.open(url,"Link",parameters);


}

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) {
      	a.disabled = false;
      	setTimeout("window.print()",5000);
	  }
    }
  }
}

function setActiveStyleSheet2(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) {
      	a.disabled = true;
	  }
    }
  }
}

function printcontent() {
		window.print();
}

function printback() {
		setActiveStyleSheet2("print");
}