var secra;
if(!secra){ secra = {}; }

secra.Printing = function(){};

secra.Printing.content = null;

secra.Printing.printThis = function(obj, css){

  var agent = navigator.userAgent.toLowerCase();
  isIE      = (agent.indexOf("msie") !== -1) ? true : false;

  var content = '<html><head><link rel="stylesheet" href="'+css+'" type="text/css" /></head><body>' + obj.innerHTML + '</body></html>';
 
  if(isIE && secra.Printing.getIEVersion()<8){ 
    window.print();
  } else {
    var pwindow = window.open('',"windowname", "width=930,height=400,top=10,left=10,toolbars=no,scrollbars=yes,status=no,sesizable=no");
	pwindow.document.open('text/html', 'replace');
	pwindow.document.writeln(content);
	pwindow.document.close();
	pwindow.focus();
	pwindow.print();
	pwindow.close();
  }
};

secra.Printing.getIEVersion = function(){
  var version = -1, agent, regex;
  if (navigator.appName === 'Microsoft Internet Explorer'){
    agent = navigator.userAgent;
    regex  = /MSIE ([0-9]{1,}[\.0-9]{0,})/;
    if(regex.exec(agent) !== null){
      version = parseFloat( RegExp.$1 );
    }
  }
  return version;
};
