function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}}function popUp(winURL){window.open(winURL,"popup");}function openNewWindow(){if(!document.getElementsByTagName) false;var lnks=document.getElementsByTagName("a");for(var i=1;i<lnks.length;i++){if(lnks[i].className=="popup"){lnks[i].onclick=function(){popUp(this.getAttribute("href"));return false;}}else if(lnks[i].className=="popup pdf"){lnks[i].onclick=function(){popUp(this.getAttribute("href"));return false;}}else if(lnks[i].className == "popup google"){lnks[i].onclick = function(){popUp(this.getAttribute("href"));return false;}}else if(lnks[i].className=="popup powerpoint"){lnks[i].onclick=function(){popUp(this.getAttribute("href"));return false;}}else if(lnks[i].className == "popup word"){lnks[i].onclick = function(){popUp(this.getAttribute("href"));return false;}}}}function newWindow(file,window){msgWindow=open(file,window,'location=yes,status=yes,scrollbars=yes,resizable=yes,width=650,height=500');if(msgWindow.opener==null)msgWindow.opener=self;}addLoadEvent(openNewWindow);

$(function() {
	
	
	var popup2 = $('.popup2');
	popup2.click(function(event){
		if(this == event.target)
			{
				var page_link = $(this).attr('href');
				window.open(page_link, '', 'width=1050,height=720,resizable=yes,scrollbars=yes');
				//window.open(page_link, '', '');
				return false;
			}
		});

	
	var open_txt = $('.open_txt');
	var open_links = $('.open_links');
	var close_txt = $('.close_txt');
	var more_text = $('.more_text');
	
	// the following three lines of code mess up IE 7
	open_links.show();
	close_txt.hide();
	more_text.hide();
	
	open_txt.click(function(event){
	if(this == event.target)
		{
			var id = $(this).attr('title');
			$('#'+id).show();
			$('#section-'+id+ ' .close_txt').css('display','block');
			$(this).css('display','none');
		}
	});
	
	close_txt.click(function(event){
	if(this == event.target)
		{
			var id = $(this).attr('title');
			$('#'+id).hide();
			$('#section-'+id+ ' .open_txt').css('display','block');
			$(this).css('display','none');
		}
	});
	
	
	$('.ldi_video_popup').click(function(event){
	if(this == event.target)
		{
			var page_link = $(this).attr('href');
			window.open(page_link, '', 'width=680,height=460,resizable=yes,scrollbars=yes');
			return false;
		}
	});
		
});
