$(document).ready(function()
{
$('#image_rotate').innerfade({		speed: 'slow',		timeout: 10000,		type: 'sequence',		containerheight: '150px'	});

});

function updateTable(ind)
{
	  $.ajax({
                    url: '/udata/custom/reloadTable/'+ind,
                    type: "GET",
                    dataType : 'xml',
                    success : function(xml)
                    {
                        
                        var table=$(xml).find('table').text();
                        var index=$(xml).find('index').text();
						$(".brands-promo-list").html(table);
						$("#indexBrend").val(index);
						$('.brands-promo-list a img').each( function() {
		grayscale( $(this) );
		$(this).attr("onmouseover", "grayscale.reset( $(this) );");
		$(this).attr("onmouseout", "grayscale( $(this) );");
	});
						  opacityUp();
						  
						}
						
				});
       

}
function opacityDown()
{
  $('.brands-promo-list').animate({
    opacity: 0,
    
  },1000, function() {
  
  updateTable($("#indexBrend").val());

  });
}
function opacityUp()
{
  $('.brands-promo-list').animate({
    opacity: 1,
    
  }, 2000, function() {
   
  });
}
function printPart(strid)
{
 var prtContent = document.getElementById(strid);
 var prtCSS = '<link rel="stylesheet" href="/templates/css/template.css" type="text/css" />';
 var WinPrint = window.open('','','left=50,top=50,width=800,height=640,toolbar=0,scrollbars=1,status=0');
 WinPrint.document.write('<div id="print" class="contentpane">');
 WinPrint.document.write(prtCSS);
 WinPrint.document.write(prtContent.innerHTML);
 WinPrint.document.write('</div>');

 WinPrint.focus();
 WinPrint.print();


}
