function pd_addfav(x){
			var site= "PRO.Дизайн - Реклама в Ростове-на-Дону, создание сайтов, полиграфия. Быстро, качественно!"

        if (document.all  && !window.opera) {
             if (typeof window.external == "object") {
                window.external.AddFavorite (document.location, document.title);
                return true;
              }
              else return false;

        } else if(window.chrome){
			alert('Нажмите ctrl+D чтобы добавить закладку в Вашем браузере!');
		} else{
            x.href=document.location;
            x.title=document.title;
            x.rel = "sidebar";
            return true;
        }



    }





$().ready(function() {  
		$('.prokwicks').kwicks({  
			max : 404,  
			spacing : 0 
			
		});  
		
		$('.prokwicks>li').mouseenter(function() {
			$('#prokwicksimg').each(function(index) { 
				$(this).remove();
			});
			
			elm = $(this).prev();
			if (elm!=undefined) {				
				elm.html("<div align=right><img id=prokwicksimg src=\"/files/prodizain/pshadow.png\"/></div>");
				$('#prokwicksimg').hide();
				$('#prokwicksimg').fadeIn('slow');
			}
		});
}); 

var currentsbi = 1;
var nextcurrentsbi = -2;
	var sblock = false;
	var sbint = 0;
		function SwitchStrategy(cci) {
			//document.title = "current:"+currentsbi+"\n new:"+cci+" f:"+sblock.toString();
			if (sblock) { 
			//	setInterval( "SwitchStrategy("+cci+")", 1000 );
				nextcurrentsbi = cci;
			
				return;
			}

			if (nextcurrentsbi==cci) {
					nextcurrentsbi = -2; 	
					return;
			}
			if (nextcurrentsbi>0) cci = nextcurrentsbi;
			index = cci;
			if (currentsbi==cci) { 

				
					return;
			}

			if (index>=0) {	

				if (cci>0)currentsbi=cci;
				
				clearInterval(sbint);
			
				sblock = true;
				var $active = $('.sbslideshow div.active');
				if ( $active.length == 0 ) $active = $('.sbslideshow div:last');
				var $next = $("#sbi"+index);
				$active.addClass('last-active');
				$next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 300, function() {
					sblock=false;
					$active.removeClass('active last-active');
					if (nextcurrentsbi>0) SwitchStrategy(nextcurrentsbi);
				});	
				
				
			} else {
				sblock = true;
				var $active = $('.sbslideshow div.active');
				if ( $active.length == 0 ) $active = $('.sbslideshow div:last');
				var $next =  $active.next().length ? $active.next()
				: $('.sbslideshow div:first');
				$active.addClass('last-active');
				$next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 300, function() {
					sblock=false;
					$active.removeClass('active last-active');
					if (nextcurrentsbi>0) SwitchStrategy(nextcurrentsbi);
				});				
				currentsbi = $next.attr('alt');
			}
		}
		
		function RunDemo() {
		//	currentsbi = 0;
			clearInterval(sbint);				
			sbint = setInterval( "SwitchStrategy(-1)", 2500 );
		}
		
	$(document).ready(function(){      

	$(document).pngFix();     
   
	s1 = new Image();
	s1.src = "/files/prodizain/targets/b1.jpg";

	s2 = new Image();
	s2.src = "/files/prodizain/targets/b2.jpg";

	s3 = new Image();
	s3.src = "/files/prodizain/targets/b3.jpg";

	s4 = new Image();
	s4.src = "/files/prodizain/targets/b4.jpg";

	$('#sbtarget1').hover( function(){ SwitchStrategy(1);}, function(){RunDemo();})
	$('#sbtarget2').hover( function(){ SwitchStrategy(2);}, function(){RunDemo();})
	$('#sbtarget3').hover( function(){ SwitchStrategy(3);}, function(){RunDemo();})
	$('#sbtarget4').hover( function(){ SwitchStrategy(4);}, function(){RunDemo();})
	
	RunDemo();
	currentsbi = 1;
	
   
}); 
