

function printDiv() {
  var cotlacit=document.getElementById('content');
  newWin = window.open('','_blank','left=100,top=50,width=700,height=800,toolbar=0,scrollbars=0,status=0');
//  newWin.document.write('<HTML><HEAD><TITLE>Dimex print</TITLE></HEAD><BODY>');
//alert(cotlacit.innerHTML);
  newWin.document.write(cotlacit.innerHTML);
//  newWin.document.write('<div onclick="window.print();">aaa</div></BODY></HTML>');
  newWin.location.reload( false );
  newWin.print();
//  newWin.onload = window.print;
  newWin.close();
}

function printChildWindow() {
	var newWindow = window.open("newWindow.html", "newWindow", "height=200,width=300");
	newWindow.document.write('<HTML><HEAD><TITLE>PrintDaughter</TITLE></HEAD><BODY><CENTER><BR><BR>This is somedata.<BR><BR><BR><INPUT TYPE="button" NAME="print" VALUE="Click to Print" ONCLICK="window.print()"></CENTER></BODY></HTML>');
	newWindow.document.close(); //This is the key!!!
}



var winW, winH;

function dajrozmery() {
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    winW = window.innerWidth;
    winH = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    winW = document.documentElement.clientWidth;
    winH = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    winW = document.body.clientWidth;
    winH = document.body.clientHeight;
  }
}


function showpict(file,wid,hei) {
   dajrozmery();
   var scroll=getScrollXY();
   var ele = document.getElementById('fotka');
   ele.innerHTML='<img src="'+file+'"></img>';
   ele.style.top=Math.round((winH-hei)/2)+scroll[1]+'px';
   ele.style.left=Math.round((winW-wid)/2)+'px';
   ele.style.visibility='visible';
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}







