function PrinterFriendly(printid,framediv) {	

		if(framediv == "div"){
				xw = new String(location).split('/')[2];

				var doc = null;
				var phtml = "<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"http://"+xw+"/css/printer/"+printid+".css\" /></head><body>"+document.getElementById(printid).innerHTML+"</body></html>";
				//var phtml = document.frames[printid].document.all['0'].innerHTML;
				//var phtml = document.getElementById(printid).src;
				var isIE = /*@cc_on!@*/false;

				var iframecd = document.createElement('IFRAME');
				iframecd.style.Left = "-500px";
				iframecd.style.Top = "-500px";
				iframecd.style.width = "0px";
				iframecd.style.height = "0px";
				iframecd.style.border = "none";
				iframecd.style.display = "block";

				document.body.appendChild(iframecd);

				doc = iframecd.contentWindow.document;
				doc.write(phtml);
				doc.close();
				iframecd.contentWindow.focus();
				iframecd.contentWindow.print();

				if(isIE == false){
					wait(1);
				}
				
				document.body.removeChild(iframecd);

		} else {
				
				document.getElementById(printid).contentWindow.focus();
				document.getElementById(printid).contentWindow.print();

		}

}