

function GC_initialize() { 
        initalert();
        document.writeln("<div id='cursordebug' style='position:absolute; z-index:2000; left:15px; top:25px; width:40; height:10; '>&nbsp;</div>");
        document.writeln("<div id='debuginfo' style='position:absolute; z-index:2000; left:15px; top:40px; width:900; height:20; visibility:hidden;'>&nbsp;</div>");
        document.writeln("<DIV id='cursorshadow' style='position:absolute; overflow:hidden; visibility: hidden; z-index:999; width:20px; height:15px; '><font color=white size=+5><b>.</b></font></DIV>");
}    



function showphoto(whatURL) {


//	GC_OneMoment2('starting whatURL with showphoto ' + whatURL );

	var str;
	str += "<table border=1 cellpadding=5 cellspacing=5 bgcolor=black><tr><td>";
	str += " <img src='" + whatURL + "' border=0>	";
	str += "</td></tr></table>";

	MM_setTextOfLayer('onemomentcontainer','',str);
	MM_showHideLayers('onemoment','','show');

 	GC_moveObject('onemoment',-7000,-7000,'relative');



}



function GC_notready() {
        GC_alert("Sorry -- that option isn't ready yet");
}

function GC_showsearchwindow() {

        var GCtmp = MM_findObj('GC_searchwindow');

        if (GCtmp != null) {
                MM_showHideLayers('GC_searchwindow','','show');
        } else {
                GC_alert("OOPS.  George hasn't loaded the search window for this page.  (ie, '<i>work in progress<i>')");
        }

}

function GC_showdetailsextra() {

                MM_showHideLayers('DETAILSEXTRA','','show','DETAILSEXTRA1','','show');
}


var GC_LDAPWindow;
var GC_MAINWINDOW = window;
GC_MAINWINDOW.scrollBy(3,1);

var GC_LDAPURL;  // Nice global variable to populate (with CP-XML-findperson, for example)
function GCldapfocus() { 

        	if (GC_LDAPURL != null) { 
                        GC_LDAPWindow=window.open(GC_LDAPURL, 'LDAPdirectory',  'width=700,height=700,scrollbars=yes,toolbar=yes,copyhistory=yes,location=yes,resizable=yes,directories=yes,menubar=yes,status=yes,screenX=30,screenY=30,dependent');
        	} else { 
                	GC_LDAPWindow=window.open('http://www.ualberta.ca/directory/', 'LDAPdirectory',  'width=700,height=700,scrollbars=yes,toolbar=yes,copyhistory=yes,location=yes,resizable=yes,directories=yes,menubar=yes,status=yes,screenX=30,screenY=30,dependent');
        	}  
		GC_LDAPWindow.focus();
}

var HTMLconfirmdelete = "<br><img border=0 src='/icons/Dialog-AreYouSure.gif'><br>";
        var confirmdelete = "\n\n\n\n\n\nAre you sure that\nyou want to delete\nthis record?\n\n\n";


        function GC_ap() {
                GC_moveObject('addperson',-100,-200,'relative');
                MM_showHideLayers('addperson',' ','show');
        }
        function GC_notavail() {
                GC_alert("option not available while you are hiding the personnel");
        }

        function GC_bp() {
                //MouseX = 900;
                //MouseY = 300;
                GC_blobprompt();
        }

        function GC_dl() {

                GC_confirm(HTMLconfirmdelete,'GC_OKdelete()' );
        }





function GC_addwords(GCwhatcontainer,GCnewwords) {

	// give me a container (such as blobname)
	// and I'll add more crap to the end if it...

	// If you give me an object that has a value, I'll use the value, otherwise, I'll just use the name/words you gave me.

	var thenewstuff = GCnewwords;

	var GCf=MM_findObj(GCwhatcontainer);

	if (GCf != null) {
		var original = GCf.innerHTML;

		var GCgg = MM_findObj(GCnewwords);
		if (GCgg != null) {

			if (GCgg.value.length>1) {	// found a value in a form object
				
				thenewstuff = GCgg.value;
			}
		}

		if (thenewstuff.indexOf("blob_file") != 0) {
			MM_setTextOfLayer(GCwhatcontainer,'',original + '<br>' + thenewstuff);
		}
	}


}


function GCdecodeMM_setTextOfLayer(GCcont,newOrConcat,GCstr) {

	


	var RXm = new RegExp("__pp__","i");

 // if this was perl,  GCnew =~ s/__pp__/%/g;

        deadman = 0;
        tmp = 0;
                while ((tmp = RXm.exec(GCstr)) != null) {

                        var start1      = 0;
                        var fin1        = tmp.index-1;
                        if (fin1 < 0) { fin1 = 0; }
                        var start2      = tmp.index+tmp[0].length;
                        var fin2        = GCstr.length;

                      GC_onlinedebug(' 3 debug:  string is: "'        + GCstr + '"    index of "'             + tmp[0]  + '"   is  "'                         + tmp.index + '"  length is "' + tmp[0].length + '" ' + tmp.index + ' ' + tmp[0].length + ' ' + GCstr.length + '     substrings:   ' + start1 + ',' + fin1 + '    ' + start2 + ',' + fin2);

                        GCstr = GCstr.substr(start1,fin1) + '%' + GCstr.substr(start2,fin2);

                        deadman++;
                        if (deadman>80) {
                                alert('  Something went wrong.  Got into an infinite loop.  Tell George');
                                return;
                        }
                        RXm.lastIndex=0;
                }

		GCstr=encodeURI(GCstr);


	if (newOrConcat.indexOf('concat') > -1) {
		GC_addwords(GCcont,GCstr);
	} else {
		MM_setTextOfLayer(GCcont,newOrConcat,GCstr);
	}



}



