function windowResize(){

	if (document.body.scrollWidth > document.body.clientWidth || document.body.scrollHeight > document.body.clientHeight) {
		wwidth =  document.body.scrollWidth + 40;
		wheight = document.body.scrollHeight + 40;
		if (wwidth > window.screen.width - 50) {
			wwidth = window.screen.width - 50;
		}
		if (wheight > window.screen.height - 50) {
			wheight = window.screen.height - 50;
		}
		
		window.resizeTo(wwidth, wheight);
	}
}



function genRandomStr(strlen) {
	str = '';
	for (i = 0; i < strlen; i++) {
		str += String.fromCharCode(Math.random()*25 + 97);
	}
	return str;
}



function w(url,width,height) {
	size='';

	if(width && height)

		size=',width='+width+',height='+height;

	var strInitParam='directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=no,toolbar=no';


	exat_wndname = genRandomStr(10);
	var description=window.open('', exat_wndname, strInitParam+size);

	description.document.write('Пожалуйста, подождите. Идет загрузка...');

	if (url) {
		description.document.location=url;
	}

	description.focus();

	return description;

}

