 //Pops up href location in a new centered window using the specified attributes.
function popupwin(thehref, win, xwidth, yheight, attrib )
	{
	//figure out the center position
	var scrW = screen.availWidth;
	var scrH = screen.availHeight;
	if (xwidth > scrW)
		{
		pW = scrW - 10;
		}
	else
		{
		pW = xwidth;
		}
	if (yheight > scrH)
		{
		pH = scrH - 40;
		}
	else
		{
		pH = yheight;
		}
	scrX = (scrW - pW - 10) * .5;
	scrY = (scrH - pH - 30) * .5; 
	
	var windowatts = "width=" + xwidth + ",height=" + yheight + ",left=" + scrX + ",top=" + scrY + ",screenX=" + scrX + ",screenY=" + scrY;
  windowatts += "," + attrib;
	window.open( thehref, win, windowatts);
	return false;
	}
 
 
  // initialise Superfish and other sitewide js type stuff.
	$(document).ready(function() { 
			$('ul.sf-menu').supersubs({
					minWidth:		 10,
					maxWidth:    20,
					extraWidth :1}).
						superfish({ 
							delay:       1000,                            // one second delay on mouseout 
							animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
							speed:       'fast',                          // faster animation speed 
							autoArrows:  false,                           // disable generation of arrow mark-up 
							dropShadows: false                            // disable drop shadows 
					});

      $('#top-image').cycle({
        fx:    'fade',
        speed:  4000

      })

			$("a.popup").click( function()
			{
				var address = this.href;
				popupwin(address, '', 860, 750, 'statusbar=1,status=1,toolbar=1,scrollbars=1,resizable=1,location=1,address=1,directories=1,menubar=1' );
				return false;
			});		
	});	