function GC_duration(somestring) {

        var GCstr='';
        var tmp='';
        var RXm;
        var GCyears=0;
        var GCmonths=0;
        var GCweeks=0;
        var GCdays=0;
        var GChours=0;
        var GCminutes=0;
        var GCseconds=0;


		somestring = somestring + ' hours';


                RXm = new RegExp("[0-9\. ]+ year","i");
		tmp = 0;
                tmp = RXm.exec(somestring);

                if (tmp) {GCyears = parseFloat(tmp[0]);}

                RXm = new RegExp("[0-9\. ]+ yr","i");
                tmp = 0;
                tmp = RXm.exec(somestring);

                if (tmp) {GCyears = parseFloat(tmp[0]);}

                RXm = new RegExp("[0-9\. ]+ mon","i");
                tmp = 0;
                tmp = RXm.exec(somestring);

                if (tmp) {GCmonths = parseFloat(tmp[0]);}

                RXm = new RegExp("[0-9\. ]+ week","i");
                tmp = 0;
                tmp = RXm.exec(somestring);

                if (tmp) {GCweeks = parseFloat(tmp[0]);}

                RXm = new RegExp("[0-9\. ]+ wk","i");
                tmp = 0;
                tmp = RXm.exec(somestring);

                if (tmp) {GCweeks = parseFloat(tmp[0]);}

                RXm = new RegExp("[0-9\. ]+ day","i");
                tmp = 0;
                tmp = RXm.exec(somestring);

                if (tmp) {GCdays = parseFloat(tmp[0]);}

                RXm = new RegExp("[0-9\. ]+ hour","i");
                tmp = 0;
                tmp = RXm.exec(somestring);

                if (tmp) {GChours = parseFloat(tmp[0]);}


                RXm = new RegExp("[0-9\. ]+ hr","i");
                tmp = 0;
                tmp = RXm.exec(somestring);

                if (tmp) {GChours = parseFloat(tmp[0]);}



                RXm = new RegExp("[0-9\. ]+ min","i");
                tmp = 0;
                tmp = RXm.exec(somestring);

                if (tmp) {GCminutes = parseFloat(tmp[0]);}

                RXm = new RegExp("[0-9\. ]+ sec","i");
                tmp = 0;
                tmp = RXm.exec(somestring);

                if (tmp) {GCseconds = parseFloat(tmp[0]);}

                var GCduration=0;
                GCduration = GCduration + (parseFloat(GCyears) * 8766);
                GCduration = GCduration + (parseFloat(GCmonths) * 720);
                GCduration = GCduration + (parseFloat(GCweeks) * 168);
                GCduration = GCduration + (parseFloat(GCdays) * 24);
                GCduration = GCduration + parseFloat(GChours);
                GCduration = GCduration + (parseFloat(GCminutes) / 60);
                GCduration = GCduration + (parseFloat(GCseconds) / 360);

                GCduration = parseInt(GCduration * 10);
                GCduration = GCduration + ' ';
		


                GCstr = GCduration.substr(0,GCduration.length-2) + '.' + GCduration.substr(GCduration.length-2,GCduration.length-1);



		// Now, turn it back into words...

		var GCyy,GCmm,GCww,GCdd,GChh,delim;
		var GCstr2 = '';

		GChh = parseFloat(GCstr);
		
		delim = '';
		
		if (GChh > 8760) {
			GCyy = parseInt( GChh / 8766);
			GChh = GChh % 8766;
			GCstr2  += delim + GCyy + ' years';
			delim = ' , ';
		}
		if (GChh > 720) {
			GCmm = parseInt( GChh / 720);
			GChh = GChh % 720;
			GCstr2 += delim + GCmm + ' months';
			delim = ' , ';
		}
		if (GChh > 168) {
			GCww = parseInt( GChh / 168);
			GChh = GChh % 168;
			GCstr2 += delim + GCww + ' weeks';
                        delim = ' , ';
		}
		if (GChh > 24) {
			GCdd = parseInt( GChh / 24);
			GChh = GChh % 24;
			GCstr2 += delim + GCdd + ' days';
                        delim = ' , ';
		}
		
		GCstr2 += delim + parseInt(GChh) + ' hours ';
			 
		
			
	

		// GCstr = GCstr + " hours";			// report in hours only
		GCstr = GCstr2;					// report is years, months, days, hours.

			GC_onlinedebug(' 1 debug:  string is: "' + GCstr + '"');


		var deadman;

		// if this was perl,  GCstr =~ s/\.0 / /ig;


                // (pad before and after)
                GCstr = ' ' + GCstr + ' ';


		RXm = new RegExp("\\.0 ","i");
		deadman = 0;
		tmp = 0;
		while ((tmp = RXm.exec(GCstr)) != null) {

			GC_onlinedebug(' 2 debug:  string is: "'         + GCstr + '"    index of "'             + tmp[0]  + '"   is  "'                         + tmp.index + '"  length is "' + tmp[0].length + '" ');

			GCstr = GCstr.substr(0,tmp.index) + GCstr.substr(tmp.index+tmp[0].length,GCstr.length); 

			deadman++;
                        if (deadman>5) {
                                alert('  Something went wrong.  Got into an infinite loop.  Tell George');
                                return 0;
                        }
			RXm.lastIndex=0;
		}

		
		// if this was perl,  GCstr =~ s/( 1 [a-z]+)s /$1 /ig;

                RXm = new RegExp(" 1 [a-zA-Z]+[sS] ","i");
		deadman = 0;
                tmp = 0;
                while ((tmp = RXm.exec(GCstr)) != null) {


			var start1 	= 0;
			var fin1 	= tmp.index+tmp[0].length-2; 
			if (fin1 < 0) { fin1 = 0; }
			var start2	= tmp.index+tmp[0].length-1;
			var fin2	= GCstr.length;

			GC_onlinedebug(' 3 debug:  string is: "'        + GCstr + '"    index of "'             + tmp[0]  + '"   is  "'                         + tmp.index + '"  length is "' + tmp[0].length + '" ' + tmp.index + ' ' + tmp[0].length + ' ' + GCstr.length + '     substrings:   ' + start1 + ',' + fin1 + '    ' + start2 + ',' + fin2);
  
                        GCstr = GCstr.substr(start1,fin1) + GCstr.substr(start2,fin2);

			deadman++;
			if (deadman>5) {
				alert('  Something went wrong.  Got into an infinite loop.  Tell George');
				return 0;
			}
			RXm.lastIndex=0;
                }


		// Special case for x weeks, 0 hours 

		RXm = new RegExp(", 0 hours ","i");
		if ((tmp = RXm.exec(GCstr)) != null) {
			GCstr = GCstr.substr(0,tmp.index);	
		}

		// (take away padding)
		GCstr = GCstr.substr(1,GCstr.length-1);




                GC_onlinedebug("   Converting  '" + somestring + "' to '" +  GCyears + " y  " + GCmonths + " m  " + GCweeks + " w  " + GCdays + " d  "  + GChours + " h  " + GCminutes + " m  " + GCseconds +  "          -----  " + GCduration + "hours , rounded to " + GCstr + " hours" + "'");




        GC_onlinedebug("   Converting  '" + somestring + "' to '" +  GCstr + " hours" + "'");

        return GCstr ;

}






