//global.js file
function document.oncontextmenu()
{	
	var s = event.srcElement.tagName;
	
	if (s && s != "INPUT" && s != "TEXTAREA" || event.srcElement.disabled || document.selection.createRange().text.length == 0)
	{
		event.returnValue = false;
	}
	return true;
}
function document.onselectstart()
{
	var s = event.srcElement.tagName;
	if (s != "INPUT" && s != "TEXTAREA") event.returnValue = false;
}
function document.ondragstart()
{//alert("document.ondragstart()");
	event.returnValue = false;
}
//hedgefundtable.js file
function sortByColumn(sortColumn, order, type)
{
	document.formSort.method = "Post";
	
	var pageType = document.formSort.type.value;
	var sortOrder = document.formSort.sortOrder.value;
	
	if(type=="performance")		
	{
		document.formSort.type.value = "performance";
	}
		
	//sort order
	if(sortOrder=="DESC")
		document.formSort.sortOrder.value = "ASC";
	else
		document.formSort.sortOrder.value = "DESC";
		
	if (order!=null && order!="")
		document.formSort.sortOrder.value = order;

	document.formSort.sortColumn.value = sortColumn;
	SetTracking();	
	document.formSort.submit();
}

function sortByCategory(categoryID ,pageType)
{	
	if(pageType!=null && pageType!="")
		document.formSort.type.value = pageType;
	
	document.formSort.categoryID.value = categoryID;
	SetTracking();	
	document.formSort.submit();
}

function SetPageType(type)
{				
	document.formSort.sortColumn.value = "";
	document.formSort.sortOrder.value = "";
	document.formSort.startPosition.value = "";
        document.formSort.categoryID.value = "";  //Amy Zhang added 12/26/2007
        
	document.formSort.type.value = type
	SetTracking();	
	document.formSort.submit();
}

function SetRecPage(startPosition)
{
	document.formSort.startPosition.value = startPosition;
	SetTracking();	
	document.formSort.submit();
}

function SetCountryId(countryId, type)
{
	
	if(type!=null && type!="")
		document.formSort.type.value = type
		
	document.formSort.countryID.value = countryId;
	SetTracking();
	document.formSort.submit();
}

function SetTracking()
{
	var type = document.formSort.type.value;	
	
	document.formSort.action = "fundlists.aspx";		
}

function ResetAll(pageType, resetPageType)
{
	document.formSort.countryID.value = "";
	document.formSort.categoryID.value = "";
	document.formSort.alphaSort.value = "";
	document.formSort.sortColumn.value = "";
	document.formSort.sortOrder.value = "";
	document.formSort.startPosition.value = "";
	
	if(document.formSort.type.value=="newfunds" || document.formSort.type.value=="newinceptfunds" || document.formSort.type.value=="deadfunds")
		document.formSort.type.value = pageType;
	
	if(resetPageType == true)
		document.formSort.type.value = pageType;
}

function SetAlphaPage(c)
{
	document.formSort.alphaSort.value = c;
	SetTracking();	
	document.formSort.submit();
}

function Search(type)
{
	
//	var topicsearch = document.all.formSearch.topicsearch.value;
	//var fundsearch = document.all.formSearch.fundsearch.value;
	
//	document.all.formSort.topicsearch.value = topicsearch;
	//document.all.formSort.fundsearch.value = fundsearch;
	
	document.all.formSearch.submit();	
	//SetPageType(type);
}

function PerformanceMore()
{
	var select = document.all["drop"];
	var categoryId = select.options[select.selectedIndex].value;
	
	ResetAll("performance", true);
	if(categoryId != 'All')
		document.formSort.categoryID.value = categoryId;	

	document.formSort.sortOrder.value = "DESC";		
	document.formSort.sortColumn.value = "Date"
	SetTracking();	
	document.formSort.submit();
}

function openHelp(link)
{
	window.open(link, null, "height=400,width=600,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes");
}

//cover_mjx.js file


	<!------ OAS SETUP begin ------>
	
	// this function gets the cookie, if it exists
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

//configuration
var l_usertype;
l_usertype = getCookie("PSI");

	
	//configuration
	OAS_sitepage = 'www.morningstar.com/hedgefunds/register';
	
	if (l_usertype == "S")
	{
	//for premium
	OAS_listpos = 'Top,Top1,x43,Right,Bottom,x46';
	}
	else
	{
	//for free
	OAS_listpos = 'TopLeft,Top1,x30,Right,Bottom,x46,x07,x08';
	}
	OAS_query = '';
	
	OAS_url ='http://ads.morningstar.com/RealMedia/ads/';
	//end of configuration
	OAS_version = 10;
	OAS_rn = '001234567890'; OAS_rns = '1234567890';
	OAS_rn = new String (Math.random()); OAS_rns = OAS_rn.substring (2, 11);
	
	function OAS_NORMAL(pos) { 
		document.write('<A HREF="' + OAS_url + 'click_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + '?' + OAS_query + '" TARGET=_top>');
		document.write('<IMG SRC="' + OAS_url + 'adstream_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + '?' + OAS_query + '" BORDER=0></A>');
	}
	
	OAS_version = 11;
	if ((navigator.userAgent.indexOf('Mozilla/3') != -1) || (navigator.userAgent.indexOf('Mozilla/4.0 WebTV') != -1))
	OAS_version = 10;
	if (OAS_version >= 11)
	document.write('<SCR'+ 'IPT LANGUAGE=JavaScript1.1 SRC="' + OAS_url + 'adstream_mjx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '?' + OAS_query + '"><\/SCRIPT>');
	 
	 document.write('');
	
	function OAS_AD(pos) {
		if (OAS_version >= 11)
		OAS_RICH(pos);
		else
		OAS_NORMAL(pos);
	}
	
	<!------ OAS SETUP end ------>


