<!--- create JavaScript function to ask the user to confirm the removal of a portlet from page --->

<!-- // CONFIRM REMOVAL OF PORTAL CONTENT (PORTLET)
function confirmRemove(contentName, actionRemove, msg){

 if(msg) {
	confirm_msg = msg;
 } else {
 	confirm_msg = "Are you sure you want to remove " + contentName + " from this page?";
 }

 var confRemove = confirm(confirm_msg);
 if(confRemove){
   location.href=actionRemove;
 }
}




// POP UP NEW BROWSER WINDOW
function newPortal(x,y,z){
  newPortal = window.open("","","status,height=x,width=y")
  newPortal.document.write(z)
}
 
// IDENTIFY BROWSER
var IE = (document.all) ? 1 : 0;
var NS = (document.layers) ? 1 : 0;

// WINDOW STATUS FUNCTIONS
window.defaultStatus = "";
function winStatus( msg )
{
	window.status = msg;
}

// ALERT FUNCTIONS
function adminAlert( msg ) {
	if( msg != null && trim(msg) != "" ) {
		alert( msg );
	}
}

//redirect page to passed url
function gotosite(site) {
 if (site != "") {
  self.location=site;
 } 
}

function goThere( node,loc ) {
	//Only perform folder opening, don't close anything
	if( parent.nav.indexOfEntries[node].isOpen == false )
		parent.nav.clickOnNode(node);
	window.location = loc;
}

function selectGo(FormURL)
{
 window.location.href=FormURL.options[FormURL.selectedIndex].value;
}



function popUp( loc, w, h, menubar ) {
	if( w == null ) { w = 500; }
	if( h == null ) { h = 350; }
	if( menubar == null || menubar == false ) {
		menubar = "";
	} else {
		menubar = "menubar,";
	}

	if( NS ) { w += 50; }
	// Need the var or else IE4 blows up not recognizing editorWin
	var editorWin = window.open(loc,'editWin', menubar + 'resizable,scrollbars,width=' + w + ',height=' + h);
	//if( !newWin.opener )
		//newWin.opener = window;
	editorWin.focus(); //causing intermittent errors
}

function popUpLarge( loc, menubar ) {
	if( menubar == null ) { menubar = false; }
	popUp( loc, 700, 500, menubar );
}


function closeMe() {
	//self.close();
	parent.close();
}

function formSubmit() {
	parent.frames[0].document.forms[0].submit();
}

function openerReload() {
	if( parent.opener.name != null )
		parent.opener.location.reload();
		//alert( parent.opener.name );
		//parent.opener.r();
}

function r() {
	self.setTimeout("rl()", 2000);
}
function rl(){
	self.location.reload();
}


// NAV TREE FUNCTIONS
function navRefresh() {
	top.nav.location.reload();
}

// STRING FUNCTIONS
function trim( str ) {
	// Immediately return if no trimming is needed
	if( (str.charAt(0) != ' ') && (str.charAt(str.length-1) != ' ') ) { return str; }
	// Trim leading spaces
	while( str.charAt(0)  == ' ' ) {
		str = '' + str.substring(1,str.length);
	}
	// Trim trailing spaces
	while( str.charAt(str.length-1)  == ' ' ) {
		str = '' + str.substring(0,str.length-1);
	}

	return str;
}

function strReplace( entry, bad, good ) {
	temp = "" + entry; // temporary holder
	while( temp.indexOf(bad) > -1 ) {
		pos= temp.indexOf( bad );
		temp = "" + ( temp.substring(0, pos) + good + 
			temp.substring( (pos + bad.length), temp.length) );
	}
	return temp;
}

// CONNECTOR FUNCTIONS
// Saved for later modification
function connectorCancel() {
	if( confirm('You have chosen to exit this page. \n\nClick \'OK\' to go to the MyIHS Welcome Page.') ) {
		if( top.location == self.location ) {
			top.location = "/index.cfm?module=myihs&pn=1";
		} else {
			self.location = "/index.cfm?module=myihs&pn=1";
		}
	}
}

function connectorDone() {
	if( top.location == self.location ) {
		top.location = "/index.cfm?module=myihs&pn=1";
	} else {
		self.location = "/index.cfm?module=myihs&pn=1";
	}
}

// -->