function initalert() {

		var str='';
                str += "<div id='GC_alertwindow' style='position:absolute; left:100px; top:100px; z-index:9999; visibility:hidden;'>";
                str += "<table border=0 cellpadding=3 cellspacing=3 bgcolor='#112233'><tr><td><font color=white size=-2><b>";
//		str += "C o n t i n u i t y &nbsp;&nbsp; P l a n n i n g";
		str += " </b></font><br>";
                str += "<table border=0 bgcolor=white cellspacing=20 cellpadding=20 width=400 height=400><tr><td valign=center>";

                str += "<span id='GC_alertcontainer'><img src='/icons/blank.gif' border=0 width=400 height=50></span><br>";                

		str += "<center><p>&nbsp;<p><span id='GC_OKcontainer'>";
		str += "<a href='javascript:MM_showHideLayers(\"GC_alertwindow\",\"\",\"hide\");'>";                
		str += "<img border=0 src='/icons/Buttons-Aqua/Button-OK.gif'></a>";
		str += "</span></center><br>";
		str += "<img src='/icons/blank.gif' width=400 height=1>";

                str += "</td></tr></table>";
                str += "</td></tr></table>";
                str += "</div>";
                document.writeln(str);


		str='';
                str += "<div id='GC_confirmwindow' style='position:absolute; left:200px; top:50px; z-index:9999; visibility:hidden;'>";
                str += "<table border=0 cellpadding=3 cellspacing=3 bgcolor='#112233'><tr><td align=center><font color=white size=-2><b>";
//              str += "C o n t i n u i t y &nbsp;&nbsp; P l a n n i n g";
                str += " </b></font><br>";
                str += "<table border=0 bgcolor=white cellspacing=40 cellpadding=40 width=400 height=400><tr><td align=center valign=center>";

                str += "<span id='GC_confirmcontainer'><img src='/icons/blank.gif' border=0 width=200 height=200></span>";

                str += "<span id='GC_cancelcontainer'>";
                str += "<a href='javascript:MM_showHideLayers(\"GC_confirmwindow\",\"\",\"hide\");'>";
                str += "<img border=0 src='/icons/Buttons-Aqua/Button-Cancel.gif'></a>";
                str += "</span>";

                str += "</td></tr></table>";
                str += "</td></tr></table>";
                str += "</div>";
                document.writeln(str);


                str='';
                str += "<div id='onemoment' style='position:absolute; left:200px; top:200px; z-index:9999; visibility:hidden;'>";
		str += "<table border=0 cellpadding=10 cellspacing=0 bgcolor='#eeffee'><tr><td>";
                str += "<table border=0 cellpadding=3 cellspacing=3 bgcolor='#112233'><tr><td width=50> </td>";
		str += "<td align=center>&nbsp;";

//		str += "<font color=white size=-2><b>C o n t i n u i t y &nbsp;&nbsp; P l a n n i n g</b></font>";

		str += "</td><td align=right valign=top>";
		str += "<a href='javascript:MM_showHideLayers(" + '"onemoment"," ","hide"); ' + "' ";
		str += "onMouseOver='MM_swapImage(" + '"OM"," ","/icons/Button-Close-Black.gif",1); ' + "' ";
        	str += "onMouseOut='MM_swapImgRestore();'  > ";
        	str += "<img border=0 ID='OM' src='/icons/Button-Close-Red.gif'>";
        	str += "</a>";
		str += "</td><tr><td colspan=3>";

                str += "<table border=0 bgcolor=white cellspacing=2 cellpadding=2 width=400 height=400>";
		str += "<tr><td align=center valign=center>";
                str += "<span id='onemomentcontainer'> <img src='/icons/blank.gif' border=0 width=200 height=200> </span>";
                str += "</td></tr></table>";

                str += "</td></tr></table>";
		str += "</td></tr></table>";
                str += "</div>";
                document.writeln(str);



}




function GC_alert(string) {
									// Simulate the alert('blah') javascript, but make it show up in the middle of a page.
	var tt = MM_findObj('GC_alertwindow');

	if (tt == null) {
		alert(string);
	} else {
	
		MM_setTextOfLayer('GC_alertcontainer','',string);
		MM_showHideLayers('GC_alertwindow','','show');

	}
	
}


function GCforeignPhone(whatthis) {
	var whatphone = whatthis.value;
        var RXm = new RegExp("[^0-9]*492[^0-9]+[0-9][0-9][0-9][0-9]","i");
        if ((tmp = RXm.exec(whatphone)) != null) {
                GC_alert("Sorry -- <br><blockquote><b>" + whatphone + "</b></blockquote><br>... seems to be a UofA telephone number. <p>To preserve continuity, you can't add an on-campus department this way.<p>If you didn't see your department on the pull-down list, contact <a href='mailto:lisa.vallee@ualberta.ca'>Lisa Vallee-Burrows</a>, and we can fix that.");
		return 0;
        } else {
		var gg=MM_findObj('phone_dept');
		gg.value=whatphone;
		return 1;
	}
}




// The actions are javascript strings
// eg:
//     <a href='blah'     onClick="GC_confirm('<b>Are you sure you want to do this?</b>',
//					'GC_OKdelete()',
//					'GC_CANCELdelete()'   );" >delete me</a>
//
//


function GC_confirm(GCstuff,OKaction) {

        // Simulate a confirm();  


        var str = '';
	str +=  GCstuff + "<br>&nbsp;<br>";
	str +=  '<font class="fakeanchor" onClick="' + OKaction + '; nd(); "><img alt="OK" src="/icons/Buttons-Aqua/Button-Delete.gif" border=0><\/font>';
	str += '<br>&nbsp;<br>';
		
	MM_setTextOfLayer('GC_confirmcontainer','',str);
	GC_moveObject('GC_confirmwindow',-300,-800,'relative');
	MM_showHideLayers('GC_confirmwindow','','show');

}



var HTMLconfirmdelete = "<br><img border=0 src='/icons/Dialog-AreYouSure.gif'><br>";

function GC_OKdelete() {
                        window.location = '/htbin/CP/CP-delete?' + location.href ;
}

function GC_CANCELdelete() {
                        var GCthis = MM_findObj('GCdeletebutton');
                        GCthis.onclick = '';
                        MM_setTextOfLayer('GCdeletebutton','',"<br><font class='fakeanchor' onclick='location.reload();'>[Delete aborted - reload page]</font><br>");
}






// this stuff allows calls to a cgi script without reloading/submitting
// http://www.w3schools.com/dom/dom_http.asp


// 
// <body onload="loadXMLDoc('test_xmlhttp.txt')">
// <div id="T1" style="border:1px solid black;height:40;width:300"></div><br />
// <button onclick="loadXMLDoc('test_xmlhttp2.txt')">Click</button>
//  </body>
// http://www.experts-exchange.com/Web/Web_Languages/XML/Q_21043023.html



var xmlhttp;

function loadXMLDoc(url,actiontype,args)
{
if (actiontype == null) {
	actiontype='GET';
}

xmlhttp=null;
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=state_Change;

		if (actiontype == 'POST') {
			// xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  			xmlhttp.open(actiontype,url,true);
  			xmlhttp.send(args);

		} else {

			xmlhttp.open(actiontype,url,true);
			xmlhttp.send(null);
		}
  }
else
  {
  alert("Your browser does not support XMLHTTP. I use advanced techniques in this web site.  Call George for help.");
  }
}

function state_Change()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
  {
  // if "OK"
  if (xmlhttp.status==200)
  {

		GC_onlinedebug('   Return from XML call.   Status=' + xmlhttp.status + '      xmlhttp.responseText=' + xmlhttp.responseText );

		eval(xmlhttp.responseText);

  		//document.getElementById('XMLCHUNK').innerHTML='<script>' + xmlhttp.responseText + '</script>';

		GC_onlinedebug(xmlhttp.responseText);
	
		//document.writeln(document.getElementById('everything').innerHTML);
		//document.writeln("<div id='result'>");
		//document.writeln("<script>");
		//document.writeln(xmlhttp.responseText);
		//document.writeln("</script>");
		//document.writeln("</div>");
//
//		window.focus();

  }
  else
  {
  alert("Problem retrieving data:" + xmlhttp.statusText);
  }
  }
}


