function changePic(obj, newPic) {
	if (obj.src)
		obj.src = newPic;
	else
		document.getElementById(obj).src = newPic;
}

jQuery.fn.hidemail = function() {
	var at = / \[szAT\] /;
	var dot = / \[szDOT\] /g;
	this.each( function() {
		var addr = jQuery(this).text().replace(at,"@").replace(dot,".");
		$(this)
			.after('<a href="mailto:'+addr+'">'+ addr +'</a>')
			.remove();
	});
};

/*
function printView(cont) {
	// get source content
	if (navigator.appName.indexOf('Explorer') >= 0) {
		content = document.getElementById(cont).innerHTML;
	}
	else {
		content = document.getElementById(cont).cloneNode(true);
	}
	// options for new popup window
	args = 'width=400,height=500,resizable=yes,scrollbars=yes';
	// create and open window
	printwin = window.open('', 'printview', args);
	printwin.document.open();
	// append html structure to window
	with (printwin.document) {
		write ('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
		write ('<html xmlns="http://www.w3.org/1999/xhtml"><head>');
		write ('<meta http-equiv="content-type" content="text/html; charset=utf-8" />');
		write ('<title>Druckansicht</title></head><body><div id="content"></div></body></html>');
	}
	printwin.document.close();
	// append content to window
	if (navigator.appName.indexOf('Explorer') >= 0) {
		printwin.document.getElementById('content').innerHTML = content;
	}
	else {
		printwin.document.getElementById('content').appendChild(content);
	}
	// start print
	printwin.print();
	// close window
	//printwin.close();
		
	if (printwin)
		return false;
	else
		return true;
}*/


function printView(box_name) {
       if (navigator.appName.indexOf("Explorer") >= 0){
        	inhalt = document.getElementById(box_name).innerHTML;
		args = 'width=400,height=500,resizable,scrollbars';
       		
                var ok = window.open('','printpopup',args);
     		ok.document.open();
      		//  alert(inhalt);
      		with (ok.document) 
      		{
      			write ('<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Strict\/\/EN" "http:\/\/www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
      			write ('<html><head>');
      			write ('<style type="text/css"> body { width: 530px; color: #333333; font-family: arial,sans-serif; } h2 { clear: both; } img {border:0;} a {text-decoration: none; border: 0; color:#333333;} h3 {clear:both; position: relative; top: 10px;} div#scrollbar, div#scrollbar2, div#scrollbar3, div#scrollbar4, div#scrollbar5, div#scrollbar6 {display:none;} div.top { clear: both; } div.top a, div.top img { display: none; } div#lyr1,div#lyr2,div#lyr3,div#lyr4,div#lyr5 { position: relative!important; top: 0!important;} div#lyr4 ul {list-style-type: none;} div.gototop {display:none;}');
      			write ('div.content { position: absolute; top: 0 }');      			
      			write ('#lyr3 div.layer_content table { border-collapse: collapse; width: 95%; margin: 10px 2px;} #lyr3 div.layer_content table th { padding: 3px; color: #333333; line-height: 1.4em; font-size: 13px; font-weight: bold; border: 1px solid #333333;} #lyr3 div.layer_content table td { padding: 3px; color: #333333; line-height: 1.4em; font-size: 13px; font-weight: normal; border: 1px solid #333333; vertical-align: top; } #lyr3 div.layer_content table td.right { white-space:nowrap; } #lyr3 div.layer_content table td span.bold { font-weight: bold; } div#hiddenParagraph_comfort { display: inline!important;}</style>');
      			write ('<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />');
      			write ('<title>Presyscheck Popup</title></head><body><div id="test">&nbsp;</div></body></html>');
		}
		ok.document.close();
       		ok.document.getElementById('test').innerHTML = inhalt ;
      		ok.print();
       		ok.close();
      
       		if (ok) return false;
        	else return true;
      }
       else { 
            	var inhalt = document.getElementById(box_name).cloneNode(true);
		args = 'width=550,height=600,resizable,scrollbars';
      		var ok = window.open('','printpopup',args);
     		ok.document.open();
      		//  alert(inhalt);
      		with (ok.document) 
      		{
      			write ('<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Strict\/\/EN" "http:\/\/www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
      			write ('<html><head>');
      			write ('<style type="text/css"> body { width: 530px; color: #333333; font-family: arial,sans-serif; } img {border:0;} a {text-decoration: none; border: 0; color:#333333;} h3 {clear:both; position: relative; top: 10px;} div#scrollbar, div#scrollbar2, div#scrollbar3, div#scrollbar4, div#scrollbar5, div#scrollbar6 {display:none;} div.top { clear: both; } div.top a, div.top img { display: none; } div#lyr1,div#lyr2,div#lyr3,div#lyr4,div#lyr5 { position: relative!important; top: 0!important; } div#lyr4 ul {list-style-type: none;} div.gototop {display:none;}');
      			write ('div.content { position: absolute; top: 0 }'); 
      			write ('#lyr3 div.layer_content table { border-collapse: collapse; width: 95%; margin: 10px 2px;} #lyr3 div.layer_content table th { padding: 3px; color: #333333; line-height: 1.4em; font-size: 13px; font-weight: bold; border: 1px solid #333333;} #lyr3 div.layer_content table td { padding: 3px; color: #333333; line-height: 1.4em; font-size: 13px; font-weight: normal; border: 1px solid #333333; vertical-align: top; } #lyr3 div.layer_content table td.right { white-space:nowrap; } #lyr3 div.layer_content table td span.bold { font-weight: bold; } div#hiddenParagraph_comfort { display: inline!important;}</style>');
      			write ('<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />');
      			write ('<title>Presyscheck Popup</title></head><body><div id="test">&nbsp;</div></body></html>');
		}
		ok.document.close();
       		ok.document.getElementById('test').appendChild(inhalt);
         	ok.print();
       		ok.close();

       		if (ok) return false;
        	else return true;
       }
        
}
