function new_win(img, name,width,height) {
      w1=window.open('','new_window','resizable=no,menubar=no,status=no,scrollbars=no,width='+width+',height='+height+',top=70,left=100');
      w1.document.open();
      w1.document.write("<html><head><title>"+name+"</title></head><body leftmargin=0 topmargin=0>");
      w1.document.write("<center><a style='font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-weight : bold; font-size: 10px; text-decoration : none; color : #336699;' href='javascript:window.close()'><img src="+img+" width="+width+" height="+(height-20)+" border=0 alt='"+name+"'><br>Закрыть окно</a>");
      w1.document.write("</body></html>");
      w1.document.close();
    w1.focus();
}
function new_win_href (name,title,width,height) {
      w1=window.open('','new_window','resizable=no,menubar=no,status=no,scrollbars=no,width='+width+',height='+height+',top=70,left=100');
      w1.document.open();
      w1.document.write("<html><head><title>"+title+"</title></head><body leftmargin=0 topmargin=0>");
      w1.document.write("<center><textarea rows=4 cols=40 wrap=on>"+name+"</textarea><br><a style='font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-weight : bold; font-size: 10px; text-decoration : none; color : #336699;' href='javascript:window.close()'>Закрыть окно</a>");
      w1.document.write("</body></html>");
      w1.document.close();
    w1.focus();
}

  function imon(a,menunum,hrefnum,col)
  {
    var currentmenu = document.getElementById(menunum);
    currentmenu.src=a;
    var currenthref = document.getElementById(hrefnum);
    currenthref.style.color=col;
  }

function fl(src){document.write(src)}

function OpenWindow( sUri, iWidth, iHeight )
{
var sWindowName = 'win' + Math.floor( Math.random()*1000 )
var iRealWidth = iWidth ? iWidth : 600
var iRealHeight = iHeight ? iHeight : screen.height - 300
var iLeft = Math.round( (screen.width-iRealWidth)/2 )
var iTop = Math.round( (screen.height-iRealHeight)/2 ) - 35
var sWindowOptions = 'status=yes,menubar=no,toolbar=no'
sWindowOptions += ',resizable=yes,scrollbars=yes,location=no'
sWindowOptions += ',width=' + iRealWidth
sWindowOptions += ',height=' + iRealHeight
sWindowOptions += ',left=' + iLeft
sWindowOptions += ',top=' + iTop
var oWindow = window.open( sUri, sWindowName, sWindowOptions )
oWindow.focus()
return oWindow
}

function winaclose()
        {
          $('#wina').css('visibility','hidden');
//          var str='<div id="form_reg"  style="position: absolute; width: 0px; height: 0px; display: none; "></div>';
//          $('#form_reg').replaceWith(str);
          $('#form_reg').css('display','none');
          $('#ajax_ico').css('visibility','hidden');
          $('#thanks').css('visibility','hidden');

        }

function thanksus()
	{

  $('#wina').css('visibility','visible');
  $('#wina').css('width',$(document).width());
  $('#wina').css('height',$(document).height());
  $('#wina').css('left',0);
  $('#wina').css('z-index','59');


      	                $('#thanks').css('left',$(window).width()/2-$('#thanks').width()/2);
	                    $('#thanks').css('top',150);
	                    $('#thanks').css('position','absolute');
		              		if ($.browser.msie)
							   {
								$('#thanks').css('position','absolute');
							   }
							else
								{
								$('#thanks').css('position','fixed');
								}

		                    $('#thanks').css('z-index','60');

					   $('#thanks').fadeIn(1000);



	}

