function OpenNewWin(url, win) {
	popupWin = window.open(url, win, 'menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,dependent=1,width=720,height=420')
} 
function OpenChildWin(url, win) {
	popupWin = window.open(url, win, 'menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,dependent=1,width=740,height=450')
}
function OpenLittleWin(url, win) {
	popupWin = window.open(url, win, 'menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,dependent=1,width=320,height=240')
}
function OpenTinyWin(url, win) {
	popupWin = window.open(url, win, 'menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,dependent=1,width=320,height=240')
}

function OpenNewsWindow(NewsID){
	window.open("/popupNews.asp?NewsID=" + NewsID,"NewsWindow","Width=550,Height=500,Scrollbars=1,Resizable=yes")
}
function DisplayPopUp(){
	window.open("popup.asp?keywords=pop", "PopUPWindow", "resizable=yes,scrollbars=yes,width=500,height=400");
}

//rollovers
function findimg()
{
	var ia,imgs;
// loop through all images of the document
	imgs=document.getElementsByTagName('img');
	for(ia=0;ia<imgs.length;ia++)
	{
// test if the class 'roll' exists
		if(/roll/.test(imgs[ia].className))
		{
// add the function roll to the image onmouseover and onmouseout and send
// the image itself as an object
			imgs[ia].onmouseover=function(){roll(this);};
			imgs[ia].onmouseout=function(){roll(this);};
		}
	}
}
function roll(o)
{
// get the src of the image, and find out the file extension
	var src = o.src;
	var ftype = src.substring(src.lastIndexOf('.'), src.length);
// check if the src already has an _over and delete it, if that is the case 
	if(/_over/.test(src))
	{
		var newsrc = src.replace('_over','');
	}else{
// else, add the _over to the src 
		var newsrc = src.replace(ftype, '_over'+ftype);
	}
	o.src=newsrc;
}

//Forces IE to recognize :hover functions
$(function() {
        $('#subNav li').hover(function(){
               $(this).addClass('sfhover');
        }, function() {
               $(this).removeClass('sfhover');
        });
		$('#subNav li.overflow').hover(function(){
               $(this).addClass('tfhover');
        }, function() {
               $(this).removeClass('tfhover');
        });
		$('#subNav2 li:not(li.active) img')
			.fadeTo('fast', 0.65)
			.each(function() {
				$(this).hover(function() {
					$(this).stop().animate({ opacity: 1.0 }, 100);
            },
           function() {
				$(this).stop().animate({ opacity: 0.65 }, 100);
           });
        });
});


function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
$(document).ready(function() {
	equalHeight($(".column"));
	equalHeight($(".subcolumn"));
});

function launchWindow(id) {	
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set heigth and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		$('#mask').fadeIn(1000);	
		$('#mask').fadeTo("slow",0.8);	
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
              
		//Set the popup window to center
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
	
		//transition effect
		$(id).fadeIn(2000); 
}