var eW = "";
var eH = "";
var eE = "nachialo";
function razmer(W, H, E){
eW = change(W);
eH = change(H);
eE = change(E);
if (document.body.clientWidth){var width = document.body.clientWidth;}else{var width = window.innerWidth;}
if (document.body.clientHeight){var height = document.body.clientHeight;}else{var height = window.innerHeight;}
if (E == "kartinka"){
  if ((W >= width) && ((W+30) >=950)){
    document.index.width = parseInt(W)+30;
  }
  else if (width <950){
    document.index.width =950;
  }
  else if ((W+30) < width){
    document.index.width = "100%";
  }
  if ((H >= height) && ((H+30) >= 830)){
    document.index.height = parseInt(H)+50;
  }
  else if (height < 830){
	document.index.height = 830;
  }
  else if ((H+30) < height){
    document.index.height = "100%";
  }
}
else if (E == "nachialo"){
  if (width <950){
    document.index.width =950;
  }
  if (height < 830){
	document.index.height = 830;
  }
  if (width >=950){
    document.index.width = "100%";
  }
  if (height >= 830){
	document.index.height = "100%";
  }
}
}
function change(a){
  return a;
}
function load(title, put, width, height){
  var okno = window.open('', '','width='+width+', height='+height);
  okno.document.write('<html><head><title>'+title+'</title><body topmargin="0" leftmargin="0">');
  okno.document.write('<div align="center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'">');
  okno.document.write('<param name="allowScriptAccess" value="sameDomain" />');
  okno.document.write('<param name="movie" value="'+put+'" /><param name="quality" value="high" /><embed src="'+put+'" quality="high" width="'+width+'" height="'+height+'" swLiveConnect="true" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  okno.document.write('</object></div></body></html>');
  //okno.document.close();
}