$(document).ready(function(){


	$("a[href^='http']").not("[class*='samewindow']").not("[href*='"+document.domain+"']").attr('target','_blank');

$("a[href*=.pdf],a[href*=.doc],a[href*=.ppt],a[href*=.xls]").attr("target","_blank");
$("a[href*=.jpg],a[href*=.gif],a[href*=.png]").colorbox({
							maxWidth:"80%",
							maxHeight:"90%"
							});

$("a.newwindow").attr('target','_blank');
	
var galleries = $('.ad-gallery').adGallery({effect:'resize'});

$('#toggle-slideshow').click(
      function() {
        galleries[0].slideshow.toggle();
        return false;
      }
    );
    $('#toggle-description').click(
      function() {
        if(!galleries[0].settings.description_wrapper) {
          galleries[0].settings.description_wrapper = $('#descriptions');
        } else {
          galleries[0].settings.description_wrapper = false;
        }
        return false;
      }
    );
  });