// Dreamweaver Cookie snippet
// Example:
// writeCookie("myCookie", "my name", 24);
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.
function writeCookie(name, value, hours)
{

	GC_onlinedebug('   %%% Debug:    Cookie ' + name + ' being set to "' + value + '"');

  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + '; domain=macedonia.ucs.ualberta.ca; path=/; ' + expire;
}
//
//
//
//
//
// Example:
// alert( readCookie("myCookie") );
function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end));
    }
  }

	GC_onlinedebug('    Reading cookie ' + name + ' = "' + cookieValue + '"');

  return cookieValue;
}

// Build a global variable/cookie that will travel the paths 
if (readCookie("Cookie_CP_viewstyle") == null) {
        writeCookie("Cookie_CP_viewstyle","HHHHEEEYYYYY_COOOKIIIIIIIIEEE");
}




var buildinglist = '';


// This one sends a query up to the server, looking for the rest of a person's info (ties to the ldap search)
//  requires that the form name be 'myform'
//
// "submit is not a function" javascript error 
// This means you have a function trying to call the form's submit() method, 
// but you also have a button which is called submit(). 
// This causes a conflict in javascript, because the submit method is 
// already bound to that button. 
// To solve the problem, simply change the name of the button so that 
// name="moo" (or something). Your submit() call in your javascript function/method will now work.

function GC_findperson(tmp) {

	var thisform = MM_findObj('myform');
	var GCfirst = thisform.firstname.value;
	var GClast = thisform.lastname.value;
	var GCphone1sub = thisform.phone1sub.value;

	var GCxxtra = '';


	if (GClast.indexOf("Last Name") < 0   ) {
		GC_OneMoment2('checking the LDAP directory');

		if (GCfirst.indexOf("First Name") >= 0) {
			thisform.firstname.value='';
		}

		if (GCphone1sub.indexOf(" ") < 0) {
			GCxxtra = '&phone=' + thisform.phone1exch.value + '-' + GCphone1sub ;
		} 



	var args = 'lastname=' + thisform.lastname.value + '&firstname=' + thisform.firstname.value + GCxxtra;
	loadXMLDoc('/htbin/CP/CP-XML-findperson?' + document.referrer ,'POST',args);


	}
	
}




// Call when you are ready to submit directly to a specific action
//   GC_changeActionAndSubmit('myform','/htbin/CP/CP-addperson');

function GC_changeActionAndSubmit(tmp,where,how) {



	var GCf;

	GCf = MM_findObj('myform');

	GC_OneMoment2('Submitting...<p>&nbsp;<p>Please be patient ... uploading files takes a while ');

	if (how == null) {
		how = 'multipart/form-data';
	}
	GC_changeAction('myform',how);

	GCf.action = where;
	GCf.submit();

}


function GC_changeCGI(where){

	var GCxx;
	GCxx = MM_findObj('myform');
	GCxx.action = where;

}


function GC_OneMoment(why) {
			GC_OneMoment2(why);

			// alert(why);

}

function GC_OneMoment2(why) {
		
		var tt = MM_findObj('onemoment');

		var xstr='';
		xstr = "    <img src='/icons/Buttons-Aqua/Aqua_coffee.gif'><br>One moment. <br><table border=0><tr><td valign=top> ...&nbsp;&nbsp; </td><td> " + why + " </td></tr></table>";

		GC_onlinedebug("  setting GC_OneMoment2  to why='" + why + "   and full text to be " + xstr);




                MM_setTextOfLayer("onemomentcontainer",'',xstr);
                MM_showHideLayers("onemoment",'','show');

		GC_moveObject("onemoment",-1000,-200,'relative');

		return;

}




var global_GC_colorsave='start';

function GC_color(what,how) {

	var obj = MM_findObj(what);
	if (obj != null) {
	
		if (global_GC_colorsave == 'start') {
			global_GC_colorsave = obj.style.backgroundColor;
		}

		if (how !='on') {
			obj.style.backgroundColor = global_GC_colorsave;
		} else {
			obj.style.backgroundColor = "#d1f5c9";
		}
	}
	return;
}


function GC_changeAction(formname,actiontype) {
	var obj = MM_findObj(formname);
	if (obj != null ) {
		obj.enctype = actiontype;


		GC_onlinedebug("     GC_changeAction ----  actiontype: " + actiontype );
	} else {

		var blah;
		GC_onlinedebug("       GC_changeAction ----  Whoa!   problem trying to change action for '" + formname + "'  what happened? ");
	}

	return;
}









var deadman=0;
function GC_ranktasks(thisselectrecord,maxrank) {

        deadman = deadman +1;
        if (deadman > 30) {
                alert("   OUCH!   INFINITE RECURSION???  WE DON'T LIKE THAT!  WHAT WENT WRONG?  TELL GEORGE");
                return;
        }


        var thiselement = MM_findObj(thisselectrecord);


        var tmpmapping = 'mapping' + thisselectrecord;
        var tt = MM_findObj(tmpmapping);
        var targettask = tt.value;

        // commit change immediately to the file 'rank'
        var args = 'targettask=' + targettask + '&newvalue=' + thiselement.value;
        loadXMLDoc('/htbin/CP/CP-XML-ranktask' ,'POST',args);


        // update the bystanders who shared the same rank value.
        for (var i=1;i<=maxrank;i++) {
                var tmpelement = 'rank' + i;
                if (tmpelement != thisselectrecord) {                  // (recursion:   do the same for the other values!)
                        var ttf = MM_findObj(tmpelement);
                        if (ttf.value == thiselement.value) {


                                var nextvalue = parseInt(tt.value,0) + 1;

                                        GC_onlinedebug(" ready to cascade...   nextvalue is " + nextvalue);

                                if (nextvalue > maxrank) {
                                        GC_onlinedebug(" the nextvalue (" + nextvalue + ") is bigger than maxrank " + maxrank);
                                        ttf.selectedIndex=0;
                                } else {

                                                var Xnew =  parseInt(nextvalue,0);
                                                var Xtt = MM_findObj(tmpelement);

                                                Xtt.selectedIndex = Xnew;

                                                GC_onlinedebug("   ready to call recursion --  tmpelement is " + tmpelement + "    maxrank is " + maxrank);

                                                GC_ranktasks(tmpelement,maxrank);

                                                // rewrite the 'rank' file with a 0 of the innocent bystander.
                                                //var Xtmpmapping = 'mapping' + tmpelement;
                                                //var Xtt = MM_findObj(Xtmpmapping);
                                                //var Xtargettask = Xtt.value;
                                                //var Xargs = 'targettask=' + Xtargettask + '&newvalue=0';
                                                //loadXMLDoc('/htbin/CP/CP-XML-ranktask' ,'POST',Xargs);
                                }


                        }
                }
        }


        MM_showHideLayers('reloadthispage','','show'); MM_showHideLayers('priotitle','','hide');
        return;

}





