//------------------frame loader and content height script --------------


function frameloader(page,menu){

	var strLocation=top.location.toString();
	
	//page is loaded from within website
	if((strLocation.indexOf("default")>-1)||(strLocation.indexOf("main")>-1)){
	parent.oDoc(parent.oCurrentMenu).style.display="none";
	parent.thisPage=page;
	parent.thisMenu=menu;
	parent.oCurrentMenu=menu;
	parent.oDoc(menu).style.display="block";
	parent.oDoc("content").style.height=contentHeight;
	

	}	
	else{ //if page url is direct to content folder: strip /content/... and redirect to load in content frame
		if (strLocation.indexOf("/content/")>0){
			
			var cut=strLocation.indexOf("/content/")
			newUrl=strLocation.substring(0,cut)
			newUrl+="/default.aspx?load="+page+"&menu="+menu
			location.replace(newUrl)
			}
			// same if url direct to /court/
		if (strLocation.indexOf("/court/")>0){
			
			var cut=strLocation.indexOf("/court/")
			newUrl=strLocation.substring(0,cut)
			newUrl+="/default.aspx?load="+page+"&menu="+menu
			location.replace(newUrl)
			}
		else {// otherwise allow page to load as is
		
			parent.oDoc(parent.oCurrentMenu).style.display="none";
			parent.oDoc("submenuX").style.display="none";
			parent.thisPage=page;
			parent.thisMenu=menu;
			parent.oCurrentMenu=menu;
			parent.oDoc(menu).style.display="block";
			parent.oDoc("content").style.height=contentHeight;
		
			}
	
	}
	
}
function openNewWin(url,x,y,scroll){
	newWin=window.open(url,"Document","left=100,top=20,screenX=100,screenY=50,scrollbars=" + scroll +",toolbar=no,menubar=no,width=" + x + ",height=" + y)
	
}


