﻿function pop_file(f, w, h) {
	var temp_url = f;
	var new_win = window.open(temp_url, 'pop' + h + w, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=' + w + ',height=' + h + ',alwaysRaised=yes');
	new_win.focus();
}

// code for scrolling announcement settings
var headline_count;
var headline_interval;
var old_headline = 0;
var current_headline = 0;
var rotation_time = 5000; //time in milliseconds

$(document).ready(function(){
	headline_count = $("div.headline").size();
	current_headline = 0;
	var h1=$("#headline"+current_headline).height();
	var h2=$("#scrollup").height();
	h=Math.round((h2-h1)/2.3);
	$("#headline"+current_headline).show().animate({top: h},2000);
	if (headline_count>1) headline_interval = setInterval(headline_rotate,rotation_time);
	old_headline = current_headline;
});

function headline_rotate() {
	current_headline = (old_headline + 1) % headline_count
	var h2=$("#scrollup").height();
	var h1=$("#headline"+current_headline).height();
	var h3=$("#headline"+old_headline).height();
	$("#headline"+old_headline).animate({top: -h3},2000, function() {
    	$(this).css('top', h2+'px');
    });
	h=Math.round((h2-h1)/2.3);
	$("#headline"+current_headline).show().animate({top: h},2000);
	old_headline = current_headline;
}