var MouseX=0;
var MouseY=0;

var divName = 'cursorshadow';
var offX=10;
var offY=10;
var ext;
var GCc;
var GCd;


function follow(evt) {
    if (GCc=MM_findObj(divName)) {
	if (document.getElementById) {
		var obj = document.getElementById(divName).style; obj.visibility = 'visible';
		obj.left = (parseInt(mouseX(evt))+offX) + 'px';
		obj.top = (parseInt(mouseY(evt))+offY) + 'px';
		MouseX = mouseX(evt);
		MouseY = mouseY(evt);
                if (GCc=MM_findObj('cursordebug')) {
                	GCc.innerHTML="<font class='smallwhite'>("+MouseX+","+MouseY+")</font>";
		}

		if (GCd=MM_findObj('followcursor')) {

			var GCheight = 400 * ( (parseInt( parseInt(MouseY) / parseInt(400) )) - 1);

			GCd.innerHTML="<img src='/icons/blank.gif' width=1 height=" + GCheight + ">";

		}
	}
	}
}
document.onmousemove = follow;


function getMousePosition(evt){

		MouseX = mouseX(evt);
		MouseY = mouseY(evt);

		if (GCc=MM_findObj('cursordebug')) {
			GCc.innerHTML="("+MouseX+","+MouseY+")";
		}
}


function GC_onlinedebug(words) {

	var GXXc;
	if (words.length < 190 ) {
		if (GXXc=MM_findObj('debuginfo')) {
			GXXc.innerHTML="<font class='smallwhite'> <i>(debug)</i>&nbsp;&nbsp;&nbsp;<xmp>" + words + "</xmp></font>";
		}
	}
}








// Small hack to reposition a menu bar DIV
// Very inefficient.

// Prepare for many menu requests

var GC_nextmenuposition=1;

function GC_menuPosition( thismenuobj , MPwhere ) {

	var obj = MM_findObj ( thismenuobj );
	var vertical = '85px';   // always the same


	GC_onlinedebug("  GC_menuPosition  menu " + thismenuobj + "   to position number " + MPwhere + "      typeof=" + typeof(MPwhere));

        if ( typeof(MPwhere) != "number" ) {
	
		GC_nextmenuposition++;
		MPwhere = GC_nextmenuposition;
		GC_onlinedebug("    defaulting menu " + thismenuobj + "   to position number " + MPwhere );

	}

        var horiz = ['ihatezero' , '10px' , '70px' , '130px' , '190px' , '250px' , '310px' , '370px'];
        var harr = horiz[MPwhere];

        obj.style.left = harr;
        obj.style.top = vertical;



}



function GC_moveObject( thisobj , LLLL, TTTT, AbsRel,  alertflag) {

//getMousePosition(evt);		// extra check for cursor position, just in case...


  var offsetY = 0;
  var offsetX = 0;
  var newleft = 0;
  var newtop  = 0;
  var newLoc  = 0;


  	var XXobj = MM_findObj (thisobj );
  	if (XXobj==null) return;


	if (TTTT == null) {
                                        TTTT = 0;
                }
        if (LLLL == null) {
                                        LLLL = 0;
                }



	if (alertflag !=null ) {

		alert("    Debug:   starting GC_moveObject ... object: ...   '" + thisobj + "' ...  current location is (" + XXobj.style.left + "," + XXobj.style.top + ")");

	}

  	if (AbsRel != null) {

        	if (AbsRel.indexOf('absolute')>=0) {

                	newtop = TTTT;
                	newleft = LLLL;

 			XXobj.style.left = newleft + "px";
 			XXobj.style.top = newtop + "px";


			return;							//  Get out if it was absolute!!!
        	} 

  	}


	GC_onlinedebug("    Debug:   object: ...   '" + thisobj + "' ...  current location is (" + XXobj.style.left + "," + XXobj.style.top + ")");

  	newtop = parseInt(MouseY) + parseInt(offsetY);
  	newtop = parseInt(newtop) + parseInt(TTTT) ;
        if (newtop <10) {
                        newtop = 30;
        }
	if (newtop < parseInt(offsetY)) {
			newtop = parseInt(offsetY) + 30;
	}
  	
	newleft = parseInt(MouseX) + parseInt(offsetX);
  	newleft = parseInt(newleft) + parseInt(LLLL);
        if (newleft < 10) {
                        newleft = 30;
        }
	if (newleft < parseInt(offsetX)) {
			newleft = parseInt(offsetX) + 30;
	}

 	XXobj.style.left = newleft + "px";
 	XXobj.style.top = newtop + "px";

 	var GCnn = "   Debug: Moving an object: ...   '" + thisobj + "' ...   cursor is at (" + MouseX + "," + MouseY + ")  object being placed at (" + newleft + "," + newtop + ")   based on offset ( " + LLLL + " + " + offsetX + "  , " + TTTT + " + " + offsetY + "  ) " + "( " + XXobj.style.left + " , " + XXobj.style.top + " ) "  ;

	GC_onlinedebug(GCnn);

	if (alertflag  != null) {

		alert(GCnn);

	}


}






	

function dept_selected() {
 var mylist = document.forms[0].ou;
 var dept = mylist.value;


	if (dept == 'other') {

		var btext = MM_findObj("GCnewdepartment");
                var original = btext.innerHTML;
		MM_setTextOfLayer("departmentlist",'',original);
		

		btext = MM_findObj("departmentlist");
		btext.style.background="#d7f4e6";

		// %%%%%%%%%%%%%%%



	} else {
		var obj1 = MM_findObj("department");
		obj1.value = dept;

		var obj3 = MM_findObj("departmentlist");
			obj3.style.visibility='hidden';

		var dtext = MM_findObj("Dlist");
		MM_setTextOfLayer("Dlist",'',"<b>" + dept + "</b><br>");
		dtext.style.visibility="visible";

	}

        return;
}



var obj;
function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


// http://javascript.about.com/library/blfollow1.htm    Hooray!  Something that actually seems to work!

function mouseX(evt) {
	if (!evt) evt = window.event; 
		if (evt.pageX) return evt.pageX; 
	else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft);
	 else return 0;
}
function mouseY(evt) {
	if (!evt) evt = window.event; 
	if (evt.pageY) return evt.pageY; 
	else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); 
	else return 0;
}




function add_more_buildings() {
 var mylist = document.forms[0].bldg_desc;
 var bldg = mylist.value;

		if (mylist.selectedIndex == 0)  return; 
		if ( (bldg == null) || (bldg == '') || ( bldg == 'null') ) { 
				mylist.selectedIndex=0;
				return; 
		}
		
	 	mylist.options[0].value=null;
		mylist.options[0].text='add another building...';
		mylist.options[mylist.selectedIndex].text=null;
		mylist.options[mylist.selectedIndex].value=null;
	 	mylist.selectedIndex=0;
		buildinglist = buildinglist + "[" + bldg + "]\n";
		
		var obj1 = MM_findObj("buildings");
			obj1.value = obj1.value + "[" + bldg + "]\n";
			obj1.rows = parseInt(obj1.rows) + 1;

		var btext = MM_findObj("Btext");
		var original = btext.innerHTML;
		MM_setTextOfLayer("Btext",'', original + "\n<br>" + bldg + " ");
		btext.style.visibility="visible";
		
return;
}




