jQuery(document).ready(function() { 
	
	pdfLinks().addClass("pdf-link").attr({ target: "_blank", title: "PDF opens in a new window" });
	docLinks().addClass("doc-link");
	externalLinks().addClass("external-link").attr({ title: "Link to an external site" });

}); 
 


function externalLinks() {
	return jQuery('a[href^=http]:not("[href^=http://www.childrencantwait.org]"):not("[href^=http://childrencantwait.org]"):not("[href^=http://support.childrencantwait.org]"):not("[href^=https://org2.democracyinaction.org]"):not(":has(\'img\')")');
}

function pdfLinks() {
  return jQuery('a[href*=.pdf]');
}

function docLinks() {
  return jQuery('a[href*=.doc]');
}// JavaScript Document


function slideshow() {

	$('#building-slideshow-pause').click(function() { $('#slides').cycle('pause'); return false; });
    $('#building-slideshow-play').click(function() { $('#slides').cycle('resume'); return false; });

	$('#building-slideshow').hover(
        function() { $('#building-slideshow #controls').fadeIn(); },
        function() { $('#building-slideshow #controls').fadeOut(); }
    );
	
	$('#slides').cycle({ 
    	fx: 'fade',
		pause: 1,
		next: '#building-slideshow-next',
		prev: '#building-slideshow-prev'
	});
	
}

function getFlashMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}