function mail(name, domain, style) {
  document.write('<a h'+'ref="'+'mai'+ 'lto:'+name+'@'+domain+'" style="'+style+'">'+name+'@'+domain+'</a>');
}

function slideSwitch() {
    var $active = $('#slideshow a.active');

    if ( $active.length == 0 ) $active = $('#slideshow a:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow a:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitchimg() {
    var $active = $('#slideshowimg img.active');

    if ( $active.length == 0 ) $active = $('#slideshow img:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshowimg img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitchAdv() {
    var $active = $('#adv_slideshow a.active');

    if ( $active.length == 0 ) $active = $('#adv_slideshow a:last');

    var $next =  $active.next().length ? $active.next()
        : $('#adv_slideshow a:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

  $(document).ready(function(){
  
    $(function() {
      setInterval( "slideSwitch()", 3000 );
	  setInterval( "slideSwitchimg()", 3000 );
	  setInterval( "slideSwitchAdv()", 3000 );
    });


	$.ImageBox.init(
						{
							loaderSRC: '/_img/loader.gif',
							closeHTML: 'Закрыть',
							textImage			: 'Фотография',
							textImageFrom		: 'из'
						}
					);


	function sld(s_header,s_block) {
	$(s_block).hide();
	if (s_header == ".souv") {$(s_block).show();}
	if (s_header == ".nagr") {$(s_block).show();}
	if (s_header == ".out0") {$(s_block).show();}
	if (s_header == ".out4") {$(s_block).show();}
	if (s_header == ".poly2") {$(s_block).show();}
    $(s_header).click(function () {
     if ($(s_block).is(":hidden")) {
        $(s_block).show("slow");
      } else {
        $(s_block).slideUp();
      }
    });
  }
  
  
	sld(".out0","#out0");
	sld(".out1","#out1");
	sld(".out2","#out2");
	sld(".out3","#out3");
	sld(".out4","#out4");
	sld(".out5","#out5");
	sld(".out6","#out6");
	sld(".out7","#out7");
	sld(".out8","#out8");
	sld(".out9","#out9");
	sld(".nagr","#nagr");
	sld(".souv","#souv");
	sld(".souv2","#souv2");
	sld(".adv","#adv");
	sld(".adv2","#adv2");
	sld(".fstyle","#fstyle");
	sld(".photo","#photo");
	sld(".photo2","#photo2");
	sld(".poly1","#poly1");
	sld(".poly2","#poly2");
	sld(".poly3","#poly3");
	sld(".poly4","#poly4");
	sld(".poly5","#poly5");
	sld(".poly6","#poly6");
	sld(".poly7","#poly7");
	sld(".poly8","#poly8");
	sld(".poly9","#poly9");
	sld(".poly10","#poly10");
	sld(".poly11","#poly11");
	sld(".fb","#fb");
	sld(".pkg1","#pkg1");
	sld(".pkg2","#pkg2");
	sld(".pkg3","#pkg3");
	sld(".pkg4","#pkg4");
	sld(".pkg5","#pkg5");
	
});

  
 
       $(document).ready(
       function(){
        $('#news').innerfade({
         animationtype: 'slide',
         speed: 750,
         timeout: 2000,
         type: 'random',
         containerheight: '1em'
        });
           
        $('ul#portfolio').innerfade({
         speed: 1000,
         timeout: 5000,
         type: 'sequence',
         containerheight: '220px'
        });
           
        $('.fade').innerfade({
         speed: 1000,
         timeout: 6000,
         type: 'random_start',
         containerheight: '1.5em'
        });
           

      });
    
 

  


