var DHTML = (document.getElementById || document.all || document.layers);

function getObjDiv(divId)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(divId);
	this.style = document.getElementById(divId).style;
  }
  else if (document.all)
  {
	this.obj = document.all[divId];
	this.style = document.all[divId].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[divId];
   	this.style = document.layers[divId];
  }
}
function inviDiv(objId,flag)
{
	if (!DHTML) return;
	var x = new getObjDiv(objId);
	x.style.visibility = (flag) ? 'hidden' : 'visible'
}
function inviDiv_Delayed(objId,flag,delay)
{
	var jsStr = "window.setTimeout('inviDiv(\"" + objId + "\"," + flag + ")'," + delay + ");";
	eval(jsStr);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
function MM_effectShake(targetElement)
{
	Spry.Effect.DoShake(targetElement);
}
function MM_effectHighlight(targetElement, duration, startColor, endColor, restoreColor, toggle)
{
	Spry.Effect.DoHighlight(targetElement, {duration: duration, from: startColor, to: endColor, restoreColor: restoreColor, toggle: toggle});
}
function MM_effectBlind(targetElement, duration, from, to, toggle)
{
	Spry.Effect.DoBlind(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
}
function MM_effectGrowShrink(targetElement, duration, from, to, toggle, referHeight, growFromCenter)
{
	Spry.Effect.DoGrow(targetElement, {duration: duration, from: from, to: to, toggle: toggle, referHeight: referHeight, growCenter: growFromCenter});
}
function MM_hide_IntroDiv(e) {
	MM_changeProp('IntroDiv','','visibility','hidden','DIV');
}
function MM_hide_IntroDiv_delayed(delay) {
	window.setTimeout('MM_hide_IntroDiv(true)',delay);
}
//MessageNextMeetingDiv
//MM_changeProp('MessageNextMeetingDiv','','visibility','visible');
function MM_hide_MessageNextMeetingDiv(e) {
	if (e) {
		MM_changeProp('MessageNextMeetingDiv','','visibility','hidden','DIV');
	} else {
		MM_changeProp('MessageNextMeetingDiv','','visibility','visible','DIV');
	}
}
function MM_hide_MessageNextMeetingDiv_delayed(delay) {
	window.setTimeout('MM_hide_MessageNextMeetingDiv(true)',delay);
}
function MM_hide_MessageOfTheDayDiv(e) {
	MM_changeProp('MessageOfTheDayDiv','','visibility','hidden','DIV');
}
function MM_hide_MessageOfTheDayDiv_delayed(delay) {
	window.setTimeout('MM_hide_MessageOfTheDayDiv(true)',delay);
}
function MM_hide_UrgentMessageDiv(e) {
	MM_changeProp('UrgentMessageDiv','','visibility','hidden','DIV');
}
function MM_hide_UrgentMessageDiv_delayed(delay) {
	window.setTimeout('MM_hide_UrgentMessageDiv(true)',delay);
}

function MM_changeProp(objId,x,theProp,theValue) { //v9.0
//  var obj = null; with (document){ if (getElementById) obj = getElementById(objId); }
//  var obj = findObj(objId);
  var obj = null; with (document){ obj =  findObj(objId); }
  if (obj){
    if (theValue == true || theValue == false)
      eval("obj.style."+theProp+"="+theValue);
    else eval("obj.style."+theProp+"='"+theValue+"'");
  }
}
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();
}
// Example:
// value1 = 3; value2 = 4;
// messageBox("text message %s and %s", value1, value2);
// this message box will display the text "text message 3 and 4"
function messageBox() {
  var i, msg = "", argNum = 0, startPos;
  var args = messageBox.arguments;
  var numArgs = args.length;
  if(numArgs)  {
    theStr = args[argNum++];
    startPos = 0;  endPos = theStr.indexOf("%s",startPos);
    if(endPos == -1) endPos = theStr.length;
    while(startPos < theStr.length)    {
      msg += theStr.substring(startPos,endPos);
      if (argNum < numArgs) msg += args[argNum++];
      startPos = endPos+2;  endPos = theStr.indexOf("%s",startPos);
      if (endPos == -1) endPos = theStr.length;
    }
    if (!msg) msg = args[0];
  }
  alert(msg);
}// Example: obj = findObj("image1");

function findObj(theObj, theDoc) {

  var p, i, foundObj;
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  return foundObj;
}
function expandMe(objId) {
//  var obj = null; with (document){ if (getElementById) obj = getElementById(objId); }
//  var obj = null; with (document){ obj =  findObj(objId); }
  var obj = objId;
  if (obj) {
		var h = obj.contentWindow.document.body.scrollHeight;// + 20;
		if (obj.height<h) obj.height = h;
  }
}
function OpenWindow(Page) {
var X = 835;
var Y = 600;
var MX = (screen.availWidth/2)-(X/2);
var MY = (screen.availHeight/2)-(Y/2);
var T = "top="+MY+"px,left="+MX+"px,height="+Y+"px,width="+X+"px,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,fullscreen=0,titlebar=0,copyhistory=0";
//RWP = window.open(Page,"_blank",T);
RWP = window.open(Page,"OpenWindow",T);
RWP.focus();
}
function MM_jumpMenu(targ,selObj,restore) { //v3.0
	var jo = selObj.options[selObj.selectedIndex].value;
	var js = jo.substring(0,11);

	if (js=='javascript:') {
		js = jo.substring(11);
		//alert("js["+js+"]");
		eval(js);
	} else {
// alert("["+selObj.options[selObj.selectedIndex].value+"]");
		if (targ!='self') {
			eval("window.open('"+selObj.options[selObj.selectedIndex].value+"','"+targ+"')");
		} else {
			eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		}
	}
//  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function disableRightClick(e) {
  if(!document.rightClickDisabled) { // initialize
    if(document.layers) {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  return false;
}
function MM_changeBackgroundImage(objId,theValue) { //v9.0
  var obj = null; with (document){ if (getElementById)
  obj = getElementById(objId); }
  if (obj){
	  if (theValue) {
	  	eval("obj.style.backgroundImage='url("+theValue+")'");
	  } else {
		  eval("obj.style.backgroundImage=''");
	  }
  }
}
var msgWindow;
function messageWindow(title, msg){
  var width="300", height="125";
  var left = (screen.width/2) - width/2;
  var top = (screen.height/2) - height/2;
  var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
  msgWindow = window.open("","msgWindow", styleStr);
  var head = '<head><title>'+title+'</title></head>';
  var body = '<center>'+msg+'<br><p><form><input type="button" value="   Done   " onClick="self.close()"></form>';
  msgWindow.document.write(head + body);
}


// * Dependencies * 
// this function requires the following snippet:
// JavaScript/readable_MM_functions/findObj
function setColor(objName, fg, bg){
  obj = findObj(objName);
  if (obj.style) {
    obj.style.color = fg;
    obj.style.backgroundColor = bg;
  }
}
function killError() {
	return true;
}
function preloadImages(){
  if(document.images){
    if(!document.imageArray) document.imageArray = new Array();
    var i,j = document.imageArray.length, args = preloadImages.arguments;
    for(i=0; i<args.length; i++){
      if (args[i].indexOf("#")!=0){
        document.imageArray[j] = new Image;
        document.imageArray[j++].src = args[i];
      }
    }
  }
}
// Example:
// value1 = 3; value2 = 4;
// messageBox("text message %s and %s", value1, value2);
// this message box will display the text "text message 3 and 4"
function messageBox() {
  var i, msg = "", argNum = 0, startPos;
  var args = messageBox.arguments;
  var numArgs = args.length;
  if(numArgs)  {
    theStr = args[argNum++];
    startPos = 0;  endPos = theStr.indexOf("%s",startPos);
    if(endPos == -1) endPos = theStr.length;
    while(startPos < theStr.length)    {
      msg += theStr.substring(startPos,endPos);
      if (argNum < numArgs) msg += args[argNum++];
      startPos = endPos+2;  endPos = theStr.indexOf("%s",startPos);
      if (endPos == -1) endPos = theStr.length;
    }
    if (!msg) msg = args[0];
  }
  alert(msg);
}function changeHd(img){
  var obj = null; with (document){ obj =  findObj('hd'); }
  if (obj) eval("obj.style.backgroundImage = 'url("+img+")';");
}