<!--
// add standard javascript routines
var overArrow	= new Image();
var outArrow	= new Image();
var overTop	= new Image();
var outTop	= new Image();

overArrow.src	= '/images/red_arrow.gif';
outArrow.src	= '/images/1x1.gif';
overTop.src	= '/images/back_to_top_over.gif';
outTop.src	= '/images/back_to_top.gif';

function navOver(str) {
	document.images['arrow_'+str].src	= overArrow.src;
}

function navOut(str) {
	document.images['arrow_'+str].src	= outArrow.src;
}

function topOver()
{
	document.images['backtotop'].src	= overTop.src;
}

function topOut()
{
	document.images['backtotop'].src	= outTop.src;
}

function unFocus()
{
	window.focus();
}

function mouseIn(message)
{
	window.status = message;
	return true;
}
	
function mouseOut()
{
	window.status = '';
	return true;
}

function enlargeImage(img, lbl, cap)
{
	window.open('/cgi-bin/tools/enlargeimage.cgi/'+img+'/'+escape(lbl)+'/'+escape(cap),'enlarge','toolbar=no,scrollbars=yes,resizable=yes,menubar=no,status=yes,directories=no,location=no,width=600,height=600');
}
	
function printPage()
{
	window.open('/cgi-bin/tools/printpage.cgi'+escape(window.document.location.pathname)+'?referer='+escape(window.document.location),'print','toolbar=no,scrollbars=yes,resizable=yes,menubar=yes,status=no,directories=no,location=no,width=800,height=400');
}

function emailPage()
{
	window.open('/cgi-bin/tools/mailpage.cgi'+escape(window.document.location.pathname)+'?title='+escape(document.title)+'&referer='+escape(window.document.location),'mail','toolbar=no,scrollbars=no,resizable=no,menubar=no,status=no,directories=no,location=no,width=600,height=600');
}
	
function popup(page)
{
	window.open(page,'info','scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,width=800,height=400');
}


//pass a JSON as a 2nd arg to customize any properties except for 'menu' cuz popup windows _NEVER_ have a menu (ArbitraryRule#10750)
function appPopupWin(page) {
	var options = arguments[1];
	if (!options) { options = {}; }
	//DumperAlert(options);
	var w_width       = options['width']       ? options['width']       : 700;
	var w_height      = options['height']      ? options['height']      : 550;
	var w_scrollbars  = options['scrollbars']  ? options['scrollbars']  : 'yes';
	var w_toolbar     = options['toolbar']     ? options['toolbar']     : 'no'
	var w_location    = options['location']    ? options['location']    : 'no';
	var w_directories = options['directories'] ? options['directories'] : 'no';
	var w_resizable   = options['resizable']   ? options['resizable']   : 'no';
	var w_status      = options['status']      ? options['status']      : 'no'
	var w_title       = options['title']       ? options['title']       : 'info';

	window.open(page,w_title,'scrollbars='+w_scrollbars+',toolbar='+w_toolbar+',location='+w_location+',directories='+w_directories+',status='+w_status+',menubar=no,resizable='+w_resizable+',width='+w_width+',height='+w_height+'');
}


function corda_view_popup(record_id,runmode, record_id_param) {
	//#var script_url_prefix = $('#main_form').attr('action'); 
	var rm_url = 'http://mgsteel.ca:10080/ac.pl?rm=' + runmode + '&record_id=' + record_id;
	var corda_render_url = 'http://spiserver3.com:2001/?@_DOC_LOAD' + rm_url + '@_PDF';
	//alert('just being here is good for runmode: ' + runmode + ' for record id: ' + record_id + ' should hit something with: ' + script_url_prefix);
	appPopupWin(corda_render_url, {'location':'yes','toolbar':'yes', 'resizable':'yes'});
}

function html_view_popup(record_id, runmode, record_id_param) {
	var script_url_prefix = $('#main_form').attr('action'); 
	var rm_url = script_url_prefix + '?rm=' + runmode + '&record_id=' + record_id;
 	appPopupWin(rm_url, {'location':'yes','toolbar':'yes', 'resizable':'yes'});
}

function get_year() {
     var currentDate = new Date();
     var year = currentDate.getFullYear();
     document.write(year); 
}


//-->

