//*--------------------------------------------------------
//* Travel pics
//*--------------------------------------------------------                            
	var w 	= "150";
	var h	= "92";
	var pic	= "CD054058.jpg";
	var hs	= "8";
	var vs	= "8";
	var border = "0";
//*------------------------------------ 
//*  
//*------------------------------------
	 var p=new Array();
	//*  
 
	var ix = 0;  
	p[ix] = "h-train-200021535.jpg"; 			
	p[ix = ix + 1] = "h-train-AA028633.jpg";	
	p[ix = ix + 1] = "v-train-comks85320.jpg";
	p[ix = ix + 1] = "h-train-AX034069.jpg";
//	p[ix = ix + 1] = "v-train-dv740006.jpg";
	p[ix = ix + 1] = "h-train-BPG0092B.jpg";
	p[ix = ix + 1] = "h-train-comks85283.jpg";
	p[ix = ix + 1] = "h-train-BU004633.jpg";
	p[ix = ix + 1] = "h-train-E006805.jpg";
	p[ix = ix + 1] = "h-train-dv792001.jpg";	
	p[ix = ix + 1] = "h-train-comks85319.jpg";
	p[ix = ix + 1] = "h-train-dv809028.jpg";
	p[ix = ix + 1] = "h-train-E006806.jpg";
	p[ix = ix + 1] = "h-train-O-049-0584.jpg";
	p[ix = ix + 1] = "h-train-dv544087.jpg";
	p[ix = ix + 1] = "h-train-comks13784.jpg";	
	p[ix = ix + 1] = "h-train-E004436.jpg";
	p[ix = ix + 1] = "h-train-dv544067.jpg";
	p[ix = ix + 1] = "h-train-dv809027.jpg";	
	p[ix = ix + 1] = "v-train-BPG0051A.jpg";

	//p[ix = ix + 1] = "";
	var pcount =  p.length  // no. of array elments

	var picindex = getCookie("citcpictrain");  
  	if (picindex == null) {picindex = get_random(pcount); }  // get random pic the first time
 	picindex = parseInt(picindex);  // Converts string to a number
 	var iy = picindex + 1;
 	if (iy >= pcount) {iy = 0}; 
// 	iy = 19; //* TEST
 	setCookie("citcpictrain", iy); 
 	pic = p[iy];
	
//	 alert(pic + " iy=" + iy);
//**** Specific Pics for specific pages.	
	if (thefile == "train-bci-exam-e.asp") {pic="v-train-exam.jpg"}  
	if (thefile == "train-bci-offcampus-e.asp") {pic="v-train-E003020.jpg"} //* writing
	if (thefile == "train-bci-reg-e.asp") {pic="h-train-reg.jpg"}
	if (thefile == "train-bci-oncampus-e.asp") {pic="h-train-onlinetest.jpg"}
	if (thefile == "train-bci-proctors-e.asp") {pic="v-train-write.jpg"}
	if (thefile == "train-ed-tele-intro-e.asp") {pic="h-train-RF4846817-2mon.jpg"} 
	if (thefile == "train-ed-sem-intro-e.asp") {pic="h-train-cd2.jpg"}
	if (thefile == "train-ed-dist-intro-e.asp") {pic="h-train-cd.jpg"}
	if (thefile == "train-ed-pub-intro-e.asp") {pic="v-train-publications.jpg"}
	if (thefile == "train-ed-dist-intro-e.asp") {pic="v-train-BW0066-033.jpg"}  //* Smiling woman at laptop
	if (thefile == "train-ed-intro-e.asp") {pic="h-train-200021534.jpg"}  //* Need horizontal format
	if (thefile == "train-ed-inhouse-e.asp") {pic="h-train-dv544070.jpg"}
	if (thefile == "train-careers-e.asp") {pic="h-travelagent.jpg"}
	if (thefile == "train-rec-endor-grad-e.asp") {pic="v-train-graduation.jpg"}
 
//var whichPic=get_random(pcount);
//var pic =  p[whichPic];
var orient = pic.substring(0,1);  //* Orientation h or v

if (orient == "v") {
	var w 	= "92";
	var h	= "150";
}

//alert (whichPic)
document.write('<img src="../images/' +  pic + '" width="' + w + '" height="' + h + '" hspace="' + hs + '" vspace="' + vs + '" border="' + border + '" align="right">');

function whichPic(count) {
//* Count is the number of itmems in the array - 1.
	count = count - 1;  //* because array is from [0] to [n]
    var ranNum= Math.round(Math.random()*  count );
    return ranNum;
}
	
function get_random(pcount) {
    var ranNum= Math.round(Math.random()* pcount);
    return ranNum;
}	

function setCookie(name, value, expires, path, domain, secure) {
//*******************************************************************************
// Generic rtn to set a cookie.
//*******************************************************************************
       var curCookie = name + "=" + escape(value) +
           ((expires) ? "; expires=" + expires.toGMTString() : "") +
           ((path) ? "; path=" + path : "") +
           ((domain) ? "; domain=" + domain : "") +
           ((secure) ? "; secure" : "");
       document.cookie = curCookie;
}
 
function getCookie(name) {
//*******************************************************************************
// Get a cookie.
//*******************************************************************************	
       var dc = document.cookie;
       var prefix = name + "=";
       var begin = dc.indexOf("; " + prefix);
       if (begin == -1) {
         begin = dc.indexOf(prefix);
         if (begin != 0) return null;
       } else
         begin += 2;
       var end = document.cookie.indexOf(";", begin);
       if (end == -1)
         end = dc.length;
       return unescape(dc.substring(begin + prefix.length, end));
     } 