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 clear_pols(id)
        {
          //alert('#'+id);
          $('#'+id).val('');
        }

function left_1(kol_v)
     {
		//alert(document.getElementById('pic_change').value);

		if(document.getElementById('pic_change').value!=0)
		{
		$('#div_change').animate({left: '+=218px'}, 1000);
		document.getElementById('pic_change').value--;
		}


	 }
function right_1(kol_v)
     {

        var kol_v2=document.getElementById('pic_change').value;
       kol_v2++;

        //alert(document.getElementById('pic_change').value+' '+kol_v2);

		if(kol_v2<kol_v)
		{
		$('#div_change').animate({left: '-=218px'}, 1000);
		document.getElementById('pic_change').value++;
		}
	 }

function left_3(kol_v)
     {
		//alert(document.getElementById('pic_change3').value);

		if(document.getElementById('pic_change3').value!=0)
		{
		$('#div_change3').animate({left: '+=518px'}, 1000);
		document.getElementById('pic_change3').value--;
		}


	 }
function right_3(kol_v)
     {

        var kol_v2=document.getElementById('pic_change3').value;
       kol_v2++;

        //alert(document.getElementById('pic_change3').value+' '+kol_v2);

		if(kol_v2<kol_v)
		{
		$('#div_change3').animate({left: '-=518px'}, 1000);
		document.getElementById('pic_change3').value++;
		}
	 }

function up_2(kol_v)
     {

        var s_num=$('#pic_change2').val();
        var s_id=$('#pic_id2').val();

        //alert('['+s_num+'<'+kol_v);


        if(s_num!=0)
        {
				var str="s_num="+s_num+"&s_id="+s_id+"&naprav=1";

		        $.post("/ajax_text_up.php",str, function (data)
                    {
                   // alert(data);

                     $('#div_change_2').fadeIn('slow',function (){$('#div_change_2').replaceWith(data);});

                    }
                );
        }

	 }
function down_2(kol_v)
     {

      var s_num=$('#pic_change2').val();
      var s_num2=$('#pic_change2').val();


      s_num2++;

       // alert('['+s_num2+'<'+kol_v);

        if(s_num2<kol_v)
        {
				var str="s_num="+s_num+"&naprav=2";

		        $.post("/ajax_text.php",str, function (data)
                    {
                    //alert(data);

                     $('#div_change_2').fadeIn('slow',function (){$('#div_change_2').replaceWith(data);});

                    }
                );
        }
	 }
