	$(function(){
				$(".news-list2 ul")
					.after('<span id="cycle-nav2">\
								<span id="cycle-control2">\
									<a href="#" id="cycle-prev2">&lt;</a>\
									<a href="#" id="cycle-next2">&gt;</a>\
								</span>\
							</span>')
					.cycle({ activePagerClass: 'activeSlide', 
						fx: 'scrollHorz', 
						speed: 800, 
						easing: 'easeInOutExpo',
						timeout: 7000,
					cleartypeNoBg: true,
					pager: '#cycle-pager2',
					prev: '#cycle-prev2',
					next: '#cycle-next2'	
					}) ;
				
				jQuery.event.add(window, "load", resizeFrame);
				
								
				$("#primary_inner").hover(function() {
					$("#primary_inner").stop(true, false).animate({'height': '250px', 'margin-top': "-239px"});
				}, function() {
					$("#primary_inner").stop(true, false).animate({'height': '50px', 'margin-top': "-39px"});
				});
				
				var slidenumber = 0;
				var currentslide;
				
				function parseXML(xml){	
					$($(xml).find('Slide')).each(function() {
						var imagesrc = $(this).find('src').text();
						$('#homecycle ul').append('<li><div class="hotspotarea"><img class="bg" src="' + imagesrc + '" />');
						
						$(this).find('Hotspot').each(function() {
									
									var Xcoord = $(this).find('Xcoord').text();
									var Ycoord = $(this).find('Ycoord').text();
									var blurb = $(this).find('blurb').text();
									var orientation = $(this).find('orientation').text();
									$('#homecycle ul li:last .hotspotarea')
											.append('<div class="hotspot"><div class="shield"><img src="/images/home/hotspot.png" /></div><div class="blurb">' + blurb +'</div></div>')
											.find('div.hotspot:last')
												.css('left', Xcoord)
												.css('top', Ycoord)
												.addClass(orientation)
								}); 
								
						$('#homecycle ul').append('</div></li>');
					});
					/*$('#homecycle li').each(function() {
						slidenumber = 0;
						$('#homecycle ul').cycle('pause');
						currentslide = $(this).index()+1;
						$($(xml).find('Slide')).each(function() {
							slidenumber++;
							if(slidenumber == currentslide) {
								var imagesrc = $(this).find('src').text();
								$('#homecycle ul').append('<li><img src="' + imagesrc + '" /></li>');
								$(this).find('Hotspot').each(function() {
									
									var Xcoord = $(this).find('Xcoord').text();
									var Ycoord = $(this).find('Ycoord').text();
									var blurb = $(this).find('blurb').text();
									
									$('#homecycle ul li .hotspotarea')
										.eq(currentslide-1)
											.append('<div class="hotspot"><div class="shield"><img src="/images/home/hotspot.png" /></div><div class="blurb">' + blurb +'</div></div>')
											.find('div.hotspot:last')
												.css('left', Xcoord)
												.css('top', Ycoord)
								}); 
							}
						}); 
					});*/
				
					$(".hotspot .shield").mouseover(function() {
						var blu = $(this).siblings('.blurb');
						blu.css("display", "block");
						blu.stop(true, false).animate({ opacity: "1" }, {queue: false});
						$(this).css("opacity", "1");
					});	
					$(".hotspot .shield").mouseout(function() {
						var blu = $(this).siblings('.blurb');
						blu.stop(true, false).animate({ opacity: "0"  }, {queue: false});
						blu.css("display", "none");
						$(this).css("opacity", ".4");
					});	
					$(".blurb").mouseover(function() {
						$(this).css("display", "block");
						$(this).stop(true, false).animate({ opacity: "1" }, {queue: false});
					});	
					$(".blurb").mouseout(function() {
						$(this).stop(true, false).animate({ opacity: "0"  }, {queue: false});
						$(this).css("display", "none");
					});	
					/*
					$(".hotspot .shield").toggle(function(){ 
						var blu = $(this).siblings('.blurb');
						blu.css("display", "block");
						blu.stop(true, false).animate({ opacity: "1" }, {queue: false});
					},function(){
					  	var blu = $(this).siblings('.blurb');
						blu.stop(true, false).animate({ opacity: "0"  }, {queue: false});
						blu.css("display", "none");
					});
					*/
					

					jQuery.event.add(window, "load", resizeFrame);
					jQuery.event.add(window, "resize", resizeFrame);	
					
				/*	var box = $('.shield');
					box.bind('proximity', {max:200}, function(e, proximity, distance){
						// font-size moves between 10px and 40px
						box.css('opacity', (proximity));				
					});					
					*/
					//$(".shield").approach({"opacity": "1"}, 300);
					//$(".shield img").approach({"width": "25", "height": "29" }, 100);
					
					/*		
					opf = {
						farOpacity : 0.0,
						farDistanceMax : 200,
						closeOpacity : 1,
						closeDistanceMin : 0,
						className : "shield" 
					};
					*/
				$('#homecycle ul') 
					.after('<span id="cycle-nav">\
								<span id="cycle-control">\
									<a href="#" id="cycle-prev">&lt;</a>\
									<a href="#" id="cycle-next">&gt;</a>\
								</span>\
							</span>') 
					.cycle({ 
						fx: 'scrollHorz', 
						speed: 800, 
						easing: 'easeInOutExpo',
						timeout: 7000,
						pager: '#cycle-pager',
						prev: '#cycle-prev',
						next: '#cycle-next'
					});		
					$('#homecycle ul').cycle('pause');
					resizeFrame();
		
				}
				
					
					$('span#cycle-control a:first').live('click', function () {
						if($(this).hasClass('paused')) {
							$(this).removeClass('paused');
							$('#homecycle').cycle('resume');
						} else {
							$(this).addClass('paused')
							$('#homecycle').cycle('pause');
						}
						return false;
					});
					
					$('#cycle-prev, #cycle-next').click(function () {
						return false;
					});	
	
				$.ajax({
					type: "GET",
					dataType: 'xml',
					url: 'homeslides.xml',
					success: parseXML
				});
				
			});
							
			function resizeFrame() {
				//var h = $(window).height();// this was causing a scroll-bar sized difference in height between the container and footer in FF when the screen was made smaller
				//var w = $(window).width();
				
				
				//var h = window.innerHeight;			
				//var w = window.innerWidth;
				
				
				//http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
				if( typeof( window.innerWidth ) == 'number' ) {
					//Non-IE
					var w = window.innerWidth;
					var h = window.innerHeight;
				  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
					//IE 6+ in 'standards compliant mode'
					var w = document.documentElement.clientWidth;
					var h = document.documentElement.clientHeight;
				  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
					//IE 4 compatible
					var w = document.body.clientWidth;
					var h = document.body.clientHeight;
				  }
  	
				var adjustedheight;	
				var adjust = 147 + 70; //header plus footer size
				
				if ((h-adjust)<0){
					adjustedheight = 1;
				}else{
					adjustedheight = h-adjust;
				}
					if( (w/(adjustedheight)) > 1.77778){ 
					//if viewing area of image is wider than 16:9, base on width to keep stretched
						var imagewidth = w; //16:9
						var imageheight = w/1.77778;
						if(imageheight > (adjustedheight)){
								$(".hotspotarea").css('margin-top', -((imageheight - (adjustedheight))/2));
						}
						
					}else{
					//taller than 16:9, base on height
						var imageheight = (adjustedheight);
						var imagewidth = (adjustedheight)*1.77778; //16:9
								$(".hotspotarea").css('margin-top', 0);
					}
				
			//	console.log(imageheight);
				//console.log(imagewidth);
				
				if (imagewidth < 979){
					imagewidth = 979;
				}
				if (imageheight < 550){
					imageheight = 550;
				}
				$("img.bg").attr('height', imageheight);
				$("img.bg").attr('width', imagewidth);
				$(".hotspotarea").css('width', imagewidth);
				
				//if image is wider than screen, add negative margin to center
				//if not, add negative negative margin ( positive! ) which centers (same as 0 auto)
					$(".hotspotarea").css('margin-left', -(imagewidth - w)/2);
				//if image is taller than screen, add negative margin-top to vertically center
				//if not, add 0 margin-top
					if (w > 979){
						//position "next" button based on screen width if greater than minimum
						$("#cycle-next").css('left', w-66);
					}
				
				$("#homecycle ul").css('height',(adjustedheight));
				$("#homecycle ul li").css('height',(adjustedheight));//this one, since footer isn't full showing that's the difference in height that snaps
				$("#homecycle ul li .hotspotarea").css('height',imageheight);
			}
