/*
Javascript functions that encapsulates menu navigation.
- to avoid name collision prefix all functions with NB_.

History:
08/16/04	Arnie Arguna	-Created
*/

var WinPop = null;

function PI_MenuLinkTo(section, page, bookmark)
{
	var theForm;
	var nextPage;
	if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
		theForm = document.forms["Form"];
	}
	else {
		theForm = document.Form;
	}
	
	nextPage = section + "|" + page;	
	
	if(bookmark != null)
		nextPage = nextPage + "|" + bookmark;
		
	theForm.targetPage.value = nextPage;
	//alert(theForm.targetPage.value);
	theForm.submit();
	
}
function redirectTo(pg)
{
	window.location = pg;
}
function ddlRedirect(opt)
{
	var urlLink = opt.options[opt.selectedIndex].value;
	if(urlLink != null & urlLink != "")
	{
		window.location = opt.options[opt.selectedIndex].value;
	}
}
function goToBookmark(bk)
{
	window.location.hash =   "#" + bk; ;
}
function PI_PopWin(parent, page, w, h)
{
	if(w == null) w=430;
	if(h == null) h=410;
	var url = "Default.aspx?PopUp=true&Parent=" + parent + "&Page=" + page;
	if(WinPop  == null|| WinPop.closed == true)
	{
		WinPop  = window.open(url,"","width=" + w + ",height=" + h + ",menubar=no, scrollbars=yes, statusbar=no, maximize=no, minimize=no, resizable=no");

	}
	else
	{
		WinPop.width=w;
		WinPop.height=h;
		WinPop.focus();
		WinPop.location = url;
		
	}
}
