var amonths = new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
function formatDate(vdate){
	var viewdd = vdate.getDay();
	var viewhh = vdate.getHours();
	var viewtt = (viewhh<12)?'AM':'PM';
	var viewmm = vdate.getMinutes()+"";
	var viewss = vdate.getSeconds()+"";
	if(viewmm.length==1){viewmm="0"+viewmm;}
	if(viewss.length==1){viewss="0"+viewss;}
	if(viewhh==0){viewhh=12;}
	if(viewhh>12){viewhh=viewhh-12;}
	return(amonths[viewdd]+" "+viewhh+":"+viewmm+":"+viewss+" "+viewtt);	
}
function initwindow(){wTime();navinit();extL();}
function navinit(){
{if(document.all&&document.getElementById){ele=document.getElementsByTagName("UL");for(j=0;j<ele.length;j++){for(i=0;i<ele[j].childNodes.length;i++){node=ele[j].childNodes[i];if(node.nodeName=="LI"){node.onmouseover=function(){this.className+=" over";};node.onmouseout=function(){this.className=this.className.replace(" over","");}}}}}}}
if (!Array.prototype.push){Array.prototype.push = function(elem){this[this.length] = elem;}}var EventManager={_registry:null,Initialise:function(){if(this._registry==null){this._registry=[];EventManager.Add(window, "unload", this.CleanUp);}},Add:function(obj,type,fn,useCapture){this.Initialise();if(typeof obj=="string"){obj = document.getElementById(obj);}if(obj==null || fn==null){return false;}if(obj.addEventListener){obj.addEventListener(type,fn,useCapture);this._registry.push({obj:obj,type:type,fn:fn,useCapture:useCapture});return true;}if(obj.attachEvent && obj.attachEvent("on" + type, fn)){this._registry.push({obj:obj,type:type,fn:fn,useCapture:false});return true;}return false;},CleanUp:function(){for(var i=0;i<EventManager._registry.length;i++){with(EventManager._registry[i]){if(obj.removeEventListener){obj.removeEventListener(type,fn,useCapture);}else if (obj.detachEvent){obj.detachEvent("on" + type, fn);}}}EventManager._registry = null;}};
function extL(){if(!document.getElementsByTagName)return;var ax=document.getElementsByTagName('a');for(var i=0;i<ax.length;i++){if(ax[i].getAttribute('href') && ax[i].getAttribute('rel')=='external'){ax[i].target='_blank';}}}
function $(id){return document.getElementById(id);}

window.onload=initwindow;

function openTransparencyPlusWindow() {
	openTPWin = window.open('http://transparencyplus.icdfunds.com/');
}

// SSO Window allows only 1 window open at a time
var gmyWin = null;

function myOpenWindow(winURL, winName, winFeatures, winObj)
{
  var theWin; // this will hold our opened window 

  // first check to see if the window already exists
  if (winObj != null)
  {
    // the window has already been created, but did the user close it?
    // if so, then reopen it. Otherwise make it the active window.
    if (!winObj.closed) {
      winObj.focus();
      return winObj;
    } 
    // otherwise fall through to the code below to re-open the window
  }

  // if we get here, then the window hasn't been created yet, or it
  // was closed by the user.
  theWin = window.open(winURL, winName, winFeatures); 
  return theWin;
} 


function CloseWindow(){
	window.open('','_self','');
	window.close();
}

