    var qwe;
    function showschet (url, w, h)
	{

		if (qwe && qwe.closed==false)
		{

			qwe.close();
		}
    var name = 'win';
	var l = window.screen.availWidth/2 - w/2;
	var t = window.screen.availHeight/2 - h/2;


	qwe = window.open( url, name, "width="+w+"px,height="+h+"px,top="+t+"px,left="+l+"px,resizeable=yes,toolbar=yes,location=no,status=no,menubar=yes,scrollbars=yes");
	qwe.focus ();
	}
	
/*	var qweSmall;
	    function showSmall (src)
	{

		if (qweSmall && qweSmall.closed==false)
		{

			qweSmall.close();
		}
			
	qweSmall=window.open (src, "winSmall", "width="+100+", height="+100+", top="+0+",left="+0+'location=no,status=no,resizable=yes,toolbar=no,scrollbars=yes,menubar=no');	
	qweSmall.focus ();
	}


*/

	function showms (url)
{ 
		if (qwe && qwe.closed==false)
		{

			qwe.close();
		}
    var name = 'win';
	var w = 600;
	var h = 300;
	var l = window.screen.availWidth/2 - w/2;
	var t = window.screen.availHeight/2 - h/2;


	qwe = window.open( url, name, "width="+w+"px,height="+h+"px,top="+t+"px,left="+l+"px,resizeable=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=no");
	qwe.focus ();
}
    
	 function GetElem (id) 
	 { 
	 var elem = document.getElementById (id); 
	 return elem;
	 }

	function show_big_image (patch, w, h)
	{
    var show = GetElem ('img_big');			
	show.style.display = 'block';
	show.style.width = '100%';
	show.style.height = '100%';
	w = w + 25;
	h = h + 24;
	show.onclick = function (){GetElem ('img_big').style.display = 'none';GetElem ('img_big').innerHTML = '';}
	//show.setAttribute ('title', 'Нажмите, чтобы закрыть');
    show.innerHTML = '<table><tr><td><div style=\'width:'+w+'px;height:'+h+'px;\'><div><div><div><div><div><div><div> </div></div></div></div></div></div></div></div></td></tr></table><div id=\'img_big_show\'></div>';
	show = GetElem ('img_big_show');
	show.style.backgroundImage = 'url('+patch+')';		
	}
   function chek_num ()
   {
    var chek_num = new String (document.location.search);
	var sel_val = GetElem ('count_elements');
	if (chek_num != '') 
	{
		chek_num = chek_num.match (/count_elements\=\d*/i);
		chek_num = chek_num[0].split ('=');
		chek_num = parseInt (chek_num[1]);
		sel_val.value = chek_num;
	}
	
   }
   function pages_count (count)
   {

	var qwery_str = new String (document.location.search);
	var url = new String (document.location);
	if (qwery_str == '')
	{
		url = url+'?count_elements='+count;
	}
	else if (qwery_str.search (/count_elements\=/i) > 0)
	{
		url = url.replace (/count_elements\=\d*/, 'count_elements='+count);
	}
	else url = url+'&count_elements='+count;
	document.location = url;
   }