function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function GC_setwords(what,from,prompt,newwords,count) {

	count = count + 1;
	newwords = newwords + '[' + count + '] ...' ;

	var GCf=MM_findObj(from);
                var btext = MM_findObj(what);
                var original = btext.innerHTML;

	if (GCf.value.length>1) {
		MM_setTextOfLayer(what,'',original+GCf.value+'<br>');
	}
	MM_showHideLayers(what,'','show');
	if (prompt != null) {
		MM_setTextOfLayer(prompt,'',newwords);
	}
	MM_showHideLayers('submitbutton','','show');

	return;
}




// Build  some empty containers to be used for future dynamic stuff ...



var GC_blobcount;			// declare the global GC_blobcount but don't give it a value (we don't want a reload to disrupt its' count)
var GCcontainerMax = 71;		// These have to be declared inside of the FORM to be effective.
var GCdoneInitialize = 0;

function XXXGC_initializeBlobs() {

if (GCdoneInitialize < 1) {
	var str="";
	for (var i = 0; i < GCcontainerMax; i++) {
        	str+= "<div id='DIVcontainer" + i + "' ";
		str+= "		style='position:absolute; left:1px; top:1px; z-index:600; width:700px; height:700px; visibility:hidden;'  > ";
        	str+=           " <span id='GCcontainer" + i + "' > ";
        	str+=           i + "/" + GCcontainerMax ;
        	str+= "<\/span><\/div>";
	}

	document.writeln(str);
	GCdoneInitialize = 1;

	}

}


function GC_initializeBlobs() {

var str='';

str+="<div id='GC_curtain' style='position:absolute; top:1000px; left:5400px; z-index:900; width:900px; height:900px; visibility:visible; background:white; background-color:white;'><img src='/icons/blank.gif' width=200 height=1></div>";

if (GCdoneInitialize < 1) {
        for (var i = 0; i <= GCcontainerMax; i++) {
                str+= "<div id='GCcontainer" + i + "' ";
                str+= "         style='position:absolute; left:1111px; top:" + i + "01px; z-index:600; width:700px; height:700px; visibility:hidden;'  > ";
                str+=           " 'GCcontainer" + i + "' " +   i + "/" + GCcontainerMax ;
                str+= "<\/div>";
        }

        document.writeln(str);
        GCdoneInitialize = 1;

        }

}





var GC_globalsetaside = 0;

function GC_setasideLayer(theLayer) {		//Simulates a "hide" by moving the layer way the heck off the edge of the screen
						// This is necessary because SAFARI will not accept 'form/input' variables from 'hidden' layers.
						// Buttheads.
						// Put those layers behind a white curtain.

	//  Hey !   let's just hide the sucker.
	//	MM_showHideLayers(theLayer,'','hide');

	GC_moveObject(theLayer,5400,1000,'absolute');
	GC_moveObject('GC_curtain',5400,1000,'absolute');

//	alert(" attempted to move layer '" + theLayer + "'  out of the way...");

 return;

}


function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,obj1,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
	obj = val;
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must be a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) { alert('Please correct the following error:\n\n'+errors);
			//obj.focus();
			//obj.select();
	}			

  document.MM_returnValue = (errors == '');
}

function GC_if_checkValue(whattolookat,whattolookfor,whattoacton,whattodo,ordothis) {
		  var this_thing, args=GC_if_checkValue.arguments;
				this_thing = MM_findObj(args[0]);
				if (this_thing.value == whattolookfor) {
							   MM_showHideLayers(whattoacton,'',whattodo);
					} else {
					     MM_showHideLayers(whattoacton,'',ordothis);
					}
     return 1;
}


function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



function GC_showWhy() {

	var whystr = '';
	
	whystr += "</center><span class='green16'>Hey, Geo!</span><blockquote><span class='prose'><font color='#111111'>Why do we have to keep pressing the 'add another?' button?<br>&nbsp;<br>";
	whystr += "Can't you just make it so you can just shift-click or something to add multiple files in one fell swoop?</font></span></blockquote><p>";
	whystr += "<hr><p><span class='black14'>Unfortunately, most web browsers pop open the <i>operating system's</i> 'open file...' ";
	whystr += "dialog box, which usually only lets you pick a single file at a time.<br> <br>";
	whystr += "So, unless I write a new local file browser for every operating system out there, I have to settle for trying to keep the button presses ";
	whystr += "to a minimum, but still instructional enough so that Joe Average can figure out how to upload more than one file.<br> <br>";
	whystr += "Yeah it's tedious.<br>An alternative would be to compress an entire folder/directory into a single 'zip' file, and send it to me ... ";
	whystr += "Raise your hands if you know how to do this... &nbsp;&nbsp;&nbsp;Anyone?...&nbsp;&nbsp;&nbsp; Bueller?...&nbsp;&nbsp;&nbsp; Is this thing on?...</span><center>";

	GC_alert(whystr); 


}




function GC_ClearLayer(tt) {

        var GCf=MM_findObj(tt);
        GCf.innerHTML = "[cancelled container '" + tt + "']";
        MM_showHideLayers(tt,'','hide');
}

function GC_OpenCommentbox(what) {
	var GCf=MM_findObj(what);
	GCf.innerHTML = "<textarea name='blob_" + what + "' cols=60 rows=14 wrap='virtual'></textarea>";
}
	

var GC_filecount=0;

function GC_blobValueStuff(isVal,BC) {



	var tmp;
	var RXm;

	RXm = new RegExp("[\.]jp[e]?g","i");
	tmp = 0;
	tmp = RXm.exec(isVal);
	if (!tmp) {

		GC_alert("  Sorry -- at this time, the program can only accept JPG files.");

	} else {



        mm = MM_findObj('filelisting');

        GC_filecount = GC_filecount + 1;

        MM_setTextOfLayer('filelisting','',mm.innerHTML + '<table border=0 cellpadding=0 cellspacing=0 class="green11"><tr><td>&nbsp;&nbsp;&nbsp;</td><td align=right class="green11">' + GC_filecount + '.&nbsp;&nbsp;&nbsp;&nbsp;</td><td class="green11"><nobr>' + isVal + '</nobr></td></tr></table>');

	var AB = 'addbutton' + BC;
	var AAB = 'addanotherbutton' + BC;
	var FL = 'GC_bloblisting' + BC;
	var FR = 'fileresult' + BC;
	var HI = 'handicon' + BC;


        //nn = MM_findObj(AB);
       // nn.src='/icons/Buttons-Aqua/Button-AddAnother.gif';
	//nn.src = '/icons/blank.gif';


	MM_showHideLayers(AAB,'','show');

        //MM_setTextOfLayer(FL,'',mm.innerHTML);
	MM_setTextOfLayer(FR,'',isVal);
	MM_showHideLayers(FR,'','show');
	MM_showHideLayers(HI,'','hide');

	MM_showHideLayers('submitbutton','','show');

	}

}



