function newWindow( nw_url, nw_name, nw_width, nw_height ) {
	expWin = window.open(nw_url, nw_name, 'toolbars=no,location=no,scrollbars=yes,resizable=yes,width=' + nw_width + ',height=' + nw_height + "'");
	}

function tutorialwindow( URLName ) {
	newWindow = window.open( URLName, 'tutorialWin', 'toolbar=no,scrollbars=yes,location=no,width=640,height=480' );
	}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
		}
	}

/*
function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
			}
		}
	}
*/	
	function changeImages() {
		if (document.images /* && (preloadFlag == true)*/) {
			for (var i=0; i<changeImages.arguments.length; i+=2) {
				document[changeImages.arguments[i]].src = "/images/nav/" + changeImages.arguments[i+1];
			}
		}
	}
		

function window300( URLName ) {
	newWindow = window.open( URLName, 'newWin', 'toolbar=no,location=no,width=350,height=350,resizable=yes' );
	}
  
function helpwindow( URLName ) {
	newWindow = window.open( URLName, 'newWin', 'scrollbars=yes,toolbar=yes,location=no,width=550' );
	}
	
function cinWindow() {
		newWindow = window.open( 'cinHelp.htm', 'cinWin', 'scrollbars=no,resizable=yes,toolbar=no,location=no,width=305,height=415' );
	}
	
	var current_image = 1;
function popup(link, title, scrollbars, width, height)
{
	mywindow = window.open('', title,"location=0,toolbar=0,menubar=0,statusbar=0,status=0,scrollbars=" + scrollbars + ",width=" + width + ",height=" + height);
	mywindow.moveTo(((screen.width/2) - (width/2)),((screen.height/2) - (height/2)));
	mywindow.focus();
	mywindow.location = link;
}

function popup_percent(link, title, scrollbars, width, height)
{
	width = screen.width * (width / 100)
	height = screen.height * (height/ 100)
	mywindow = window.open('', title,"location=0,toolbar=0,menubar=0,statusbar=0,status=0,scrollbars=" + scrollbars + ",width=" + width + ",height=" + height);
	mywindow.moveTo(((screen.width/2) - (width/2)),((screen.height/2) - (height/2)));
	mywindow.focus();
	mywindow.location = link;
}

function printpage()
{
	window.print();
	window.close();
}

function jump_menu()
{
	var Item = document.getElementById('jump_dd').options[document.getElementById('jump_dd').selectedIndex].value;
	if (Item != 'default_1' && Item != 'default_2' && Item != 'default_3') {
		location=Item;
	}
	else
	{
		document.getElementById('jump_dd').selectedIndex = document.getElementById('jump_dd').options[0]
	}
}

function jump_menu2()
{
	var Item = document.getElementById('jump_dd2').options[document.getElementById('jump_dd2').selectedIndex].value;
	if (Item != 'default_1' && Item != 'default_2' && Item != 'default_3') {
		location=Item;
	}
	else
	{
		document.getElementById('jump_dd2').selectedIndex = document.getElementById('jump_dd2').options[0]
	}
}

function rotate_banner(image)
{
	var old = current_image;
	if ((image == 0) && (current_image > 1)) {
		current_image--;
	}
	else {
		if ((image == '6')&& (current_image < '5')) {
			current_image++;
		}
		else {
			if (image > 0 && image < 6) {
				current_image = image;
			}
		}
	}
	document.getElementById('main_content_top_right_top').style.backgroundImage = 'url(/images/rotating_banner/banner_'+current_image+'.jpg)';
	changeImages('button_'+old,'main_content_top_right_nav_button.gif');
	changeImages('button_'+current_image,'main_content_top_right_nav_button_hover.gif');
	document.getElementById('rotate_banner_url').href = litRBLinks[current_image];
}

function change_selector(id) {
	if(current_image != id){
		changeImages('button_'+id,'main_content_top_right_nav_button.gif');
	}
	else{
		changeImages('button_'+id,'main_content_top_right_nav_button_hover.gif');
	}
}

function change_init(id) {
	changeImages('button_'+id,'main_content_top_right_nav_button_hover.gif');
}

var contShowMenu = false;

function scheduleShowMenu(html_id){
	contShowMenu = true;
	SetTimeout("showMenu(" + html_id + ");", 2000);
}

function cancelShowMenu(html_id){
	contShowMenu = false;
}



function showMenu(element) {
	if (element + '' == ''){element = 'dd_links'} 
	if ( document.getElementById(element).className == 'visible') {
		document.getElementById(element).className = 'hidden';
	}
	else {
		document.getElementById(element).className = 'visible';
	}
}

function hideMenu(element) {
	if (element + '' == ''){element = 'dd_links'} 
	document.getElementById(element).className = 'hidden';
}

function linkHover(id) {
	document.getElementById(id).style.backgroundColor = "#ADADAD";
}
function linkOut(id) {
	document.getElementById(id).style.backgroundColor = "#E6C25E";
}

var timer = 1;
var timer_function;

function stopTimers() {
	window.clearTimeout(timer_function);
}

function startTimer(object, button, object2) {
	if (object + '' == ''){object = ''} 
	timer_function = setTimeout("hideMenu('" + object + "')",timer*1000);
}