// JavaScript Document
function slideSwitch() {
    var $active = $('#paddy-slideshow DIV.active');

    if ( $active.length == 0 ) $active = $('#paddy-slideshow DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#paddy-slideshow DIV:first');


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

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

function adSwitch001() {
    var $active = $('#right-ad-holder DIV.active');

    if ( $active.length == 0 ) $active = $('#right-ad-holder DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#right-ad-holder DIV: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(){
			$("a[rel^='prettyPhoto']").prettyPhoto();
			
			$("a.show-video").fancybox({
                overlayShow: true,
				padding:20,
                frameWidth:560,
                frameHeight:326
            });
			
			$(".video-cont-wrap a.iframe").fancybox({
                overlayShow: true,
				padding:20,
                frameWidth:380,
                frameHeight:186
            });
		});

$(document).ready(function() {
 	var imgWidth = $('embed.directory_ad').width();
 	var imgHeight = $('embed.directory_ad').height();

 	$('embed.directory_ad').hover(function() {
  		//$(this).animate({width: 1.3*imgWidth, height: 1.3*imgHeight})
		$(this).width(335)
		$(this).height(216)
   		}, function(){
  		//$(this).animate({width: imgWidth, height: imgHeight})
		$(this).width(imgWidth)
		$(this).height(imgHeight)
 	})
})

$(document).ready(function() {
    setInterval( "slideSwitch()", 4000 );
	setInterval( "adSwitch001()", 5000 );
	$(document).pngFix();
});
