// *********************
// open window functions
//<?php print swf_getframe(); ?>

//if not in frames
if (parent.frames.length==0) {

  //document.write("The page you have requested has been redirected into this site.  Please close this window.")
  var root = "http://www.conrailray.com"

  document.location.href=root+"/index.php?link="+location.href;

}

// *********************
// redraw menu functions

function redraw(url) {
   parent.menu.menuRedraw(url);
}

// *********************
// open window functions

	function window_properties(sWidth, sHeight, sScrollbars) {
		
		var menuWidth = "174";
		var wp = "";
		wp = wp + "width=" + sWidth;
		wp = wp + ",height=" + sHeight;		
		wp = wp + ",resizable=yes";
		wp = wp + ",scrollbars="+sScrollbars;
		wp = wp + ",menubar=no";
		wp = wp + ",toolbar=no";
		wp = wp + ",directories=no";
		wp = wp + ",location=no";
		wp = wp + ",status=no";
		
		//center new window code...
		var winW = 630, winH = 460;

		if (parseInt(navigator.appVersion)>3) {
		 if (navigator.appName=="Netscape") {
		  winW = (menuWidth/2 + window.innerWidth/2 - sWidth/2);
		  winH = window.innerHeight/2;
		  if( (winH -100) >= 0 ) winH = winH -100;
		  wp = wp + ",screenX=" + winW;
		  wp = wp + ",screenY=" + winH;
		 }
		 if (navigator.appName.indexOf("Microsoft")!=-1) {
		  winW = (menuWidth/2 + document.body.offsetWidth/2 - sWidth/2);
		  winH = document.body.offsetHeight/2;
		  if( (winH -100) >= 0 ) winH = winH -100;		  
		  wp = wp + ",left=" + winW;
		  wp = wp + ",top=" + winH;
		 }
		}
		
		/*document.write(
		 "Window width = "+(winW*2)+"<br>"+"Window height = "+((winH+100)*2)+"<br>"+
		 "Centered width = "+winW+"<br>"+"Window height = "+(winH+100)+"<br>"+
		 "Offset width = "+winW+"<br>"+"Window height = "+(winH-100)
		) */

		//wp = wp + ",screenX=100,screenY=75";
		//wp = wp + ",left=100,top=75";
		return wp;
	}
	
	function wdopen(sFile) {

		var width = "480"; //480, 640
		var height = "360";	//360, 480
		var wf = "";	
		wf = window_properties(width, height, "yes");	

		window.open(sFile,"opener",wf);
	}
	
	function wopen(sFile,sWidth,sHeight) {

		var wf = "";	
		wf = window_properties(sWidth, sHeight, "no");	
		
		window.open(sFile,"opener",wf);
	}

// *********************
// date modified functions

//control var
var type = "MMddyyyy";

// MMddyyyy = MMdd,yyyy
// yyyyMMdd = yyyyMMdd
// else         = dd-Month-yy

function date_ddmmmyy(date)
{
  var d = date.getDate();
  var m = date.getMonth() + 1;
  var y = date.getYear();

  // handle different year values 
  // returned by IE and NS in 
  // the year 2000.
  if(y >= 2000)
  {
    y -= 2000;
  }
  if(y >= 100)
  {
    y -= 100;
  }

  var mmm = 
    ( 1==m)?'Jan':( 2==m)?'Feb':(3==m)?'Mar':
    ( 4==m)?'Apr':( 5==m)?'May':(6==m)?'Jun':
    ( 7==m)?'Jul':( 8==m)?'Aug':(9==m)?'Sep':
    (10==m)?'Oct':(11==m)?'Nov':'Dec';

  var sDate = "";
  if(type=="MMddyyyy") {
    //Month dd, yyyy
    sDate = mmm +" "+ (d<10?"0"+d:d) +", 20"+ (y<10?"0"+y:y);
  }else if (type=="yyyyMMdd") {
      sDate = "20"+ (y<10?"0"+y:y) +" "+mmm+" "+ (d<10?"0"+d:d);
  }else{
    sDate = "" + (d<10?"0"+d:d) + "-" +
    mmm + "-" +  (y<10?"0"+y:y);
  }

  return sDate;
}


//
// get last modified date of the 
// current document
//
function date_lm()
{
  return date_lastmodified();
}
function date_lastmodified()
{
  var lmd = document.lastModified;
  var s   = "Unknown";
  var d1;

  // check if we have a valid date
  // before proceeding
  if(0 != (d1=Date.parse(lmd)))
  {
    s = "" + date_ddmmmyy(new Date(d1));
  }

  return s;
}







































