function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,width=633,height=500,left = 490,top = 100');");
}
var curBanner="";
$().ready(function(){
;
if(curBanner=="") {
	$("#button1 a").addClass('on');
}
	
// attach a function to the quick links...	
	if ($('select.spec').length>0){
		
		$('select.spec').change(function(){
			if ($(this).val() !="#"){
				window.location.href=$(this).val();
				
			}
			//alert ($(this).val());
		})
	}
	
if ($('#btn_go').length>0){
		
		$('#btn_go').hover(
				function () {
					$(this).addClass("go_blue");
		  },
		  function () {
		    $(this).removeClass("go_blue");
		  }
)
	}
	


if ($('#logoParade').length>0){
	//alert('ready')
	$("div#logoParade").smoothDivScroll({
		pauseAutoScroll: "mouseover",
		autoScroll: "onstart", 
		autoScrollDirection: "endlessloop", 
		autoScrollSpeed: 4 
	
		});
}

// link mouseovers
/*
 * <li id="sciencelab"><a href="2011science/index.php">THE SCIENCE LAB</a></li>
<li id="examprodemo"><a href="resourcezone/index.php">EXAMPRO DEMO</a></li>
<li id="resources"><a href="resourcezone/index.php">RESOURCES</a></li>
<!--<li id="community"><a href="community/index.php">THE COMMUNITY</a></li>-->
<li id="becomeamember"><a href="community/register.php">BECOME A MEMBER</a></li>
*/

// hover functions for  midNav links
$('#button1').hover(function () {showBanner('#banner1'); });
$('#button2').hover(function () {showBanner('#banner2'); });
$('#button3').hover(function () {showBanner('#banner3'); });
$('#button4').hover(function () {showBanner('#banner4'); });

$('#button1').click(function () {showBanner('#banner1'); });
$('#button2').click(function () {showBanner('#banner2'); });
$('#button3').click(function () {showBanner('#banner3'); });
$('#button4').click(function () {showBanner('#banner4'); });




$('li#button1 a')
    .hover(function(event) {
        $(this).addClass('on');
	$("#button2 a").removeClass('on');
	$("#button3 a").removeClass('on');	
    	$("#button4 a").removeClass('on');        
    });
    
$('li#button2 a')
    .hover(function(event) {
        $(this).addClass('on');
	$("#button1 a").removeClass('on');
	$("#button3 a").removeClass('on');	
    	$("#button4 a").removeClass('on');
    });
    
$('li#button3 a')
    .hover(function(event) {
        $(this).addClass('on');
	$("#button1 a").removeClass('on');
	$("#button2 a").removeClass('on');	
    	$("#button4 a").removeClass('on');
    });
    
$('li#button4 a')
    .hover(function(event) {
        $(this).addClass('on');
	$("#button1 a").removeClass('on');
	$("#button2 a").removeClass('on');	
    	$("#button3 a").removeClass('on');
    });    


});


function showBanner(id){
	if (curBanner != id){
	hideBanners();
	if ($(id).hasClass('hide')){
		$(id).removeClass('hide');
		curBanner = id;
		$("#button1 a").removeClass('on');		
		curBanner = id;

	}
	}
}

function hideBanners(id){
	$('.top_banner').addClass('hide');
}