function GC_blobprompt(multiple,whatwords,specialtarget) {


        // specialtarget                adds a form value that allows me to have multiple blob prompts on the same page,
        //                              but targeted at different records (example:   altmeasure_fred and altmeasure_bob)

        // whatwords = 'blobname_fred'                  tells me where to keep a visibile list of the multiple files chosen...

        // multiple = 'multiple'                        tells me to not issue a "submit" command, just stack them up...




        // Changed to force submission immediately, rather than queueing up multiple files before a submit.
        // Even *I* was forgetting to press the "submit" button after the file was queued up.
        // Besides, most people will only submit one file at a time.


        if (!GC_blobcount)      { GC_blobcount=0;  }

        GC_blobcount = GC_blobcount+1;
        if (GC_blobcount > GCcontainerMax ) {
		var bc=GC_blobcount - 1;

                                        GC_onlinedebug(" blobprompt called.   GC_blobcount is " + GC_blobcount + "  that's past the maximum\n " +
                                                " (that means you're trying to upload too many new objects at once). ");
					GC_alert("I count " + bc + " files to be uploaded.<br>That's all I can handle");
					MM_showHideLayers('submitbutton','','show');
                                        return;
        }


        MM_showHideLayers('submitbutton','','hide');            // Make user finish the blob dialog box before he can submit


var oldstr='';
var str="";

        var divname="GCcontainer" + GC_blobcount;

        str+= "<table width=600 border=0 cellpadding=1 cellspacing=1 bgcolor='#112233'>";
        str+= "<tr>";
        str+= " <td align=center>";
        str+= "                         <font color='white' size=-2><b>ADD AN IMAGE</b></font><br>";
        str+= "                         <table border=0 bgcolor=white cellspacing=3 cellpadding=3>";
        str+= "                                 <tr><td>&nbsp;&nbsp;&nbsp;</td>";
        str+= "                                         <td>&nbsp;</td>";
        str+= "                                         <td align=right valign=top>";
      	str+=                                 " <a href='javascript:MM_showHideLayers(\"" + divname + "\",\"\",\"hide\",\"fileresult" + GC_blobcount + "\",\"\",\"hide\",\"addanotherbutton" + GC_blobcount +"\",\"\",\"hide\",\"submitbutton\",\"\",\"show\");'     ";
        str+= "                                                         onMouseOver=" + '"' + "MM_swapImage('CB" + divname + "','','/icons/Button-Close-Black.gif',1);" + '"' + " onMouseOut='MM_swapImgRestore();'  >";
        str+= "                                                                 <img border=0 ID='CB" + divname + "' src='/icons/Button-Close-Red.gif'>";
        str+= "                                                         </a>";
        str+= "                                         </td>";
        str+= "                                 </tr><tr>";
        str+= "                                         <td>&nbsp;</td>";
        str+= "                                         <td>";


str+= "    <table width='90%' border=0 cellpadding=0 cellspacing=0 bgcolor='#f7f7f7'>";
str+= "          <tr >";
str+= "                <td valign=top align=right><font class='blackprompt'>";
str+= "				<nobr><font size=+1>File to include</font>&nbsp;&nbsp;&nbsp;&nbsp;</nobr><br><nobr>(from your desktop):&nbsp;&nbsp;&nbsp;&nbsp;</nobr>";
str+= "                		</font>";
str+= "			</td>";

str+= "                <td colspan=2 align=right>";





//              ***************************************************************   fix this   ****************************************************************


var nn=navigator.userAgent;
if (nn.indexOf("harrrrrrrrrrMSIE 7")>0) {


	str+= "                                 <div class='fileinputs'>               ";
        str+= "                                         <input TABINDEX=103 name='blob_file" + GC_blobcount + "'        ";
        str+= "                                          type='file' onchange='GC_blobValueStuff(this.value," + GC_blobcount + ");' >";

        str+= "                                 <span style='visibility:hidden;'>&nbsp;<img id='addbutton" + GC_blobcount + "' width=100 src='/icons/Buttons-Aqua/Button-Upload.gif' alt='Browse local file system' />";
        str+= "                                 <span id='fileresult" + GC_blobcount + "' style='visibility:hidden;'>&nbsp;</div>  ";




} else {


	str+= "					<table border=0 width=600><tr>";
	str+= "                     <td><font class='green12'><b>&nbsp;&nbsp;&nbsp;file #" + GC_blobcount + ":</b></font>&nbsp;&nbsp;&nbsp;</td>";
	str+= "						<td width=500 align=right>";
	str+= "                     			<nobr><input TABINDEX=103 name='blob_file" + GC_blobcount + "'  	";
	str+= "                                          type='file' class='xxxGCfilehidden' onchange='GC_blobValueStuff(this.value," + GC_blobcount + ");' >";
	str+= "						<img src='/icons/blank.gif' width=100 height=1></nobr>";
	str+= "					</td></tr></table>";


//      	str+= "                                 <span class='xxGCfakefile'>&nbsp;<img id='addbutton" + GC_blobcount + "' width=100 height=1 src='/icons/blank.gif' alt='Browse local file system' />";
//      	str+= "                                 </span>";

	str+= "				<table border=0 width=600><tr><td>&nbsp;</td><td align=right><nobr>";
	str+= "					<span id='handicon" + GC_blobcount + "' style='visibility:visible;'><img src='/icons/hand.up.gif'>";
	str+= "				<img src='/icons/blank.gif' width=100 height=1></nobr></td></tr></table>";

	str+= "					<div id='fileresult" + GC_blobcount + "' class='GCfakefileresult'>&nbsp;</div>  ";




}




str+= "                     </nobr>";



str+= "                 </td></tr>";
str+= "                 <tr>";
str+= "                <td>";


str+=                           "<br>";
str+= "                         <span id='aaa'  onClick=\"  ";
//str+= "                              MM_showHideLayers('GCcontainer" + GC_blobcount + "','','hide');   ";
str+= "					GC_setasideLayer('GCcontainer" + GC_blobcount + "','','hide');   ";
str+= "				     MM_showHideLayers('fileresult" + GC_blobcount + "','','hide','addanotherbutton" + GC_blobcount +"','','hide');   ";
str+= "                                 \">";
str+=                                   "<img border=0 src='/icons/Buttons-Aqua/Button-Cancel.gif'>";
str+=                           "</span>";
str+= "                 </td>";



str+= "<td colspan=2><table border=0 cellpadding=1 cellspacing=1 ><tr>";

str+= "         <td width=250 align='right' valign='top'><nobr><font class='blackprompt'>           A short title for this file:";
str+= "         </font></nobr></td>";
str+= "         <td><input  TABINDEX=100 name='blob_title" + GC_blobcount + "' type='text' size='30' maxlength='50'>";

if (specialtarget != null) {

        var stnum = specialtarget.substring( specialtarget.indexOf('_')+1, specialtarget.length);

        str+= "     <input type=hidden name='alt_specialtarget_" + stnum + "' value='" + specialtarget + "'>\n";
        str+= "     <input type=hidden name='alt_specialmap_" + GC_blobcount + "' value='" + stnum + "'>\n";

}

//str+= "</td><td><span id='handicon" + GC_blobcount + "' style='visibility:visible;'><img src='/icons/hand.up.gif'>&nbsp;&nbsp;</span></td></tr><tr>";


str+= "</td><td>&nbsp;&nbsp;</span></td></tr><tr>";

str+= "                <td width=250 align='right' valign='top'><font class='blackprompt'>  A two or three line<br> summary of this file,<br>";
str+= "                                                                                and why it is a <br>relevant contribution:";
str+= "                </font></td>";
str+= "                <td><textarea TABINDEX=101 name='blob_summary" + GC_blobcount + "' ";
str+= "                        STYLE='font-size:12px; font-family: Helvetica, Helvetica New, Geneva'";
str+= "                        cols='50' rows='5'  wrap='VIRTUAL'></textarea>";
str+= "                </td>";
str+= "</tr></table></td></tr><tr><td colspan=3>&nbsp;</td></tr>";

//str+= "                 <tr bgcolor='white'><td colspan=2 class='green11' ><br><span id='GC_bloblisting" + GC_blobcount + "' class='green11'>&nbsp;</span></td></tr>";

str+= " ";
str+= "</table>";


if (multiple != null) {

      str+= "  <div id='addanotherbutton" + GC_blobcount + "' style='visibility:hidden'><p align=right><span id='why' onclick='GC_showWhy();' class='fakeanchor'>Why do we need this?</span>&nbsp;&nbsp;&nbsp;<br>&nbsp;<br> ";
      str+= 				    "<img src='/icons/hand.right.gif'>&nbsp;<span id='aarr' onClick=\"                 							";
      str+=                                 " GC_addwords('" + whatwords + "', 'blob_file"  + GC_blobcount + "');                               ";
      //str+= "                              MM_showHideLayers('GCcontainer" + GC_blobcount + "','','hide');   ";
      str+= "                                  GC_setasideLayer('GCcontainer" + GC_blobcount + "','','hide');   ";
      str+= "                                MM_showHideLayers('fileresult" + GC_blobcount + "','','hide','addanotherbutton" + GC_blobcount +"','','hide');   ";
      str+=                                 " GC_blobprompt('multiple','blobname_photos','photos'); \" >                                        ";
      str+=                                   "<img border=0 src='/icons/Buttons-Aqua/Button-AddAnother.gif'>                                   ";
      str+=                                   "</span></p></div>";
}


if (multiple == null) {
        str+= "                    <p>&nbsp;<p>&nbsp;     <p align=right><span id='ffee'  onClick=\" ";
	str+= "				GC_OneMoment2('Submitting...<p>&nbsp;<p>Please be patient ... uploading files takes a while ');     ";

        str+= "                         GC_changeActionAndSubmit('myform','/htbin/CP/CP-addblobs','multipart/form-data'); ";
//      str+= "                         GC_changeActionAndSubmit('myform','/htbin/EchoPost','multipart/form-data'); ";

        str+= "                                 \"    >";
        str+=                                   "<img border=0 src='/icons/Buttons-Aqua/Button-Submit.gif'>";
        str+=                                   "</span>";
} else {
        str+= "                         <p align=right><span id='ffee'  onClick=\" ";
        str+= "                                 GC_addwords('" + whatwords + "', 'blob_file"  + GC_blobcount + "');";
        //str+= "                              MM_showHideLayers('GCcontainer" + GC_blobcount + "','','hide');   ";
        str+= "                                   GC_setasideLayer('GCcontainer" + GC_blobcount + "','','hide');   ";
        str+= "						MM_showHideLayers('submitbutton','','show');	";
        str+= "                                MM_showHideLayers('fileresult" + GC_blobcount + "','','hide','addanotherbutton" + GC_blobcount +"','','hide');   ";
        str+= "                                 \"    >";
        str+=                                   "<img border=0 src='/icons/Buttons-Aqua/Button-Done.gif'>";
        str+=                                   "</span>";
}



        str+= "                                   </p>             </td>";
        str+= "                                        </tr>";
        str+= "                                </table>";



        str+= "                        </td>";
        str+= "                </tr>";
        str+= "                </table>";


        var thisframe="DIVcontainer" + GC_blobcount;
        var tt="GCcontainer" + GC_blobcount;

      GC_moveObject(thisframe,-1600,-1200,'relative');
      GC_moveObject(tt,-1600,-1900,'relative');


        //GC_moveObject( tt ,80,80, 'absolute');


        var GCf=MM_findObj(tt);
        //GCf.innerHTML = '<font color=red>' + thisframe + '</font>' + str;
	GCf.innerHTML = ' ' + str;

        MM_showHideLayers(tt,' ','show');


        return;



}













function GC_panelwrapper(divname,topbot) {

var str= '';



if (topbot == 'top') {



	var GCaa = MM_findObj(divname);
	if (GCaa == null) {

		str += "<div id='" + divname + "' style='position:absolute; left:110px; top:120px; z-index:9999; visibility:hidden;'>";
	
	}

	str+= "<table border=0 cellpadding=3 cellspacing=3 bgcolor='#112233'>";
	str+= "<tr>";
	str+= "	<td align=center>";
//        str+= "        			<font color='white' size=-2><b>C o n t i n u i t y &nbsp;&nbsp; P l a n n i n g</b></font><br>";
        str+= "        			<table border=0 bgcolor=white cellspacing=3 cellpadding=3>";
        str+= "        				<tr><td>&nbsp;&nbsp;&nbsp;</td>";
        str+= "        					<td>&nbsp;</td>";
        str+= "        					<td align=right valign=top>";
        str+= "                                       			<a href='javascript:MM_showHideLayers(" + '"' + divname + '"," ","hide"' + ");'";              
        str+= "        	                          			onMouseOver=" + '"' + "MM_swapImage('CB" + divname + "','','/icons/Button-Close-Black.gif',1);" + '"' + " onMouseOut='MM_swapImgRestore();'  >";
        str+= "                                               			<img border=0 ID='CB" + divname + "' src='/icons/Button-Close-Red.gif'>";
        str+= "                                       			</a>";
        str+= "        					</td>";
        str+= "        				</tr><tr>";
        str+= "        					<td>&nbsp;</td>";
        str+= "        					<td>";


 	document.writeln(str);
        return;


} else if (topbot == 'bot') {




        str+= "                                                </td>";
        str+= "                                        </tr>";
        str+= "                                </table>";
        str+= "                        </td>";
        str+= "                </tr>";
        str+= "                </table>";


	document.writeln(str);
	return;




} else {

	GC_onlinedebug("  GC_panelwrapper called incorrectly. This shouldn't happen.  Call George and tell him what you did");

}

return;


}





function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);



